Image decoding method, image decoding apparatus, image encoding method, and image encoding apparatus for adaptive loop filtering

By using adaptive loop filtering technology, the problem of insufficient prediction performance in high-resolution image encoding and decoding is solved by utilizing the first and second filters and the adaptive filter coefficients, thereby reducing errors and noise and improving image quality.

CN121866764APending Publication Date: 2026-04-14SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing image encoding and decoding techniques are insufficient in predictive encoding and decoding performance when processing high-resolution or high-definition images, and there are error and noise problems between the original block and the filtered block.

Method used

An adaptive loop filtering technique is employed to filter image blocks using first and second filters and adaptive filter coefficients, thereby improving predictive coding and decoding performance and reducing errors and noise.

Benefits of technology

It improves the predictive coding and decoding performance of image blocks, reduces noise in the filtered blocks and the error between the original blocks and the filtered blocks, and improves image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121866764A_ABST
    Figure CN121866764A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image decoding method for adaptive loop filtering. The image decoding method may include a step of acquiring information on adaptive loop filtering from a bitstream. The image decoding method may include a step of obtaining a first filtered residual sample point corresponding to a current sample point by performing filtering using a residual sample point of the current sample point and a first filter. The image decoding method may include a step of obtaining a second filtered residual sample corresponding to a current sample by performing filtering using a first filtered residual block and a second filter. The image decoding method may include a step of acquiring an adaptive loop filtering sample point by using a first filtering residual sample point, a second filtering residual sample point, and at least one adaptive filter coefficient acquired from information on adaptive loop filtering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image encoding and decoding, and specifically to a method and apparatus for encoding and decoding an image by performing adaptive loop filtering on a current block included in the current image. Background Technology

[0002] Image data is encoded according to a predefined data compression standard and then stored as a bitstream on a recording medium or transmitted through a communication channel.

[0003] With the development and widespread availability of hardware capable of reproducing and storing high-resolution or high-definition image content, the demand for codecs that can efficiently encode or decode such content is increasing. Encoded image content can be decoded and reproduced. Recently, methods for effectively compressing high-resolution or high-definition image content have been implemented. For example, image compression techniques have been proposed that can be efficiently implemented by manipulating the filtering methods used in image encoding and decoding processes.

[0004] As one of the techniques used to manipulate filtering methods, various modifications can be made to the filtering parameters used for loop filtering, and the decoding or encoding data used for filtering can be diversified. Summary of the Invention

[0005] Technical issues The image encoding method and apparatus, as well as the image decoding method and apparatus according to the embodiments, are designed to improve the performance of predictive encoding and predictive decoding for the current block.

[0006] The image encoding method and apparatus, as well as the image decoding method and apparatus according to the embodiments, are intended to help improve image quality by reducing noise in the filter block or reducing the error between the original block and the filter block.

[0007] The technical problems to be solved by this disclosure are not limited to those mentioned above, and those skilled in the art will clearly understand from the following description other technical problems not described herein.

[0008] Solution In embodiments of this disclosure, an image decoding method for adaptive loop filtering is provided. The image decoding method may include: obtaining information about adaptive loop filtering from a bitstream. The image decoding method may include: performing filtering using residual samples of a current sample and a first filter to obtain a first filtered residual sample corresponding to the current sample. The image decoding method may include: performing filtering using the first filtered residual sample and a second filter to obtain a second filtered residual sample corresponding to the current sample. The image decoding method may include: obtaining adaptive loop filtering samples using the first filtered residual sample, the second filtered residual sample, and at least one adaptive filter coefficient obtained from the information about adaptive loop filtering.

[0009] In embodiments of this disclosure, an image decoding apparatus for adaptive loop filtering is provided. The image decoding apparatus includes at least one memory storing at least one instruction and at least one processor configured to operate according to the at least one instruction. The at least one processor can obtain information about adaptive loop filtering from a bitstream. The at least one processor can obtain a first filtered residual sample corresponding to a current sample by filtering a residual sample device of the current sample using a first filter. The at least one processor can obtain a second filtered residual sample corresponding to the current sample by performing filtering using the first filtered residual sample and a second filter. The at least one processor can obtain adaptive loop filtered samples using the first filtered residual sample, the second filtered residual sample, and at least one adaptive filter coefficient obtained from the information about adaptive loop filtering.

[0010] In embodiments of this disclosure, an image coding method for adaptive loop filtering is provided. The image coding method may include: obtaining a first filtered residual sample corresponding to the current sample by performing filtering using a residual sample of the current sample and a first filter. The image coding method may include: obtaining a second filtered residual sample corresponding to the current sample by performing filtering using a first filtered residual block and a second filter. The image coding method may include: determining at least one adaptive filter coefficient for performing adaptive loop filtering on the current block using the first filtered residual sample and the second filtered residual sample. The image coding method may include: generating a bitstream including information about adaptive loop filtering based on the at least one adaptive filter coefficient.

[0011] In embodiments of this disclosure, an image coding apparatus for adaptive loop filtering is provided. The image coding apparatus includes at least one memory storing at least one instruction and at least one processor operating according to the at least one instruction. The at least one processor can obtain a first filtered residual sample corresponding to the current sample by performing filtering using a residual sample of the current sample and a first filter. The at least one processor can obtain a second filtered residual sample corresponding to the current sample by performing filtering using a first filtered residual block and a second filter. The at least one processor can determine at least one adaptive filter coefficient for performing adaptive loop filtering on the current block using the first and second filtered residual samples. The at least one processor can generate a bitstream including information about the adaptive loop filtering based on the at least one adaptive filter coefficient.

[0012] In one embodiment, a computer-readable recording medium on which a bitstream is recorded is provided. The bitstream may include information regarding adaptive loop filtering. The information regarding adaptive loop filtering may be based on at least one adaptive filter coefficient for adaptive loop filtering of a current block including a current sample, wherein the at least one adaptive filter coefficient can be determined using a first filter residual sample and a second filter residual sample, wherein the first filter residual sample corresponding to the current sample can be obtained by performing filtering using the residual sample of the current sample and the first filter, and the second filter residual sample corresponding to the current sample can be obtained by performing filtering using the first filter residual sample and the second filter.

[0013] Beneficial effects The image encoding method and apparatus, as well as the image decoding method and apparatus according to the embodiments, can improve the performance of predictive encoding and predictive decoding for the current block.

[0014] The image encoding method and apparatus according to the embodiments, as well as the image decoding method and apparatus, can improve image quality by reducing noise in the filter block or reducing the error between the original block and the filter block.

[0015] The technical problems to be solved by this disclosure are not limited to those mentioned above, and those skilled in the art will clearly understand from the following description other technical problems not described herein. Attached Figure Description

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

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

[0018] Figure 3The process of determining at least one coding unit by dividing the current coding unit is illustrated according to an embodiment.

[0019] Figure 4 The illustration shows a process according to an embodiment of determining at least one coding unit by dividing coding units into non-square shapes.

[0020] Figure 5 The process of dividing coding units based on at least one of block shape information and division shape pattern information according to an embodiment is illustrated.

[0021] Figure 6 A method for determining a specific coding unit among an odd number of coding units is shown according to an embodiment.

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

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

[0024] Figure 9 The process of determining at least one coding unit by dividing a first coding unit is illustrated according to an embodiment.

[0025] Figure 10 The diagram illustrates that, according to an embodiment, the shape that can be divided is limited when a second coding unit, which is a non-square shape determined by dividing a first coding unit, satisfies certain conditions.

[0026] Figure 11 The process of dividing the coding units into square shapes is shown according to an embodiment when the dividing shape pattern information cannot indicate "dividing into four square shape coding units".

[0027] Figure 12 The processing order among multiple coding units according to the embodiment is shown to vary depending on the processing of the coding units.

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

[0029] Figure 14 The diagram illustrates an index (partial index, hereinafter referred to as PID) for depth and coding unit differentiation, which can be determined based on the shape and size of the coding unit according to an embodiment.

[0030] Figure 15The illustration shows that, according to an embodiment, multiple encoding units are determined based on multiple specific data units included in the image.

[0031] Figure 16 The 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.

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

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

[0034] Figure 19 A block diagram of an image encoding and decoding system that performs loop filtering according to an embodiment is shown.

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

[0036] Figure 21 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0037] Figure 22 This is a diagram illustrating the operation of filtering the current sample point according to an embodiment.

[0038] Figure 23 This is a diagram illustrating the operation of performing adaptive loop filtering according to an embodiment.

[0039] Figure 24 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0040] Figure 25 This is a diagram illustrating the operation of filtering the current sample point according to an embodiment.

[0041] Figure 26 This is a diagram illustrating the operation of filtering the current sample point according to an embodiment.

[0042] Figure 27 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0043] Figure 28 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0044] Figure 29This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0045] Figure 30 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0046] Figure 31 This is a flowchart of an image decoding method according to an embodiment.

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

[0048] Figure 33 This is a flowchart of an image encoding method according to an embodiment. Detailed Implementation

[0049] Because this disclosure allows for various changes and numerous embodiments, embodiments will be shown in the accompanying drawings and described in detail in the specific implementation. However, this is not intended to limit the embodiments of this disclosure, and this disclosure includes all modifications, equivalents, and alternatives falling within the spirit and technical scope of the various embodiments.

[0050] In describing embodiments, detailed descriptions of relevant known technologies may be omitted where it is determined that such descriptions unnecessarily obscure the spirit of this disclosure. Furthermore, numbers used in the description of embodiments (e.g., first, second, etc.) may correspond to identifiers used to distinguish one element from another.

[0051] Throughout this disclosure, the expression "at least one of a, b or c" means only a, only b, only c, both a and b, both a and c, both b and c, all of a, b and c, or variations thereof.

[0052] When an element is referred to as “connected” or “coupled” to another element, the element may be directly connected or coupled to the other element, but unless otherwise stated, the elements may be connected or coupled to each other via an intermediate element.

[0053] In this disclosure, an element referred to by "unit," "module," etc., may be one element that combines two or more elements, or it may be one element further subdivided into two or more elements. Furthermore, in addition to its primary function, each element described below may also perform some or all of the functions that other elements are responsible for, and some of the primary functions that each element is responsible for may be dedicated to other elements.

[0054] In this disclosure, "image" can mean picture, still image, frame, moving image or video composed of multiple consecutive still images.

[0055] In this disclosure, a "sample point" can represent the data to be processed (as data assigned to a sampling location in an image). For example, pixels in a frame in the spatial domain can correspond to a sample point. A unit comprising multiple sample points can be defined as a block.

[0056] In the following text, refer to Figures 1 to 19 An image encoding method and apparatus, as well as an image decoding method and apparatus, based on tree-structured encoding and transformation units according to embodiments are disclosed.

[0057] Figure 1 A block diagram of an image decoding device 100 according to an embodiment is shown.

[0058] Image decoding device 100 may include a bitstream acquisition unit 110 and a decoding unit 120. The bitstream acquisition unit 110 and the decoding unit 120 may each include at least one processor. Additionally, the bitstream acquisition unit 110 and the decoding unit 120 may include memory storing instructions to be executed by the at least one processor.

[0059] Bitstream acquisition unit 110 can receive a bitstream. The bitstream includes information about an image encoded by the image encoding device 200 described below. Furthermore, the bitstream can be transmitted from the image encoding device 200. The image encoding device 200 and the image decoding device 100 can be connected to each other via wired or wireless means, and the bitstream acquisition unit 110 can receive the bitstream via wired or wireless means. The bitstream acquisition unit 110 can receive the bitstream from a storage medium (e.g., an optical medium or a hard disk). Decoding unit 120 can reconstruct the image based on the information obtained from the received bitstream. Decoding unit 120 can obtain syntax elements for reconstructing the image from the bitstream. Decoding unit 120 can reconstruct the image based on the syntax elements.

[0060] To describe in detail the operation of the image decoding device 100, the bit stream acquisition unit 110 can receive bit streams.

[0061] 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. Image decoding device 100 can perform the operation of determining the partitioning rules 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 and the partitioning rules. To determine the partitioning rules, 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. To determine the partitioning rules, 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.

[0062] The division of coding units according to embodiments of the present disclosure is described in detail below.

[0063] First, the frame can be divided into one or more slices or one or more tiles. A slice or a tile can be a sequence of one or more coding tree units (CTUs). Depending on the implementation, a slice may include one or more tiles, and a slice may include one or more CTUs. A slice comprising one or more tiles can be determined within the frame.

[0064] In contrast to CTUs, there are Coding Tree Blocks (CTBs). A CTB is an N×N block (where N is an integer) consisting of N×N samples. Each color component can be divided into one or more CTUs.

[0065] When the image has three sample arrays (sample arrays for the Y, Cr, and Cb components), the CTU is a unit that includes the CTB of the luma samples, two CTBs of the chroma samples corresponding to the CTBs of the luma samples, and a syntax structure for encoding the luma and chroma samples. When the image is monochrome, the CTU is a unit that includes the CTB of the monochrome samples and a syntax structure for encoding the monochrome samples. When the image is encoded as a color plane divided for each color component, the CTU is a unit that includes the syntax structure for encoding the image and the images' samples.

[0066] A CTB can be divided into an M×N coded block containing M×N samples (where M and N are integers).

[0067] When the image has three sample arrays for the Y, Cr, and Cb components, the coding unit (CU) is a unit that includes a coding block for the luma samples, two coding blocks for the chroma samples corresponding to the luma sample coding blocks, and a syntax structure for encoding the luma and chroma samples. When the image is monochrome, the CU is a unit that includes coding blocks for monochrome samples and a syntax structure for encoding the monochrome samples. When the image is encoded as a color plane divided for each color component, the CU is a unit that includes a syntax structure for encoding the image and the image samples.

[0068] As stated above, CTB and CTU are different concepts, and coded block and CU are also different concepts. That is, CU (CTU) refers to a data structure that includes a coded block (CTB) containing corresponding samples and a syntax structure corresponding to the coded block (CTB). However, those skilled in the art will understand that CU (CTU) or coded block (CTB) refers to a block of a certain size containing a certain number of samples. Therefore, in the following description, unless there are special circumstances, CTB and CTU, or coded block and CU, may be described without distinction.

[0069] An image can be divided into CTUs. The size of a CTU can be determined based on information obtained from the bitstream. The shape of a CTU is a square with the same dimensions. However, this disclosure is not limited thereto.

[0070] 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.

[0071] For example, information about the maximum size of a luminance coded block that can be divided into two blocks and the difference in luminance block size can be obtained from the bitstream. The information about the luminance block size difference indicates the size difference between the luminance CTU and the maximum luminance coded block that can be divided into two blocks. Therefore, the size of the luminance CTU can be determined by combining the information about the maximum size of the luminance coded block that can be divided into two blocks obtained from the bitstream and the information about the luminance block size difference. The size of the chrominance CTU can also be determined by using the size of the chrominance CTU. For example, when the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chrominance block can be half the size of the luminance block, and similarly, the size of the chrominance CTU can be half the size of the luminance CTU.

[0072] According to the embodiment, since information about the maximum size of a luminance coding block that can be divided into two parts is obtained from the bitstream, the maximum size of the luminance coding block that can be divided into two parts can be variably determined. Conversely, the maximum size of a luminance coding block that can be divided into three parts can be fixed. For example, the maximum size of a luminance coding block that can be divided into three parts in an I-frame can be 32×32, and the maximum size of a luminance coding block that can be divided into three parts in a P-frame or B-frame can be 64×64.

[0073] Furthermore, the CTU can be hierarchically divided into CUs based on the partition shape pattern information obtained from the bitstream. At least one of the following can be obtained from the bitstream as partition shape pattern information: information indicating four-partition or non-four-partition, information indicating multiple-partition or non-multiple-partition, partition direction information, and partition type information.

[0074] For example, information indicating whether a CU will be partitioned into four parts (QUAD_SPLIT) or not can indicate whether the current CU will be partitioned into four parts (QUAD_SPLIT) or not.

[0075] When the current CU is not quad-partitioned, the information indicating whether it will be partitioned or not can indicate whether the current CU will no longer be partitioned (NO_SPLIT) or whether the current CU will be partitioned into two or three parts.

[0076] When the current CU is divided into two or three parts, the division direction information indicates whether the current CU is divided in the horizontal or vertical direction.

[0077] When the current CU is divided in the horizontal or vertical direction, the division type information indicates whether the current CU is divided into two or three parts.

[0078] The partitioning mode of the current CU can be determined based on the partitioning direction and partitioning type information. The partitioning mode of the current CU when it is divided into two parts horizontally can be determined as horizontal two-part partitioning (SPLIT_BT_HOR), the partitioning mode of the current CU when it is divided into three parts horizontally can be determined as horizontal three-part partitioning (SPLIT_TT_HOR), the partitioning mode of the current CU when it is divided into two parts vertically can be determined as vertical two-part partitioning (SPLIT_BT_VER), and the partitioning mode of the current CU when it is divided into three parts vertically can be determined as vertical three-part partitioning (SPLIT_TT_VER).

[0079] Image decoding device 100 can obtain partitioning shape pattern information as a binary bit string from a bit stream. The form of the bit stream received by image decoding device 100 may include fixed-length binary code, unary code, truncated unary code, predetermined binary code, etc. The binary bit string represents the information as a sequence of 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 whether to perform four partitions on the CU, the partitioning direction, and the partitioning type based on a binary bit string.

[0080] A CU can be less than or equal to a CTU. For example, since a CTU is also a CU with the largest size, a CTU is a CU. When the partitioning shape mode information for a CTU indicates "no partitioning," the CU determined from the CTU has the same size as the CTU. When the partitioning shape mode information for a CTU indicates "partitioning," a CTU can be partitioned into CUs. Additionally, when the partitioning shape mode information for a CU indicates "partitioning," a CU can be partitioned into CUs with smaller sizes. However, image partitioning is not limited to this, and CTUs and CUs may not be distinguished. (See reference...) Figures 3 to 16A more detailed description of the CU partitioning.

[0081] In addition, one or more prediction blocks can be determined from the CU for prediction. The prediction blocks may be less than or equal to the CU. Furthermore, one or more transformation blocks can be determined from the CU for transformation. The transformation blocks may be less than or equal to the CU.

[0082] The shape and size of the transform block and the prediction block can be independent.

[0083] In another embodiment, prediction can be performed by using a CU as a prediction block. Alternatively, transformation can be performed by using a CU as a transformation block.

[0084] Reference Figures 3 to 16 The partitioning of the CU is described in more detail. The current block and neighboring blocks in this disclosure can represent one of a CTU, CU, prediction block, and transform block. Furthermore, the current block or current CU is the block currently being decoded or encoded, or the block currently being partitioned. A neighboring block can be a block that has been reconstructed prior to the current block. A neighboring block can be spatially or temporally adjacent to the current block. A neighboring block can be located on one of the following sides: lower left, left, upper left, upper right, right, or lower right of the current block.

[0085] Figure 3 The image decoding device 100 according to an embodiment is shown to determine the processing of at least one CU by dividing the current CU.

[0086] The block shape can 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 dimensions of the CU.

[0087] The shape of the CU can be square or non-square. When the width and height of the CU are equal (i.e., when the block shape of the CU is 4N×4N), the image decoding device 100 can determine that the block shape information of the CU is square. The image decoding device 100 can determine that the shape of the CU is non-square.

[0088] When the width and height of the CU are different from each other (i.e., when the block shape of the CU 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 that the block shape information of the CU is not square. When the shape of the CU is not square, the image decoding device 100 can determine the aspect ratio of the multiple block shape information of the CU to be at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. Furthermore, the image decoding device 100 can determine whether the CU is horizontal or vertical based on the length of its width and height. Additionally, the image decoding device 100 can determine the size of the CU based on at least one of the length of its width, the length of its height, or its area.

[0089] According to an embodiment, the image decoding device 100 can determine the shape of the CU by using block shape information, and can determine the shape into which the CU is divided by using partition shape pattern information. That is, the partitioning method of the CU indicated by the partition shape pattern information can be determined according to what block shape is indicated by the block shape information used by the image decoding device 100.

[0090] Image decoding device 100 can obtain partition shape pattern information from a bitstream. However, this disclosure is not limited to this, and image decoding device 100 and image encoding device 200 can determine pre-arranged partition shape pattern information based on block shape information. Image decoding device 100 can determine pre-arranged partition type pattern information for a CTU or a minimum CU. For example, image decoding device 100 can determine the partition shape pattern information for a CTU as four partitions. Furthermore, image decoding device 100 can determine the partition shape pattern information for the minimum CU as "no partitioning". Specifically, image decoding device 100 can determine the size of the CTU to be 256×256. Image decoding device 100 can determine the pre-arranged partition type pattern information as four partitions. Four partitions are a partition shape pattern in which the width and height of the CU are both bisected. Image decoding device 100 can obtain a CU with a size of 128×128 from a CTU with a size of 256×256 based on the partition shape pattern information. Furthermore, image decoding device 100 can determine the size of the minimum CU to be 4×4. The image decoding device 100 can obtain the division shape pattern information indicating "no division" for the smallest CU.

[0091] According to an embodiment, the image decoding device 100 can use block shape information indicating that the current CU has a square shape. For example, the image decoding device 100 can determine whether to not divide the square-shaped CU, whether to divide the square-shaped CU vertically, whether to divide the square-shaped CU horizontally, or whether to divide the square-shaped CU into four CUs based on the division shape pattern information. (See also...) Figure 3 When the block shape information of the current CU 300 indicates a square shape, the decoding unit 120 may not divide the CU 310a with the same size as the current CU 300 according to the division shape mode information indicating "do not divide", or may determine the divided CUs 310b, 310c, 310d, 310e, 310f, etc. based on the division shape mode information indicating a specific division method.

[0092] Reference Figure 3 According to an embodiment, the image decoding device 100 can determine two CUs 310b divided from the current CU 300 in the vertical direction based on division shape pattern information indicating "division in the vertical direction". The image decoding device 100 can determine two CUs 310c divided from the current CU 300 in the horizontal direction based on division shape pattern information indicating "division in the horizontal direction". The image decoding device 100 can determine four CUs 310d divided from the current CU 300 in both the vertical and horizontal directions based on division shape pattern information indicating "division in both the vertical and horizontal directions". According to an embodiment, the image decoding device 100 can determine three CUs 310e divided from the current CU 300 in the vertical direction based on division shape pattern information indicating "ternary division in the vertical direction". The image decoding device 100 can determine three CUs 310f divided from the current CU 300 in the horizontal direction based on division shape pattern information indicating "ternary division in the horizontal direction". However, the partitioning shapes into which a square-shaped CU can be divided should not be construed as limited to the shapes described above, and may include various shapes that can be represented by partitioning shape pattern information. The specific partitioning shapes into which a square-shaped CU can be divided are described in detail below through various embodiments.

[0093] Figure 4 The image decoding device 100 according to an embodiment is shown to determine at least one CU by dividing a CU of a non-square shape.

[0094] According to an embodiment, the image decoding device 100 can use block shape information indicating that the current CU has a non-square shape. The image decoding device 100 can determine whether to not divide the current CU with a non-square shape or whether to divide the current CU with a non-square shape using a specific method based on the division shape pattern information. (See also...) Figure 4When the block shape information of the current CU 400 or 450 indicates a non-square shape, the image decoding device 100 can determine a CU 410 or 460 with the same size as the current CU 400 or 450 based on the partitioning shape pattern information indicating "no partitioning," or it can determine the partitioned CUs 420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, and 480c based on the partitioning shape pattern information indicating a specific partitioning method. The specific partitioning methods for partitioning non-square CUs are described in detail below through various embodiments.

[0095] According to an embodiment, the image decoding device 100 can determine the shape into which the CU is divided by using division shape pattern information, and in this case, the division shape pattern information can indicate the number of at least one CU generated by dividing the CU. (Refer to...) Figure 4 When the partition shape pattern information indicates that the current CU 400 or 450 is divided into two CUs, the image decoding device 100 can determine the two CUs 420a and 420b or 470a and 470b included in the current CU by partitioning the current CU 400 or 450 based on the partition shape pattern information.

[0096] According to an embodiment, when the image decoding device 100 divides a non-square current CU 400 or 450 based on division shape pattern information, the image decoding device 100 can divide the current CU by considering the position of the long side of the non-square current CU 400 or 450. For example, the image decoding device 100 can determine multiple CUs by dividing the current CU 400 or 450 in the direction of dividing the long side of the current CU 400 or 450, considering the shape of the current CU 400 or 450.

[0097] According to an embodiment, when the partitioning shape pattern information indicates that a CU is divided (tripartitely divided) into an odd number of blocks, the image decoding device 100 can determine the odd number of CUs included in the current CU 400 or 450. For example, when the partitioning shape pattern information indicates that the current CU 400 or 450 is divided into three CUs, the image decoding device 100 can divide the current CU 400 or 450 into three CUs 430a, 430b, and 430c or 480a, 480b, and 480c.

[0098] In an embodiment, the aspect ratio of the current CU 400 or 450 can be 4:1 or 1:4. When the aspect ratio is 4:1, the block shape information can be horizontal because the width is longer than the height. When the aspect 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 to divide the current CU into an odd number of blocks based on the partition shape pattern information. Additionally, the image decoding device 100 can determine the partitioning direction of the current CU 400 or 450 based on the block shape information of the current CU 400 or 450. For example, when the current CU 400 is in the vertical direction, the image decoding device 100 can determine CUs 430a, 430b, and 430c by partitioning the current CU 400 horizontally. Similarly, when the current CU 450 is in the horizontal direction, the image decoding device 100 can determine CUs 480a, 480b, and 480c by partitioning the current CU 450 vertically.

[0099] According to an embodiment, the image decoding device 100 can determine an odd number of CUs included in the current CU 400 or 450, and the determined CUs may not all have the same size. For example, among the determined odd number of CUs 430a, 430b, and 430c, or CUs 480a, 480b, and 480c, the size of a particular CU 430b or 480b may be different from the sizes of other CUs 430a and 430c, or CUs 480a and 480c. That is, the current CU 400 or 450 can be divided and determined as CUs, which can have multiple types of sizes, and in some cases, the odd number of CUs 430a, 430b, and 430c, or CUs 480a, 480b, and 480c, may have different sizes.

[0100] According to an embodiment, when the partitioning shape pattern information indicates that a CU is divided into an odd number of blocks, the image decoding device 100 can determine the odd number of CUs included in the current CU 400 or 450. Furthermore, the image decoding device 100 can impose a predetermined restriction on at least one CU among the odd number of CUs generated by the partitioning. (Refer to...) Figure 4 The image decoding device 100 can perform different decoding processing on the central CU 430b or 480b among the three CUs 430a, 430b, and 430c or CUs 480a, 480b, and 480c generated by dividing the current CU 400 or 450, compared to the other CUs 430a and 430c or CUs 480a and 480c. For example, unlike the other CUs 430a and 430c or CUs 480a and 480c, the image decoding device 100 can restrict the central CU 430b or 480b from being divided again, or can restrict the CU 430b or 480b to be divided only a certain number of times.

[0101] Figure 5 The image decoding device 100 according to an embodiment is shown to divide CUs based on at least one of block shape information and division shape pattern information.

[0102] According to an embodiment, the image decoding device 100 can determine whether to divide the square-shaped first CU 500 into CUs or not to divide the square-shaped first CU 500 based on at least one of block shape information and partition shape pattern information. According to an embodiment, when the partition shape pattern information indicates that the first CU 500 is partitioned in the horizontal direction, the image decoding device 100 can determine the second CU 510 by partitioning the first CU 500 in the horizontal direction. The first CU, second CU, and third CU used in the embodiment are terms used to understand the relationship between CUs before and after partitioning. For example, when the first CU is partitioned, the second CU can be determined, and when the second CU is partitioned, the third CU can be determined. In the following, the relationship between the first CU, second CU, and third CU used can be understood as following the characteristics described above.

[0103] According to an embodiment, the image decoding device 100 can determine whether to classify the determined second CU 510 as a CU or not to classify the determined second CU 510 based on the division shape pattern information. (Refer to...) Figure 5 The image decoding device 100 can divide a non-square-shaped second CU 510, determined by dividing the first CU 500, into at least one third CU 520a, 520b, 520c, 520d, etc., based on the division shape pattern information, or it can choose not to divide the second CU 510. The image decoding device 100 can obtain the division shape pattern information, and can divide multiple second CUs (e.g., 510) of various shapes determined by dividing the first CU 500 based on the obtained division shape pattern information, and can divide the second CU 510 according to the method used to divide the first CU 500 based on the division shape pattern information. According to an embodiment, when the first CU 500 is divided into a second CU 510 based on the division shape pattern information used for the first CU 500, the second CU 510 can also be divided into third CUs (e.g., 520a, 520b, 520c, 520d, etc.) based on the division shape pattern information used for the second CU 510. In other words, CUs can be recursively partitioned based on the partitioning shape pattern information associated with each CU. Therefore, square-shaped CUs can be determined from non-square-shaped CUs, and square-shaped CUs can be recursively partitioned to determine non-square-shaped CUs.

[0104] Reference Figure 5A specific CU (e.g., a central CU or a square-shaped CU) among an odd number of third CUs 520b, 520c, and 520d determined by dividing a non-square-shaped second CU 510 can be recursively partitioned. According to an embodiment, a non-square-shaped third CU 520b, which is one of the odd number of third CUs 520b, 520c, and 520d, can be horizontally divided into a plurality of fourth CUs. A non-square-shaped fourth CU 530b or 530d, which is one of the plurality of fourth CUs 530a, 530b, 530c, and 530d, can be further divided into a plurality of CUs. For example, a non-square-shaped fourth CU 530b or 530d can be further divided into an odd number of CUs. Methods for recursive partitioning of CUs are described below with reference to various embodiments.

[0105] According to an embodiment, the image decoding device 100 can divide each of the third CUs 520a, 520b, 520c, 520d, etc., into a CU 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 CU 510. According to an embodiment, the image decoding device 100 can divide the non-square-shaped second CU 510 into an odd number of third CUs 520b, 520c, and 520d. The image decoding device 100 can impose specific restrictions on a particular third CU among the odd number of third CUs 520b, 520c, and 520d. For example, the image decoding device 100 can restrict the CU 520c located at the center of the odd number of third CUs 520b, 520c, and 520d from being divided, or it can limit the number of times CU 520c can be divided.

[0106] Reference Figure 5 The image decoding device 100 may restrict the central CU 520c among the odd number of third CUs 520b, 520c, and 520d included in the non-square second CU 510 from being further divided, or from being divided according to a specific division shape (e.g., divided into only four CUs or divided according to a shape corresponding to the division shape of the second CU 510), or from being divided only a specific number of times (e.g., divided only n times, where n>0). However, the above-described restriction on the central CU 520c is merely a simple embodiment and should not be construed as limiting it to the above embodiment, but rather should be interpreted as including various restrictions that allow decoding of the central CU 520c differently from the other CUs 520b and 520d.

[0107] According to an embodiment, the image decoding device 100 can obtain partitioning shape pattern information for partitioning the current CU from a specific location within the current CU.

[0108] Figure 6A method for determining a specific CU among an odd number of CUs, performed by an image decoding device 100 according to an embodiment, is shown.

[0109] Reference Figure 6 The partitioning shape pattern information of the current CU 600 or 650 can be obtained from a sample point at a specific location among multiple sample points included in the current CU 600 or 650 (e.g., sample point 640 or 690 located at the center). However, a specific location within the current CU 600 from which at least one partitioning shape pattern information can be obtained should not be construed as limited to Figure 6 The center position shown should be interpreted as including various positions that can be included within the current CU 600 (e.g., top, bottom, left, right, upper left, lower left, upper right, or lower right, etc.). The image decoding device 100 can obtain the division shape pattern information obtained from a specific position and determine whether to divide the current CU into CUs with various shapes and sizes.

[0110] According to an embodiment, when the current CU is divided into a specific number of CUs, the image decoding device 100 can select one of the CUs. Various methods for selecting one CU from a plurality of CUs are possible, and these methods are described below with reference to the various embodiments provided.

[0111] According to an embodiment, the image decoding device 100 can divide the current CU into multiple CUs and determine the CU at a specific location.

[0112] According to an embodiment, the image decoding device 100 can use information indicating the position of each of the odd number of CUs to determine the CU located at the center of the odd number of CUs. (See also...) Figure 6 The image decoding device 100 can determine an odd number of CUs 620a, 620b, and 620c or an odd number of CUs 660a, 660b, and 660c by dividing the current CU 600 or the current CU 650. The image decoding device 100 can determine the center CU 620b or the center CU 660b by using information about the positions of the odd number of CUs 620a, 620b, and 620c or the odd number of CUs 660a, 660b, and 660c. For example, the image decoding device 100 can determine the center CU 620b by determining the positions of CUs 620a, 620b, and 620c based on information indicating the positions of specific samples included in CUs 620a, 620b, and 620c. Specifically, the image decoding device 100 can determine the position of CU 620a, 620b and 620c based on the information indicating the position of the upper left sample points 630a, 630b and 630c of CU 620a, 620b and 620c, and determine the CU 620b located at the center.

[0113] According to an embodiment, the information indicating the position of the top-left sample points 630a, 630b, and 630c included in CUs 620a, 620b, and 620c respectively may include information about the position or coordinates of CUs 620a, 620b, and 620c within the frame. According to an embodiment, the information indicating the position of the top-left sample points 630a, 630b, and 630c included in CUs 620a, 620b, and 620c respectively may include information indicating the width or height of CUs 620a, 620b, and 620c included in the current CU 600, and the width or height may correspond to information indicating the difference between the coordinates of CUs 620a, 620b, and 620c within the frame. That is, the image decoding device 100 can determine the CU 620b located at the center by directly using information about the position or coordinates of CUs 620a, 620b, and 620c within the frame, or by using information about the width or height of the CU corresponding to the difference between the coordinates.

[0114] According to an embodiment, information indicating the position of the upper left sample point 630a of the top CU 620a can indicate (xa, ya) coordinates, information indicating the position of the upper left sample point 630b of the center CU 620b can indicate (xb, yb) coordinates, and information indicating the position of the upper left sample point 630c of the bottom CU 620c can indicate (xc, yc) coordinates. The image decoding device 100 can determine the center CU 620b by using the coordinates of the upper left samples 630a, 630b, and 630c included in CUs 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 CU 620b located at the center, including the coordinates (xb, yb) of sample point 630b, can be determined as the central CU among CUs 620a, 620b, and 620c determined by dividing the current CU 600. However, the coordinates indicating the positions of the upper left sample points 630a, 630b, and 630c can indicate coordinates representing absolute positions within the frame. Furthermore, based on the position of the upper left sample point 630a of the top CU 620a, (dxb, dyb) coordinates can be used as information indicating the relative position of the upper left sample point 630b of the center CU 620b, and (dxc, dyc) coordinates as information indicating the relative position of the upper left sample point 630c of the bottom CU 620c. Moreover, the method of determining a CU at a specific position by using the coordinates of the sample points as information indicating the positions of the sample points included in the CU should not be interpreted as limited to the methods described above, but rather as allowing the use of various arithmetic methods using the coordinates of the sample points.

[0115] According to an embodiment, the image decoding device 100 can divide the current CU 600 into a plurality of CUs 620a, 620b, and 620c, and can select a CU from CUs 620a, 620b, and 620c according to specific criteria. For example, the image decoding device 100 can select a CU 620b with a different size from CUs 620a, 620b, and 620c.

[0116] According to an embodiment, the image decoding device 100 can determine the width or height of each of CUs 620a, 620b, and 620c using (xa,ya) coordinates, (xb,yb) coordinates, and (xc,yc) coordinates, wherein the (xa,ya) coordinates indicate the position of the upper left sample point 630a of the top CU 620a, the (xb,yb) coordinates indicate the position of the upper left sample point 630b of the center CU 620b, and the (xc,yc) coordinates indicate the position of the upper left sample point 630c of the bottom CU 620c. The image decoding device 100 can determine the size of each of CUs 620a, 620b, and 620c using coordinates (xa,ya), (xb,yb), and (xc,yc) indicating the position of CUs 620a, 620b, and 620c. According to an embodiment, the image decoding device 100 can determine the width of the top CU 620a as the width of the current CU 600. Image decoding device 100 can determine the height of the top CU 620a as yb-ya. According to an embodiment, image decoding device 100 can determine the width of the center CU 620b as the width of the current CU 600. Image decoding device 100 can determine the height of the center CU 620b as yc-yb. According to an embodiment, image decoding device 100 can determine the width or height of the bottom CU by using the width or height of the current CU and the width and height of the top CU 620a and center CU 620b. Image decoding device 100 can determine CUs with dimensions different from the dimensions of other CUs based on the determined widths and heights of CUs 620a, 620b, and 620c. (Refer to...) Figure 6 The image decoding device 100 can identify a center CU 620b, which has a size different from that of the top CU 620a and the bottom CU 620c, as a CU at a specific location. However, since the above-described process by which the image decoding device 100 identifies a CU with a size different from that of the other CUs is merely an embodiment of determining a CU at a specific location by using the size of the CU determined based on sample point coordinates, various processes can be used to determine a CU at a specific location by comparing the size of the CU determined according to specific sample point coordinates.

[0117] Image decoding device 100 can determine the width or height of each of CUs 660a, 660b, and 660c using (xd, yd) coordinates, (xe, ye) coordinates, and (xf, yf) coordinates, where (xd, yd) coordinates indicate the position of the upper left sample point 670a of the left CU 660a, (xe, ye) coordinates indicate the position of the upper left sample point 670b of the center CU 660b, and (xf, yf) coordinates indicate the position of the upper left sample point 670c of the right CU 660c. Image decoding device 100 can determine the size of each of CUs 660a, 660b, and 660c using (xd, yd), (xe, ye), and (xf, yf) coordinates indicating the positions of CUs 660a, 660b, and 660c.

[0118] According to an embodiment, the image decoding device 100 can determine the width of the left CU 660a as xe-xd. The image decoding device 100 can determine the height of the left CU 660a as the height of the current CU 650. According to an embodiment, the image decoding device 100 can determine the width of the center CU 660b as xf-xe. The image decoding device 100 can determine the height of the center CU 660b as the height of the current CU 660. According to an embodiment, the image decoding device 100 can determine the width or height of the right CU 660c by using the width or height of the current CU 650 and the width and height of the left CU 660a and the center CU 660b. The image decoding device 100 can determine a CU with dimensions different from the dimensions of the other CUs based on the determined widths and heights of the CUs 660a, 660b, and 660c. (Refer to...) Figure 6 The image decoding device 100 can identify a center CU 660b, which has a size different from that of the left CU 660a and the right CU 660c, as a CU at a specific location. However, since the above-described process by which the image decoding device 100 identifies a CU with a size different from that of the other CUs is merely an embodiment of determining a CU at a specific location using the size of the CU determined based on sample point coordinates, various processes can be used to determine a CU at a specific location by comparing the size of the CU determined according to specific sample point coordinates.

[0119] However, the location of the sample points considered in order to determine the location of the CU should not be interpreted as limited to the upper left position mentioned above, and can be interpreted as the use of information about the location of any sample points included in the CU.

[0120] According to an embodiment, the image decoding device 100 can consider the shape of the current CU and select a CU at a specific position from an odd number of CUs determined by dividing the current CU. For example, when the current CU is a non-square shape with a width greater than its height, the image decoding device 100 can determine a CU at a specific position in the horizontal direction. That is, the image decoding device 100 can determine one of the CUs with different positions in the horizontal direction and can impose restrictions on the corresponding CU. When the current CU is a non-square shape with a height greater than its width, the image decoding device 100 can determine a CU at a specific position in the vertical direction. That is, the image decoding device 100 can determine one of the CUs with different positions in the vertical direction and can impose restrictions on the corresponding CU.

[0121] According to an embodiment, the image decoding device 100 can determine a CU at a specific location among the even-numbered CUs using information indicating the position of each of the even-numbered CUs. The image decoding device 100 can determine the even-numbered CUs by dividing the current CUs (bipartitioning), and can use information about the positions of the even-numbered CUs to determine the CU at a specific location. In this regard, the specific processing can be the same as described above. Figure 6 The description corresponds to the processing of a CU at a specific position (e.g., the center position) among an odd number of CUs, therefore, the specific processing is omitted.

[0122] According to an embodiment, when a non-square current CU is divided into multiple CUs, specific information about a CU at a specific location can be used in the division process to determine the CU at that specific location among the multiple CUs. For example, the image decoding device 100 can use at least one of the block shape information and division shape pattern information stored in the samples included in the central CU during the division process to determine the central CU among the multiple CUs into which the current CU is divided.

[0123] Reference Figure 6The image decoding device 100 can divide the current CU 600 into multiple CUs 620a, 620b, and 620c based on the division shape pattern information, and can determine the CU 620b located at the center among the multiple CUs 620a, 620b, and 620c. Furthermore, the image decoding device 100 can determine the CU 620b located at the center by considering the location where the division shape pattern information is obtained. That is, the division shape pattern information of the current CU 600 can be obtained from the sample point 640 located at the center of the current CU 600. When the current CU 600 is divided into multiple CUs 620a, 620b, and 620c based on the division shape pattern information, the CU 620b including the sample point 640 can be determined as the CU located at the center. However, the information used to determine the CU located at the center should not be interpreted as limited to the division shape pattern information, and various types of information can be used in the process of determining the CU located at the center.

[0124] According to an embodiment, specific information for identifying a CU at a specific location can be obtained from specific sample points included in the CU to be determined. (Refer to...) Figure 6 The image decoding device 100 can use partitioning shape pattern information obtained from samples at specific locations within the current CU 600 (e.g., samples located at the center of the current CU 600) to determine a CU at a specific location (e.g., the CU located at the center of the multiple partitioned CUs) 620a, 620b, and 620c into which the current CU 600 is divided. That is, the image decoding device 100 can determine samples at specific locations by considering the block shape of the current CU 600, and the image decoding device 100 can impose specific constraints by determining a CU 620b that includes samples from which specific information (e.g., partitioning shape pattern information) can be obtained among the multiple CUs 620a, 620b, and 620c determined by partitioning the current CU 600. (Refer to...) Figure 6 According to an embodiment, the image decoding device 100 can determine a sample 640 located at the center of the current CU 600 as a sample from which specific information can be obtained, and the image decoding device 100 can impose specific restrictions on the decoding process of the CU 620b including the sample 640. However, the location of the sample from which specific information can be obtained should not be interpreted as limited to the aforementioned location, but can be interpreted as any location of the sample included in the determined CU 620b, so as to impose restrictions on it.

[0125] According to an embodiment, the location of sample points from which specific information can be obtained can be determined based on the shape of the current CU 600. According to an embodiment, block shape information can determine whether the current CU is square or non-square, and the location of sample points from which specific information can be obtained can be determined based on the shape. For example, the image decoding device 100 can determine sample points located on boundaries that bisect at least one of the width and height of the current CU as sample points from which specific information can be obtained by using at least one of information about the width and height of the current CU. As another example, when the block shape information associated with the current CU 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 CU as a sample point from which specific information can be obtained.

[0126] According to an embodiment, when the image decoding device 100 divides the current CU into multiple CUs, the image decoding device 100 can use division shape pattern information to determine the CU at a specific location among the multiple CUs. According to an embodiment, the image decoding device 100 can obtain the division shape pattern information from samples included at specific locations within the CUs, and the image decoding device 100 can divide the multiple CUs by using the division shape pattern information obtained from samples included at specific locations within each of the multiple CUs generated by dividing the current CU. That is, the CUs can be recursively divided by using the division shape pattern information obtained from samples included at specific locations within each CU. Because reference has already been made above... Figure 5 The process of recursively partitioning the CU is described, so its detailed description is omitted.

[0127] According to an embodiment, the image decoding device 100 can determine at least one CU by dividing the current CU, and can determine the order in which the at least one CU is decoded based on a specific block (e.g., the current CU).

[0128] Figure 7 The following illustration shows the order in which the image decoding device 100 processes multiple CUs when it determines multiple CUs by dividing the current CU, according to an embodiment.

[0129] According to an embodiment, based on the division shape pattern information, the image decoding device 100 can determine the second CUs 710a and 710b by dividing the first CU 700 in the vertical direction, determine the second CUs 730a and 730b by dividing the first CU 700 in the horizontal direction, or determine the second CUs 750a, 750b, 750c and 750d by dividing the first CU 700 in both the vertical and horizontal directions.

[0130] Reference Figure 7The image decoding device 100 can determine an order such that the second CUs 710a and 710b, determined by dividing the first CU 700 in the vertical direction, are processed in the horizontal direction 710c. The image decoding device 100 can determine the processing order of the second CUs 730a and 730b, determined by dividing the first CU 700 in the horizontal direction, as the vertical direction 730c. The image decoding device 100 can determine the second CUs 750a, 750b, 750c, and 750d, determined by dividing the first CU 700 in both the vertical and horizontal directions, based on a specific order (e.g., raster scan order 750e or z-scan order) of processing the CUs in the next row first and then processing the CUs in the next row.

[0131] According to an embodiment, the image decoding device 100 can recursively divide the CUs. (Refer to...) Figure 7 The image decoding device 100 can determine a plurality of CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d by dividing a first CU 700, and can recursively divide each of the determined plurality of CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The method for dividing the plurality of CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d can be a method corresponding to the method for dividing the first CU 700. Therefore, each of the plurality of CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d can be independently divided into a plurality of CUs. (Refer to...) Figure 7 The image decoding device 100 can determine the second CUs 710a and 710b by dividing the first CU 700 in the vertical direction. In addition, it can determine whether each of the second CUs 710a and 710b is divided independently or not.

[0132] According to an embodiment, the image decoding device 100 can divide the second CU 710a on the left side into third CUs 720a and 720b in the horizontal direction, and can leave the second CU 710b on the right side undivided.

[0133] According to an embodiment, the processing order of CUs can be determined based on the process of dividing the CUs. In other words, the processing order of the divided CUs can be determined based on the processing order of the CUs immediately preceding the division. The image decoding device 100 can determine the processing order of the third CUs 720a and 720b determined by dividing the second CU 710a on the left, independently of the second CU 710b on the right. Since the third CUs 720a and 720b are determined by dividing the second CU 710a on the left in the horizontal direction, the third CUs 720a and 720b can be processed along the vertical direction 720c. In addition, since the processing order of the second CU 710a on the left and the second CU 710b on the right corresponds to the horizontal direction 710c, the CU 710b on the right can be processed after processing the third CUs 720a and 720b included in the second CU 710a on the left along the vertical direction 720c. The above content is intended to explain the process of determining the processing order of CUs based on the CUs before division. Therefore, it should not be interpreted as limited to the above embodiments, but should be interpreted as various methods for processing CUs divided and determined in various shapes that can be processed independently according to a specific order.

[0134] Figure 8 The image decoding device 100, according to an embodiment, determines that the current CU is divided into an odd number of CUs when CUs cannot be processed in a specific order.

[0135] According to an embodiment, the image decoding device 100 can determine that the current CU is divided into an odd number of CUs based on the obtained partition shape pattern information. (See also...) Figure 8 The square-shaped first CU 800 can be divided into non-square-shaped second CUs 810a and 810b, and the second CUs 810a and 810b can be independently divided into third CUs 820a, 820b, 820c, 820d, and 820e. According to an embodiment, the image decoding device 100 can determine a plurality of third CUs 820a and 820b by horizontally dividing the left CU 810a within the second CU, and the right CU 810b can be divided into an odd number of third CUs 820c, 820d, and 820e.

[0136] According to an embodiment, the image decoding device 100 can determine the existence or non-existence of an odd number of partitioned CUs by determining whether the third CUs 820a, 820b, 820c, 820d, and 820e can be processed in a specific order. (See also...) Figure 8The image decoding device 100 can determine the third CUs 820a, 820b, 820c, 820d, and 820e by recursively dividing the first CU 800. The image decoding device 100 can determine whether the first CU 800, the second CUs 810a and 810b, or the third CUs 820a, 820b, 820c, 820d, and 820e are divided into an odd number of CUs in a plurality of partitioned shapes based on at least one of block shape information and partition shape pattern information. For example, the CUs on the right side of the second CUs 810a and 810b can be divided into an odd number of third CUs 820c, 820d, and 820e. The order in which the multiple CUs included in the first CU 800 are processed can be a specific order (e.g., z-scan order 830), and the image decoding device 100 can determine whether the third CUs 820c, 820d, and 820e, determined by dividing the second CU 810b on the right into an odd number of CUs, satisfy the condition that the third CUs 820c, 820d, and 820e can be processed in a specific order.

[0137] According to an embodiment, the image decoding device 100 can determine whether the third CUs 820a, 820b, 820c, 820d, and 820e included in the first CU 800 satisfy a condition that the third CUs 820a, 820b, 820c, 820d, and 820e can be processed in a specific order, and this condition is related to whether at least one of the width and height of the second CUs 810a and 810b is bisected according to the boundaries of the third CUs 820a, 820b, 820c, 820d, and 820e. For example, the third CUs 820a and 820b, determined by bisecting the height of the non-square second CU 810a on the left, can satisfy the condition. Because the boundaries of the third CUs 820c, 820d, and 820e, determined by dividing the second CU 810b on the right side into three CUs, do not bisect the width or height of the second CU 810b on the right side, it can be determined that the third CUs 820c, 820d, and 820e do not meet the condition. When the condition is not met, the image decoding device 100 can determine that the scanning order is discontinuous, and based on the determination result, it can determine that the second CU 810b on the right side is divided into an odd number of CUs. According to an embodiment, when the CUs are divided into an odd number of CUs, the image decoding device 100 can impose specific restrictions on the CUs at specific positions within the divided CUs. Since the content of such restrictions, specific positions, etc., have been described above with reference to various embodiments, their detailed description is omitted.

[0138] Figure 9 The image decoding device 100 according to an embodiment is shown to determine the processing of at least one CU by dividing a first CU 900.

[0139] According to an embodiment, the image decoding device 100 can divide the first CU 900 based on the division shape pattern information obtained by the bitstream acquisition unit 110. The square-shaped first CU 900 can be divided into four square-shaped CUs, or it can be divided into multiple non-square-shaped CUs. For example, referring to… Figure 9 When the first CU 900 is square and the division shape pattern information indicates "divided into non-square CUs", the image decoding device 100 can divide the first CU 900 into a plurality of non-square CUs. Specifically, when the division shape pattern information indicates dividing the first CU 900 in the horizontal or vertical direction to determine an odd number of CUs, the image decoding device 100 can divide the square-shaped first CU 900 into second CUs 910a, 910b, and 910c determined by dividing the first CU 900 into an odd number of CUs in the vertical direction, or divide the square-shaped first CU 900 into second CUs 920a, 920b, and 920c determined by dividing the first CU 900 into an odd number of CUs in the horizontal direction.

[0140] According to an embodiment, the image decoding device 100 can determine whether the second CUs 910a, 910b, 910c, 920a, 920b, and 920c included in the first CU 900 satisfy a condition that the second CUs 910a, 910b, 910c, 920a, 920b, and 920c can be processed in a specific order. This condition is related to whether at least one of the width and height of the first CU 900 is bisected according to the boundaries of the second CUs 910a, 910b, 910c, 920a, 920b, and 920c. (Refer to...) Figure 9 Because the boundaries of the second CUs 910a, 910b, and 910c, determined by dividing the first CU 900 into square shapes in the vertical direction, do not bisect the width of the first CU 900, it can be determined that the first CU 900 does not satisfy the condition that the first CU 900 can be processed in a specific order. Furthermore, because the boundaries of the second CUs 920a, 920b, and 920c, determined by dividing the first CU 900 into square shapes in the horizontal direction, do not bisect the height of the first CU 900, it can be determined that the first CU 900 does not satisfy the condition that the first CU 900 can be processed in a specific order. When the conditions are not met, the image decoding device 100 can determine that the scanning order is discontinuous, and based on the determination result, it can determine that the first CU 900 is divided into an odd number of CUs. According to an embodiment, when the CUs are divided into an odd number of CUs, the image decoding device 100 can impose specific restrictions on the CUs at specific positions within the divided CUs. Since the content of such restrictions, specific positions, etc., have been described above with reference to various embodiments, their detailed description is omitted.

[0141] According to an embodiment, the image decoding device 100 can determine CUs with various shapes by dividing a first CU.

[0142] Reference Figure 9 The image decoding device 100 can divide the first CU 900 with a square shape and the first CU 930 or 950 with a non-square shape into CUs with various shapes.

[0143] Figure 10 The image decoding device 100, according to an embodiment, restricts the shape into which the second CU can be divided when a second CU of a non-square shape, determined by dividing the first CU 1000, satisfies certain conditions.

[0144] According to an embodiment, the image decoding device 100 can determine, based on the partitioning shape pattern information obtained by the bitstream acquisition unit 110, whether to divide the square-shaped first CU 1000 into non-square-shaped second CUs 1010a, 1010b, 1020a, and 1020b. The second CUs 1010a, 1010b, 1020a, and 1020b can be partitioned independently. Therefore, the image decoding device 100 can determine whether to partition or not into multiple CUs based on the partitioning shape pattern information associated with each of the second CUs 1010a, 1010b, 1020a, and 1020b. According to an embodiment, the image decoding device 100 can determine the third CUs 1012a and 1012b by partitioning the second CU 1010a, which is the left side of the non-square shape determined by partitioning the first CU 1000 in the vertical direction, in the horizontal direction. However, when the image decoding device 100 divides the left second CU 1010a in the horizontal direction, the right second CU 1010b can be restricted from being divided in the horizontal direction in the same way as the left second CU 1010a. When dividing the right second CU 1010b in the same direction to determine the third CUs 1014a and 1014b, the left second CU 1010a and the right second CU 1010b can be divided independently in the horizontal direction to determine the third CUs 1012a, 1012b, 1014a, and 1014b. However, this is the same result as the image decoding device 100 dividing the first CU 1000 into four square-shaped second CUs 1030a, 1030b, 1030c, and 1030d based on the division shape pattern information, which may be inefficient in terms of image decoding.

[0145] According to an embodiment, the image decoding device 100 can determine the third CUs 1022a, 1022b, 1024a, and 1024b by dividing the second CUs 1020a or 1020b, which are non-square shapes determined by dividing the first CU 1000 in the horizontal direction, in the vertical direction. However, when the image decoding device 100 divides one of the second CUs in the vertical direction (e.g., the top second CU 1020a), for the reasons described above, the other second CU (e.g., the bottom CU 1020b) can be restricted to be divided in the vertical direction in the same way as the direction in which the top second CU 1020a is divided.

[0146] Figure 11 The image decoding device 100 performs a process of dividing the square CUs when the division shape pattern information does not indicate "divided into four square CUs" according to an embodiment.

[0147] According to an embodiment, the image decoding device 100 can determine second CUs 1110a, 1110b, 1120a, 1120b, etc., by dividing the first CU 1100 based on division shape pattern information. The division shape pattern information may include information about the various shapes into which the CU can be divided, but the information about the various shapes may not always include information about CUs used to divide the CU into four square shapes. Based on the division shape pattern information, the image decoding device 100 cannot divide the square-shaped first CU 1100 into four square-shaped second CUs 1130a, 1130b, 1130c, and 1130d. Based on the division shape pattern information, the image decoding device 100 can determine second CUs 1110a, 1110b, 1120a, 1120b, etc., that are not square shapes.

[0148] According to an embodiment, the image decoding device 100 can independently divide each of the non-square-shaped second CUs 1110a, 1110b, 1120a, 1120b, etc. Each of the second CUs 1110a, 1110b, 1120a, 1120b, etc., can be divided in a specific order using a recursive method, which can be a division method corresponding to the method used to divide the first CU 1100 based on division shape pattern information.

[0149] For example, the image decoding device 100 can determine the square-shaped third CUs 1112a and 1112b by dividing the left second CU 1110a in the horizontal direction, and can determine the square-shaped third CUs 1114a and 1114b by dividing the right second CU 1110b in the horizontal direction. Furthermore, the image decoding device 100 can determine the square-shaped third CUs 1116a, 1116b, 1116c, and 1116d by dividing both the left second CU 1110a and the right second CU 1110b in the horizontal direction. In this case, the CUs can be determined to have the same shape as the first CU 1100, which is divided into four square shapes: the second CUs 1130a, 1130b, 1130c, and 1130d.

[0150] As another example, the image decoding device 100 can determine the square-shaped third CUs 1122a and 1122b by dividing the top second CU 1120a in the vertical direction, and can determine the square-shaped third CUs 1124a and 1124b by dividing the bottom second CU 1120b in the vertical direction. Furthermore, the image decoding device 100 can determine the square-shaped third CUs 1126a, 1126b, 1126c, and 1126d by dividing both the top second CU 1120a and the bottom second CU 1120b in the vertical direction. In this case, the CUs can be determined to have the same shape as the second CUs 1130a, 1130b, 1130c, and 1130d, which are divided into four square shapes by the first CU 1100.

[0151] Figure 12 The processing order among multiple CUs according to an embodiment is shown to vary depending on the processing of the CUs.

[0152] According to an embodiment, the image decoding device 100 can divide the first CU 1200 based on partition shape pattern information. When the block shape is square and the partition shape pattern information indicates that the first CU 1200 is divided in at least one direction, either horizontal or vertical, the image decoding device 100 can determine the second CU (e.g., 1210a, 1210b, 1220a, 1220b, etc.) by partitioning the first CU 1200. (See also...) Figure 12The non-square shapes of the second CUs 1210a, 1210b, 1220a, and 1220b, determined by dividing the first CU 1200 only in the horizontal or vertical direction, can be independently divided based on the division shape pattern information of each of the second CUs 1210a, 1210b, 1220a, and 1220b. For example, the image decoding device 100 can determine the third CUs 1216a, 1216b, 1216c, and 1216d by dividing the second CUs 1210a and 1210b generated by dividing the first CU 1200 in the vertical direction in the horizontal direction, and can determine the third CUs 1226a, 1226b, 1226c, and 1226d by dividing the second CUs 1220a and 1220b generated by dividing the first CU 1200 in the horizontal direction in the vertical direction. As already referred to above... Figure 11 The process of dividing the second CU 1210a, 1210b, 1220a and 1220b is described, so its detailed description is omitted.

[0153] According to an embodiment, the image decoding device 100 can process CUs in a specific order. (As already referred to above...) Figure 7 The characteristics of processing CUs according to a specific order are described, so their detailed description is omitted. (See reference...) Figure 12 The image decoding device 100 can divide a first CU 1200 into square shapes to determine four third CUs 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d, each with a square shape. According to an embodiment, the image decoding device 100 can determine the processing order of the third CUs 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d based on the shape into which the first CU 1200 is divided.

[0154] According to an embodiment, the image decoding device 100 can determine the third CUs 1216a, 1216b, 1216c, and 1216d by dividing the second CUs 1210a and 1210b generated by dividing them in the horizontal direction. The image decoding device 100 can process the third CUs 1216a, 1216b, 1216c, and 1216d in the following order 1217: first, process the third CUs 1216a and 1216c included in the second CU 1210a on the left side in the vertical direction, and then process the third CUs 1216b and 1216d included in the second CU 1210b on the right side in the vertical direction.

[0155] According to an embodiment, the image decoding device 100 can determine the third CUs 1226a, 1226b, 1226c, and 1226d by dividing the second CUs 1220a and 1220b in the vertical direction and dividing them in the horizontal direction. The image decoding device 100 can process the third CUs 1226a, 1226b, 1226c, and 1226d in the following order 1227: first, process the third CUs 1226a and 1226c included in the top second CU 1220a in the horizontal direction, and then process the third CUs 1226b and 1226d included in the bottom second CU 1220b in the horizontal direction.

[0156] Reference Figure 12 The second CUs 1210a, 1210b, 1220a, and 1220b can be divided into square-shaped third CUs 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d, respectively. The second CUs 1210a and 1210b, determined by vertical division, and the second CUs 1220a and 1220b, determined by horizontal division, are divided into different shapes, but according to the later-determined third CUs 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d, the first CU 1200 is ultimately divided into CUs with the same shape. Therefore, even when determining CUs with the same shape by recursively dividing CUs based on the division shape pattern information via different processes, the image decoding device 100 can process multiple CUs determined to have the same shape in different orders.

[0157] Figure 13 The process of determining the depth of a CU as the shape and size of the CU change when recursively dividing the CU to determine multiple CUs is illustrated according to an embodiment.

[0158] According to an embodiment, the image decoding device 100 can determine the depth of the CU based on a specific criterion. For example, the specific criterion could be the length of the long side of the CU. The image decoding device 100 can determine that when the length of the long side of the current CU is divided to be 2n (n>0) times the length of the long side of the CU before the division, the depth of the current CU increases by n compared to the depth of the CU before the division. In the following, the CU with increased depth is referred to as a CU with lower depth.

[0159] Reference Figure 13According to an embodiment, the image decoding device 100 can determine a second CU 1302, a third CU 1304, etc., with a lower depth by dividing a first CU 1300 of a square shape based on block shape information indicating a square shape (e.g., the block shape information may indicate "0: SQUARE"). When the size of the first CU 1300 of the square shape is 2N×2N, the second CU 1302, determined by dividing the width and height of the first CU 1300 by 1 / 2, can have a size of N×N. Furthermore, the third CU 1304, determined by dividing the width and height of the second CU 1302 by 1 / 2, can have a size of N / 2×N / 2. In this case, the width and height of the third CU 1304 correspond to 1 / 4 times the width and height of the first CU 1300. When the depth of the first CU 1300 is D, the depth of the second CU 1302, which is half the width and height of the first CU 1300, can be D+1, and the depth of the third CU 1304, which is one-quarter the width and height of the first CU 1300, can be D+2.

[0160] According to an embodiment, based on block shape information indicating a non-square shape (e.g., the block shape information may indicate "1: NS_VER" or "2: NS_HOR", where "1: NS_VER" indicates a non-square shape with a height greater than its width, and "2: NS_HOR" indicates a non-square shape with a width greater than its height), the image decoding device 100 can determine a second CU 1312 or 1322, a third CU 1314 or 1324, etc., with a lower depth by dividing the first CU 1310 or 1320 of the non-square shape.

[0161] The image decoding device 100 can determine the second CU (e.g., 1302, 1312, 1322, etc.) by dividing at least one of the width and height of the first CU 1310, which has a size of N×2N. That is, the image decoding device 100 can determine the second CU 1302, which has a size of N×N, or the second CU 1322, which has a size of N×N / 2, by dividing the first CU 1310 in the horizontal direction, and can also determine the second CU 1312, which has a size of N / 2×N, by dividing it in both the horizontal and vertical directions.

[0162] According to an embodiment, the image decoding device 100 can determine a second CU (e.g., 1302, 1312, 1322, etc.) by dividing at least one of the width and height of a first CU 1320 with a size of 2N×N. That is, the image decoding device 100 can determine a second CU 1302 with a size of N×N or a second CU 1312 with a size of N / 2×N by dividing the first CU 1320 in the vertical direction, and can also determine a second CU 1322 with a size of N×N / 2 by dividing it in both the horizontal and vertical directions.

[0163] According to an embodiment, the image decoding device 100 can determine a third CU (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of the second CU 1302, which has a size of N×N. That is, the image decoding device 100 can divide the second CU 1302 in the vertical and horizontal directions to determine a third CU 1304 with a size of N / 2×N / 2, a third CU 1314 with a size of N / 4×N / 2, or a third CU 1324 with a size of N / 2×N / 4.

[0164] According to an embodiment, the image decoding device 100 can determine a third CU (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second CU 1312 with dimensions of N / 2 × N. That is, the image decoding device 100 can determine a third CU 1304 with dimensions of N / 2 × N / 2 or a third CU 1324 with dimensions of N / 2 × N / 4 by dividing the second CU 1312 in the horizontal direction, and can also determine a third CU 1314 with dimensions of N / 4 × N / 2 by dividing the second CU 1312 in both the vertical and horizontal directions.

[0165] According to an embodiment, the image decoding device 100 can determine a third CU (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second CU 1322 with a size of N×N / 2. That is, the image decoding device 100 can determine a third CU 1304 with a size of N / 2×N / 2 or a third CU 1314 with a size of N / 4×N / 2 by dividing the second CU 1322 in the vertical direction, and can also determine a third CU 1324 with a size of N / 2×N / 4 by dividing the second CU 1322 in both the vertical and horizontal directions.

[0166] According to an embodiment, the image decoding device 100 can divide square-shaped CUs (e.g., 1300, 1302, 1304) in the horizontal or vertical direction. For example, a first CU 1310 with a size of N×2N can be determined by dividing a first CU 1300 with a size of 2N×2N in the vertical direction, or a first CU 1320 with a size of 2N×N can be determined by dividing a first CU 1300 in the horizontal direction. According to an embodiment, when determining the depth based on the length of the longest side of the CU, the depth of the CU determined by dividing a first CU 1300 with a size of 2N×2N in the horizontal or vertical direction can be equal to the depth of the first CU 1300.

[0167] In an embodiment, the width and height of the third CU 1314 or 1324 can be 1 / 4 times that of the first CU 1310 or 1320. When the depth of the first CU 1310 or 1320 is D, the depth of the second CU 1312 or 1322, which is 1 / 2 times the width and height of the first CU 1310 or 1320, can be D+1, and the depth of the third CU 1314 or 1324, which is 1 / 4 times the width and height of the first CU 1310 or 1320, can be D+2.

[0168] Figure 14 An index (partial index, hereinafter referred to as PID) for depth and CU differentiation is shown according to an embodiment, which can be determined based on the shape and size of the CU.

[0169] According to an embodiment, the image decoding device 100 can determine a second CU having various shapes by dividing a first CU 1400 into square shapes. (See also...) Figure 14 The image decoding device 100 can determine the second CUs 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d by dividing the first CU 1400 in at least one direction, either vertical or horizontal, according to the division shape pattern information. That is, the image decoding device 100 can determine the second CUs 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information used for the first CU 1400.

[0170] According to an embodiment, the depths of the second CUs 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d, determined based on the division shape pattern information of the first CU 1400 (a square shape), can be determined based on the length of its longer side. For example, since the length of one side of the first CU 1400 (a square shape) is equal to the length of the longer side of the second CUs 1402a, 1402b, 1404a, and 1404b (non-square shapes), the depth of the first CU 1400 and the second CUs 1402a, 1402b, 1404a, and 1404b (non-square shapes) can be considered equal to D. Conversely, when the image decoding device 100 divides the first CU 1400 into four square-shaped second CUs 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information, the length of one side of each square-shaped second CU 1406a, 1406b, 1406c, and 1406d is half the length of one side of the first CU 1400. Therefore, the depth of the second CUs 1406a, 1406b, 1406c, and 1406d can be D+1, which is a depth lower than the depth D of the first CU 1400.

[0171] According to an embodiment, the image decoding device 100 can divide a first CU 1410, whose height is greater than its width, into a plurality of second CUs 1412a, 1412b, 1414a, 1414b, and 1414c in the horizontal direction according to the division shape pattern information. According to an embodiment, the image decoding device 100 can also divide a first CU 1420, whose width is greater than its height, into a plurality of second CUs 1422a, 1422b, 1424a, 1424b, and 1424c in the vertical direction according to the division shape pattern information.

[0172] According to an embodiment, the depths of the second CUs 1412a, 1412b, 1414a, 1414b, 1422a, 1422b, 1424c, and 1424d, determined based on the division shape pattern information of the first CU 1410 or 1420 for non-square shapes, can be determined based on the length of the longer side. For example, because the length of one side of the square-shaped second CUs 1412a and 1412b is half the length of one side of the non-square-shaped first CU 1410 whose height is greater than its width, the depth of the second CUs 1412a and 1412b is D+1, which is one depth lower than the depth D of the non-square-shaped first CU 1410.

[0173] Furthermore, the image decoding device 100 can divide the non-square-shaped first CU 1410 into an odd number of second CUs 1414a, 1414b, and 1414c based on the division shape pattern information. The odd number of second CUs 1414a, 1414b, and 1414c can include the non-square-shaped second CUs 1414a and 1414c as well as the square-shaped second CU 1414b. In this case, because the length of the longer side of the non-square-shaped second CUs 1414a and 1414c and the length of one side of the square-shaped second CU 1414b are half the length of one side of the first CU 1410, the depth of the second CUs 1414a, 1414b, and 1414c can be D+1, which is a depth lower than the depth D of the first CU 1410. The image decoding device 100 can determine the depth of the CU associated with the first CU 1420, which has a width greater than its height, by using a method corresponding to the method for determining the depth of the CU associated with the first CU 1410.

[0174] According to an embodiment, when determining the index PID for distinguishing the partitioned CUs, when the number of partitioned CUs does not have the same size, the image decoding device 100 can determine the index based on the size ratio between the CUs. (See also...) Figure 14 Among the odd-numbered CUs 1414a, 1414b, and 1414c, the central CU 1414b can have a height twice that of CUs 1414a and 1414c, where CU 1414b has the same width as the other CUs 1414a and 1414c but a different height. That is, in this case, the central CU 1414b can comprise two distinct CUs 1414a and 1414c. Therefore, when the index PID of the central CU 1414b according to the scanning order is 1, the index of the next CU 1414c can be 3, which is increased by 2. In other words, the index values ​​may exhibit discontinuities. According to an embodiment, the image decoding device 100 can determine whether the odd-numbered CUs do not have the same size based on the presence of discontinuities in the indices used to distinguish the divided CUs.

[0175] According to an embodiment, the image decoding device 100 can determine whether a CU is divided into a specific partition shape based on the value of an index used to distinguish among a plurality of CUs determined by partitioning from the current CU. (See also...) Figure 14The image decoding device 100 can determine an even number of CUs 1412a and 1412b or an odd number of CUs 1414a, 1414b, and 1414c by dividing a first CU 1410 into rectangles whose height is longer than their width. The image decoding device 100 can use an index PID representing each CU to distinguish multiple CUs. In an embodiment, the PID can be obtained from a sample point at a specific location of each CU (e.g., the top-left sample point).

[0176] According to an embodiment, the image decoding device 100 can determine a CU at a specific location within the divided and determined CUs by using an index for distinguishing CUs. According to an embodiment, when the division shape pattern information for a first CU 1410, a rectangle whose height is greater than its width, indicates "divided into three CUs," the image decoding device 100 can divide the first CU 1410 into three CUs 1414a, 1414b, and 1414c. The image decoding device 100 can assign an index to each of the three CUs 1414a, 1414b, and 1414c. The image decoding device 100 can compare the indices for each CU to determine the center CU among the odd number of CUs divided. The image decoding device 100 can determine CU 1414b, which has an index corresponding to the middle value among the CU indices, as the CU at the center position among the CUs determined by dividing the first CU 1410. According to an embodiment, when determining the index for distinguishing the divided CUs, when the CUs do not have the same size, the image decoding device 100 can determine the index based on the size ratio between the CUs. (See also...) Figure 14The CU 1414b generated by dividing the first CU 1410 can be twice the height of CUs 1414a and 1414c, wherein CU 1414b has the same width as the other CUs 1414a and 1414c but has a different height than the other CUs 1414a and 1414c. In this case, when the index PID of the CU 1414b located at the center is 1, the index of the next CU 1414c in the next order can be 3, which is increased by 2. As in this case, when the index increases uniformly and then the amount of increase changes, the image decoding device 100 can determine that the current CU is divided into multiple CUs including CUs with different sizes from the other CUs. According to an embodiment, when the division shape pattern information indicates "divided into an odd number of CUs", the image decoding device 100 can divide the current CU into the following shape: a CU at a specific position among the odd number of CUs (e.g., the center CU) has a different size from the other CUs. In this case, the image decoding device 100 can determine the center CU with different sizes by using the index PID for the CU. However, the dimensions or positions and indexes of the CU at specific locations are specific to the illustrative embodiment and should not be construed as limited thereto, but should be construed as being able to use various indexes, positions and dimensions of the CU.

[0177] According to an embodiment, the image decoding device 100 may use a specific data unit, wherein the recursive partitioning of the CU begins from that specific data unit.

[0178] Figure 15 The illustration shows how multiple CUs are determined based on multiple specific data units included in the screen, according to an embodiment.

[0179] According to an embodiment, the specific data unit can be defined as a data unit from which CUs are recursively divided using division shape pattern information. That is, the specific data unit may correspond to the CU with the highest depth used in the process of determining the multiple CUs used to divide the current frame. For ease of explanation, the specific data unit is referred to as a reference data unit.

[0180] According to an embodiment, the reference data unit can represent a specific size and shape. According to an embodiment, the reference data unit can include M×N sample points. Here, M and N can be equal to each other, or can be integers represented as powers of 2. That is, the reference data unit can have a square shape or a non-square shape, and can subsequently be divided into an integer number of CUs.

[0181] 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 for dividing the current frame by using division shape pattern information for each reference data unit. The process of dividing the reference data units can correspond to a division process using a quadtree structure.

[0182] According to an embodiment, the image decoding device 100 may predefine the minimum size that a reference data unit included in the current frame can have. Therefore, the image decoding device 100 may determine reference data units of various sizes that are greater than or equal to the minimum size, and may determine at least one CU based on the determined reference data units by using partitioning shape pattern information.

[0183] Reference Figure 15 The image decoding device 100 may use a square-shaped reference CU 1500 or a non-square-shaped reference CU 1502. According to embodiments, the shape and size of the reference CU may be determined based on various data units (e.g., sequences, frames, stripes, strip segments, parallel blocks, parallel block groups, CTUs, etc.) that may include at least one reference CU.

[0184] According to an embodiment, the bitstream acquisition unit 110 of the image decoding device 100 can obtain at least one of the following information from the bitstream for each of various data units: information about the shape of the reference CU and information about the size of the reference CU. This has already been demonstrated above. Figure 3 The current CU 300 partitioning process describes the process of determining at least one CU included in the reference CU 1500 of the square shape, and the above has been passed through Figure 4 The process of dividing the current CU 400 or 450 describes the process of determining at least one CU included in the reference CU 1502 which is of a non-square shape; therefore, its detailed description is omitted.

[0185] According to an embodiment, the image decoding device 100 can use an index for identifying the size and shape of a reference CU to determine the size and shape of the reference CU based on a set of data units predefined based on specific conditions. That is, the bitstream acquisition unit 110 can obtain from the bitstream only the index for identifying the size and shape of the reference CU for each strip, strip segment, parallel block, parallel block group, CTU, etc., that is a data unit satisfying a specific condition (e.g., a data unit smaller than the strip) among various data units (e.g., sequences, frames, stripes, strip segments, parallel blocks, parallel block groups, CTUs, etc.). The image decoding device 100 can determine the size and shape of the reference data unit for each data unit satisfying the above conditions by using the index. When information about the shape and size of the reference CU is obtained and used from the bitstream for each relatively small data unit, the efficiency of bitstream usage may be poor. Therefore, instead of directly obtaining information about the shape and size of the reference CU, only the index can be obtained and used. In this case, at least one of the size and shape of the reference CU corresponding to the index indicating the size and shape of the reference CU can be predefined. In other words, the image decoding device 100 can determine at least one of the dimensions and shapes of the reference CU included in the data unit used as the basis for obtaining the index by selecting at least one of the dimensions and shapes of the predefined reference CU according to the index.

[0186] According to embodiments, the image decoding device 100 may use at least one reference CU included in a CTU 1510. That is, the CTU used for partitioning an image may include at least one reference CU, and the CU can be determined by recursively partitioning each reference CU. In embodiments, at least one of the width and height of the CTU may be an integer multiple of at least one of the width and height of the reference CU. According to embodiments, the size of the reference CU may be the size of the CTU partitioned n times according to a quadtree structure. That is, according to various embodiments, the image decoding device 100 may determine the reference CU by partitioning the CTU n times according to a quadtree structure, and may partition the reference CU based on at least one of block shape information and partition shape pattern information.

[0187] According to an embodiment, the image decoding device 100 can obtain and use block shape information indicating the shape of the current CU or partition shape pattern information indicating the method of partitioning the current CU from the bitstream. 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 and use syntax elements corresponding to the block shape information or partition shape pattern information for each CTU and reference CU from the bitstream.

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

[0189] Image decoding device 100 can determine image partitioning rules. Partitioning rules can be predefined between image decoding device 100 and image encoding device 200. Image decoding device 100 can determine image partitioning rules based on information obtained from the bitstream. For example, image decoding device 100 can determine 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 partitioning rules differently based on frames, stripes, parallel blocks, time layers, CTUs, or CUs.

[0190] Image decoding device 100 may determine partitioning rules based on the block shape of the CU. The block shape may include the size, shape, aspect ratio, and orientation of the CU. Image encoding device 200 and image decoding device 100 may predefine partitioning rules based on the block shape of the CU. However, this disclosure is not limited thereto. Image decoding device 100 may determine partitioning rules based on information obtained from the bitstream received from image encoding device 200.

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

[0192] The dimensions of the CU can include various sizes, such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, ..., 256×256. The dimensions of the CU can be classified according to the length of its long side, the length of its short side, or its width. The image decoding device 100 can apply the same classification rules to CUs classified into the same group. For example, the image decoding device 100 can classify CUs with equal long side lengths as having the same size. Furthermore, the image decoding device 100 can apply the same classification rules to CUs with equal long side lengths.

[0193] The aspect ratio of a CU can include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, or 1:32. Furthermore, the orientation of a CU can include both horizontal and vertical directions. A horizontal orientation indicates that the width of the CU is longer than its height. A vertical orientation indicates that the width of the CU is shorter than its height.

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

[0195] The partitioning rule based on the size of the CU can be a predefined 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.

[0196] The image decoding device 100 can adaptively determine the partitioning rules based on the position of the CU. The image decoding device 100 can adaptively determine the partitioning rules based on the position occupied by the CU in the image.

[0197] Furthermore, the image decoding device 100 can determine partitioning rules such that CUs generated through different partitioning paths do not have the same block shape. However, this disclosure is not limited to this, and CUs generated through different partitioning paths can have the same block shape. CUs generated through different partitioning paths can have different decoding processing orders. Because it has already been combined Figure 12 The decoding process order is described, so its detailed description is omitted.

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

[0199] Reference Figure 16The image decoding device 100 can determine different combinations of partitioning shapes into which a CU can be divided for each frame. For example, the image decoding device 100 can decode an image by using a frame 1600 that can be divided into four CUs, a frame 1610 that can be divided into two or four CUs, and a frame 1620 that can be divided into two, three, or four CUs, all included in at least one frame in the image. The image decoding device 100 can divide the frame 1600 into multiple CUs using only partitioning shape information indicating "divided into four square-shaped CUs". The image decoding device 100 can divide the frame 1610 using only partitioning shape information indicating "divided into two or four CUs". The image decoding device 100 can divide the frame 1620 using only partitioning shape information indicating "divided into two, three, or four CUs". The above combinations of partitioning shapes are merely embodiments for explaining the operation of the image decoding device 100. Therefore, the above combinations of partitioning shapes should not be construed as limiting to these embodiments, but rather as allowing for various combinations of partitioning shapes to be used for each specific data unit.

[0200] According to an embodiment, the bitstream acquisition unit 110 of the image decoding device 100 can acquire a bitstream including an index indicating 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 acquisition unit 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 image decoding device 100 can determine the combination of partition shapes into which the CU can be divided for each specific data unit by using the acquired index, and therefore, different combinations of partition shapes can be used for each specific data unit.

[0201] Figure 17 Various shapes of the CU, which can be determined based on partition shape pattern information represented in binary code, are shown according to embodiments.

[0202] According to an embodiment, the image decoding device 100 can divide the CU into various shapes using block shape information and partitioning shape pattern information obtained through the bitstream acquisition unit 110. The shape of the partitionable CU can correspond to various shapes including those described with reference to the above embodiments.

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

[0204] According to an embodiment, when the image decoding device 100 divides a square-shaped CU into four square-shaped CUs by dividing the square-shaped CU in the horizontal and vertical directions, there may be four types of division shapes that can be indicated by the division shape pattern information for the square-shaped CUs. According to an embodiment, the division shape pattern information may be represented as a two-digit binary code, and the binary code may be assigned to each division shape. For example, when the CU is not divided, the division shape pattern information may be represented as (00)b. When the CU is divided in the horizontal and vertical directions, the division shape pattern information may be represented as (01)b. When the CU is divided in the horizontal direction, the division shape pattern information may be represented as (10)b. When the CU is divided in the vertical direction, the division shape pattern information may be represented as (11)b.

[0205] According to an embodiment, when the image decoding device 100 divides a non-square-shaped CU in a horizontal or vertical direction, the type of division shape that can be indicated by the division shape pattern information can be determined based on the number of CUs divided. (Refer to...) Figure 17 According to an embodiment, the image decoding device 100 can divide a non-square-shaped CU into up to three CUs. The image decoding device 100 can divide a CU into two CUs, and in this case, the division shape pattern information can be represented as (10)b. The image decoding device 100 can divide a CU into three CUs, and in this case, the division shape pattern information can be represented as (11)b. The image decoding device 100 can determine not to divide the CU, and in this case, the division shape pattern information can be represented as (0)b. That is, the image decoding device 100 can use variable-length coding (VLC) instead of fixed-length coding (FLC) to use binary codes indicating the division shape pattern information.

[0206] According to the embodiments, refer to Figure 17 The binary code indicating that the CU is not to be divided can be represented as (0)b. When the binary code indicating that the CU is not to be divided is set to (00)b, even if there is no partitioning shape pattern information set to (01)b, all the binary codes of the 2-bit partitioning shape pattern information must be used. However, as Figure 17 As shown, when three partitioning shapes are used for a non-square-shaped CU, even if a 1-bit binary code (0)b is used as partitioning shape pattern information, the image decoding device 100 can determine that the CU is not partitioned, thus the bitstream can be used effectively. However, the partitioning shape of a non-square-shaped CU indicated by the partitioning shape pattern information should not be interpreted as limited to... Figure 17 The three shapes shown are intended to be interpreted as including all shapes described in the above embodiments.

[0207] Figure 18 Other shapes of the CU, which can be determined based on partition shape pattern information represented in binary code, are shown according to an embodiment.

[0208] Reference Figure 18 The image decoding device 100 can divide a square-shaped CU in the horizontal or vertical direction based on the division shape pattern information, and can also divide a non-square-shaped CU in the horizontal or vertical direction. That is, the division shape pattern information can indicate that a square-shaped CU is divided in one direction. In this case, the binary code of the division shape pattern information indicating that a square-shaped CU is not divided can be represented as (0)b. When the binary code of the division shape pattern information indicating that a CU is not divided is set to (00)b, even if there is no division shape pattern information set to (01)b, all the binary codes of the 2-bit division shape pattern information must be used. However, as... Figure 18 As shown, when three partition shapes are used for a square-shaped CU, even if a 1-bit binary code (0)b is used as partition shape pattern information, the image decoding device 100 can determine that the CU is not partitioned, thus the bitstream can be used effectively. However, the partition shape of the square-shaped CU indicated by the partition shape pattern information should not be interpreted as limited to... Figure 18 The three shapes shown are intended to be interpreted as including all shapes described in the above embodiments.

[0209] In this embodiment, block shape information or partition shape pattern information can be represented using binary code, and such information can be directly generated as a bitstream. Alternatively, the block shape information or partition shape pattern information represented as binary code may not be directly generated as a bitstream, but can be used as binary code input in Context Adaptive Binary Arithmetic Coding (CABAC).

[0210] According to an embodiment, the image decoding device 100 is described as obtaining a syntax for block shape information or partition shape pattern information via CABAC. A bitstream including binary codes for the syntax can be obtained by a bitstream acquisition unit 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 elements to be decoded, and can decode each binary bit using probability information. The image decoding device 100 can repeat the above process until the binary bit string including the decoded binary bits becomes equal to one of the previously obtained binary bit strings. The image decoding device 100 can determine the syntax elements by debinarizing the binary bit strings.

[0211] 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 the image decoding device 100 can update the probability model of the binary bits obtained by the bit stream acquisition unit 110. (Refer to...) Figure 17 According to an embodiment, the bitstream acquisition unit 110 of the image decoding device 100 can acquire a bitstream representing binary codes indicating partitioning pattern information. The image decoding device 100 can determine the syntax for the partitioning shape pattern information by using the acquired 1-bit or 2-bit binary codes. The image decoding device 100 can update the probability of each bit of the 2-bit binary code to determine the syntax for the partitioning shape pattern information. That is, the image decoding device 100 can update the probability of having a value of 0 or 1 when decoding the next binary bit based on whether the value of the first binary bit in the 2-bit binary code is 0 or 1.

[0212] According to an embodiment, in the process of determining the syntax, the image decoding device 100 may update the probability of the binary bits used in the process of decoding the binary bits of the binary bit string of the syntax, and the image decoding device 100 may determine that a particular bit in the binary bit string has the same probability without updating the probability.

[0213] Reference Figure 17In the process of determining the syntax by using a binary bit string indicating the partitioning shape pattern information for non-square CUs, when a non-square CU is not partitioned, 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. That is, when the block shape information indicates that the current CU is non-square, the first binary bit of the binary bit string used for the partitioning shape pattern information can be 0 when the non-square CU is not partitioned, and the first binary bit of the binary bit string used for the partitioning shape pattern information can be 1 when the non-square CU is partitioned into two or three CUs. Therefore, the probability that the first binary bit of the binary bit string used for the partitioning shape pattern information for non-square CUs is 0 can be 1 / 3, and the probability that the first binary bit of the binary bit string used for the partitioning shape pattern information for non-square CUs is 1 can be 2 / 3. As described above, since the partitioning shape pattern information indicating that non-square CUs are not partitioned can be represented simply as a 1-bit binary string with a value of 0, the image decoding device 100 can only determine the syntax for the partitioning shape pattern information by determining whether the second binary bit is 0 or 1 if the first binary bit of the partitioning shape pattern information is 1. According to an embodiment, the image decoding device 100 can decode the binary bits by assuming that the probability of the second binary bit being 0 or 1 is the same when the first binary bit used for partitioning the shape pattern information is 1.

[0214] According to an embodiment, the image decoding device 100 may use various probabilities for each binary bit in the process of 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 a non-square block. 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 width or the length of the long side of the current CU. 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 shape of the current CU and the length of the long side.

[0215] 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 a CU of a specific size or larger. For example, for a CU with a size based on the length of its long side having 64 or more samples, the probability of binary bits for dividing shape pattern information can be determined to be the same.

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

[0217] Figure 19 A block diagram of an image encoding and decoding system that performs loop filtering is shown.

[0218] The image encoding and decoding system 1900 has an encoding stage 1910 that transmits the encoded bitstream of the image, and a decoding stage 1950 that receives the bitstream and decodes it to output a reconstructed image. Here, the encoding stage 1910 may have a configuration similar to that of the image encoding device 200 described below, and the decoding stage 1950 may have a configuration similar to that of the image decoding device 100.

[0219] In the encoding stage 1910, the prediction coding unit 1915 outputs prediction data through inter-frame prediction and intra-frame prediction, and the transform and quantization unit 1920 outputs the quantized transform coefficients of the residual data between the prediction data and the current input image. The entropy coding unit 1925 outputs a bitstream by encoding and transforming the quantized transform coefficients. The quantized transform coefficients are reconstructed into spatial domain data by the inverse quantization and inverse transform unit 1930, and the reconstructed spatial domain data is output as a reconstructed image by the loop filtering unit 1940. The reconstructed image can be used by the prediction coding unit 1915 as a reference image for the next input image.

[0220] The encoded image data in the bitstream received by the decoding stage 1950 is reconstructed into spatial domain residual data by the entropy decoding unit 1955 and the dequantization and inverse transform unit 1960. The prediction data and residual data output from the prediction decoding unit 1975 can be combined to form spatial domain image data, and the loop filtering unit 1970 can output a reconstructed image for the current original image by performing filtering on the spatial domain image data. The reconstructed image can be used by the prediction decoding unit 1975 as a reference image for the next original image.

[0221] The loop filtering unit 1940 in the encoding stage 1910 performs loop filtering by using filter information input according to user input or system settings. The filter information used by the loop filtering unit 1940 is output to the entropy encoding unit 1925 and transmitted to the decoding stage 1950 along with the encoded image data. The loop filtering unit 1970 in the decoding stage 1950 can perform loop filtering based on the filter information input from the decoding stage 1950.

[0222] 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 inverse processing of the image decoding method, are described with reference to various embodiments.

[0223] Figure 2 A block diagram of an image encoding device 200 according to an embodiment is shown, capable of encoding an image based on at least one of block shape information and segmentation shape pattern information.

[0224] Image encoding device 200 may include encoding unit 220 and bitstream generation unit 210. Encoding unit 220 may receive and encode an input image. Encoding unit 220 may obtain at least one syntax element by encoding the input image. 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 mode, coding block flag, intra-prediction mode, direct flag, merge flag, incremental QP, reference index, prediction direction, and transform index. Encoding unit 220 may determine a context model based on block shape information including at least one of the shape, orientation, aspect ratio, or size of the CU.

[0225] The bitstream generation unit 210 can generate a bitstream based on the encoded input image. For example, the bitstream generation unit 210 can generate a bitstream by performing entropy encoding on syntax elements based on a context model. Furthermore, the image encoding device 200 can send the bitstream to the image decoding device 100.

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

[0227] According to an embodiment, encoding unit 220 can determine the shape into which the CU is divided. Encoding unit 220 can determine the shape of at least one CU included in the CU, and bitstream generation unit 210 can generate a bitstream including division shape pattern information, wherein the division shape pattern information includes information about the shape of the CU.

[0228] According to an embodiment, the encoding unit 220 can determine whether a CU is divided. When the encoding unit 220 determines that a CU is not divided or that a CU includes only one CU, the bitstream generation unit 210 can generate a bitstream including partitioning pattern information indicating that the CU is not divided. Furthermore, the encoding unit 220 can divide a CU into multiple CUs included in the CU, and the bitstream generation unit 210 can generate a bitstream including partitioning shape pattern information indicating "divided into multiple CUs".

[0229] According to an embodiment, information indicating how many CUs a CU will be divided into or in which direction the CUs will be divided can be included in the division shape pattern information. For example, the division shape pattern information may indicate "dividing in at least one of the vertical and horizontal directions", or it may indicate "no division".

[0230] Image encoding device 200 determines information about the partitioning shape pattern of the CU based on the partitioning shape pattern of the CU. Image encoding device 200 determines a context model based on at least one of the shape, orientation, aspect ratio, or size of the CU. Image encoding device 200 generates a bitstream of information about the partitioning shape pattern used to partition the CU based on the context model.

[0231] To determine the context model, the image encoding device 200 may obtain an array for matching at least one of the shape, orientation, aspect ratio, or size of the CUs with an index used for the context model. The image encoding device 200 may obtain the index for the context model based on at least one of the shape, orientation, aspect ratio, or size of the CUs in the array. The image encoding device 200 may determine the context model based on the index used for the context model.

[0232] To determine the context model, the image coding device 200 may further determine the context model based on block shape information including at least one of the shape, orientation, aspect ratio, or size of neighboring CUs adjacent to the CU. Additionally, neighboring CUs may include at least one CU located to the lower left, left, upper left, upper right, right, or lower right of the CU.

[0233] In addition, to determine the context model, the image encoding device 200 can compare the width of the upper neighboring CU with the width of the CU. Furthermore, the image encoding device 200 can compare the height of the left and right neighboring CUs with the height of the CU. Moreover, the image encoding device 200 can determine the context model based on the comparison results.

[0234] 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 is omitted.

[0235] In embodiments of this disclosure, the Adaptive Parameter Set (APS) filter set may include the current APS filter set or a previous APS filter set. The APS filter set may be a filter set obtained or derived from the strip header or the APS for each strip. Furthermore, at least one APS filter set corresponding to a strip may be obtained or derived.

[0236] In embodiments of this disclosure, the current APS filter set may represent a collection of filters obtained or derived from the strip header of the current strip for filtering blocks included in the current strip. For example, an image decoding device may obtain or derive four APS filter sets for filtering blocks included in the current strip. On the other hand, the number of APS filter sets used for filtering blocks included in the current strip is not limited to the disclosed examples and may be less than or greater than four.

[0237] In embodiments of this disclosure, the current APS filter set may represent a set of filters obtained or derived from the strip header of a previous strip for filtering blocks included in the previous strip. For example, an image decoding device may obtain or derive at least one filter set for filtering blocks included in the previous strip from the strip header of a previous strip. The image decoding device may use the filter set obtained from the strip header of the previous strip to filter blocks included in the current strip. Alternatively, the previous strip may be a previously decoded strip in the current image or a strip included in a previously decoded image.

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

[0239] Reference Figure 20 The image decoding device 2000 may include an acquisition unit 2010 and a prediction decoding unit 2030. Figure 20 The obtaining unit 2010 shown in the figure can correspond to Figure 1 The bitstream acquisition unit 110 shown in the figure, and the prediction decoding unit 2030 can correspond to Figure 1 The decoding unit 120 is shown in the diagram. Additionally, the obtaining unit 2010 may correspond to... Figure 19 The entropy decoding unit 1955 shown in the figure, and the prediction decoding unit 2030 can correspond to Figure 19 The prediction decoding unit 1975 is shown in the figure.

[0240] In an embodiment, the acquisition unit 2010 and the prediction decoding unit 2030 may be implemented as at least one processor. In an embodiment, the acquisition unit 2010 and the prediction decoding unit 2030 may operate according to instructions stored in a memory.

[0241] In an embodiment, the image decoding device 2000 may include a memory for storing the input and output data of the acquisition unit 2010 and the prediction decoding unit 2030. Additionally, the image decoding device 2000 may include a memory control unit for controlling the data input and output of the memory.

[0242] In an embodiment, the obtaining unit 2010 can obtain a bitstream generated as a result of encoding the image.

[0243] In an embodiment, the bitstream may include the result of encoding the current block. The bitstream may include multiple pieces of information for reconstructing the current block. The current block may be a CTU, CU, transform unit, prediction unit, or filtering unit partitioned from the current image to be decoded. Furthermore, the current block may be a block at a predefined position being processed in the currently being performed encoding or decoding operation. The current sample may be any sample included in the current block.

[0244] In an embodiment, the prediction decoding unit 2030 may determine the current block based on block shape information and / or segmentation shape pattern information included in the bitstream corresponding to at least one of the following levels: sequence parameter set, picture parameter set, video parameter set, strip header, and strip segment header.

[0245] In an embodiment, the obtaining unit 2010 can receive a bitstream from an image encoding device via a network.

[0246] In an embodiment, the obtaining unit 2010 can obtain a bit stream from a data storage medium, including magnetic media such as hard disks, floppy disks and magnetic tapes, optical recording media such as optical disc read-only memory (CD-ROM) and digital multifunction disc (DVD), magneto-optical media such as optical floppy disks, etc.

[0247] In this embodiment, the obtaining unit 2010 can obtain syntax elements for decoding the image from the bitstream. The values ​​corresponding to the syntax elements can be included in the bitstream according to the hierarchical structure of the image.

[0248] In an embodiment, the obtaining unit 2010 can obtain the binary bits corresponding to the syntax elements by performing entropy decoding on the bit stream.

[0249] In an embodiment, the prediction decoding unit 2030 can obtain information about adaptive loop filtering from the bitstream. This information can also be obtained as syntax elements. The prediction decoding unit 2030 can obtain all or part of the information about adaptive loop filtering from at least one of the sequence parameter set, frame parameter set, APS, strip header, and strip data of the bitstream. The information about adaptive loop filtering may include at least one of the following: information indicating whether adaptive loop filtering is performed, information about whether an APS filter set is used, a filter set index, information about whether the current APS filter set is obtained, an APS index, information about the number of filters in each current APS filter set included in the APS filter set, and information about at least one APS filter included in the current APS filter set (e.g., APS filter coefficients, classifier information, etc.).

[0250] On the other hand, an APS filter can be called an adaptive filter. Furthermore, an APS filter set can be called an adaptive filter set. Additionally, APS filter coefficients can be called adaptive filter coefficients.

[0251] For example, information about adaptive loop filtering obtained from the sequence parameter set can be information about the APS filter to be applied to the current sequence. Information about adaptive loop filtering obtained from the frame parameter set can be information about the APS filter to be applied to the current frame. Information about adaptive loop filtering obtained from the strip header or strip data can be information about the APS filter to be applied to the current strip.

[0252] On the other hand, the adaptive loop filter can be a filter that uses one of at least a predefined filter set, at least one previous APS filter set, and at least one current APS filter set. The previous APS filter can be a filter included in the current APS filter set contained in the information about adaptive loop filtering obtained for data units decoded prior to the current block. The information about adaptive loop filtering for previously decoded data units can be used as information about the previous APS filter. The adaptive loop filter can include at least one of filtering using a predefined filter set (e.g., a first filter, a second filter, or a third filter) and APS filtering.

[0253] In an embodiment, the prediction decoding unit 2030 may obtain information about whether to use the APS filter set based on information indicating whether to perform adaptive loop filtering. For example, when the prediction decoding unit 2030 determines to perform adaptive loop filtering, the prediction decoding unit 2030 may obtain information about whether to use the APS filter set.

[0254] In an embodiment, the prediction decoding unit 2030 may obtain at least one of the following: a filter set index, information about whether the current APS filter set is available, and an APS index, based on information indicating whether the APS filter set is used. For example, when the prediction decoding unit 2030 determines that the APS filter set is not used, the prediction decoding unit 2030 may obtain the filter set index. When the prediction decoding unit 2030 determines that the APS filter set is used, the prediction decoding unit 2030 may obtain the APS index and information about whether the current APS filter set is available.

[0255] In an embodiment, the prediction decoding unit 2030 can obtain information about the number of filters included in each current APS filter set and information about at least one APS filter included in the current APS filter set, based on information about whether the current APS filter set is obtained. For example, when the prediction decoding unit 2030 determines that the current APS filter set is obtained, the prediction decoding unit 2030 can obtain information about the number of filters included in each current APS filter set and information about at least one APS filter included in the current APS filter set.

[0256] In an embodiment, the prediction decoding unit 2030 may perform filtering using a predefined filter set for the current block based on at least one predefined filter set and a filter set index. For example, the prediction decoding unit 2030 may store a filter set including at least one filter derived from the learning data in memory. The prediction decoding unit 2030 may store at least one filter set in memory. Referring below... Figure 24 Describe its details. In the following text, predefined filters may be referred to as fixed filters. Additionally, a predefined filter set may be referred to as a fixed filter set. The filter set index may be referred to as a fixed filter index or a fixed index.

[0257] In an embodiment, the prediction decoding unit 2030 can perform a first filtering on the current block using a reconstructed block, an intermediate filtering block of the current block, and a first filter. The prediction decoding unit 2030 can obtain a first filtering block by performing the first filtering using the reconstructed block, the intermediate filtering block, and the first filter, wherein the first filtering block includes a first filtered sample corresponding to the current sample. The prediction decoding unit 2030 can obtain a first filtered sample corresponding to the current sample by performing filtering using the intermediate filtered sample of the current sample and the first filter.

[0258] In an embodiment, the prediction decoding unit 2030 can obtain a second filtered sample corresponding to the current sample by performing a second filtering using a reconstruction block, a first filtering block, and a second filter. The prediction decoding unit 2030 can obtain a second filtering block by performing a second filtering using a reconstruction block, a first filtering block, and a second filter, wherein the second filtering block includes the second filtered sample corresponding to the current sample. The prediction decoding unit 2030 can obtain the filtered sample corresponding to the current sample by performing filtering using the first filtered sample and the second filter.

[0259] In an embodiment, the prediction decoding unit 2030 can obtain a third filter block by performing a third filtering using a reconstructed block and a third filter, wherein the third filter block includes a third filtered sample corresponding to the current sample. The prediction decoding unit 2030 can obtain the third filtered sample corresponding to the current sample by performing filtering using the reconstructed sample and the third filter.

[0260] In an embodiment, the prediction decoding unit 2030 may perform APS filtering using at least one of the information regarding adaptive loop filtering and at least one of the following blocks: intermediate filter block, first filter block, second filter block, third filter block, reconstruction block, residual block, first filter residual block, second filter residual block, third filter residual block, third filter intermediate filter block, and difference block. The prediction decoding unit 2030 may perform adaptive loop filtering by using at least one of the following: intermediate filter block, first filter block, second filter block, third filter block, reconstruction block, residual block, first filter residual block, and adaptive filter.

[0261] In an embodiment, the prediction decoding unit 2030 may perform adaptive loop filtering based on information about adaptive loop filtering and at least one of the following: reconstructed samples, first filtered samples, second filtered samples, third filtered samples, intermediate filtered samples, residual samples, first filtered residual samples, second filtered residual samples, third filtered residual samples, third filtered intermediate filtered samples, and difference samples.

[0262] In an embodiment, the prediction decoding unit 2030 may perform filtering based on at least one of the reconstructed sample and its neighboring samples, at least one of the first filtered sample and its neighboring samples, at least one of the second filtered sample and its neighboring samples, at least one of the third filtered sample and its neighboring samples, at least one of the intermediate filtered sample and its neighboring samples, at least one of the residual sample and its neighboring samples, at least one of the first filtered residual sample and its neighboring samples, at least one of the second filtered residual sample and its neighboring samples, at least one of the third filtered residual sample and its neighboring samples, at least one of the third filtered intermediate filtered sample and its neighboring samples, at least one of the difference sample and its neighboring samples, and information regarding adaptive loop filtering.

[0263] The various methods for performing adaptive loop filtering in this disclosure are described in detail below.

[0264] In an embodiment, the image decoding device 2000 can obtain a filtered block by performing adaptive loop filtering on the current block. The image decoding device 2000 can obtain a filtered block that has undergone adaptive loop filtering by performing APS filtering on the current block using an APS filter or a predefined filter, or by using filtering with a predefined filter set. The filtered block may include adaptive loop filtering samples.

[0265] In the following text, in this disclosure, reference will be made to: Figures 21 to 33 Describe the specific steps involved in performing adaptive loop filtering.

[0266] Figure 21 This is a diagram illustrating the loop filtering operation according to an embodiment.

[0267] In an embodiment, the loop filtering unit of the image encoding device or the loop filtering unit of the image decoding device 2000 (hereinafter, loop filtering unit 2100) may perform at least one of deblocking filtering 2110, sample adaptive offset filtering 2120, and adaptive loop filtering 2130.

[0268] In an embodiment, the deblocking filter 2110 may be a filter that reduces the blocking effect that occurs during the processing of transformation, prediction and quantization by using a deblocking filter applied to the boundaries of the transform block.

[0269] In embodiments, the filter length for deblocking filter 2110 can be determined based on the image components or the size of the smallest transform block on either side. A 4-tap, 8-tap, or 14-tap filter can be applied to the transform block of the luminance sample, and a 6-tap filter can be applied to the transform block of the chrominance sample. On the other hand, the size or length of the taps used for deblocking filter 2110 is not limited to the disclosed examples.

[0270] In embodiments, the filter length for deblocking filter 2110 can be determined based on the smoothness or boundary conditions of the boundaries between transform blocks. For example, when filtering image data, image decoding device 2000 may identify regions containing highly dispersed samples as edges and may not perform deblocking filter to prevent the edges of objects from being blurred. Image decoding device 2000 can calculate the smoothness within the image data or confirm whether boundary conditions are met, and filter the boundaries of transform blocks only when the boundaries of transform blocks are confirmed to be flat. Boundary conditions may vary depending on whether the boundary is a vertical or horizontal boundary, whether the transform block is used for luminance samples, or whether the transform block is used for chrominance samples. Image decoding device 2000 can obtain information associated with the boundary conditions from the bitstream, and the boundary conditions can be preset. Furthermore, the filter coefficients associated with deblocking filter 2110 can be preset.

[0271] In an embodiment, the sample adaptive offset filter 2120 may be a filter that classifies samples from neighboring blocks and applies an offset to the classified samples in order to reduce ringing effects. For example, the sample adaptive offset filter 2120 may be a filter that reduces the error between the reconstructed image and the original image by adding an offset to at least one sample included in an image that has already undergone deblocking filtering.

[0272] In an embodiment, the sample adaptive offset filter 2120 can determine the sample characteristics within a block as one of not using sample adaptive offset filtering, performing edge offset filtering, or performing offset filtering.

[0273] In this embodiment, edge offset filtering is a filtering process performed when a block is identified as having an edge in a specific direction and where there is an error in the sample points along that edge direction. For the purpose of edge offset filtering, the image decoding device 2000 can perform edge offset filtering on the block by obtaining the type corresponding to the block and four edge offset values.

[0274] In this embodiment, band-off filtering is a filtering method that classifies samples within a block into brightness bands with similar brightness values ​​and applies an offset to multiple consecutive bands. The image decoding device 2000 can perform band-off filtering by obtaining information about the multiple bands, such as information about the starting interval of the bands and the offset value for each of the multiple bands.

[0275] In an embodiment, the image decoding device 2000 can perform sample adaptive offset filtering on the current block by using information about sample adaptive offset filtering for neighboring blocks. For example, the image decoding device 2000 can perform sample adaptive offset filtering on the current block by using information about sample adaptive offset filtering for the upper or left block.

[0276] In an embodiment, the adaptive loop filter 2130 can be a filter that is applied to the current block by using a filter adaptively determined or obtained based on the characteristics of the current block. The adaptive loop filter 2130 can be a filter performed using at least one predefined filter set, at least one APS filter set obtained from the APS, and a filter determined based on at least one type of the current block's type. Alternatively, the operation of obtaining the filter set can include obtaining the filter coefficients of each of the plurality of filters used in the adaptive loop filter 2130 for the current block. Furthermore, the operation of obtaining the filter can include obtaining at least one filter coefficient for the filter.

[0277] In an embodiment, the image decoding device 2000 may perform adaptive loop filtering 2130 by using a 7×7 filter as a 7×7 diamond-shaped filter for the luminance component of the current sample included in the current block and a 5×5 filter as a 5×5 diamond-shaped filter for the chrominance component. Adaptive loop filtering 2130 may include a first filter 2160 or an APS filter 2180.

[0278] In the following text, refer to Figure 22 , Figure 23 or Figure 25 The filter shape (or tap) for performing adaptive loop filtering 2130 according to the embodiments is described in detail. On the other hand, the shape and size of the filter and the type of block for performing adaptive loop filtering 2130 are not limited to the disclosed examples.

[0279] In an embodiment, the image decoding device 2000 can determine the type of the current block as one of several types based on characteristics such as directionality and activity of the samples within the current block. Characteristics such as directionality and activity of the samples within the current block can be determined using the gradient of the current block. For example, the directionality of the current block can be determined as one of five directions by calculating the horizontal gradient, vertical gradient, and diagonal gradient from the samples included in the current block included in the current image and the neighboring samples of the current block. Furthermore, the activity of the current block can be determined as one of five activities by using the gradient calculated for directionality classification. Because the type of the current block can be determined using five directions and five activities, the type of the current block can be determined as one of 25 types.

[0280] On the other hand, the number of directions, the number of activities, and the number of types are not limited to the examples disclosed. In the following text, refer to... Figure 22 Describe in detail the method used to determine the type of the current block.

[0281] In an embodiment, the image decoding device 2000 may obtain information about adaptive loop filtering from the bitstream. The image decoding device 2000 may obtain information about adaptive loop filtering from the strip header, strip data, or APS. The information about adaptive loop filtering may include information indicating whether adaptive loop filtering is performed, information 2140 regarding whether an APS filter set is used, and at least one filter from at least one APS filter set.

[0282] In an embodiment, the image decoding device 2000 may obtain information including, in the information about adaptive loop filtering, indicating whether adaptive loop filtering is performed.

[0283] In an embodiment, the image decoding device 2000 may obtain information 2140 regarding whether an APS filter set is used. For example, the image decoding device 2000 may obtain an index indicating whether an APS filter set is used as information 2140 regarding whether an APS filter set is used.

[0284] In an embodiment, the image decoding device 2000 may determine, based on information 2140 regarding whether to use an APS filter set, to perform adaptive loop filtering 2130 on the current block without using an APS filter set. For example, when the image decoding device 2000 determines that an APS filter set is not used, the image decoding device 2000 may perform a first filtering 2160 by using at least one predefined filter set. The at least one predefined filter set may be stored in the memory of the image decoding device 2000.

[0285] In an embodiment, when the image decoding device 2000 determines that the APS filter set is not used, the image decoding device 2000 may obtain a filter set index indicating one of at least one predefined filter sets. The image decoding device 2000 may determine a first filter for the current block based on the filter set index and type. The image decoding device 2000 may identify or obtain filter coefficients for the first filter determined based on the filter set index and type.

[0286] For example, the number of predefined filters can be 64, and the number of predefined filter sets can be 16. Furthermore, each filter set in the filter set can include information about filters corresponding to 25 different categories.

[0287] In an embodiment, the image decoding device 2000 can obtain filter coefficients for a first filter by inputting a filter set index and the current block to a first classifier 2150. The first classifier 2150 can determine the first filter based on a category determined according to the filter set index and the characteristics of the current block. The image decoding device 2000 can obtain the filter coefficients for the first filter output by the first classifier 2150. The current block can be a 2×2 or 4×4 block. On the other hand, the number of predefined filters, the number of predefined filter sets, and the size of the current block as the unit for performing filtering are not limited to the disclosed examples.

[0288] In an embodiment, the image decoding device 2000 can perform a first filtering 2160 on an intermediate filtering block of the current block using filter coefficients for a first filter. The image decoding device 2000 can obtain a filtered block by performing the first filtering 2160 on the intermediate filtering block. The image decoding device 2000 can obtain the first filtered block obtained by performing the first filtering 2160 on the intermediate filtering block as a filtered block.

[0289] In an embodiment, the image decoding device 2000 can perform a first filter 2160 on the current block by performing a first filter on at least one or all samples included in the intermediate filter block. For example, the image decoding device 2000 can filter the intermediate filter sample corresponding to the current sample by adding the values ​​obtained by multiplying the differences between the intermediate filter block and the neighboring samples of the intermediate filter sample included in the intermediate filter block by the corresponding first filter coefficients using a first filter tap for the first filter 2160. Furthermore, the image decoding device 2000 can perform the first filter 2160 on the current block by performing filtering on at least one or all samples included in the intermediate filter block with respect to the intermediate filter sample.

[0290] On the other hand, an intermediate filter block can represent at least one filter block that has undergone deblocking, adaptive sample offset filtering, and bilateral filtering. Furthermore, when it is determined that deblocking, adaptive sample offset filtering, and bilateral filtering have not yet been performed, an intermediate filter block can represent a reconstructed block.

[0291] In an embodiment, the image decoding device 2000 may determine, based on information 2140 regarding whether to use the APS filter set, to perform adaptive loop filtering 2130.

[0292] In an embodiment, when the image decoding device 2000 determines that adaptive loop filtering 2130 is to be performed using an APS filter set, the image decoding device 2000 may obtain information about whether a current APS filter set is obtained. The image decoding device 2000 may obtain the current APS filter set based on the information about whether a current APS filter set is obtained. When the image decoding device 2000 determines that a current APS filter set is obtained, the image decoding device 2000 may obtain an APS index indicating one filter set in at least one current APS filter set and at least one filter set in at least one previous APS filter set. In this disclosure, the APS index may be an index indicating a filter set in at least one APS filter set that includes the filter to be applied to the current block.

[0293] In an embodiment, the image decoding device 2000 may not obtain the current APS filter set based on information about whether the current APS filter set is available. When the image decoding device 2000 determines that the current APS filter set is not to be used, the image decoding device 2000 may obtain an APS index indicating a filter set from at least one previous APS filter set. In an embodiment, the image decoding device 2000 may obtain the APS index from the strip header, strip data, or the APS.

[0294] In an embodiment, the image decoding device 2000 may perform APS filtering 2180 based on the APS index. The image decoding device 2000 can obtain the APS filter for the current block using the type of the current block and the APS filter set indicated by the APS index. The image decoding device 2000 can perform APS filtering 2180 on the current block using the APS filter.

[0295] For example, the image decoding device 2000 may obtain four current APS filter sets and two previous APS filter sets as APS filter sets for the current stripe. Each APS filter set may include information about filters corresponding to up to 25 categories, respectively. The image decoding device 2000 may obtain an APS index having an index value of one of the indices from 0 to 5 corresponding to the four current APS filter sets and the two previous APS filter sets, respectively. On the other hand, the number of current APS filter sets and the number of previous APS filter sets are not limited to the disclosed examples.

[0296] In an embodiment, the image decoding device 2000 can obtain filter coefficients for an APS filter by inputting an APS index and the current block to a second classifier 2170. The second classifier 2170 can determine the APS filter based on a category determined according to the characteristics of the APS index and the current block. The image decoding device 2000 can obtain the filter coefficients for the APS filter output by the second classifier 2170. In this disclosure, obtaining a filter from a classifier can include obtaining filter coefficients for each filter. Additionally, in this disclosure, using each filter can include using the filter coefficients for each filter.

[0297] In an embodiment, the image decoding device 2000 can perform APS filtering 2180 on an intermediate filtering block using filter coefficients for an APS filter. The image decoding device 2000 can obtain a filtered block by performing APS filtering 2180 on the intermediate filtering block. The image decoding device 2000 can obtain the APS filtered block obtained by performing APS filtering 2180 on the intermediate filtering block as a filtered block.

[0298] On the other hand, performing a specific filter on a specific block can include performing the specific filter by using sample values ​​included in the specific block. Furthermore, filtering a specific sample using a specific filter can include filtering using the sample value of the specific sample and its neighboring samples.

[0299] In an embodiment, the image decoding device 2000 can minimize the error between the original samples and the filtered samples of the current image by performing an adaptive loop filter 2130, including a first filter 2160 or an APS filter 2180. Therefore, an image with a smaller error than the original image can be provided by performing the adaptive loop filter 2130.

[0300] Figure 22 This is a diagram illustrating the operation of filtering the current sample point according to an embodiment.

[0301] In an embodiment, the image decoding device 2000 may adaptively determine a filter based on characteristics of the current block 2210, such as directionality and activity. The image decoding device 2000 may filter the current block 2210 using the adaptively determined filter.

[0302] In an embodiment, the image decoding device 2000 may determine the type of the current block 2210 by using the directionality and activity of the current block 2210 according to Equation 1 below.

[0303] [Equation 1] In an embodiment, the image decoding device 2000 may determine the orientation of the current block 2210 based on the gradient of the current block 2210. and activity The image decoding device 2000 can determine the gradient of the current block 2210, wherein the gradient of the current block 2210 includes the vertical gradient, the horizontal gradient, the gradient connecting the upper left and lower right, and the gradient connecting the upper right and lower left.

[0304] In an embodiment, the gradient of the current block 2210 can be determined by considering not only the samples included in the current block 2210, but also the neighboring samples 2230 of the current block 2210. The gradient of the current block 2210 can be calculated based on samples included in the extended block 2220 that includes the current block 2210. On the other hand, the extended block 2220 is not limited to... Figure 22 The example is publicly available, and it can be another block that overwrites the current block 2210.

[0305] In this embodiment, the vertical gradient of the current block 2210 can be determined according to Equation 2 below. The horizontal gradient of the current block 2210 can be determined according to Equation 3 below. The gradients relative to the top-left and bottom-right of the current block 2210 can be determined using Equation 4 below. The gradients relative to the upper right and lower left of the current block 2210 can be determined using Equation 5 below. This indicates that R(i,j) of the current sample point 2215 can be the top-left sample point of the current block 2210.

[0306] [Equation 2]

[0307] [Equation 3]

[0308] [Equation 4]

[0309] [Equation 5]

[0310] On the other hand, equations 2 to 5 above can be used to perform a one-dimensional Laplace calculation on some sample points indicated by V to reduce the complexity or computational cost of class determination, or they can be used to perform a one-dimensional Laplace calculation on all sample points included in extension block 2220.

[0311] In an embodiment, the image decoding device 2000 may use the maximum and minimum values ​​of the horizontal and vertical gradients, as well as the maximum and minimum values ​​of the diagonal gradient, to determine directionality. For example, the image decoding device 2000 may determine the maximum value of the horizontal or vertical gradient as follows: and minimum value Furthermore, the image decoding device 2000 can determine the maximum value of the diagonal gradient as follows: and minimum value .

[0312]

[0313]

[0314]

[0315]

[0316] In an embodiment, the image decoding device 2000 may determine directionality based on the maximum and minimum values ​​of the horizontal and vertical gradients, as well as the maximum and minimum values ​​of the diagonal gradient. The value. For example, when the condition... and When satisfied, directionality The value can be determined to be 0. When the image decoding device 2000 meets... and At that time, the image decoding device 2000 can detect directionality. The value is determined to be 2. When the image decoding device 2000 satisfies... But not satisfied At that time, the image decoding device 2000 can detect directionality. The value is set to 1. When the image decoding device 2000 does not meet... But satisfied At that time, the image decoding device 2000 can detect directionality. The value is set to 4. When the image decoding device 2000 does not meet the requirement... And not satisfied At that time, the image decoding device 2000 can detect directionality. The value is determined to be 3.

[0317] In an embodiment, the image decoding device 2000 can determine activity by using horizontal and vertical gradients. The value of activity. It can represent an activity value quantized to a range from 0 to 4. The value of activity. It can be a value determined according to Equation 6 below.

[0318] [Equation 6]

[0319] In an embodiment, the image decoding device 2000 can determine the type of the current block 2210 by using determined directionality and activity values. The image decoding device 2000 can perform filtering on the current sample 2215 included in the current block 2210 by using a determined filter. For example, the image decoding device 2000 can determine a filter included in at least one predefined filter set as a first filter by using the determined type of the current block 2210. Optionally, the image decoding device 2000 can determine a filter included in at least one APS filter set within an APS filter set as an APS filter by using the determined type of the current block 2210.

[0320] In an embodiment, the image decoding device 2000 can perform adaptive loop filtering on the current block 2210 by filtering at least one or all samples included in the current block 2210 using a determined filter. The image decoding device 2000 can also perform filtering on the current sample 2215 based on the current sample 2215, its neighboring samples 2230, and the determined filter. Furthermore, the image decoding device 2000 can perform adaptive loop filtering on the current block 2210 by filtering at least one or all samples included in the current block 2210 in the same or similar manner as the filtering operation on the current sample 2215.

[0321] In the following text, refer to Figure 23 Describe in detail the operation of adaptive loop filtering.

[0322] Figure 23 This is a diagram illustrating the operation of performing adaptive loop filtering according to an embodiment.

[0323] In an embodiment, the image decoding device 2000 may perform adaptive loop filtering on the current block. The image decoding device 2000 may perform adaptive loop filtering on the current block by using a determined filter to filter all samples included in the current block. The image decoding device 2000 may perform filtering on the current samples of the current block using at least one tap.

[0324] In an embodiment, the image decoding device 2000 can perform adaptive loop filtering by using a 7×7 rhombus-shaped 7×7 filter 2310 for the luminance component of the current sample included in the current block and a 5×5 rhombus-shaped 5×5 filter 2320 for the chrominance component.

[0325] In an embodiment, the image decoding device 2000 may determine a filter set from at least one APS filter set, or may determine a filter set from at least one predefined filter set. The image decoding device 2000 may obtain or determine one of the filters included in the determined filter set as the filter to be used for adaptive loop filtering. Hereinafter, the operation of performing adaptive loop filtering by performing APS filtering on the current block is described in detail with reference to examples.

[0326] For example, image decoding device 2000 can determine an APS filter set based on at least one APS filter set and an APS index. (See reference...) Figure 22 The image decoding device 2000 can determine the gradient of the current block 2210, and determine the directionality and activity by using the determined gradient. The image decoding device 2000 can determine the class by using the determined values ​​of directionality and activity. The image decoding device 2000 can obtain an APS filter included in a determined set of APS filters by using the determined class values.

[0327] In an embodiment, the image decoding device 2000 can obtain an APS filter by obtaining APS filter coefficients, wherein the APS filter coefficients are filter coefficients used for the APS filter. The APS filter may include a 7×7 filter and a 5×5 filter. The APS filter coefficients may include values ​​C0 to C12 within the 7×7 filter 2310 and values ​​C0 to C12 within the 5×5 filter 2320. The image decoding device 2000 can obtain values ​​C0 to C12 within the 7×7 filter 2310, wherein values ​​C0 to C12 are filter coefficients used for the luminance component of the current sample point included in the current block. The image decoding device 2000 can obtain values ​​C0 to C6 within the 5×5 filter 2320, wherein values ​​C0 to C6 are filter coefficients used for the chrominance component of the current sample point.

[0328] In an embodiment, the image decoding device 2000 can perform APS filtering on the current block by using an APS filter to filter at least one or all samples included in the current block. The image decoding device 2000 can also perform filtering on the current samples included in the current block by using APS filter coefficients. Furthermore, the image decoding device 2000 can perform APS filtering on the current block by performing filtering on the current samples with respect to at least one or all samples included in the current block.

[0329] In the embodiments, reference is made to Figure 22 The image decoding device 2000 can be used Figure 22 The current sample point 2215, the neighboring sample points 2230 and Figure 23The 7×7 filter 2310 is used to perform filtering. When the image decoding device 2000 matches the current sample 2215 with the position of C12, which is the filter coefficient located at the center of the 7×7 filter 2310, the image decoding device 2000 can perform filtering on the current sample by using the neighboring samples of the current sample corresponding to the positions of C0 to C11.

[0330] For example, the image decoding device 2000 can Figure 22 The current sample 2215 and the first sample 2231 included in the neighboring samples 2230 of the current sample are matched with the upper filter coefficient C0 among the filter coefficients in the 7×7 filter 2310. The image decoding device 2000 can Figure 22 The current sample 2215 and the second sample 2232, which is included in the neighboring sample 2230 of the current sample, are matched with the upper filter coefficient C1 among the filter coefficients in the 7×7 filter 2310. The image decoding device 2000 can perform the matching in the same manner as matching the first sample and the second sample with the filter coefficients in the 7×7 filter 2310. Figure 22 The current sample 2215 and the samples included in the neighboring samples 2230 of the current sample are matched with the filter coefficients in the 7×7 filter 2310.

[0331] In an embodiment, when the filter coefficient C12 located at the center of the 7×7 filter 2310 matches the current sample, the image decoding device 2000 can perform APS filtering by using the filter coefficients C0 to C11 for the neighboring samples corresponding to the positions of the current sample.

[0332] For example, the image decoding device 2000 can apply filter coefficients included in a 7×7 filter 2310 corresponding to the position of each sample point from the image. Figure 22 The sample values ​​of the intermediate filtered sample corresponding to the current sample and the neighboring sample 2230 of the intermediate filtered sample. Subtract the sample values ​​of the intermediate filter samples The difference obtained is used to perform filtering. The image decoding device 2000 can perform APS filtering on the current sample according to Equation 7 below.

[0333] [Equation 7]

[0334] On the other hand, in the equation above, It can represent the intermediate filtered sample point corresponding to the current sample point, and This can represent a filter block obtained by performing APS filtering on intermediate filter samples. Additionally, It can represent filter coefficients, and This can be a limiting function that limits the value of x to a value between -y and y. Furthermore, It can represent the amplitude limiting parameter. and It can be and Integers between and The filter length can be represented. The image decoding device 2000 can obtain the filter coefficients and limiting parameters from at least one of the bitstream, strip header, strip data, and APS. Optionally, the filter coefficients and limiting parameters can be predefined values ​​in memory.

[0335] In an embodiment, the image decoding device 2000 can obtain a filter block by performing an operation on at least one or all samples included in the current block according to Equation 7 above.

[0336] On the other hand, this disclosure is not limited to the disclosed examples. The filter described above may be a filter obtained from a predefined filter set instead of a filter obtained from an APS filter set, and the first filtering using the first filter may be performed by using APS filtering in the same or similar manner as the method for performing APS filtering. Furthermore, the equation for performing filtering on the current sample is not limited to Equation 7 above. Samples other than the reconstructed sample can be used, and the filter coefficients may include parameters for other samples as well as parameters for the reconstructed sample. In addition, the image decoding device 2000 may perform adaptive loop filtering, including APS filtering or filtering using a predefined filter set, by using only the filter coefficients without using the limiting function and limiting parameters.

[0337] On the other hand, for ease of explanation, a method for filtering the luminance component of the current sample included in the current block using a 7×7 filter 2310 has been described in detail. However, adaptive loop filtering for the current block can be performed by filtering other samples included in the current block in the same manner. Furthermore, the chrominance component of the current sample can be filtered using a 5×5 filter 2320 in the same or similar manner as the method for filtering the luminance component of the current sample using a 7×7 filter 2310. Moreover, although the APS filter has been described as an example, the first, second, and third filters of this disclosure can also be performed in accordance with... Figure 23 The filtering is performed in the same or similar manner as the methods disclosed in the literature.

[0338] Figure 24 This is a diagram illustrating the filtering operation performed in a loop filter according to an embodiment.

[0339] In an embodiment, the loop filter unit 2400 may perform at least one of deblocking filter 2410, sample adaptive offset filter 2420, bilateral filter 2425, and adaptive loop filter 2430.

[0340] In the embodiment, the deblocking filter 2410 and the sample adaptive offset filter 2420 of the loop filter unit 2400 can be respectively connected to... Figure 21 The deblocking filter 2110 and the sample adaptive offset filter 2120 correspond to each other, therefore, their identical descriptions are omitted.

[0341] In an embodiment, the bilateral filter 2425 may be a filter that considers not only spatial parameters but also the intensity parameters of neighboring samples of the current sample to reduce ringing effects. The bilateral filter 2425 may be a filter executed in parallel with the sample adaptive offset filter after deblocking filtering, or it may be a filter executed before or after the sample adaptive offset filter.

[0342] In an embodiment, the image decoding device 2000 can perform bilateral filtering 2425 on the current sample by assigning larger weights to samples that are adjacent to the current sample and have small spatial parameter differences among the neighboring samples and / or samples that have small intensity parameter differences among the neighboring samples.

[0343] In an embodiment, the image decoding device 2000 can obtain an intermediate filter block including intermediate filter samples corresponding to the current sample by performing at least one of deblocking filtering, sample adaptive offset filtering, and bilateral filtering on the reconstructed block of the current block.

[0344] In this embodiment, the image decoding device 2000 may obtain information about adaptive loop filtering. The image decoding device 2000 may obtain information 2440, including in the information about adaptive loop filtering, regarding whether to use the APS filter set. The image decoding device 2000 may obtain a filter set index, including in the information about adaptive loop filtering.

[0345] In an embodiment, the image decoding device 2000 may perform adaptive loop filtering 2430 on the current block based on information 2440 regarding whether to use the APS filter set.

[0346] In an embodiment, when the image decoding device 2000 determines that the APS filter set is not to be used based on information 2440 regarding whether the APS filter set is used, the image decoding device 2000 may use a predefined filter set to perform filtering 2450. The image decoding device 2000 may perform adaptive loop filtering 2430 by performing filtering 2450 using the predefined filter set.

[0347] In an embodiment, performing filtering 2450 using a predefined filter set may include performing a first filtering 2454 operation on the current block or performing a second filtering 2458 operation on the current block.

[0348] In an embodiment, when the image decoding device 2000 performs filtering 2450 using a predefined filter set, the image decoding device 2000 can obtain the filter set index from the bitstream, strip header, strip data, or APS. Figure 24 The filter set index can be used to perform operations with... Figure 21 The filter set index has the same or similar function as the index, or it can be an index that performs the same function as the filter set index. Figure 21 The filter set index has different functions. The Image Decoding Device 2000 can obtain the filter set index in blocks of one of the CTU, CU, prediction block, and transform block.

[0349] In an embodiment, the image decoding device 2000 may perform filtering 2450 using the predefined filter set for the current block by using at least one filter, based on at least one predefined filter set and a filter set index. For example, the at least one filter may include a first filter or a second filter. Filtering 2450 using the predefined filter set may include at least one of a first filter, a second filter, and a third filter.

[0350] In an embodiment, the image decoding device 2000 may store at least one predefined filter set in memory. Each of the predefined filter sets may include information about filters corresponding to multiple categories, respectively. For example, the number of predefined filters may be 512. The number of predefined filter sets may be 2. Furthermore, each of the filter sets may include information about filters corresponding to 7168 categories, respectively. Each of the predefined filter sets may have the same or different sizes of expansion blocks used to determine the category.

[0351] On the other hand, the number of predefined filters and the number of predefined filter sets are not limited to the published examples.

[0352] In one embodiment, the image decoding device 2000 can obtain a first filter by inputting an intermediate filter block to a first classifier 2452. Alternatively, obtaining or determining a filter can involve obtaining or determining filter coefficients. For example, obtaining a first filter can involve obtaining at least one first filter coefficient. Obtaining a second filter can involve obtaining at least one second filter coefficient. Obtaining a third filter can involve obtaining at least one third filter coefficient. Obtaining an APS filter can involve obtaining at least one APS filter coefficient.

[0353] In an embodiment, the first classifier 2452 may receive intermediate filter blocks and determine the class of the current block. The first classifier 2452 may output a determined filter by using the determined class and a first predefined filter set. The image decoding device 2000 may obtain filter coefficients for the first filter from the first classifier 2452. The first classifier 2452 may be a Laplacian classifier that determines the class based on directionality and activity.

[0354] In an embodiment, the image decoding device 2000 may determine the category by using a Laplace classifier according to the following equation 8.

[0355] [Equation 8]

[0356] On the other hand, in the above equation, It can represent the number of directional values. Additionally, , and These can be respectively corresponding to Equation 1 above. , and And its description is redundant with the description provided above, so it is omitted here. On the other hand, i can represent the value of the classifier. For example, when i=0, it can represent the value of the first classifier 2452. For example, in the first classifier 2452, it can be based on activity. and Determine the type .

[0357] In an embodiment, the image decoding device 2000 can determine the ratio between the maximum and minimum values ​​of the horizontal or vertical gradient according to the following equation: And the ratio between the maximum and minimum values ​​of the diagonal gradient. .

[0358]

[0359]

[0360] In one embodiment, the image decoding device 2000 can determine orientation by using a list of thresholds. The image decoding device 2000 can calculate the horizontal and vertical edge strengths. and diagonal edge strength The image decoding device 2000 can determine the horizontal and vertical edge intensity. and diagonal edge strength Directionality is determined by comparing it with elements included in the threshold list.

[0361] For example, the image decoding device 2000 can use a threshold list. Threshold list This can be a list of thresholds used for the first classifier 2452. When the condition is met... At that time, the image decoding device 2000 can determine the horizontal and vertical edge intensity. The value is determined to be 0. Furthermore, when... At that time, the image decoding device 2000 can meet the requirements. The largest integer is determined as the horizontal and vertical edge strength. When satisfied At that time, the image decoding device 2000 can determine the diagonal edge intensity. The value is determined to be 0. Furthermore, when... At that time, the image decoding device 2000 can meet the requirements. The largest integer is determined as the diagonal edge strength. .

[0362] On the other hand, the threshold list may be the same or different depending on whether it is horizontal and vertical edge strength or diagonal edge strength, and is not limited to the disclosed examples.

[0363] In the embodiment, determining the horizontal and vertical edge strength and diagonal edge strength Afterwards, the image decoding device 2000 can... The directionality is determined according to Table 1. When it is not... At that time, the image decoding device 2000 can determine the directionality according to Table 2. .

[0364] [Table 1]

[0365] [Table 2]

[0366] In an embodiment, the image decoding device 2000 can determine activity by using horizontal and vertical gradients. The value of activity. It can represent an activity value quantized to a range from 0 to n. The value of activity. This can be a value determined according to Equation 9 below. On the other hand, it is used to determine the activity determined by the first classifier 2452. The quantization parameter n can be 15.

[0367] [Equation 9]

[0368] In an embodiment, the image decoding device 2000 may determine the category by using a Laplace classifier according to the following equation 10.

[0369] [Equation 10]

[0370] In an embodiment, the image decoding device 2000 may update the type of the first filter by using the type based on the above Equation 8, according to Equation 10.

[0371] In an embodiment, the image decoding device 2000 may calculate the average value of sample values ​​included in an extended block of the current block. The image decoding device 2000 may calculate the difference between the sample value and the average value for each sample included in the current block. The image decoding device 2000 may determine the scaling factor based on the activity derived in the processing of calculating types according to Equation 8 above.

[0372] In an embodiment, the image decoding device 2000 can obtain the image by quantizing the square root of the sum of the squares of the differences between the sample values ​​and the average value for each sample value included in the current block, using the scaling factor as a scaling factor. .For example, The value can be an integer between 0 and 7.

[0373] In an embodiment, the image decoding device 2000 can perform a first filtering 2454 on the current block using a reconstructed block, an intermediate filtering block for the current block, and a first filter. The image decoding device 2000 can obtain a first filtering block by performing the first filtering 2454 using the reconstructed block, the intermediate filtering block, and the first filter, wherein the first filtering block includes a first filtered sample corresponding to the current sample.

[0374] In an embodiment, the image decoding device 2000 can obtain a first filtered sample by performing filtering using a reconstructed sample corresponding to the shape of the tap used for the first filter and at least one of the reconstructed sample's neighboring samples, an intermediate filtered sample, and a first filter.

[0375] For example, when the reconstructed sample matches the position of a filter coefficient located at the center of the tap used for the first filter, the image decoding device 2000 can perform filtering on the current sample using the reconstructed sample and neighboring samples corresponding to the positions of the remaining filter coefficients. The image decoding device 2000 can perform the first filtering 2454 on the current block by performing filtering on at least one or all samples included in the current block in the same or similar manner as filtering the current sample.

[0376] For example, the image decoding device 2000 can perform filtering by applying a first filter to the difference between the values ​​of the reconstructed sample corresponding to the current sample and the neighboring samples of the reconstructed sample included in the reconstructed block, and the values ​​of the intermediate filtered samples corresponding to the current sample included in the intermediate filtered block, and thus obtain the first filtered sample. Furthermore, the image decoding device 2000 can obtain the neighboring samples of the first filtered sample by performing filtering on the neighboring samples of the reconstructed sample in the same manner as obtaining the first filtered sample. Additionally, the image decoding device 2000 can perform the first filtering 2454 on the current block by performing filtering on at least one sample included in the current block in the same or similar manner as filtering the current sample.

[0377] On the other hand, the neighboring samples of the first filtered sample point can be samples located around the first filtered sample point corresponding to the current sample point, and can be samples that have already been filtered by the first filter.

[0378] In the following text, the first filter, second filter, third filter, and APS filter of this disclosure may be performed in the same or similar manner as the filter using the first filter.

[0379] In an embodiment, the image decoding device 2000 can obtain a second filter by inputting an intermediate filter block to a second classifier 2456. The second classifier 2456 can receive the intermediate filter block and determine the class of the current block. The second classifier 2456 can output a determined filter by using the determined class and a second predefined filter set. The image decoding device 2000 can obtain filter coefficients for the second filter from the second classifier 2456. The second classifier 2456 can be a Laplacian classifier that determines the class based on directionality and activity.

[0380] on the other hand, Figure 24 The second classifier 2456 can perform the same operation as... Figure 21 The second classifier 2170 has a different function, or can perform the same function as... Figure 21 The second classifier 2170 has the same or similar function.

[0381] On the other hand, the size of the expansion block considered in the first classifier 2452 for determining the class can be different from the size of the expansion block considered in the second classifier 2456 for determining the class. For example, when the size of the current block is 2×2, the size of the expansion block in the first classifier 2452 can be 4×4, and the size of the expansion block in the second classifier 2456 can be 12×12. However, the size of the current block, the size of the expansion block in the first classifier 2452, and the size of the expansion block in the second classifier 2456 are not limited to the disclosed examples.

[0382] In an embodiment, the image decoding device 2000 may determine the category in the second classifier 2456 in the same or similar manner as the method used to determine the category in the first classifier 2452. For example, the image decoding device 2000 may determine the category in the second classifier 2456 according to Equation 8 or Equation 10 above. However, when the size of the extended block considered for determining the category in the first classifier 2452 is different from the size of the extended block considered for determining the category in the second classifier 2456, the number of samples used to determine orientation or activity may be different. However, the image decoding device 2000 may determine orientation in the second classifier 2456 by using Table 1 or Table 2 used in the first classifier 2452. Furthermore, it is used to determine the activity determined by the second classifier 2456. The quantization parameter n can be 15.

[0383] In an embodiment, the image decoding device 2000 can obtain a second filtered sample corresponding to the current sample by performing a second filtering 2458 using a reconstruction block, a first filtering block, and a second filter. The image decoding device 2000 can obtain a second filtering block by performing a second filtering 2458 using a reconstruction block, a first filtering block, and a second filter, wherein the second filtering block includes the second filtered sample corresponding to the current sample.

[0384] In an embodiment, the image decoding device 2000 can obtain a second filtered sample by filtering the current sample using a first filtered sample corresponding to the shape of the tap used for the second filtering, at least one of the samples among the neighboring samples of the first filtered sample, an intermediate filtered sample, and a second filter.

[0385] For example, when the position of the first filtered sample matches the position of a filter coefficient located at the center of the tap used for the second filtering, the image decoding device 2000 can perform filtering on the current sample using the first filtered sample and neighboring samples corresponding to the positions of the remaining filter coefficients. The image decoding device 2000 can perform the second filtering 2458 on the current block by performing filtering on at least one or all samples included in the current block in the same or similar manner as filtering the current sample.

[0386] On the other hand, the image decoding device 2000 can obtain the neighboring samples of the second filtered sample by filtering the neighboring samples of the first filtered sample in the same way as the method for obtaining the second filtered sample.

[0387] On the other hand, the operation of obtaining the second filtered sample can be the same as or similar to the operation of obtaining the first filtered sample.

[0388] On the other hand, this disclosure is not limited to the disclosed examples. When the tap used for filtering includes only one filter coefficient, filtering can be performed using only the current sample (or a specific sample corresponding to the current sample) and one filter coefficient. Furthermore, when the tap used for the second filtering includes multiple filter coefficients, the second filtering 2458 can be performed in the same or similar manner as the first filtering 2454.

[0389] On the other hand, in this disclosure, even when the case described below includes multiple filter coefficients, filtering can be performed by using a single filter coefficient and a sample corresponding to the current sample when the tap includes only one filter coefficient.

[0390] For example, when the second filter tap includes only one filter coefficient, the image decoding device 2000 can perform a second filtering by applying one of the filter coefficients included in the second filter tap to the difference between the first filtered sample and the reconstructed sample, and thus obtain the second filtered sample. On the other hand, in some cases, the filters or taps of this disclosure and the second filter may include only one filter coefficient, and their equivalent descriptions are omitted.

[0391] In an embodiment, the image decoding device 2000 may obtain a first filter block or a second filter block as a filter block based on a filter set index. For example, when the image decoding device 2000 obtains a filter set index with a value of 0 for the current block from the bitstream, the image decoding device 2000 may obtain a first filter block as a filter block. When the image decoding device 2000 obtains a filter set index with a value of 1 for the current block from the bitstream, the image decoding device 2000 may obtain a second filter block as a filter block.

[0392] In an embodiment, when the image decoding device 2000 determines to use the APS filter set based on information 2440 regarding whether to use the APS filter set, the image decoding device 2000 may perform APS filtering 2490 using the APS filter set. The image decoding device 2000 may then perform adaptive loop filtering 2430 by performing APS filtering 2490.

[0393] In an embodiment, the image decoding device 2000 may obtain information about adaptive loop filtering from the bitstream, strip header, strip data, or APS. The information about adaptive loop filtering may include information about whether a current APS filter set is available, the number of filters in each current APS filter set, and at least one APS filter and at least one APS index included in the current APS filter set.

[0394] on the other hand, Figure 24 The APS index can be used for execution and Figure 21An index that has the same or similar function as the APS index.

[0395] In an embodiment, the image decoding device 2000 can perform APS filtering on the current block by using an APS filter obtained based on at least one APS filter set and an APS index 2490.

[0396] In an embodiment, the image decoding device 2000 may obtain at least one current APS filter set or at least one previous APS filter set based on information about adaptive loop filtering obtained from the strip header, strip data, or APS.

[0397] In an embodiment, the image decoding device 2000 may obtain information about the current APS filter set, or obtain index information indicating stripes or blocks to be referenced, in order to obtain a previous APS filter set. For example, the current APS filter set may have up to four filters, the previous APS filter set may have up to eight filters, and each of the APS filter sets may include up to 25 filters. Each of the APS filter sets may include information about filters corresponding to 25 categories respectively. Furthermore, each of the APS filter sets may include filter coefficients for the filters included in each of the APS filter sets. Each of the APS filter sets may include classifier information indicating which type of classifier will be used to determine the category.

[0398] On the other hand, the maximum number of current APS filter sets, the maximum number of previous APS filter sets, and the maximum number of filters included in each filter set are not limited to the disclosed examples.

[0399] In an embodiment, the third classifier 2460 may be determined as one of a plurality of classifiers. The image decoding device 2000 may determine one of the plurality of classifiers as the third classifier 2460 based on classifier information included in each APS filter set. For example, the image decoding device 2000 may determine the third classifier 2460 as one of a Laplacian classifier, a band-based classifier, and a residual-based classifier, wherein the Laplacian classifier determines the class based on directionality and activity based on classifier information included in each APS filter set, the band-based classifier determines the class based on the sum of sample values ​​included in the intermediate filter block of the current block, and the residual-based classifier determines the class based on the sum of sample values ​​included in the residual block of the current block.

[0400] In an embodiment, a band-based classifier can determine the class using Equation 11 below. Alternatively, the sum in Equation 11 below can represent the sum of sample values ​​included in the intermediate filter block.

[0401] [Equation 11] class_index(sum 25) >> (Sample bit depth + 2) In an embodiment, the residual-based classifier can determine the class using Equation 12 below. Alternatively, "sum" in Equation 12 can represent the sum of the absolute values ​​of the extended residual blocks, including the residual block corresponding to the current block.

[0402] [Equation 12] classIdx=sum>> (sample bit depth - 4) In an embodiment, the image decoding device 2000 may determine at least one of a Laplacian classifier, a band-based classifier, and a residual-based classifier as a third classifier 2460 based on at least one APS filter set and an APS index. For example, the image decoding device 2000 may determine the classifier corresponding to the APS filter set indicated by the APS index as the third classifier 2460 based on classifier information included in the APS filter set indicated by the APS index.

[0403] In an embodiment, the image decoding device 2000 can obtain an APS filter by inputting an APS filter set indicated by an APS index to a third classifier 2460. The image decoding device 2000 can determine the class by using the determined third classifier 2460. Alternatively, the third classifier 2460 can determine the APS filter based on the APS filter set indicated by the APS index and the determined class. The image decoding device 2000 can obtain an APS filter by inputting intermediate filter blocks or residual blocks to the third classifier 2460. For example, when the image decoding device 2000 uses a Laplacian classifier or a band-based classifier as the third classifier 2460, the image decoding device 2000 can receive intermediate filter blocks and determine the class of the current block. When the image decoding device 2000 uses a residual-based classifier as the third classifier 2460, the image decoding device 2000 can receive residual blocks and determine the class of the current block.

[0404] In an embodiment, when the image decoding device 2000 uses a Laplacian classifier as a third classifier, the image decoding device 2000 can determine the class of the current block in the same or similar manner as the method used to determine the class in the first classifier 2452 or the second classifier 2456. For example, the image decoding device 2000 can determine the class in the third classifier according to Equation 1 or Equation 8 above. However, when the size of the extended block considered in the first classifier 2452 for determining the class is different from the size of the extended block considered in the third classifier for determining the class, the number of samples used to determine orientation or activity may be different.

[0405] For example, the image decoding device 2000 can determine the type according to Equation 1 above. Additionally, it can be based on... Figure 22 The publicly disclosed method for determining directionality and activity is used to determine directionality. and activity The image decoding device 2000 can use a defined directionality and activity To determine the type of the current block.

[0406] In an embodiment, when the image decoding device 2000 uses a band-based classifier as a third classifier, the image decoding device 2000 can determine the class by using sample values ​​included in an intermediate filter block for the current block. For example, when the size of the current block is 2×2, the image decoding device 2000 can determine or obtain the class of the current block based on the sample values ​​of samples included in an intermediate filter block of size 2×2 obtained by performing at least one of deblocking filtering, sample adaptive offset filtering, and bilateral filtering on the reconstructed block of the current block.

[0407] In an embodiment, when the image decoding device 2000 uses a residual-based classifier as a third classifier, the image decoding device 2000 can determine the class by using sample values ​​included in the residual block for the current block. For example, when the size of the current block is 2×2, the image decoding device 2000 can determine or obtain the class of the current block based on the sample values ​​of the samples included in the residual block of size 2×2 for the current block.

[0408] In an embodiment, the image decoding device 2000 may perform adaptive loop filtering 2430 by performing APS filtering 2490 on the current block using an APS filter. The image decoding device 2000 may perform filtering using the APS filter on the current sample included in the current block. Furthermore, the image decoding device 2000 may perform APS filtering 2490 on the current block by filtering at least one or all samples included in the current block in the same or similar manner as filtering the current sample using the APS filter.

[0409] In an embodiment, the image decoding device 2000 can perform APS filtering 2490 by using an intermediate filter block, a first filter block, a second filter block, a third filter block, a reconstruction block, a residual block, a first filter residual block, and an APS filter. The image decoding device 2000 can obtain the APS filter block obtained by performing APS filtering 2490 as a filter block.

[0410] In an embodiment, the image decoding device 2000 may obtain filter coefficients for a third filter, which is a predefined filter, in order to perform APS filtering 2490. The filter coefficients for the third filter may be information pre-stored in memory. The image decoding device 2000 may obtain a third filter block by performing third filtering 2470 using a reconstruction block and the third filter.

[0411] In an embodiment, the image decoding device 2000 may use the result of filtering 2450 using a predefined set of filters to perform APS filtering 2490. For example, the image decoding device 2000 may use a first filter block and a second filter block to perform APS filtering 2490.

[0412] In an embodiment, the image decoding device 2000 may also perform APS filtering 2490 using a first filter used in filtering 2450 using a predefined filter set. For example, the image decoding device 2000 may obtain a first filtered residual block by performing first filtering 2480 using a residual block and a first filter. For example, the first filter may be a filter determined by a first classifier 2452 using the determined category and a predefined filter set.

[0413] On the other hand, APS filtering 2490 can be performed on the current block by performing filtering with an APS filter on at least one or all samples included in the current block in the same or similar manner as the method of performing filtering with an APS filter on the current samples included in the current block. On the other hand, referring to Figure 25 Describe in detail the filtering operation performed on the current sample using the APS filter.

[0414] In an embodiment, the image decoding method may use a first or second filter block obtained by filtering 2450 using a predefined filter set for APS filtering 2490. Since the operations for obtaining the first and second filter blocks have already been described in detail above, their identical descriptions are omitted.

[0415] In an embodiment, the image decoding device 2000 can obtain a third filter block by performing a third filtering using a reconstruction block, an intermediate filter block, and a third filter, wherein the third filter block includes a third filter sample corresponding to the current sample. For example, the image decoding device 2000 can obtain a third filter sample by performing filtering using a reconstruction sample corresponding to the shape of a tap used for the third filtering, at least one of the reconstruction sample's neighboring samples, an intermediate filter sample, and a third filter.

[0416] Furthermore, the image decoding device 2000 can obtain the neighboring samples of the third filtered sample by performing filtering on the neighboring samples of the reconstructed sample in the same manner as the method for obtaining the third filtered sample.

[0417] On the other hand, since the operation of obtaining the third filter sample can be the same as or similar to the operation of obtaining the first or second filter sample, the same description is omitted.

[0418] In an embodiment, the image decoding device 2000 can obtain a first filtered residual block by performing a first filtering 2480 using a residual block of the current block and a first filter. The image decoding device 2000 can obtain a first filtered residual block, wherein the first filtered residual block includes a first filtered residual sample corresponding to the current sample. The image decoding device 2000 can obtain the first filtered residual sample corresponding to the current sample by filtering the current sample using a first filter and at least one of the residual sample corresponding to the tap used for the first filtering and neighboring samples of the residual sample.

[0419] For example, when a residual sample matches the position of a filter coefficient located at the center of a tap used for the first filter, the image decoding device 2000 can perform filtering on the current sample using the residual sample and neighboring samples corresponding to the positions of the remaining filter coefficients. The image decoding device 2000 can perform the first filtering 2480 on the current block by performing filtering on at least one or all samples included in the current block in the same or similar manner as filtering the current sample.

[0420] For example, the image decoding device 2000 can obtain the first filtered residual sample by applying a first filter to each of the values ​​of the residual sample and the neighboring samples of the residual sample.

[0421] The image decoding device 2000 can obtain a first filtered residual block by performing filtering on at least one block or all blocks included in the residual block in the same or similar manner as the method for obtaining the first filtered residual sample. Furthermore, the image decoding device 2000 can obtain neighboring samples of the first filtered residual sample by performing filtering on neighboring samples of the residual sample in the same manner as the method for obtaining the first filtered residual sample.

[0422] On the other hand, the first filter 2480 may be a filter that uses the same or similar filter as the first filter used in the first filter 2454 included in the filter 2450 that uses a predefined filter set. For example, the first filter 2480 may be a filter that uses all or some of the filter coefficients in the filter coefficients used in the first filter 2454.

[0423] In an embodiment, the image decoding device 2000 can obtain adaptive loop filter samples by using at least one adaptive filter coefficient (APS filter coefficient) obtained with information about adaptive loop filtering for intermediate filter samples, first filter samples, second filter samples, third filter samples, reconstructed samples, and residual samples.

[0424] In an embodiment, the image decoding device 2000 can perform adaptive loop filtering on the current block using at least one of the following: intermediate filter sample and neighboring sample of intermediate filter sample; at least one of the first filter sample and neighboring sample of the first filter sample; at least one of the second filter sample and neighboring sample of the second filter sample; at least one of the third filter sample and neighboring sample of the third filter sample; at least one of the reconstructed sample corresponding to the current sample and neighboring sample of the reconstructed sample included in the reconstruction block; and at least one of the residual sample corresponding to the current sample and neighboring sample of the residual sample included in the residual block.

[0425] For example, the image decoding device 2000 can perform pixel-wise filtering by applying adaptive filter coefficients to at least one sample among intermediate filtered samples and their neighboring samples, at least one sample among first filtered samples and their neighboring samples, at least one sample among second filtered samples and their neighboring samples, at least one sample among third filtered samples and their neighboring samples, at least one sample among reconstructed samples and their neighboring samples, and at least one sample among residual samples and their neighboring samples, thereby obtaining adaptive loop filter samples. The image decoding device 2000 can perform adaptive loop filtering by performing APS filtering 2490 on the current block. Furthermore, the image decoding device 2000 can obtain the APS filter block obtained by performing APS filtering 2490 as an adaptive loop filter block.

[0426] In an embodiment, the image decoding device 2000 can perform adaptive loop filtering on the current block by using at least one of a first filter residual sample and a neighboring sample of the first filter residual sample. The image decoding device 2000 can obtain from the bitstream whether or not the first filter residual sample is used and whether or not a neighboring sample of the first filter residual sample is used. The image decoding device 2000 can obtain from at least one of the strip header, strip data, and APS whether or not the first filter residual sample is used and whether or not a neighboring sample of the first filter residual sample is used.

[0427] Furthermore, the number of filter coefficients and the parameters associated with the filter coefficients can be used to determine whether to use at least one of the first filter residual sample and its neighboring samples.

[0428] In the following text, refer to Figure 25 Describe in detail the shape of the taps used for APS filtering.

[0429] Figure 25 This is a diagram illustrating the operation of filtering the current sample point according to an embodiment.

[0430] In an embodiment, the image decoding device 2000 may perform filtering on the current sample using at least one of spatial tap 2510, first filter tap 2520, second filter tap 2530, reconstruction tap 2540, residual tap 2550, first residual filter tap 2560, and third filter tap 2570. Furthermore, the image decoding device 2000 may perform APS filtering on the current block by performing filtering on at least one or all samples included in the current block in the same or similar manner as the method used to perform filtering on the current sample.

[0431] In an embodiment, the operation of the image decoding device 2000 to perform APS filtering on the current block may include filtering the current sample point using at least one of the spatial tap 2510, the first filter tap 2520, the second filter tap 2530, the reconstruction tap 2540, the residual tap 2550, the first residual filter tap 2560, and the third filter tap 2570 according to Equation 13 above.

[0432] [Equation 13]

[0433] In an embodiment, It can represent the intermediate filtered sample point corresponding to the current sample point. It can represent filtered samples. It can represent filter coefficients.

[0434] In an embodiment, the image decoding device 2000 can perform APS filtering by using an intermediate filter block and a space tap 2510. For example, when an intermediate filter sample matches the center position of the space tap 2510, the image decoding device 2000 can perform filtering using the space tap 2510 and at least one of the neighboring samples of the intermediate filter sample corresponding to the position of the APS filter coefficients C0 to C9 included in the space tap 2510.

[0435] For example, image decoding device 2000 can perform filtering by multiplying each APS filter coefficient by the difference between an intermediate filter sample and its neighboring samples, where the neighboring samples correspond to the positions of APS filter coefficients C0 to C9 included in spatial tap 2510. The operation of performing filtering by using APS filter coefficients C0 to C9 included in spatial tap 2510 and neighboring samples of the intermediate filter sample can be described by the following formula. In the following formula, It can represent intermediate filter samples. The difference between each value of the intermediate filtered sample and each neighboring sample, or the value obtained by limiting the difference based on the limiting parameter.

[0436]

[0437] In an embodiment, the image decoding device 2000 can perform APS filtering by using a first filter block and a first filter tap 2520. For example, when the image decoding device 2000 matches a first filtered sample with a filter coefficient C34 located at the center of the first filter tap 2520, the image decoding device 2000 can perform filtering by utilizing the first filter tap 2520 and at least one of the first filtered sample and its neighboring samples, wherein the neighboring samples of the first filtered sample correspond to the positions of the APS filter coefficients C10 to C27 included in the first filter tap 2520.

[0438] For example, the image decoding device 2000 can perform filtering by multiplying each APS filter coefficient by the difference between an intermediate filtered sample and a neighboring sample of a first filtered sample, wherein the neighboring samples of the first filtered sample correspond to the positions of APS filter coefficients C10 to C27 included in the first filter tap 2520. The operation of performing filtering by using APS filter coefficients C10 to C27 included in the first filter tap 2520 and the neighboring samples of the first filtered sample can be described by the following formula. In the following formula, It can represent the difference obtained by subtracting the value of the intermediate filtered sample from the value of each neighboring sample of the first filtered sample, or the value obtained by limiting the difference based on the limiting parameter.

[0439]

[0440] In an embodiment, the image decoding device 2000 can perform filtering by multiplying the APS filter coefficient C34 by the difference between the intermediate filter sample and the first filter sample, wherein the first filter sample corresponds to the position of the APS filter coefficient C34 included in the first filter tap 2520.

[0441] In an embodiment, the image decoding device 2000 can perform APS filtering by using a second filter block and a second filter tap 2530. For example, the image decoding device 2000 can perform filtering by using second filter samples and APS filter coefficients C35 included in the second filter tap 2530. For example, the image decoding device 2000 can perform filtering by multiplying the APS filter coefficients C35 by the difference between the second filter samples and the intermediate filter samples.

[0442] In an embodiment, the filtering operation performed using a first filter sample and the APS filter coefficient C34 included in the first filter tap 2520, and the filtering operation performed using a second filter sample and the APS filter coefficient C35 included in the second filter tap 2530 can be described by the following formulas. In the following formulas, This can represent the difference obtained by subtracting the value of an intermediate filtered sample from the value of a first filtered sample, or the difference obtained by subtracting the value of an intermediate filtered sample from the value of a second filtered sample. Optionally, It can represent the value obtained by limiting the difference based on the limiting parameter.

[0443]

[0444] In an embodiment, the image decoding device 2000 can perform APS filtering using a reconstruction block and a reconstruction tap 2540. The image decoding device 2000 can perform APS filtering including operations involving filtering using reconstructed samples and the reconstruction tap 2540. For example, when the image decoding device 2000 matches a reconstructed sample with a filter coefficient C36 located at the center of the reconstruction tap 2540, the image decoding device 2000 can perform filtering using the reconstruction tap 2540 and at least one of the reconstructed sample and its neighboring samples, wherein the neighboring samples correspond to the positions of the APS filter coefficients C32 to C33 included in the reconstruction tap 2540.

[0445] For example, image decoding device 2000 can perform filtering by multiplying each APS filter coefficient by the difference between the intermediate filtered sample and the neighboring samples of the reconstructed sample, where the neighboring samples of the reconstructed sample correspond to the positions of APS filter coefficients C32 and C33 included in reconstruction tap 2540. The operation of performing filtering by using APS filter coefficients C32 and C33 included in reconstruction tap 2540 and the neighboring samples of the reconstructed sample can be described by the following formula. In the following formula, It can represent the difference obtained by subtracting the value of the intermediate filtered sample from the value of each neighboring sample of the reconstructed sample, or the value obtained by limiting the difference based on the limiting parameter.

[0446]

[0447] In an embodiment, the image decoding device 2000 can perform filtering by multiplying the APS filter coefficients C36 by the difference between the intermediate filtered sample and the reconstructed sample, where the reconstructed sample corresponds to the position of the APS filter coefficients C36 included in the reconstruction tap 2540. The operation of performing filtering by using the reconstructed sample and the APS filter coefficients C36 included in the reconstruction tap 2540 can be described by the following formula. In the following formula, It can represent the difference obtained by subtracting the value of the intermediate filtered sample from the value of the reconstructed sample, or the value obtained by limiting the difference based on the limiting parameter.

[0448]

[0449] In an embodiment, the image decoding device 2000 can perform APS filtering by using residual blocks and residual taps 2550. For example, the image decoding device 2000 can perform filtering by using residual samples and APS filter coefficients C37 included in the residual taps 2550. For example, the image decoding device 2000 can perform filtering by multiplying the residual samples by the APS filter coefficients C37 included in the residual taps 2550. The operation of performing filtering by using residual samples and APS filter coefficients C37 included in the residual taps 2550 can be described by the following equation. In the following formula, It can represent the value of the residual sample point, or the value obtained by limiting the value of the residual sample point based on the limiting parameter.

[0450]

[0451] In an embodiment, the image decoding device 2000 can perform APS filtering by using a first filter residual block and a first residual filter tap 2560. For example, the image decoding device 2000 can perform filtering by using first filter residual samples and APS filter coefficients C39 included in the first residual filter tap 2560. For example, the image decoding device 2000 can perform filtering by multiplying the first filter residual samples by the APS filter coefficients C39 included in the first residual filter tap 2560. The operation of performing filtering by using first filter residual samples and APS filter coefficients C39 included in the first residual filter tap 2560 can be described by the following formula. In the following formula, It can represent the value of the first filtered residual sample point, or the value obtained by limiting the value of the first filtered residual sample point.

[0452]

[0453] In an embodiment, the image decoding device 2000 can perform APS filtering by using a third filter block and a third filter tap 2570. For example, when the image decoding device 2000 matches a third filter sample with a filter coefficient C38 located at the center of the third filter tap 2570, the image decoding device 2000 can perform filtering by using the third filter tap 2570 and at least one of the third filter sample and its neighboring samples, wherein the neighboring samples of the third filter sample correspond to the positions of the APS filter coefficients C28 to C31 included in the third filter tap 2570.

[0454] For example, the image decoding device 2000 can perform filtering by multiplying each APS filter coefficient by the difference between the intermediate filter sample and the neighboring samples of the third filter sample, where the neighboring samples of the third filter sample correspond to the positions of APS filter coefficients C28 to C31 included in the third filter tap 2570. The operation of performing filtering by using the APS filter coefficients C28 to C31 included in the third filter tap 2570 and the neighboring samples of the third filter sample can be described by the following formula. In the following formula, It can represent the difference obtained by subtracting the value of the intermediate filtered sample from the value of each neighboring sample of the third filtered sample, or the value obtained by limiting the difference based on the limiting parameter.

[0455]

[0456] In an embodiment, the image decoding device 2000 can perform filtering by multiplying the APS filter coefficient C38 by the difference between the intermediate filter sample and the third filter sample, wherein the third filter sample corresponds to the position of the APS filter coefficient C38 included in the third filter tap 2570.

[0457] In an embodiment, the filtering operation performed using a third filter sample and the APS filter coefficient C38 included in the third filter tap 2570 can be described by the following formula. In the following formula, It can represent the difference obtained by subtracting the value of the intermediate filter sample from the value of the third filter sample, or the value obtained by limiting the difference based on the limiting parameter.

[0458]

[0459] on the other hand, Figure 25The spatial tap 2510, first filter tap 2520, second filter tap 2530, reconstruction tap 2540, residual tap 2550, first residual filter tap 2560, and third filter tap 2570 disclosed herein are not limited to the disclosed examples, and the image decoding device 2000 can perform APS filtering by using each tap and all or some samples of the sample corresponding to each tap and its neighboring samples. Furthermore, the image decoding device 2000 can use... Figure 25 Other undisclosed samples are used to perform APS filtering on the current block.

[0460] On the other hand, for ease of explanation, the limiting operation based on the limiting parameter has been omitted in this disclosure.

[0461] Figure 26 This is a diagram illustrating the operation of filtering the current sample point according to an embodiment.

[0462] In this embodiment, the image decoding device 2000 may perform adaptive loop filtering on the current block. The operation of performing adaptive loop filtering on the current block by the image decoding device 2000 may include performing APS filtering on the current block. Furthermore, the operation of performing APS filtering on the current block by the image decoding device 2000 may include performing filtering on the current sample points.

[0463] In an embodiment, the image decoding device 2000 can obtain a filtered block by performing APS filtering on the current block. The image decoding device 2000 can also obtain a filtered block by performing filtering on at least one sample or every sample in the current block. Alternatively, the image decoding device 2000 can obtain a filtered block by performing APS filtering on the current block including the current sample, wherein the filtered block includes filtered samples corresponding to the current sample.

[0464] In an embodiment, the image decoding device 2000 can obtain the filtered sample by adding a value obtained by multiplying at least one APS filter coefficient 2620 by at least one input value 2630 corresponding to each of the at least one APS filter coefficient 2620 to the intermediate filtered sample.

[0465] In the embodiments, reference is made to Figure 25 The image decoding device 2000 can obtain the difference between the intermediate filter sample value and the sample value of the intermediate filter sample by subtracting the sample value of the intermediate filter sample from the sample value of each of the neighboring samples corresponding to the position of the APS filter coefficients C0 to C9 included in the space tap 2510. The difference is used as the input value of i0 to i9.

[0466] In an embodiment, the image decoding device 2000 can obtain the difference between the sample value of the first filtered sample and the sample value of the intermediate filtered sample, which is obtained by subtracting the sample value of the intermediate filtered sample from the sample value of each of the neighboring samples corresponding to the positions of the APS filter coefficients C10 to C27 included in the first filter tap 2520, as the input value of i10 to i27.

[0467] In an embodiment, the image decoding device 2000 can obtain the difference between the sample value of the third filter sample and the sample value of the intermediate filter sample, obtained by subtracting the sample value of the intermediate filter sample from the sample value of each of the neighboring samples corresponding to the positions of the APS filter coefficients C28 to C31 included in the third filter tap 2570, as the input value of i28 to i31.

[0468] In an embodiment, the image decoding device 2000 may obtain the difference between the sample value of each of the neighboring samples corresponding to the position of the reconstructed sample corresponding to the position of the APS filter coefficients C32 and C33 included in the reconstruction tap 2540 and the sample value of the intermediate filtered sample as the input value of i32 and i33.

[0469] In this embodiment, the image decoding device 2000 obtains the difference between the first filtered sample and the intermediate filtered sample as the input value of i34. The image decoding device 2000 obtains the difference between the second filtered sample and the intermediate filtered sample as the input value of i35. The image decoding device 2000 obtains the difference between the reconstructed sample and the intermediate filtered sample as the input value of i36. The image decoding device 2000 obtains the sample value of the residual sample as the input value of i37. The image decoding device 2000 obtains the difference between the third filtered sample and the intermediate filtered sample as the input value of i38. The image decoding device 2000 obtains the sample value of the first filtered residual sample as the input value of i37.

[0470] In an embodiment, the image decoding device 2000 can obtain filtered samples by adding the inner product of the APS filter coefficients C0 to C39 and the input values ​​i0 to i39 to the intermediate filtered samples.

[0471] On the other hand, this disclosure is not limited to the disclosed examples, and the image decoding device 2000 can perform filtering on the current sample by using APS filter coefficients with a structure different from that of the APS filter coefficients of this disclosure or by using input values ​​with a structure different from that of the input values ​​of this disclosure.

[0472] Figure 27 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0473] In an embodiment, the loop filter unit 2700 may perform at least one of deblocking filter 2710, sample adaptive offset filter 2720, bilateral filter 2725, and adaptive loop filter 2730.

[0474] In an embodiment, Figure 27 The deblocking filter 2710, sample adaptive offset filter 2720, and bilateral filter 2725 in the loop filter unit 2700 can be respectively connected to... Figure 24 The deblocking filter 2410, the sample adaptive offset filter 2420, and the bilateral filter 2425 correspond to each other, therefore, their identical descriptions are omitted.

[0475] In an embodiment, Figure 27 The information regarding whether to use the APS filter set (2740), filtering using a predefined filter set (2750), first classifier (2752), first filter (2754), second classifier (2756), second filter (2758), third classifier (2760), third filter (2770), first filter (2780), and APS filter (2790) can respectively correspond to... Figure 24 Information regarding whether to use the APS filter set 2440, filtering using the predefined filter set 2450, first classifier 2452, first filter 2454, second classifier 2456, second filter 2458, third classifier 2460, third filter 2470, first filter 2480, and APS filter 2490 in the document is omitted here.

[0476] In an embodiment, the image decoding device 2000 can obtain a first filtered residual block by performing a first filtering 2780 using the residual block of the current block and a first filter. The image decoding device 2000 can also obtain a first filtered residual sample corresponding to the current sample by performing filtering using the residual sample of the current sample and the first filter. Furthermore, the image decoding device 2000 can obtain a first filtered residual block by performing filtering on the residual block using the first filter, wherein the first filtered residual block includes the first filtered residual sample corresponding to the current sample.

[0477] Furthermore, the image decoding device 2000 may obtain the first filtered residual block by performing filtering on at least one or all samples included in the residual block in the same or similar manner as the method for obtaining the first filtered residual samples.

[0478] In one embodiment, the image decoding device 2000 can obtain first filtered residual samples by performing filtering using residual samples and a first filter. Alternatively, the image decoding device 2000 can obtain first filtered residual samples by performing filtering using residual samples and predefined filter coefficients for the first filter.

[0479] In one embodiment, the image decoding device 2000 can obtain the first filtered residual sample by performing filtering on the residual block or residual sample using a first filter and at least one of the residual sample and neighboring samples corresponding to the filter coefficients predefined for the first filter 2780. Alternatively, the filter coefficients predefined for the first filter 2780 can be used as the first filter.

[0480] For example, the image decoding device 2000 can obtain the first filtered residual sample by adding the values ​​obtained by applying filter coefficients corresponding to each sample and defined for the first filter to at least one of the residual sample and neighboring samples of the residual sample.

[0481] On the other hand, the first filter 2780 may be a filter that uses the same or similar filter as the first filter used in the first filter 2754 included in the filter 2750 that uses a predefined filter set. For example, the first filter 2780 may be a filter that uses all or some of the coefficients of the filter coefficients used in the first filter 2754.

[0482] In an embodiment, the image decoding device 2000 can obtain a second filtered residual block by performing a second filtering 2790 using a first filtered residual block and a second filter of the current block. The image decoding device 2000 can also obtain a second filtered residual sample corresponding to the current sample by performing filtering using a first filtered residual sample and a second filter. Furthermore, the image decoding device 2000 can obtain a second filtered residual block by performing filtering using a first filtered residual sample and a second filter, wherein the second filtered residual block includes the second filtered residual sample corresponding to the current sample.

[0483] Furthermore, the image decoding device 2000 can obtain a second filter residual block by performing filtering using at least one or all of the samples included in the first filter residual block in the same or similar manner as the method for obtaining the second filter residual samples.

[0484] In one embodiment, the image decoding device 2000 can obtain the second filtered residual sample by performing filtering on the first filtered residual block or residual sample using first filtered residual samples corresponding to filter coefficients predefined for the second filter 2790 and filter coefficients predefined for the second filter. Alternatively, the filter coefficients predefined for the second filter 2790 can be used as the second filter.

[0485] For example, the image decoding device 2000 can obtain the second filter residual sample by applying filter coefficients predefined for the second filter to the first filter residual sample.

[0486] On the other hand, the second filter 2782 may be a filter that uses the same or similar filter as the second filter used in the second filter 2758 included in the filter 2750 that uses a predefined filter set. For example, the second filter 2782 may be a filter that uses all or some of the filter coefficients in the filter coefficients used in the second filter 2758.

[0487] In this embodiment, the image decoding device 2000 can perform adaptive loop filtering 2730 by performing APS filtering 2790. The image decoding device 2000 can perform APS filtering on the current block using a first filter residual sample and a second filter residual sample. The image decoding device 2000 can obtain adaptive loop filtering samples by performing APS filtering 2790. The image decoding device 2000 can obtain the APS filtering samples obtained by performing APS filtering 2790 as adaptive loop filtering samples for the current sample.

[0488] For example, the image decoding device 2000 can perform APS filtering 2790 by using at least one of the second filter residual sample and the neighboring sample of the second filter residual sample, the first filter residual sample, and the APS filter obtained based on information about adaptive loop filtering.

[0489] In an embodiment, the image decoding device 2000 may obtain an APS filter set based on information about adaptive loop filtering. Furthermore, the image decoding device 2000 may obtain an APS filter based on index information indicating at least one APS filter included in the APS filter set. The image decoding device 2000 is an APS filter and may obtain at least one adaptive filter coefficient. On the other hand, as described above, the APS filter set and the APS filter may be referred to as an adaptive filter set and an adaptive filter.

[0490] In an embodiment, the image decoding device 2000 can obtain adaptive loop filter samples by using a first filter residual sample, a second filter residual sample, and at least one adaptive filter coefficient obtained from information about the adaptive loop filter. Alternatively, the at least one adaptive filter coefficient may include filter coefficients for the first filter residual sample and / or filter coefficients for the second filter residual sample.

[0491] In an embodiment, the image decoding device 2000 may apply filter coefficients obtained based on information about adaptive loop filtering for a first filtered residual sample to the first filtered residual sample. The image decoding device 2000 may apply filter coefficients obtained based on information about adaptive loop filtering for a second filtered residual sample to a second filtered residual sample. The image decoding device 2000 may obtain adaptive loop filtered samples using values ​​obtained by applying filter coefficients for the first filtered residual sample to the first filtered residual sample and values ​​obtained by applying filter coefficients for the second filtered residual sample to the second filtered residual sample.

[0492] In this embodiment, to obtain adaptive loop filter samples, it is possible to use... Figures 28 to 30 The method disclosed herein is used to obtain adaptive loop filter samples.

[0493] In an embodiment, it can be achieved through... Figure 27 Intra-loop filtering can be used to improve the quality of subjective or objective images.

[0494] Figure 28 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0495] In an embodiment, the loop filter unit 2800 may perform at least one of deblocking filter 2810, sample adaptive offset filter 2820, bilateral filter 2825, and adaptive loop filter 2830.

[0496] In an embodiment, Figure 28 The deblocking filter 2810, sample adaptive offset filter 2820, and bilateral filter 2825 in the loop filter unit 2800 can be respectively connected to... Figure 24 The deblocking filter 2410, the sample adaptive offset filter 2420, and the bilateral filter 2425 correspond to each other, therefore, their identical descriptions are omitted.

[0497] In an embodiment, Figure 28 The information regarding whether to use the APS filter set (2840), filtering using a predefined filter set (2850), first classifier (2852), first filter (2854), second classifier (2856), second filter (2858), third classifier (2860), third filter (2870), first filter (2880), and APS filter (2890) can respectively correspond to... Figure 24 Information regarding whether to use the APS filter set 2440, filtering using the predefined filter set 2450, first classifier 2452, first filter 2454, second classifier 2456, second filter 2458, third classifier 2460, third filter 2470, first filter 2480, and APS filter 2490 in the document is omitted here.

[0498] In an embodiment, Figure 28 The first filter 2880 and the second filter 2882 can respectively correspond to Figure 27 The first filter 2780 and the second filter 2782 are therefore omitted from the same description.

[0499] In an embodiment, the image decoding device 2000 can obtain a third filtered residual block by performing a third filtering 2884 using the residual block of the current block and a third filter. The image decoding device 2000 can also obtain a third filtered residual sample corresponding to the current sample by performing filtering using the residual sample of the current sample and the third filter. Furthermore, the image decoding device 2000 can obtain a third filtered residual block by performing filtering on the residual block using a third filter, wherein the third filtered residual block includes the third filtered residual sample corresponding to the current sample.

[0500] Furthermore, the image decoding device 2000 can obtain the third filter residual block in the same or similar manner as the method for obtaining the third filter residual samples, based on performing filtering by using at least one or all samples included in the residual block.

[0501] In this embodiment, the image decoding device 2000 can obtain third filtered residual samples by performing filtering using residual samples and a third filter. The image decoding device 2000 can also obtain third filtered residual samples by performing filtering using residual samples and predefined filter coefficients for the third filter.

[0502] In an embodiment, the image decoding device 2000 can obtain third-filtered residual samples by performing filtering on a residual block or residual samples using a third filter and at least one of the residual samples and neighboring samples corresponding to the filter coefficients predefined for the third filter 2884. Alternatively, the filter coefficients predefined for the third filter 2884 can be used as the third filter.

[0503] For example, the image decoding device 2000 can obtain the third filter residual sample by adding the values ​​obtained by applying the residual sample and at least one of the neighboring samples of the residual sample to the filter coefficients predefined for the third filter corresponding to each sample.

[0504] In an embodiment, the image decoding device 2000 can obtain a third filtering intermediate filter block by performing a third filtering 2886 using an intermediate filter block of the current block and a third filter. The image decoding device 2000 can also obtain a third filtering intermediate filter sample corresponding to the current sample by performing filtering using an intermediate filter sample of the current sample and a third filter. Furthermore, the image decoding device 2000 can obtain a third filtering intermediate filter block by performing filtering on an intermediate filter block using a third filter, wherein the third filtering intermediate filter block includes a third filtering intermediate filter sample corresponding to the current sample.

[0505] Furthermore, the image decoding device 2000 can obtain the third filter intermediate filter block in the same or similar manner as the method for obtaining the third filter intermediate filter samples, based on performing filtering by using at least one or all samples included in the intermediate filter block.

[0506] In an embodiment, the image decoding device 2000 can obtain third filter intermediate filter samples by performing filtering using intermediate filter samples and a third filter. The image decoding device 2000 can obtain third filter residual samples by performing filtering using intermediate filter samples and predefined filter coefficients for the third filter.

[0507] In an embodiment, the image decoding device 2000 can obtain the intermediate filter sample of the third filter by performing filtering on the intermediate filter block or intermediate filter sample using the third filter and the intermediate filter corresponding to the filter coefficients predefined for the third filter 2886.

[0508] For example, the image decoding device 2000 can obtain the intermediate filter sample of the third filter by using the value obtained by applying the filter coefficients predefined for the third filter to the intermediate filter sample.

[0509] On the other hand, the third filter 2884 for the residual block and the third filter 2886 for the intermediate filter block can be filters that use the same or similar filters as the predefined filters used in the third filter 2870 for the reconstruction block. For example, the third filter 2884 or the third filter 2886 can be a filter that uses all or some of the filter coefficients used in the third filter 2870.

[0510] In this embodiment, the image decoding device 2000 can perform adaptive loop filtering 2830 by performing APS filtering 2890. The image decoding device 2000 can perform APS filtering by using third filter residual samples. The image decoding device 2000 can obtain adaptive loop filtering samples by performing APS filtering 2890. The image decoding device 2000 can obtain the APS filtering samples obtained by performing APS filtering 2890 as adaptive loop filtering samples for the current sample.

[0511] For example, the image decoding device 2000 can perform APS filtering 2890 by using third filter residual samples and an APS filter obtained based on information about adaptive loop filtering.

[0512] In one embodiment, the image decoding device 2000 can obtain adaptive loop filter samples by using third filter residual samples and at least one adaptive filter coefficient obtained from information about adaptive loop filtering. Alternatively, the at least one adaptive filter coefficient may include filter coefficients used for the third filter residual samples.

[0513] In an embodiment, the image decoding device 2000 may apply filter coefficients obtained based on information about adaptive loop filtering to the third filter residual sample. The image decoding device 2000 may obtain adaptive loop filtering samples by using the values ​​obtained by applying the filter coefficients for the third filter residual sample. In an embodiment, the image decoding device 2000 may perform adaptive loop filtering 2830 by performing APS filtering 2890. The image decoding device 2000 may perform APS filtering by using intermediate filter samples from the third filter.

[0514] For example, the image decoding device 2000 can perform APS filtering 2890 by using third filter intermediate filter samples and an APS filter obtained based on information about adaptive loop filtering.

[0515] In one embodiment, the image decoding device 2000 can obtain adaptive loop filter samples by using third intermediate filter samples and at least one adaptive filter coefficient obtained from information about adaptive loop filtering. Alternatively, the at least one adaptive filter coefficient may include filter coefficients used for the third intermediate filter samples.

[0516] In an embodiment, the image decoding device 2000 may apply filter coefficients for the third intermediate filter sample, obtained based on information about the adaptive loop filter, to the third intermediate filter sample. The image decoding device 2000 may obtain the adaptive loop filter sample by using the values ​​obtained by applying the filter coefficients for the third intermediate filter sample to the third intermediate filter sample.

[0517] In an embodiment, it can be achieved through... Figure 28 Loop filtering can be used to improve the quality of subjective or objective images.

[0518] Figure 29 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0519] In an embodiment, the loop filter unit 2900 may perform at least one of deblocking filter 2910, sample adaptive offset filter 2920, bilateral filter 2925, and adaptive loop filter 2930.

[0520] In an embodiment, Figure 29 The deblocking filter 2910, sample adaptive offset filter 2920, and bilateral filter 2925 in the loop filter unit 2900 can be respectively connected to... Figure 24 The deblocking filter 2410, the sample adaptive offset filter 2420, and the bilateral filter 2425 correspond to each other, therefore, their identical descriptions are omitted.

[0521] In an embodiment, Figure 29 The information regarding whether to use the APS filter set (2940), filtering using a predefined filter set (2950), first classifier (2952), first filter (2954), second classifier (2956), second filter (2958), third classifier (2960), third filter (2970), first filter (2980), and APS filter (2990) can respectively correspond to... Figure 24 Information regarding whether to use the APS filter set 2440, filtering using the predefined filter set 2450, first classifier 2452, first filter 2454, second classifier 2456, second filter 2458, third classifier 2460, third filter 2470, first filter 2480, and APS filter 2490 in the document is omitted here.

[0522] In one embodiment, the image decoding device 2000 can obtain a first filter by inputting at least one of a reconstructed block, an intermediate filter block, and a residual block into a first classifier 2952. The first filter for the first filter 2954 can be determined based on at least one of the reconstructed block, the intermediate filter block, and the residual block. Alternatively, the image decoding device 2000 can obtain an intermediate filter block by performing filtering on the reconstructed block using at least one of a deblocking filter, a sample adaptive offset filter, and a bilateral filter.

[0523] In an embodiment, the first classifier 2952 may receive at least one of a reconstructed block, an intermediate filtered block, and a residual block, and determine the type of the current block. For example, the first classifier 2952 may determine directionality and activity based on the reconstructed block, or it may determine directionality and activity based on the residual block, in order to determine the type of the current block. Optionally, the first classifier 2952 may use sample values ​​included in the reconstructed block or sample values ​​included in the residual block as parameters for determining the type of the current block.

[0524] In an embodiment, the image decoding device 2000 can obtain a second filter by inputting at least one of a reconstructed block, an intermediate filter block, and a residual block into a second classifier 2956. The second filter for the second filter 2958 can be determined based on at least one of the reconstructed block, the intermediate filter block, and the residual block.

[0525] In an embodiment, the second classifier 2956 may receive at least one of a reconstructed block, an intermediate filtered block, and a residual block, and determine the type of the current block. For example, the second classifier 2956 may determine directionality and activity based on the reconstructed block, or it may determine directionality and activity based on the residual block, in order to determine the type of the current block. Optionally, the second classifier 2956 may use sample values ​​included in the reconstructed block or sample values ​​included in the residual block as parameters for determining the type of the current block.

[0526] In an embodiment, the image decoding device 2000 may obtain at least one APS filter set and an APS index. Each of the APS filter sets may include classifier information indicating which type of classifier to use to determine the class. For example, the image decoding device 2000 may use one of a Laplacian classifier, a band-based classifier, and a residual-based classifier as a third classifier based on the classifier information included in the APS filter set indicated by the APS index.

[0527] In an embodiment, the image decoding device 2000 can obtain an APS filter by inputting at least one of a reconstructed block, an intermediate filter block, and a residual block to a third classifier 2960. An APS filter (adaptive filter) for APS filtering 2990 can be determined based on at least one of the reconstructed block, intermediate filter block, and residual block.

[0528] In an embodiment, the image decoding device 2000 can perform adaptive loop filtering 2930 by performing APS filtering 2990. The image decoding device 2000 can perform filtering by using an APS filter determined based on at least one of a reconstruction block, an intermediate filtering block, and a residual block. The image decoding device 2000 can perform filtering by using an APS filter. The image decoding device 2000 can obtain adaptive loop filtering samples by using an adaptive filter determined based on the difference block.

[0529] In an embodiment, the third classifier 2960 may receive at least one of a reconstructed block, an intermediate filtered block, and a residual block, and determine the class of the current block. For example, when a Laplacian classifier is used as the third classifier 2960, the image decoding device 2000 may determine directionality and activity based on the reconstructed block, or based on the residual block, to determine the class of the current block. In the image decoding device 2000, the third classifier 2960 may use sample values ​​included in the reconstructed block or sample values ​​included in the residual block as parameters for determining the class of the current block.

[0530] In an embodiment, it can be achieved through... Figure 29 Loop filtering can be used to improve the quality of subjective or objective images.

[0531] Figure 30 This is a diagram illustrating adaptive loop filtering performed in a loop filtering unit according to an embodiment.

[0532] In an embodiment, the loop filter unit 3000 may perform at least one of deblocking filter 3010, sample adaptive offset filter 3020, bilateral filter 3025, and adaptive loop filter 3030.

[0533] In an embodiment, Figure 30 The deblocking filter 3010, sample adaptive offset filter 3020, and bilateral filter 3025 in the loop filter unit 3000 can be respectively connected to... Figure 24 The deblocking filter 2410, the sample adaptive offset filter 2420, and the bilateral filter 2425 correspond to each other, therefore, their identical descriptions are omitted.

[0534] In an embodiment, Figure 30 The information regarding whether to use the APS filter set 3040, filtering using the predefined filter set 3050, first classifier 3052, first filter 3054, second classifier 3056, second filter 3058, third classifier 3060, third filter 3070, first filter 3080, and APS filter 3090 can respectively correspond to Figure 24Information regarding whether to use the APS filter set 2440, filtering using the predefined filter set 2450, first classifier 2452, first filter 2454, second classifier 2456, second filter 2458, third classifier 2460, third filter 2470, first filter 2480, and APS filter 2490 in the document is omitted here.

[0535] In one embodiment, the image decoding device 2000 may perform APS filtering based on a difference block representing the difference between the residual block and the intermediate filter block. In another embodiment, the image decoding device 2000 may obtain a first filter by inputting the difference block to a first classifier 3052. A first filter for the first filter 3054 may be determined based on the difference block.

[0536] In an embodiment, the first classifier 3052 may receive difference blocks and determine the type of the current block. For example, the first classifier 3052 may determine directionality and activity based on the difference blocks in order to determine the type of the current block. Optionally, the first classifier 3052 may use sample values ​​included in the difference blocks as parameters for determining the type of the current block.

[0537] In an embodiment, the image decoding device 2000 can obtain a second filter by inputting the difference blocks into a second classifier 3056. The second filter for the second filter 3058 can be determined based on the difference blocks.

[0538] In an embodiment, the second classifier 3056 may receive difference blocks and determine the type of the current block. For example, the second classifier 3056 may determine directionality and activity based on the difference blocks to determine the type of the current block. Optionally, the second classifier 3056 may use sample values ​​included in the difference blocks as parameters for determining the type of the current block.

[0539] In an embodiment, the image decoding device 2000 can obtain an APS filter by inputting the difference blocks to a third classifier 3060. The APS filter for APS filtering 3090 can be determined based on the difference blocks.

[0540] In this embodiment, the image decoding device 2000 may perform filtering using an APS filter determined based on difference blocks. The image decoding device 2000 may also perform adaptive loop filtering by performing APS filtering 2490 using the APS filter.

[0541] In an embodiment, the third classifier 3060 can receive difference blocks and determine the type of the current block. For example, when a Laplacian classifier is used as the third classifier 3060, the image decoding device 2000 can determine directionality and activity based on the difference blocks to determine the type of the current block. In the image decoding device 2000, the third classifier 3060 can use sample values ​​included in the difference blocks as parameters for determining the type of the current block.

[0542] In an embodiment, the image decoding device 2000 may perform adaptive loop filtering 3030 by performing APS filtering 3090. The image decoding device 2000 may perform APS filtering 3090 on the current block by using a difference block that includes difference samples corresponding to the current sample.

[0543] In this embodiment, the image decoding device 2000 can perform APS filtering 3090 by using difference points and an APS filter. The image decoding device 2000 can perform APS filtering 3090 by applying the APS filter to the difference points and their neighboring samples. Furthermore, the image decoding device 2000 can obtain the APS-filtered block obtained by performing APS filtering 3090 as the current block's filter block.

[0544] In one embodiment, the image decoding device 2000 can obtain adaptive loop-filtered samples using difference samples and at least one adaptive filter coefficient obtained from information about adaptive loop filtering. Alternatively, the at least one adaptive filter coefficient may include filter coefficients for the difference samples.

[0545] In an embodiment, the image decoding device 2000 may apply filter coefficients for the difference points, obtained based on information about adaptive loop filtering, to the difference points. The image decoding device 2000 may obtain adaptive loop filtered samples by using the values ​​obtained by applying the filter coefficients for the difference points to the difference points.

[0546] In an embodiment, it can be achieved through... Figure 30 Intra-loop filtering can be used to improve the quality of subjective or objective images.

[0547] Figure 31 This is a flowchart of an image decoding method according to an embodiment.

[0548] During operation of S3110, the image decoding device 2000 can obtain information about adaptive loop filtering from the bitstream. The image decoding device 2000 can obtain information about adaptive loop filtering from the APS. The image decoding device 2000 can obtain information about adaptive loop filtering from the strip header.

[0549] In this embodiment, the image decoding device 2000 may obtain information including, within the information regarding adaptive loop filtering, indicating whether adaptive loop filtering is performed. The image decoding device 2000 may obtain information including, within the information regarding adaptive loop filtering, regarding whether an APS filter set is used. The image decoding device 2000 may obtain a filter set index including, within the information regarding adaptive loop filtering.

[0550] In this embodiment, the image decoding device 2000 may obtain information, included in the information regarding adaptive loop filtering, regarding whether a current APS filter set has been obtained. The image decoding device 2000 may obtain information, included in the information regarding adaptive loop filtering, regarding the number of filters included in each current APS filter set. The image decoding device 2000 may obtain information, included in the information regarding adaptive loop filtering, regarding at least one APS filter included in the current APS filter set. The image decoding device 2000 may obtain an APS index, included in the information regarding adaptive loop filtering.

[0551] On the other hand, this disclosure is not limited to the disclosed examples, and the information regarding adaptive loop filtering may include the information necessary to perform adaptive loop filtering.

[0552] In operation S3120, the image decoding device 2000 can obtain a first filtered residual sample corresponding to the current sample by performing filtering using the residual block of the current sample and the first filter.

[0553] In an embodiment, the image decoding device 2000 can perform a first filtering by using a residual block and a first filter. The image decoding device 2000 can obtain a first filtered residual block by performing the first filtering by using the residual block and the first filter, wherein the first filtered residual block includes first filtered residual samples.

[0554] In an embodiment, the image decoding device 2000 can obtain the first filtered residual samples by performing filtering on a residual block or residual samples using a first filter and residual samples corresponding to filter coefficients predefined for the first filter. Alternatively, the first filter can be referred to as filter coefficients predefined for the first filter.

[0555] For example, the image decoding device 2000 can obtain the first filtered residual sample by adding the values ​​obtained by applying filter coefficients corresponding to each sample and defined for the first filter to at least one of the residual sample and its neighboring samples. On the other hand, this disclosure is not limited to the disclosed example, and the image decoding device 2000 can obtain the first filtered residual sample by using the values ​​obtained by multiplying the predefined filter coefficients by the residual sample.

[0556] Because it has already been referenced Figures 21 to 30 Operation S3120 has been described in detail, so its identical description is omitted.

[0557] In operation S3130, the image decoding device 2000 can obtain a second filtered residual sample corresponding to the current sample by performing filtering using the first filtered residual sample and the second filter.

[0558] In an embodiment, the image decoding device 2000 can perform a second filtering by using a first filtering residual block and a second filter. The image decoding device 2000 can obtain a second filtering residual block by performing the second filtering by using the first filtering residual block and the second filter, wherein the second filtering residual block includes second filtering residual samples.

[0559] In an embodiment, the image decoding device 2000 can obtain the second filtered residual sample by performing filtering on the first filtered residual block or the first filtered residual sample using a second filter and first filtered residual samples corresponding to filter coefficients predefined for the second filter. Alternatively, the second filter can be referred to as filter coefficients predefined for the second filter.

[0560] For example, the image decoding device 2000 can obtain the second filter residual sample by applying predefined filter coefficients for the second filter to the first filter residual sample. On the other hand, this disclosure is not limited to the disclosed example, and the image decoding device 2000 can obtain the second filter residual sample by using the value obtained by multiplying the predefined filter coefficients by the first filter residual sample.

[0561] Because it has already been referenced Figures 21 to 30 Operation S3130 has been described in detail, so its identical description is omitted.

[0562] In operation S3140, the image decoding device 2000 can obtain adaptive loop filter samples by using a first filter residual sample, a second filter residual sample, and at least one adaptive filter coefficient obtained from information about the adaptive loop filter.

[0563] In an embodiment, the image decoding device 2000 may determine whether to perform adaptive loop filtering based on information included in the information about adaptive loop filtering indicating whether to perform adaptive loop filtering. The image decoding device 2000 may determine whether to perform adaptive loop filtering by using an APS filter set based on information included in the information about adaptive loop filtering regarding whether to use an APS filter set.

[0564] In an embodiment, the image decoding device 2000 may obtain at least one current APS filter set included in the information regarding adaptive loop filtering. The image decoding device 2000 may utilize the APS index included in the information regarding adaptive loop filtering to determine, from the at least one APS filter set, the APS filter set to be used for filtering the current block.

[0565] In an embodiment, the image decoding device 2000 can perform APS filtering by using an APS filter determined based on at least one of reconstructed blocks, intermediate blocks, residual blocks, and difference blocks. To perform APS filtering, the image decoding device 2000 can determine one APS filter from at least one APS filter included in the APS filter set as the APS filter for adaptive loop filtering by using a type determined based on at least one of reconstructed blocks, intermediate filtering blocks, residual blocks, and difference blocks.

[0566] In an embodiment, the image decoding device 2000 may perform filtering by using an APS filter determined based on a difference block representing the difference between the reconstructed block and the intermediate filter block. To perform adaptive loop filtering, the image decoding device 2000 may determine one of at least one APS filter included in the APS filter set by using a type determined based on the difference block.

[0567] In an embodiment, the image decoding device 2000 may determine an APS filter for APS filtering based on a determined set of APS filters and the type of the current block. The image decoding device 2000 may obtain adaptive loop filter samples by performing adaptive loop filtering using the determined APS filter, a first filter residual sample, and a second filter residual sample.

[0568] In an embodiment, the image decoding device 2000 can obtain adaptive loop filter samples by adding intermediate filter samples to a value obtained by multiplying the first filter residual sample and the second filter residual sample by at least one adaptive filter coefficient included in the APS filter determined for the first filter residual sample and the second filter residual sample, respectively. The image decoding device 2000 can obtain an adaptive loop filter block by obtaining adaptive loop filter samples for at least one or all samples included in the current block.

[0569] In an embodiment, the image decoding device 2000 can obtain a third filtered residual sample corresponding to the current sample by performing filtering using the residual sample and the third filter.

[0570] In one embodiment, the image decoding device 2000 can obtain adaptive loop filter samples by performing APS filtering using third filter residual samples and at least one adaptive filter coefficient. In another embodiment, the image decoding device 2000 can obtain adaptive loop filter samples by adding an intermediate filter sample to a value obtained by multiplying the third filter residual sample and at least one of its neighboring samples by APS filter coefficients included in the APS filter determined for that at least one sample. In yet another embodiment, the image decoding device 2000 can obtain adaptive loop filter samples by performing APS filtering using third filter intermediate samples and at least one adaptive filter coefficient. For example, the image decoding device 2000 can obtain adaptive loop filter samples by adding an intermediate filter sample to a value obtained by multiplying the APS filter coefficients by the difference between the third filter intermediate samples and the intermediate filter samples.

[0571] Because it has already been referenced Figures 21 to 30 Operation S3140 has been described in detail, so its identical description is omitted.

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

[0573] Reference Figure 32 The image encoding device 3200 may include a prediction encoding unit 3210 and a generation unit 3230.

[0574] The prediction coding unit 3210 and the generation unit 3230 according to the embodiment can be implemented as at least one processor. In the embodiment, the prediction coding unit 3210 and the generation unit 3230 can operate according to at least one instruction stored in at least one memory.

[0575] In an embodiment, the image encoding device 3200 may include at least one memory storing input and output data of the predictive encoding unit 3210 and the generation unit 3230. Additionally, the image encoding device 3200 may include a memory control unit that controls the data input and output of the memory.

[0576] In the embodiment, the prediction coding unit 3210 may correspond to Figure 19 The prediction coding unit 1915 shown in the figure, and the generation unit 3230 can correspond to Figure 19 The entropy coding unit 1925 is shown in the figure.

[0577] In an embodiment, the predictive coding unit 3210 can obtain divided stripes by dividing a stripe into at least one stripe. The predictive coding unit 3210 can determine at least one APS filter for at least one block included in the divided stripe. The predictive coding unit 3210 can obtain an APS filter set including the determined at least one APS filter. The predictive coding unit 3210 can obtain the APS filter set from each divided stripe.

[0578] In an embodiment, the prediction coding unit 3210 may determine at least one APS filter coefficient corresponding to at least one preset tap in order to determine the APS filter.

[0579] In an embodiment, the prediction coding unit 3210 may determine at least one APS filter coefficient that corresponds to or is included in at least one of the following taps: spatial tap, first filter tap, second filter tap, third filter tap, reconstruction tap, residual tap, first residual filter tap, second residual filter tap, third residual filter tap, third intermediate filter tap, and difference tap.

[0580] In an embodiment, the predictive coding unit 3210 can determine which filter to use for the current block from among APS filters included in at least one APS filter set and filters included in at least one predefined filter set. The predictive coding unit 3210 can determine the filter for adaptive loop filtering of the current block as follows: among filtered blocks obtained by performing adaptive loop filtering using at least one APS filter set and filtered blocks obtained by performing adaptive loop filtering using at least one predefined filter set, the filter produces a filtered block that differs less from the original block.

[0581] In an embodiment, the predictive coding unit 3210 may determine to use an APS filter in order to perform adaptive loop filtering on the current block. The predictive coding unit 3210 may determine or obtain information about the adaptive loop filtering required to obtain the APS filter in the predictive decoding unit 2030. The information about the adaptive loop filtering may include at least one of the following: whether a current APS filter set is obtained, the number of filters included in the current APS filter set, at least one APS filter included in the current APS filter set, and the APS index. The current block may be a CTU, CU, transform unit, predictive unit, or filtering unit partitioned from the current image to be encoded.

[0582] In an embodiment, the predictive coding unit 3210 may determine which filters included in a predefined filter set to use in order to perform adaptive loop filtering on the current block. The predictive coding unit 3210 may determine or obtain information about the adaptive loop filtering required to obtain the APS filter in the predictive decoding unit 2030. Information about the adaptive loop filtering may include a filter set index.

[0583] In an embodiment, the predictive coding unit 3210 can compare the difference between the original block and the filtered block obtained by performing adaptive loop filtering with the difference between the original block and the intermediate filtered block, and when it is determined that adaptive loop filtering is not suitable, the predictive coding unit 3210 can determine that the information indicating whether to perform adaptive loop filtering is not to perform adaptive loop filtering.

[0584] In an embodiment, when the filter used for determining the adaptive loop filtering of the current block is an APS filter included in at least one APS filter or a filter included in at least one predefined filter set, the prediction coding unit 3210 may determine whether to perform adaptive loop filtering based on the information indicating whether to perform adaptive loop filtering.

[0585] In an embodiment, when the filter used for adaptive loop filtering of the current block is a filter included in at least one predefined filter set, the predictive coding unit 3210 can determine the filter set index and can determine whether the APS filter set is used as not using the APS filter set.

[0586] In an embodiment, when the filter used for adaptive loop filtering of the current block is an APS filter included in at least one APS filter set, the prediction coding unit 3210 may determine at least one of the following: information about whether the current APS filter set is obtained, information about the number of filters included in each current APS filter set, information about at least one APS filter included in the current APS filter set, and the APS index.

[0587] In an embodiment, the predictive coding unit 3210 may generate a bitstream including information about adaptive loop filtering, wherein the information about adaptive loop filtering includes at least one of information indicating whether adaptive loop filtering is performed, information about whether an APS filter set is used, and a filter set index.

[0588] In an embodiment, the predictive coding unit 3210 may generate a bitstream including information about adaptive loop filtering, wherein the information about adaptive loop filtering includes information indicating whether adaptive loop filtering is performed, information about whether the current APS filter set is obtained, information about the number of filters included in each current APS filter set, information about at least one APS filter included in the current APS filter set, and at least one of the APS indexes.

[0589] In an embodiment, at least one piece of information included in the information about adaptive loop filtering may be included as a flag or index.

[0590] In an embodiment, at least some of the information regarding adaptive loop filtering may be included in the sequence parameter set, frame parameter set, adaptive parameter set, strip header, or strip data of the bitstream.

[0591] In one embodiment, the predictive coding unit 3210 may determine information about the adaptive loop filtering used for the current block according to a predefined method. In this case, the information about the adaptive loop filtering may not be included in the bitstream.

[0592] In an embodiment, encoding the current block can refer to a process that enables the image decoding device 2000 to reconstruct information about the current block. The information generated through encoding can be included in a bitstream.

[0593] In an embodiment, the generating unit 3230 may generate a bitstream that includes the result of encoding the image. The bitstream may include the result of encoding the current block.

[0594] In an embodiment, the generating unit 3230 can send the bitstream to the image decoding device 2000 via a network.

[0595] In an embodiment, the generating unit 3230 may store the bitstream in a data storage medium, wherein the data storage medium includes magnetic media such as hard disks, floppy disks and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as optical floppy disks, etc.

[0596] In an embodiment, the generation unit 3230 may generate a bitstream comprising syntax elements generated by encoding the image. Values ​​corresponding to the syntax elements may be included in the bitstream according to the hierarchical structure of the image.

[0597] In an embodiment, the bitstream generated when the generating unit 3230 performs entropy encoding on the syntax elements may be included in the bitstream.

[0598] In an embodiment, the bitstream may include information about adaptive loop filtering of the current block within the current image. Furthermore, information about adaptive loop filtering may be determined based on at least one set of APS filters. On the other hand, since information about adaptive loop filtering has already been described above, its identical description is omitted.

[0599] In this embodiment, since the operation of the image encoding device 3200 can be the same as that of the image decoding device 2000, the description of the operation of the image decoding device 2000 can also be applied to the image encoding device 3200.

[0600] In the embodiment, since the operation of the predictive coding unit 3210 of the image coding device 3200 can be the same as the operation of the predictive decoding unit 2030 of the image decoding device 2000, the description of the operation of the predictive decoding unit 2030 can be applied to the predictive coding unit 3210 in the same way.

[0601] Figure 33 This is a flowchart of an image encoding method according to an embodiment.

[0602] During operation S3310, the image encoding device 3200 can obtain a first filtered residual sample corresponding to the current sample by performing filtering using the residual sample of the current sample and the first filter.

[0603] In an embodiment, the image encoding device 3200 may perform filtering on the residual block of the current block using a first filter. For example, the image encoding device 3200 may determine the first filter corresponding to the type determined according to the current block from filters included in a first predefined filter set.

[0604] In an embodiment, the image encoding device 3200 can obtain a first filtered residual block by performing a first filtering using a residual block and a first filter. The image encoding device 3200 can obtain the first filtered residual block by performing filtering on the residual block using a first filter, wherein the first filtered residual block includes a first filtered residual sample corresponding to the current sample. The image encoding device 3200 can obtain the first filtered residual sample by performing filtering on the residual sample using a first filter.

[0605] In one embodiment, the image encoding device 3200 can obtain the first filtered residual sample by performing filtering on the residual sample or residual block using filter coefficients predefined for the first filter and the residual sample corresponding to the predefined filter coefficients. Alternatively, the filter coefficients predefined for the first filter on the residual block can be at least one filter coefficient included in the first filter.

[0606] For example, the image encoding device 3200 may use the value obtained by calculating the inner product of the value of at least one filter coefficient used for the first filter with the value of the residual sample corresponding to the at least one filter coefficient used for the first filter and the value of at least one sample among the neighboring samples of the residual sample as the value of the first filter residual sample.

[0607] In operation S3320, the image encoding device 3200 can obtain a second filtered residual sample corresponding to the current sample by performing filtering using a first filtered residual sample and a second filter.

[0608] In an embodiment, the image encoding device 3200 may perform filtering on the first filtered residual block using a second filter. For example, the image encoding device 3200 may determine a second filter from among the filters included in a second predefined filter set that corresponds to the type determined according to the current block.

[0609] In an embodiment, the image encoding device 3200 can obtain a second filtered residual block by performing a second filtering using a first filtered residual block and a second filter. The image encoding device 3200 can obtain a second filtered residual block by performing filtering on the first filtered residual block using a second filter, wherein the second filtered residual block includes a second filtered residual sample corresponding to the current sample. The image encoding device 3200 can obtain a second filtered residual sample by performing filtering on the first filtered residual sample using a second filter.

[0610] In one embodiment, the image encoding device 3200 can obtain the second filtered residual sample by performing filtering on the first filtered residual sample or residual block using predefined filter coefficients for the second filter and the first filtered residual sample corresponding to the predefined filter coefficients. Alternatively, the predefined filter coefficients for the second filtered residual block can be at least one filter coefficient included in the second filter.

[0611] For example, the image encoding device 3200 can obtain a value as the value of the second filter residual sample by calculating the inner product of at least one filter coefficient used for the second filter and the value of at least one sample among the first filter residual sample corresponding to the at least one filter coefficient used for the second filter and the neighboring samples of the first filter residual sample.

[0612] In operation S3330, the image encoding device 3200 can determine at least one adaptive filter coefficient for performing adaptive loop filtering by using the first filter residual sample and the second filter residual sample. The at least one adaptive filter coefficient for performing adaptive loop filtering may be referred to as an APS filter or an adaptive filter.

[0613] In an embodiment, the image encoding device 3200 may determine at least one APS filter to be applied to the first and second filtered residual samples. The image encoding device 3200 may determine an APS filter set including at least one APS filter.

[0614] In an embodiment, the image encoding device 3200 can obtain divided stripes by dividing a stripe into at least one stripe. The image encoding device 3200 can determine at least one APS filter for at least one block included in the divided stripes. The image encoding device 3200 can obtain an APS filter set including the determined at least one APS filter. The image encoding device 3200 can obtain an APS filter set from each divided stripe. The image encoding device 3200 can obtain or determine at least one APS filter set for a stripe. The image encoding device 3200 can obtain or determine at least one APS filter set including filter coefficients for performing APS filtering on the current block.

[0615] For example, image encoding device 3200 can divide a stripe into four stripes. Image encoding device 3200 can determine 25 APS filters for at least one block included in the four divided stripes, and can obtain an APS filter set including the 25 APS filters. Image encoding device 3200 can obtain an APS filter set including the 25 APS filters from each of the four divided stripes.

[0616] In an embodiment, the image encoding device 3200 may determine at least one adaptive filter coefficient for samples corresponding to the position of at least one preset tap in order to determine an APS filter.

[0617] In an embodiment, the image encoding device 3200 may determine at least one adaptive filter coefficient corresponding to or included in at least one of the following taps: spatial tap, first filter tap, second filter tap, third filter tap, reconstruction tap, first residual filter tap, second residual filter tap, third residual filter tap, third intermediate filter tap, and differential tap.

[0618] In an embodiment, the image encoding device 3200 may determine at least one APS filter coefficient (adaptive filter coefficient) for at least one of the following samples: including intermediate filter samples and neighboring samples of intermediate filter samples in a spatial tap, first filter samples and neighboring samples of first filter samples corresponding to a first filter tap, second filter samples and neighboring samples of second filter samples corresponding to a second filter tap, third filter samples and neighboring samples of third filter samples corresponding to a third filter tap, and reconstructed samples and neighboring samples of reconstructed samples corresponding to a reconstruction tap. The residual sample point and its neighboring sample point corresponding to the residual tap; the first filter residual sample point and its neighboring sample point corresponding to the first residual filter tap; the second filter residual sample point and its neighboring sample point corresponding to the second residual filter tap; the third filter residual sample point and its neighboring sample point corresponding to the third residual filter tap; the third intermediate filter sample point and its neighboring sample point corresponding to the third intermediate filter tap; and the difference sample point and its neighboring sample point corresponding to the difference tap.

[0619] In an embodiment, the image encoding device 3200 may determine at least one adaptive filter coefficient to be applied to at least one of the following samples: intermediate filter sample, first filter sample, second filter sample, third filter sample, reconstructed sample, residual sample, first filter residual sample, second filter residual sample, third filter residual sample, and third filter intermediate filter sample.

[0620] In one embodiment, the image encoding device 3200 may determine adaptive filter coefficients to be applied to the first and second filtered residual samples. In another embodiment, the image encoding device 3200 may determine at least one adaptive filter coefficient to be applied to the first and second filtered residual samples. Furthermore, when the image encoding device 3200 uses neighboring samples of the first and / or second filtered residual samples to perform filtering on the current sample, the image encoding device 3200 may determine at least one adaptive filter coefficient corresponding to each of the neighboring samples of the first and / or second filtered residual samples.

[0621] In an embodiment, the image encoding device 3200 may determine adaptive filter coefficients to be applied to the third filter residual sample. For example, the image encoding device 3200 may determine at least one adaptive filter coefficient corresponding to at least one of the following samples: the third filter residual sample corresponding to the third residual filter tap and neighboring samples of the third filter residual sample.

[0622] In one embodiment, the image encoding device 3200 may determine adaptive filter coefficients to be applied to the third intermediate filter sample. In another embodiment, the image encoding device 3200 may determine at least one adaptive filter coefficient corresponding to at least one of the third intermediate filter sample and at least one of its neighboring samples.

[0623] In an embodiment, the image encoding device 3200 may determine adaptive filter coefficients to be applied to the difference sample. For example, the image encoding device 3200 may determine at least one adaptive filter coefficient corresponding to at least one of the difference sample corresponding to the difference tap and at least one of the neighboring samples of the difference sample.

[0624] In operation S3340, the image encoding device 3200 can generate a bitstream including information about adaptive loop filtering based on at least one adaptive filter coefficient.

[0625] In one embodiment, the image encoding device 3200 may determine at least one APS filter. The image encoding device 3200 may determine or obtain an APS filter set including at least one APS filter. Alternatively, each APS filter may include at least one adaptive filter coefficient.

[0626] In an embodiment, the image encoding device 3200 may determine the most suitable APS filter among at least one APS filter included in each APS filter set. For example, the image encoding device may determine an index indicating one of the at least one APS filter sets and / or an index indicating one of the at least one APS filter.

[0627] For example, the image encoding device 3200 may determine the following filter as the filter for adaptive loop filtering of the current block: in an adaptive loop filtering block comprising adaptive loop filtering samples obtained by performing adaptive loop filtering using at least one APS filter included in at least one APS filter set, and a filtering block obtained by performing adaptive loop filtering using filters included in at least one predefined filter set, the filter produces a filtering block with a smaller difference from the original block. Furthermore, the determined filter may be an adaptive filter.

[0628] In an embodiment, one of the filters in at least one APS filter may be based on at least one determined adaptive filter coefficient.

[0629] On the other hand, at least one APS filter set may include at least one current APS filter set or at least one previous APS filter set, wherein at least one current APS filter set includes at least one APS filter determined for the current block or the current strip, and at least one previous APS filter set includes at least one APS filter determined for the previous block or the previous strip.

[0630] In an embodiment, the image encoding device 3200 may compare the difference between the original block and the filtered block obtained by performing adaptive loop filtering with the difference between the original block and the intermediate filtered block, and when it is determined that adaptive loop filtering is not suitable, the image encoding device 3200 may determine that the information indicating whether to perform adaptive loop filtering is not to perform adaptive loop filtering.

[0631] In an embodiment, when the filter used for determining the adaptive loop filtering of the current block is an APS filter included in at least one APS filter or a filter included in at least one predefined filter set, the image encoding device 3200 may determine whether to perform adaptive loop filtering based on information indicating whether to perform adaptive loop filtering.

[0632] In an embodiment, when the filter used for adaptive loop filtering of the current block is a filter included in at least one predefined filter set, the image encoding device 3200 can determine the filter set index and can determine whether the APS filter set is used as not using the APS filter set.

[0633] In an embodiment, when the filter used for adaptive loop filtering of the current block is an APS filter included in at least one APS filter set, the image encoding device 3200 may determine at least one of the following: information about whether a current APS filter set is obtained, information about the number of filters included in each current APS filter set, information about at least one APS filter included in the current APS filter set, and an APS index.

[0634] In an embodiment, the image encoding device 3200 may generate a bitstream including information about adaptive loop filtering, wherein the information about adaptive loop filtering includes at least one of information indicating whether adaptive loop filtering is performed, information about whether an APS filter set is used, and a filter set index.

[0635] In an embodiment, the image encoding device 3200 may generate a bitstream including information about adaptive loop filtering, wherein the information about adaptive loop filtering includes information indicating whether adaptive loop filtering is performed, information about whether a current APS filter set is obtained, information about the number of filters included in each current APS filter set, information about at least one APS filter included in the current APS filter set, and at least one of the APS indexes.

[0636] In an embodiment, information about adaptive loop filtering may be included in the sequence parameter set, frame parameter set, adaptive parameter set, strip header, or strip data of the bitstream.

[0637] In embodiments of this disclosure, an image decoding method for adaptive loop filtering is provided. The image decoding method may include obtaining information about adaptive loop filtering from a bitstream (S3110). The image decoding method may include obtaining a first filtered residual sample corresponding to the current sample by performing filtering using a residual sample of the current sample and a first filter (S3120). The image decoding method may include obtaining a second filtered residual sample corresponding to the current sample by performing filtering via using the first filtered residual sample and a second filter (S3130). The image decoding method may include obtaining adaptive loop filtering samples by using the first filtered residual sample, the second filtered residual sample, and at least one adaptive filter coefficient obtained from the information about adaptive loop filtering (S3140).

[0638] In an embodiment, the image decoding method may further include: obtaining a third filtered residual sample corresponding to the current sample by performing filtering using residual samples and a third filter. The image decoding method may also include: obtaining adaptive loop filtered samples by using the third filtered residual sample and the at least one adaptive filter coefficient.

[0639] In an embodiment, the image decoding method may further include obtaining a third-filtered intermediate-filtered sample corresponding to the current sample by performing filtering using a third filter and intermediate-filtered samples. The intermediate-filtered samples are obtained by performing at least one of the following on the reconstructed block of the current block: deblocking filtering 2410, 2710, 2810, 2910, and 3010; sample adaptive offset filtering 2420, 2720, 2820, 2920, and 3030; and bilateral filtering 2425, 2725, 2825, 2925, and 3025. The image decoding method may also include obtaining adaptive loop-filtered samples by using the third-filtered intermediate-filtered samples and at least one adaptive filter coefficient.

[0640] In an embodiment, a first filter and a second filter may be determined based on at least one of the reconstruction block, intermediate filter block, and residual block of the current block, wherein the intermediate filter block is obtained by performing at least one of the following on the reconstruction block: deblocking filtering 2410, 2710, 2810, 2910 and 3010, sample adaptive offset filtering 2420, 2720, 2820, 2920 and 3030, and bilateral filtering 2425, 2725, 2825, 2925 and 3025.

[0641] In an embodiment, the image decoding method may include: using at least one of a reconstructed block, an intermediate filtering block, and a residual block based on the current block, wherein the intermediate filtering block is obtained by performing at least one of deblocking filters 2410, 2710, 2810, 2910, and 3010, sample adaptive offset filters 2420, 2720, 2820, 2920, and 3030, and bilateral filters 2425, 2725, 2825, 2925, and 3025 on the reconstructed block.

[0642] In one embodiment, a first filter and a second filter may be determined based on a difference block representing the difference between the reconstructed block and an intermediate filter block, the intermediate filter block being obtained by performing at least one of deblocking filters 2410, 2710, 2810, 2910 and 3010, sample adaptive offset filters 2420, 2720, 2820, 2920 and 3030, and bilateral filters 2425, 2725, 2825, 2925 and 3025 on the reconstructed block.

[0643] In an embodiment, the image decoding method may include an adaptive filter determined based on the difference between a reconstructed block representing the current block and an intermediate filter block, the intermediate filter block being obtained by performing at least one of deblocking filters 2410, 2710, 2810, 2910 and 3010, sample adaptive offset filters 2420, 2720, 2820, 2920 and 3030, and bilateral filters 2425, 2725, 2825, 2925 and 3025 on the reconstructed bl...

Claims

1. An image decoding method for adaptive loop filtering, the image decoding method comprising: Obtain information about adaptive loop filtering from the bitstream (S3110); The first filtered residual sample corresponding to the current sample is obtained by performing filtering using the residual sample of the current sample and the first filter (S3120); A second filtered residual sample corresponding to the current sample is obtained by performing filtering using a first filtered residual sample and a second filter (S3130); and Adaptive loop filter samples are obtained by using first filter residual samples, second filter residual samples, and at least one adaptive filter coefficient obtained from information about adaptive loop filtering (S3140).

2. The image decoding method according to claim 1 further includes: The third filtered residual sample corresponding to the current sample is obtained by performing filtering using the residual sample and the third filter. The process of obtaining the adaptive loop filter samples (S3140) includes obtaining the adaptive loop filter samples by using the third filter residual samples and the at least one adaptive filter coefficient.

3. The image decoding method according to claim 1 or 2 further includes: The intermediate filtered sample corresponding to the current sample is obtained by performing filtering using a third filter and intermediate filtered samples. The intermediate filtered sample is obtained by performing at least one of the following on the reconstructed block including the current sample: deblocking filtering (2410, 2710, 2810, 2910, 3010), sample adaptive offset filtering (2420, 2720, 2820, 2920, 3030), and bilateral filtering (2425, 2725, 2825, 2925, 3025). The process of obtaining the adaptive loop filter samples (S3140) includes obtaining the adaptive loop filter samples by using the third intermediate filter samples and the at least one adaptive filter coefficient.

4. The image decoding method according to any one of claims 1 to 3, wherein, The first filter and the second filter are determined based on at least one of the following blocks: a reconstruction block comprising the current block containing the current sample; an intermediate filter block obtained by performing at least one of deblocking filtering (2410, 2710, 2810, 2910, 3010), sample adaptive offset filtering (2420, 2720, 2820, 2920, 3030), and bilateral filtering (2425, 2725, 2825, 2925, 3025) on the reconstruction block; and a residual block comprising the residual sample.

5. The image decoding method according to any one of claims 1 to 4, wherein, Obtaining the adaptive loop filter samples (S3140) includes: using an adaptive filter determined based on at least one of the following blocks: a reconstruction block of the current block including the current samples; an intermediate filter block obtained by performing at least one of deblocking filtering (2410, 2710, 2810, 2910, 3010), sample adaptive offset filtering (2420, 2720, 2820, 2920, 3030), and bilateral filtering (2425, 2725, 2825, 2925, 3025) on the reconstruction block; and a residual block including the residual samples.

6. The image decoding method according to any one of claims 1 to 5, wherein, The first and second filters are determined based on difference blocks, wherein the difference block represents the difference between a reconstructed block comprising the current block of the current sample and an intermediate filter block obtained by performing at least one of deblocking filtering (2410, 2710, 2810, 2910, 3010), sample adaptive offset filtering (2420, 2720, 2820, 2920, 3030), and bilateral filtering (2425, 2725, 2825, 2925, 3025) on the reconstructed block.

7. The image decoding method according to any one of claims 1 to 6, wherein, Obtaining the adaptive loop filter samples (S3140) includes: using an adaptive filter determined based on difference blocks, wherein the difference block represents the difference between a reconstructed block including the current sample and an intermediate filter block obtained by performing at least one of deblocking filtering (2410, 2710, 2810, 2910, 3010), sample adaptive offset filtering (2420, 2720, 2820, 2920, 3030), and bilateral filtering (2425, 2725, 2825, 2925, 3025) on the reconstructed block.

8. The image decoding method according to claim 6 or 7, wherein, Obtaining the adaptive loop filter samples (S3140) includes: obtaining the adaptive loop filter samples by using the difference samples included in the difference block and the at least one adaptive filter coefficient.

9. The image decoding method according to any one of claims 1 to 8, wherein, Information about adaptive loop filtering includes indications of whether adaptive loop filtering should be performed.

10. The image decoding method according to any one of claims 1 to 9, wherein, Information about adaptive loop filtering includes information on whether or not an adaptive filter set is used.

11. The image decoding method according to any one of claims 1 to 10, wherein, Information about adaptive loop filtering includes information about at least one adaptive filter included in the adaptive filter set.

12. The image decoding method according to any one of claims 1 to 11, further comprising: Intermediate filtered samples corresponding to the current sample are obtained by performing at least one of the following on the reconstructed block, including the current sample: deblocking filtering (2410, 2710, 2810, 2910, 3010), sample adaptive offset filtering (2420, 2720, 2820, 2920, 3030), and bilateral filtering (2425, 2725, 2825, 2925, 3025); A first filtered sample corresponding to the current sample is obtained by performing filtering using the reconstructed sample included in the reconstruction block, the intermediate filtered sample, and the first filter. The second filtered sample corresponding to the current sample is obtained by performing filtering using the reconstructed sample, the first filtered sample, and the second filter. and The third filtered sample corresponding to the current sample is obtained by performing filtering using the reconstructed sample, the intermediate filtered sample, and the third filter. The process of obtaining the adaptive loop filter samples (S3140) includes obtaining the adaptive loop filter samples by using the intermediate filter samples, the first filter samples, the second filter samples, the third filter samples, the reconstructed samples, the residual samples, and the at least one adaptive filter coefficient.

13. An image coding method for adaptive loop filtering, the image coding method comprising: The first filtered residual sample corresponding to the current sample is obtained by performing filtering using the residual sample of the current sample and the first filter (S3310); The second filtered residual sample corresponding to the current sample is obtained by performing filtering using the first filtered residual sample and the second filter (S3320); At least one adaptive filter coefficient for performing adaptive loop filtering on the current block, including the current sample, is determined by using the first filter residual sample and the second filter residual sample (S3330); and A bitstream including information about adaptive loop filtering is generated based on the at least one adaptive filter coefficient (S3340).

14. The image encoding method according to claim 13, further comprising: The third filtered residual sample corresponding to the current sample is obtained by performing filtering using the residual sample and the third filter. The determination of the at least one adaptive filter coefficient for performing adaptive loop filtering on the current block (S3330) includes: determining the at least one adaptive filter coefficient for performing adaptive loop filtering on the current block by using third filter residual samples.

15. A computer-readable recording medium recording a bitstream, wherein, The bitstream includes information about adaptive loop filtering. The information regarding adaptive loop filtering is based on at least one adaptive filter coefficient used to perform adaptive loop filtering on the current block, which includes the current sample. Specifically, the at least one adaptive filter coefficient is determined by using first filter residual samples and second filter residual samples. Specifically, the first filtered residual sample corresponding to the current sample is obtained by performing filtering using the residual sample of the current sample and the first filter, and Specifically, filtering is performed using the first filtered residual sample and the second filter to obtain the second filtered residual sample corresponding to the current sample.