A method for video decoding to obtain a quantization parameter and an apparatus therefor, a method for video encoding to transmit a quantization parameter and an apparatus therefor

KR103032068B1Active Publication Date: 2026-10-13SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
KR1020250010740
Authority / Receiving Office
KR · KR
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-01-10
Filing Date
2025-01-23
Publication Date
2026-10-13
Estimated Expiration
2044-04-09

Smart Images

  • Figure 112025009788430-PAT00017_ABST
    Figure 112025009788430-PAT00017_ABST
Patent Text Reader

Abstract

A video decoding method according to one embodiment provided in the present disclosure comprises obtaining QP initial value and picture header QP difference value information to be applied to a current picture from a picture parameter set, and if the picture header QP difference value information indicates that the QP difference value information exists in the picture header of the current picture, obtaining a first QP difference value for the current picture from the picture header, determining a QP for an encoding unit included in the current picture using the QP initial value and the first QP difference value, performing inverse quantization on the encoding unit using the QP to obtain conversion coefficients of the encoding unit, and restoring the encoding unit using the conversion coefficients.
Need to check novelty before this filing date? Find Prior Art

Description

Technology Field

[0001] The present disclosure relates to a video decoding method and apparatus, and a video encoding method and apparatus, and to a method and apparatus for encoding video by effectively performing a quantization parameter (QP), and a method and apparatus for decoding video. Background Technology

[0002] In conventional compression methods, square encoding units were determined through a recursive division process in which, after deciding whether to divide the encoding unit included in the picture during the process of determining the size of the encoding unit, it was uniformly divided into four encoding units of the same size. However, for high-resolution images, the degradation of image quality in the restored image caused by the use of uniform square encoding units has recently become a problem. Therefore, methods and devices for dividing high-resolution images into various types of encoding units are being proposed. The problem to be solved

[0003] The present disclosure relates to a video decoding method and apparatus, and a video encoding method and apparatus. It aims to solve the problem of a method for efficiently transmitting QP difference values ​​in a video encoding apparatus and a method for efficiently obtaining QP difference values ​​in a video decoding apparatus. means of solving the problem

[0004] A video decoding method according to one embodiment provided in the present disclosure may include: obtaining an initial value of a Quantization Parameter (QP) to be applied to a current picture from a set of picture parameters, and obtaining picture header QP difference value information from the set of picture parameters indicating whether QP difference value information exists in the picture header of the current picture; if the picture header QP difference value information indicates that QP difference value information exists in the picture header of the current picture, obtaining a first QP difference value for the current picture from the picture header; determining a QP for a coding unit included in the current picture using the initial value of the QP and the first QP difference value; performing inverse quantization on the coding unit using the QP to obtain conversion coefficients of the coding unit; and restoring the coding unit using the conversion coefficients.

[0005] According to one embodiment, the video decoding method may further include: a step of obtaining a second QP difference value for a current slice from a slice header of a current slice included in the current picture when the picture header QP difference value information indicates that the QP difference value information does not exist in the picture header; a step of determining a QP for a coding unit included in the current slice using the QP initial value and the second QP difference value; a step of obtaining conversion coefficients of the coding unit by performing inverse quantization on the coding unit using the QP; and a step of restoring the coding unit using the conversion coefficients.

[0006] According to one embodiment, the step of obtaining conversion coefficients of the encoding unit by performing inverse quantization on the encoding unit using the QP may include: obtaining the QP difference value for the luminance component of the current picture from the picture header; determining the QP for the luminance component of the slices included in the current picture by adding the QP initial value and the first QP difference value for the luminance component; and determining the QP of the encoding unit included in the current picture and included in the slices using the QP for the luminance component of the slices.

[0007] According to one embodiment, the step of determining the QP of the encoding unit may include: obtaining a QP difference value for the encoding unit from a bitstream; and determining the QP for the luminance component of the encoding unit using the QP for the luminance component of the slices and the QP difference value for the encoding unit.

[0008] According to one embodiment, the step of obtaining conversion coefficients of the encoding unit by performing inverse quantization on the encoding unit using the QP may include: obtaining the second QP difference value for the luminance component of the current slice from the slice header; determining the QP for the luminance component of the current slice by adding the QP initial value and the second QP difference value for the luminance component; and determining the QP of the encoding unit included in the current slice using the QP for the luminance component of the current slice.

[0009] According to one embodiment, the step of determining the QP of the encoding unit may include: obtaining a QP difference value for the encoding unit from a bitstream; and determining the QP for the luminance component of the encoding unit using the QP for the luminance component of the current slice and the QP difference value for the encoding unit.

[0010] According to one embodiment, the step of obtaining conversion coefficients of the encoding unit by performing inverse quantization on the encoding unit using the QP may include: obtaining a Cb QP difference value for the Cb chroma component of the current slice and a Cr QP difference value for the Cr chroma component of the current slice from the slice header; determining a Cb QP for the Cb chroma component of the current encoding unit by updating the QP for the Cb chroma component of the current encoding unit included in the current slice using the Cb QP difference value for the Cb chroma component of the current slice; and determining a Cr QP for the Cr chroma component of the current encoding unit by updating the QP for the Cr chroma component of the current encoding unit using the Cr QP difference value for the Cr chroma component of the current slice.

[0011] A video decoding device according to one embodiment provided in the present disclosure may include: an acquisition unit that obtains a QP initial value to be applied to a current picture from a picture parameter set, obtains picture header QP difference value information from the picture parameter set indicating whether QP difference value information exists in the picture header of the current picture, and obtains a first QP difference value for the current picture from the picture header if the picture header QP difference value information indicates that the QP difference value information exists in the picture header; and a decoding unit that determines a QP for an encoding unit included in the current picture using the QP initial value and the first QP difference value if the picture header QP difference value information indicates that the QP difference value information exists in the picture header, obtains conversion coefficients of the encoding unit by performing inverse quantization on the encoding unit using the QP, and restores the encoding unit using the conversion coefficients of the encoding unit.

[0012] A video encoding method according to one embodiment provided in the present disclosure may include: a step of determining a QP initial value to be applied to a current picture; a step of determining a first QP difference value between a QP used in the current picture and the QP initial value when determining the QP difference value for each picture, and generating a picture header for the current picture including the first QP difference value; and a step of generating a picture parameter set including picture header QP difference value information indicating whether QP difference value information exists in the picture header of the current picture and the QP initial value.

[0013] According to one embodiment, the video encoding method may further include the step of determining a second QP difference value between the QP used in the current slice included in the current picture and the initial QP value when determining the QP difference value per slice, and generating a slice header for the current slice including the second QP difference value.

[0014] According to one embodiment, the step of generating a picture header for the current picture, including the first QP difference value, may include: determining a QP for the luminance component of slices included in the current picture; and determining the first QP difference value for the luminance component of the current picture using the difference value between the QP for the luminance component of slices included in the current picture and the initial QP value.

[0015] According to one embodiment, the step of determining the first QP difference value may include: determining the QP difference value for the encoding unit using the difference value between the QP for the luminance component of the encoding unit and the QP for the luminance component of the slices; and encoding the QP difference value for the encoding unit.

[0016] According to one embodiment, the step of generating a slice header for the current slice including the second QP difference value may include: determining a QP for the luminance component of the current slice; and determining the second QP difference value for the luminance component of the current slice using the difference value between the QP for the luminance component of the current slice and the initial QP value.

[0017] According to one embodiment, the step of determining the second QP difference value may include: determining the QP difference value for the encoding unit by subtracting the QP for the luminance component of the current slice from the QP for the luminance component of the encoding unit; and encoding the QP difference value for the encoding unit.

[0018] According to one embodiment, the step of determining the second QP difference value may include: determining a Cb QP difference value for a Cb chroma component of a current encoding unit to determine a QP of a Cb chroma component of a current encoding unit included in the current slice; determining a Cr QP difference value for a Cr chroma component of a current encoding unit to determine a QP of a Cr chroma component of a current encoding unit included in the current slice; and encoding a Cb QP difference value for a Cb chroma component of the current slice and a Cr QP difference value for a Cr chroma component of the current slice, and generating a slice header for the current slice including the Cb QP difference value and the Cr QP difference value.

[0019] A computer-readable recording medium is provided, having a program for performing a video decoding method according to one embodiment provided in the present disclosure on a computer.

[0020] A computer-readable recording medium is provided, having a program for performing a video encoding method according to one embodiment provided in the present disclosure on a computer. Effects of the invention

[0021] According to a video encoding method and a video decoding method according to one embodiment, a method for transmitting the difference value of QP is determined according to the characteristics of the picture or data transmission efficiency, and the difference value of QP can be signaled according to the method. Brief explanation of the drawing

[0022] A brief description of each drawing is provided to help to better understand the drawings cited in this specification. FIG. 1 illustrates a schematic block diagram of an image decoding device according to one embodiment. FIG. 2 illustrates a flowchart of an image decoding method according to one embodiment. FIG. 3 illustrates a process in which an image decoding device divides a current encoding unit to determine at least one encoding unit according to one embodiment. FIG. 4 illustrates a process in which an image decoding device, according to one embodiment, divides a non-square encoding unit to determine at least one encoding unit. FIG. 5 illustrates a process in which an image decoding device divides a encoding unit based on at least one of block form information and division form mode information according to one embodiment. FIG. 6 illustrates a method for an image decoding device to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment. FIG. 7 illustrates the order in which a plurality of encoding units are processed when an image decoding device determines a plurality of encoding units by dividing a current encoding unit according to one embodiment. FIG. 8 illustrates a process in which, according to one embodiment, an image decoding device determines that the current encoding unit is divided into an odd number of encoding units when the encoding unit cannot be processed in a predetermined order. FIG. 9 illustrates a process in which an image decoding device divides a first encoding unit to determine at least one encoding unit according to one embodiment. FIG. 10 illustrates that, according to one embodiment, when a video decoding device divides a first encoding unit and a second encoding unit of a non-square shape determined by the division satisfies a predetermined condition, the shape in which the second encoding unit can be divided is limited. FIG. 11 illustrates the process of a video decoder dividing square-shaped encoding units when, according to one embodiment, the divided shape mode information cannot be divided into four square-shaped encoding units. FIG. 12 illustrates that, according to one embodiment, the processing order between a plurality of encoding units may vary depending on the division process of the encoding unit. FIG. 13 illustrates a process in which, according to one embodiment, a encoding unit is recursively divided to determine a plurality of encoding units, and the depth of the encoding unit is determined as the shape and size of the encoding unit change. FIG. 14 illustrates a depth and part index (hereinafter PID) for distinguishing between coding units that can be determined according to the shape and size of the coding units according to one embodiment. FIG. 15 illustrates that a plurality of encoding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment. Figure 16 is a block diagram of an image encoding and decoding system. FIG. 17 illustrates a block diagram of a video decoding device according to one embodiment. FIG. 18 illustrates a flowchart of a video decoding method according to one embodiment. FIG. 19 illustrates a block diagram of a video encoding device according to one embodiment. FIG. 20 illustrates a flowchart of a video encoding method according to one embodiment. FIG. 21 illustrates a schematic diagram for inducing QP at the picture level or slice level according to one embodiment. FIG. 22 illustrates a picture parameter set containing picture header QP difference value information according to one embodiment. FIG. 23 illustrates a picture header containing the QP difference value of the current picture according to one embodiment. FIG. 24 illustrates a slice header containing the QP difference value of the current slice according to one embodiment. FIG. 25 illustrates a set of picture parameters containing information indicating whether the picture header includes deblocking filter-related parameters according to one embodiment. FIG. 26 illustrates a picture header containing parameters related to a deblocking filter of the current picture according to one embodiment. FIG. 27 illustrates a slice header containing parameters related to the deblocking filter of the current slice according to one embodiment. FIG. 28 illustrates a set of picture parameters containing information indicating whether various tool-related parameters are included in the picture header according to one embodiment. FIG. 29 illustrates a picture header containing parameters related to weight prediction of the current picture, parameters related to SAO (sample adaptive offset), and parameters related to the reference picture list according to one embodiment. FIG. 30 illustrates a picture header containing ALF (Adaptive loop filter) related parameters of the current picture according to one embodiment. FIG. 31 illustrates a slice header containing reference picture list related parameters, weight prediction related parameters, and SAO related parameters of the current slice according to one embodiment. FIG. 32 illustrates a slice header containing ALF-related parameters of the current slice according to one embodiment. Specific details for implementing the invention

[0023] The present disclosure is capable of various modifications and may have various embodiments, and specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the embodiments of the present disclosure, and it should be understood that the present disclosure includes all modifications, equivalents, and substitutions that fall within the spirit and scope of the various embodiments.

[0024] In describing the embodiments, if it is determined that a detailed description of related prior art could unnecessarily obscure the gist of the present disclosure, such detailed description is omitted. Additionally, numbers used in the description of the specification (e.g., first, second, etc.) are merely identifiers to distinguish one component from another.

[0025] In addition, when a component is described in this specification as being "connected" or "connected" to another component, it should be understood that the component may be directly connected to or directly connected to the other component, but unless otherwise specifically stated, it may also be connected or connected through another component in between.

[0026] In addition, components expressed as '~part (unit)', 'module', etc. in this specification may consist of two or more components combined into a single component, or a single component may be divided into two or more components according to more detailed functions. Furthermore, each component described below may additionally perform some or all of the functions performed by other components in addition to the primary function it is responsible for, and it goes without saying that some of the primary functions performed by each component may be exclusively performed by other components.

[0027] Additionally, in this specification, 'image' or 'picture' may refer to a still image of a video or a moving image, that is, the video itself.

[0028] Additionally, in this specification, 'sample' refers to data assigned to a sampling location of an image that is subject to processing. For example, pixel values ​​in an image in a spatial domain and transformation coefficients in a transformation domain may be samples. A unit comprising at least one such sample may be defined as a block.

[0029] Additionally, in this specification, 'Current Block' may refer to a block of the maximum encoding unit, encoding unit, prediction unit, or transformation unit of the current image to be encoded or decoded.

[0030] Additionally, in this specification, a motion vector being in the direction of List 0 may mean a motion vector used to point to a block within a reference picture included in List 0, and a motion vector being in the direction of List 1 may mean a motion vector used to point to a block within a reference picture included in List 1. Additionally, a motion vector being unidirectional may mean a motion vector used to point to a block within a reference picture included in List 0 or List 1, and a motion vector being bidirectional may mean that the motion vector includes a motion vector in the direction of List 0 and a motion vector in the direction of List 1.

[0031] Additionally, in this specification, 'binary split' of a block refers to a split that creates two sub-blocks with half the width or height of the block. Specifically, when a 'binary vertical split' is performed on the current block, the split is performed in the vertical direction (vertical direction) at half the width of the current block, so two sub-blocks can be created with a width that is half the width of the current block and a height equal to the height of the current block. When a 'binary horizontal split' is performed on the current block, the split is performed in the horizontal direction (horizontal direction) at half the height of the current block, so two sub-blocks can be created with a height that is half the height of the current block and a width equal to the width of the current block.

[0032] In addition, in this specification, 'ternary split' of a block refers to a split in which the width or height of the block is divided in a 1:2:1 ratio to create three sub-blocks. Specifically, when a 'ternary vertical split' is performed on the current block, the split is performed in the vertical direction (vertical direction) at a point in the 1:2:1 ratio of the width of the current block, so two sub-blocks with a width of 1 / 4 of the width of the current block and the same height as the current block, and one sub-block with a width of 2 / 4 of the width of the current block and the same height as the current block can be created. When 'Tunery horizontal splitting' is performed on the current block, the splitting is performed in the horizontal direction (horizontal direction) at a 1:2:1 ratio of the current block's height, so two sub-blocks with a height of 1 / 4 of the current block's height and a width equal to the current block's width, and one sub-block with a height of 2 / 4 of the current block's height and a width equal to the current block's width can be created.

[0033] In addition, in this specification, 'quadsplit' of a block refers to a division in which the width and height of the block are divided in a 1:1 ratio to create four sub-blocks. Specifically, when 'quadsplit' is performed on the current block, the division is performed in the vertical direction (vertical direction) at half the width of the current block and the division is performed in the horizontal direction (horizontal direction) at half the height of the current block, so that four sub-blocks can be created having a width that is half the width of the current block and a height that is half the height of the current block.

[0034] Hereinafter, with reference to FIGS. 1 to 16, an image encoding device and an image decoding device, an image encoding method and an image decoding method are described in detail according to one embodiment. With reference to FIGS. 3 to 16, a method for determining a data unit of an image is described according to one embodiment, and with reference to FIGS. 17 to 40, a video encoding / decoding method according to one embodiment using the determined data unit is described later.

[0035] A method and apparatus for adaptively selecting based on various forms of encoding units according to an embodiment of the present disclosure are described below with reference to FIGS. 1 and 2.

[0036] FIG. 1 illustrates a schematic block diagram of an image decoding device according to one embodiment.

[0037] The video decoding device (100) may include a receiving unit (110) and a decoding unit (120). The receiving unit (110) and the decoding unit (120) may include at least one processor. Additionally, the receiving unit (110) and the decoding unit (120) may include a memory that stores instructions to be executed by at least one processor.

[0038] The receiver (110) can receive a bitstream. The bitstream contains information in which an image is encoded by an image encoding device (2200) described later. Additionally, the bitstream can be transmitted from the image encoding device (2200). The image encoding device (2200) and the image decoding device (100) can be connected via wired or wireless connection, and the receiver (110) can receive the bitstream via wired or wireless connection. The receiver (110) can receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoding unit (120) can restore the image based on information obtained from the received bitstream. The decoding unit (120) can obtain syntax elements for restoring the image from the bitstream. The decoding unit (120) can restore the image based on the syntax elements.

[0039] The operation of the video decoding device (100) is explained in more detail with reference to FIG. 2.

[0040] FIG. 2 illustrates a flowchart of an image decoding method according to one embodiment.

[0041] According to one embodiment of the present disclosure, a receiver (110) receives a bitstream.

[0042] The image decoding device (100) performs the step (210) of obtaining an empty string corresponding to a partitioning mode of the encoding unit from a bitstream. The image decoding device (100) performs the step (220) of determining a partitioning rule for the encoding unit. Additionally, the image decoding device (100) performs the step (230) of partitioning the encoding unit into a plurality of encoding units based on at least one of the empty string corresponding to the partitioning mode and the partitioning rule. To determine the partitioning rule, the image decoding device (100) may determine an acceptable first range of the size of the encoding unit according to the ratio of the width and height of the encoding unit. To determine the partitioning rule, the image decoding device (100) may determine an acceptable second range of the size of the encoding unit according to the partitioning mode of the encoding unit.

[0043] In the following, the division of a encoding unit according to one embodiment of the present disclosure will be described in detail.

[0044] First, a single picture can be divided into one or more slices or one or more tiles. A single slice or tile can be a sequence of one or more Coding Tree Units (CTUs). In contrast to the Coding Tree Unit (CTU), there is a Coding Tree Block (CTB).

[0045] A maximum encoding block (CTB) refers to an NxN block containing NxN samples (N is an integer). Each color component can be divided into one or more maximum encoding blocks.

[0046] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the maximum encoding unit (CTU) is a unit that includes the maximum encoding block for luminance samples and two corresponding maximum encoding blocks for chroma samples, and the syntax structures used to encode the luminance samples and chroma samples. When a picture is a monochrome picture, the maximum encoding unit is a unit that includes the maximum encoding block for monochrome samples and the syntax structures used to encode the monochrome samples. When a picture is encoded into color planes separated by color components, the maximum encoding unit is a unit that includes the picture and the syntax structures used to encode the samples of the picture.

[0047] A single maximum coding block (CTB) can be divided into MxN coding blocks containing MxN samples (M and N are integers).

[0048] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) is a unit that includes a coding block for luminance samples and two coding blocks for corresponding chroma samples, and syntax structures used to encode the luminance samples and chroma samples. When a picture is a monochrome picture, a coding unit is a unit that includes a coding block for monochrome samples and syntax structures used to encode the monochrome samples. When a picture is a picture encoded in color planes separated by color components, a coding unit is a unit that includes the picture and syntax structures used to encode the samples of the picture.

[0049] As explained above, the maximum encoding block and the maximum encoding unit are distinct concepts, and the encoding block and the encoding unit are distinct concepts. That is, the (maximum) encoding unit refers to a data structure that includes the (maximum) encoding block containing the corresponding sample and the corresponding syntax structure. However, since a person skilled in the art can understand that the (maximum) encoding unit or the (maximum) encoding block refers to a block of a predetermined size containing a predetermined number of samples, the maximum encoding block and the maximum encoding unit, or the encoding block and the encoding unit, are referred to without distinction in the following specification unless there are special circumstances.

[0050] The image can be divided into Coding Tree Units (CTUs). The size of the CTU can be determined based on information obtained from the bitstream. The shape of the CTU can be a square of equal size, but it is not limited to this.

[0051] For example, information about the maximum size of a luma-encoded block can be obtained from a bitstream. For example, the maximum size of a luma-encoded block indicated by the information about the maximum size of a luma-encoded block may be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, or 256x256.

[0052] For example, information regarding the maximum size of a two-divisionable luminance coding block and the difference in luminance block size can be obtained from a bitstream. The information regarding the difference in luminance block size may represent the size difference between the maximum luminance coding unit and the maximum two-divisionable luminance coding block. Therefore, by combining the information regarding the maximum size of the two-divisionable luminance coding block obtained from the bitstream with the information regarding the difference in luminance block size, the size of the maximum luminance coding unit can be determined. Using the size of the maximum luminance coding unit, the size of the maximum chroma coding unit can also be determined. For example, if the Y:Cb:Cr ratio according to the color format is 4:2:0, the size of the chroma block may be half the size of the luminance block, and similarly, the size of the maximum chroma coding unit may be half the size of the maximum luminance coding unit.

[0053] According to one embodiment, information regarding the maximum size of a binary splittable luminous encoding block is obtained from a bitstream, so the maximum size of the binary splittable luminous encoding block can be determined variably. Alternatively, the maximum size of a ternary splittable luminous encoding block can be fixed. For example, the maximum size of a ternary splittable luminous encoding block in picture I may be 32x32, and the maximum size of a ternary splittable luminous encoding block in picture P or picture B may be 64x64.

[0054] Additionally, the maximum encoding unit can be hierarchically divided into encoding units based on splitting mode information obtained from the bitstream. As splitting mode information, at least one of information indicating whether it is a quad split, information indicating whether it is a multi-split, splitting direction information, and splitting type information can be obtained from the bitstream.

[0055] For example, information indicating whether quad splitting is performed can indicate whether the current encoding unit will be quad split or not.

[0056] If the current encoding unit is not quad-splitting, information indicating multi-splitting can indicate whether the current encoding unit will no longer be split (NO_SPLIT) or whether it will be binary / ternary split.

[0057] If the current encoding unit is binary or binary split, the splitting direction information indicates that the current encoding unit is split in either the horizontal or vertical direction.

[0058] If the current encoding unit is split horizontally or vertically, the split type information indicates that the current encoding unit is split into binary split or binary split.

[0059] The splitting mode of the current encoding unit can be determined based on the splitting direction information and the splitting type information. The splitting mode when the current encoding unit is binary split in the horizontal direction can be determined as binary horizontal splitting (SPLIT_BT_HOR), when it is territorial split in the horizontal direction as territorial horizontal splitting (SPLIT_TT_HOR), when it is binary split in the vertical direction as binary vertical splitting (SPLIT_BT_VER), and when it is territorial split in the vertical direction as territorial vertical splitting (SPLIT_BT_VER).

[0060] The image decoding device (100) can obtain splitting mode information from a bitstream from a single empty string. The form of the bitstream received by the image decoding device (100) may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The empty string represents information as a sequence of binary numbers. The empty string may consist of at least one bit. The image decoding device (100) can obtain splitting mode information corresponding to the empty string based on a splitting rule. Based on the single empty string, the image decoding device (100) can determine whether to quad split the encoding unit, whether not to split it, or the splitting direction and splitting type.

[0061] A coding unit may be smaller than or equal to a maximum coding unit. For example, since the maximum coding unit is a coding unit having the maximum size, it is also a coding unit. If the segmentation mode information for the maximum coding unit indicates that it is not segmented, the coding unit determined from the maximum coding unit has the same size as the maximum coding unit. If the segmentation mode information for the maximum coding unit indicates that it is segmented, the maximum coding unit may be segmented into coding units. Additionally, if the segmentation mode information for a coding unit indicates segmentation, the coding units may be segmented into coding units of smaller size. However, the segmentation of the image is not limited to this, and the maximum coding unit and the coding unit may not be distinguished. The segmentation of coding units is explained in more detail in FIGS. 3 through 16.

[0062] Additionally, one or more prediction blocks for prediction may be determined from the coding unit. The prediction blocks may be equal to or smaller than the coding unit. Additionally, one or more transformation blocks for transformation may be determined from the coding unit. The transformation blocks may be equal to or smaller than the coding unit.

[0063] The shape and size of the transformation block and the prediction block may not be related to each other.

[0064] In another embodiment, prediction can be performed using the encoding unit as a prediction block. Additionally, conversion can be performed using the encoding unit as a conversion block.

[0065] The division of the encoding unit is described in more detail in FIGS. 3 through 16. The current block and surrounding block of the present disclosure may represent one of the maximum encoding unit, the encoding unit, the prediction block, and the transformation block. Additionally, the current block or the current encoding unit is a block currently undergoing decoding or encoding, or a block currently undergoing division. The surrounding block may be a block restored prior to the current block. The surrounding block may be spatially or temporally adjacent to the current block. The surrounding block may be located on one of the lower-left, left, upper-left, upper, upper-right, right, or lower-right sides of the current block.

[0066] FIG. 3 illustrates a process in which an image decoding device divides a current encoding unit to determine at least one encoding unit according to one embodiment.

[0067] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N. Here, N may be a positive integer. Block shape information is information indicating at least one of the shape, orientation, width, and height ratio or size of the encoding unit.

[0068] The shape of the encoding unit may include square and non-square. When the width and height of the encoding unit are the same (i.e., when the block shape of the encoding unit is 4Nx4N), the image decoder (100) may determine the block shape information of the encoding unit as square. The image decoder (100) may determine the shape of the encoding unit as non-square.

[0069] When the width and height of the encoding unit are different (i.e., when the block shape of the encoding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the image decoder (100) can determine the block shape information of the encoding unit as non-square. When the shape of the encoding unit is non-square, the image decoder (100) can determine the ratio of the width and height among the block shape information of the encoding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, or 32:1. Additionally, based on the width and height of the encoding unit, the image decoding device (100) can determine whether the encoding unit is in a horizontal direction or a vertical direction. Additionally, based on at least one of the width, height, or width of the encoding unit, the image decoding device (100) can determine the size of the encoding unit.

[0070] According to one embodiment, the image decoding device (100) can determine the form of the encoding unit using block form information and can determine how the encoding unit is divided using division form mode information. That is, depending on what block form the block form information used by the image decoding device (100) represents, the method of dividing the encoding unit represented by the division form mode information can be determined.

[0071] The video decoder (100) can obtain split-form mode information from the bitstream. However, it is not limited thereto, and the video decoder (100) and the video encoding device (2200) can determine pre-agreed split-form mode information based on block form information. The video decoder (100) can determine pre-agreed split-form mode information for a maximum encoding unit or a minimum encoding unit. For example, the video decoder (100) can determine the split-form mode information for the maximum encoding unit as quad split. Additionally, the video decoder (100) can determine the split-form mode information for the minimum encoding unit as "not split." Specifically, the video decoder (100) can determine the size of the maximum encoding unit to be 256x256. The video decoder (100) can determine the pre-agreed split-form mode information as quad split. Quad split is a split-form mode that divides both the width and height of the encoding unit into two equal parts. The image decoder (100) can obtain a 128x128 size encoding unit from a 256x256 size encoding unit based on the division mode information. Additionally, the image decoder (100) can determine the size of the minimum encoding unit to be 4x4. The image decoder (100) can obtain division mode information indicating "not divided" for the minimum encoding unit.

[0072] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is in the shape of a square. For example, the image decoding device (100) may determine whether to not divide the square encoding unit, to divide it vertically, to divide it horizontally, or to divide it into four encoding units, etc., according to the division shape mode information. Referring to FIG. 3, when the block shape information of the current encoding unit (300) indicates a square shape, the decoding unit (120) may not divide the encoding unit (310a) having the same size as the current encoding unit (300) according to the division shape mode information indicating that it is not divided, or may determine the divided encoding units (310b, 310c, 310d, 310e, 310f, etc.) based on the division shape mode information indicating a predetermined division method.

[0073] Referring to FIG. 3, the image decoding device (100) can determine two encoding units (310b) that divide the current encoding unit (300) in the vertical direction based on splitting form mode information indicating that it is divided in the vertical direction according to one embodiment. The image decoding device (100) can determine two encoding units (310c) that divide the current encoding unit (300) in the horizontal direction based on splitting form mode information indicating that it is divided in the horizontal direction. The image decoding device (100) can determine four encoding units (310d) that divide the current encoding unit (300) in the vertical direction and the horizontal direction based on splitting form mode information indicating that it is divided in the vertical direction and the horizontal direction. The image decoding device (100) can determine three encoding units (310e) that divide the current encoding unit (300) in the vertical direction based on splitting form mode information indicating that it is divided ternary in the vertical direction according to one embodiment. The image decoding device (100) can determine three encoding units (310f) that divide the current encoding unit (300) horizontally based on division form mode information indicating horizontal division. However, the division form in which the square encoding unit can be divided should not be interpreted as being limited to the form described above, and may include various forms that the division form mode information can represent. The specific division forms in which the square encoding unit is divided will be described in detail below through various embodiments.

[0074] FIG. 4 illustrates a process in which an image decoding device, according to one embodiment, divides a non-square encoding unit to determine at least one encoding unit.

[0075] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is in a non-square shape. The image decoding device (100) may determine whether to not divide the current encoding unit of the non-square shape or to divide it in a predetermined way according to the division shape mode information. Referring to FIG. 4, when the block shape information of the current encoding unit (400 or 450) indicates a non-square shape, the image decoding device (100) may determine an encoding unit (410 or 460) having the same size as the current encoding unit (400 or 450) based on division shape mode information indicating that it is not divided, or determine divided encoding units (420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, 480c) based on division shape mode information indicating a predetermined division method. A predetermined division method in which a non-square encoding unit is divided will be specifically described below through various embodiments.

[0076] According to one embodiment, the image decoding device (100) can determine the form in which the encoding unit is divided using the division form mode information, and in this case, the division form mode information may indicate the number of at least one encoding unit generated by dividing the encoding unit. Referring to FIG. 4, when the division form mode information indicates that the current encoding unit (400 or 450) is divided into two encoding units, the image decoding device (100) can determine two encoding units (420a, 420b, or 470a, 470b) included in the current encoding unit by dividing the current encoding unit (400 or 450) based on the division form mode information.

[0077] According to one embodiment, when an image decoding device (100) divides a current encoding unit (400 or 450) in a non-square shape based on division shape mode information, the image decoding device (100) may divide the current encoding unit by considering the position of the long side of the current encoding unit (400 or 450) in a non-square shape. For example, the image decoding device (100) may determine a plurality of encoding units by dividing the current encoding unit (400 or 450) in a direction that divides the long side of the current encoding unit (400 or 450) by considering the shape of the current encoding unit (400 or 450).

[0078] According to one embodiment, when the segmentation mode information indicates that the encoding unit is divided into an odd number of blocks (terminal segmentation), the image decoder (100) can determine an odd number of encoding units included in the current encoding unit (400 or 450). For example, when the segmentation mode information indicates that the current encoding unit (400 or 450) is divided into three encoding units, the image decoder (100) can divide the current encoding unit (400 or 450) into three encoding units (430a, 430b, 430c, 480a, 480b, 480c).

[0079] According to one embodiment, the ratio of the width to the height of the current encoding unit (400 or 450) may be 4:1 or 1:4. When the ratio of the width to the height is 4:1, the block shape information may be in the horizontal direction because the width is longer than the height. When the ratio of the width to the height is 1:4, the block shape information may be in the vertical direction because the width is shorter than the height. The image decoder (100) may determine to divide the current encoding unit into an odd number of blocks based on the division shape mode information. Additionally, the image decoder (100) may determine the division direction of the current encoding unit (400 or 450) based on the block shape information of the current encoding unit (400 or 450). For example, if the current encoding unit (400) is in a vertical direction, the image decoding device (100) can determine the encoding units (430a, 430b, 430c) by dividing the current encoding unit (400) in a horizontal direction. Also, if the current encoding unit (450) is in a horizontal direction, the image decoding device (100) can determine the encoding units (480a, 480b, 480c) by dividing the current encoding unit (450) in a vertical direction.

[0080] According to one embodiment, the image decoding device (100) may determine an odd number of encoding units included in the current encoding unit (400 or 450), and the sizes of the determined encoding units may not all be the same. For example, among the determined odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c), the size of a certain encoding unit (430b or 480b) may have a different size from the other encoding units (430a, 430c, 480a, 480c). That is, the current encoding unit (400 or 450) can be divided and determined as a encoding unit, and the encoding unit can have multiple types of sizes, and in some cases, an odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c) may each have different sizes.

[0081] According to one embodiment, when the segmentation mode information indicates that the encoding unit is divided into an odd number of blocks, the image decoding device (100) can determine the odd number of encoding units included in the current encoding unit (400 or 450), and furthermore, the image decoding device (100) can impose a predetermined limit on at least one encoding unit among the odd number of encoding units generated by the segmentation. Referring to FIG. 4, the image decoding device (100) can perform the decoding process for the central encoding unit (430b, 480b) among the three encoding units (430a, 430b, 430c, 480a, 480b, 480c) generated by the segmentation of the current encoding unit (400 or 450) differently from the other encoding units (430a, 430c, 480a, 480c). For example, the video decoding device (100) may restrict the centrally located encoding unit (430b, 480b) from being further divided unlike other encoding units (430a, 430c, 480a, 480c), or restrict it to being divided only a predetermined number of times.

[0082] FIG. 5 illustrates a process in which an image decoding device divides a encoding unit based on at least one of block form information and division form mode information according to one embodiment.

[0083] According to one embodiment, the image decoding device (100) may determine whether to divide a square-shaped first encoding unit (500) into encoding units or not to divide it based on at least one of block shape information and division shape mode information. According to one embodiment, if the division shape mode information indicates that the first encoding unit (500) is divided in a horizontal direction, the image decoding device (100) may divide the first encoding unit (500) in a horizontal direction to determine a second encoding unit (510). The first encoding unit, the second encoding unit, and the third encoding unit used according to one embodiment are terms used to understand the relationship before and after division between the encoding units. For example, if the first encoding unit is divided, the second encoding unit may be determined, and if the second encoding unit is divided, the third encoding unit may be determined. In the following, the relationship between the first encoding unit, the second encoding unit, and the third encoding unit used may be understood as following the features described above.

[0084] According to one embodiment, the image decoding device (100) may determine whether to divide the determined second encoding unit (510) into encoding units or not to divide it based on the division shape mode information. Referring to FIG. 5, the image decoding device (100) may divide the determined non-square second encoding unit (510) into at least one third encoding unit (520a, 520b, 520c, 520d, etc.) by dividing the first encoding unit (500) based on the division shape mode information, or may not divide the second encoding unit (510). The image decoding device (100) can obtain segmentation mode information, and the image decoding device (100) can divide a first encoding unit (500) based on the obtained segmentation mode information to divide a plurality of second encoding units (e.g., 510) of various forms, and the second encoding units (510) can be divided according to the method in which the first encoding unit (500) was divided based on the segmentation mode information. According to one embodiment, when the first encoding unit (500) is divided into a second encoding unit (510) based on the segmentation mode information for the first encoding unit (500), the second encoding unit (510) can also be divided into a third encoding unit (e.g., 520a, 520b, 520c, 520d, etc.) based on the segmentation mode information for the second encoding unit (510). That is, the encoding unit can be recursively partitioned based on partitioning mode information associated with each encoding unit. Thus, a square encoding unit can be determined from a non-square encoding unit, and a non-square encoding unit can be determined by recursively partitioning this square encoding unit.

[0085] Referring to FIG. 5, among the odd number of third encoding units (520b, 520c, 520d) determined by dividing a second encoding unit (510) of a non-square shape, a predetermined encoding unit (e.g., a central encoding unit or a square encoding unit) may be recursively divided. According to one embodiment, a square-shaped third encoding unit (520b), which is one of the odd number of third encoding units (520b, 520c, 520d), may be divided horizontally into a plurality of fourth encoding units. A non-square-shaped fourth encoding unit (530b or 530d), which is one of the plurality of fourth encoding units (530a, 530b, 530c, 530d), may again be divided into a plurality of encoding units. For example, a non-square fourth encoding unit (530b or 530d) may be further divided into an odd number of encoding units. Methods that can be used for the recursive division of encoding units will be described later through various embodiments.

[0086] According to one embodiment, the image decoding device (100) may divide each of the third encoding units (520a, 520b, 520c, 520d, etc.) into encoding units based on the division shape mode information. Additionally, the image decoding device (100) may decide not to divide the second encoding unit (510) based on the division shape mode information. According to one embodiment, the image decoding device (100) may divide the non-square second encoding unit (510) into an odd number of third encoding units (520b, 520c, 520d). The image decoding device (100) may place a certain limit on a certain third encoding unit among the odd number of third encoding units (520b, 520c, 520d). For example, the video decoding device (100) may limit the encoding unit (520c) located in the middle of the odd number of third encoding units (520b, 520c, 520d) so that it is not further divided or is limited to being divided a set number of times.

[0087] Referring to FIG. 5, the image decoding device (100) may limit the middle encoding unit (520c) among the odd number of third encoding units (520b, 520c, 520d) included in the second encoding unit (510) of a non-square shape to no longer be divided, to be divided into a predetermined division form (e.g., divided into only 4 encoding units or divided into a form corresponding to the divided form of the second encoding unit (510)), or to be divided only a predetermined number of times (e.g., divided only n times, n > 0). However, the above limitation on the middle encoding unit (520c) is merely a simple example and should not be interpreted as being limited to the above-described examples, but should be interpreted as including various limitations that allow the middle encoding unit (520c) to be decoded differently from the other encoding units (520b, 520d).

[0088] According to one embodiment, the image decoding device (100) can obtain splitting form mode information used to split the current encoding unit at a predetermined location within the current encoding unit.

[0089] FIG. 6 illustrates a method for an image decoding device to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment.

[0090] Referring to FIG. 6, the segmentation mode information of the current encoding unit (600, 650) can be obtained from a sample at a specific location among a plurality of samples included in the current encoding unit (600, 650) (e.g., a sample located in the center (640, 690)). However, the specific location within the current encoding unit (600) where at least one of such segmentation mode information can be obtained should not be interpreted as being limited to the center location shown in FIG. 6, and should be interpreted as including various locations within the current encoding unit (600) (e.g., top, bottom, left, right, top-left, bottom-left, top-right, or bottom-right, etc.). The image decoding device (100) can obtain the segmentation mode information obtained from the specific location and decide whether to divide the current encoding unit into encoding units of various shapes and sizes or not to divide it.

[0091] According to one embodiment, the image decoding device (100) may select one of the encoding units when the current encoding unit is divided into a predetermined number of encoding units. There may be various methods for selecting one of the multiple encoding units, and such methods will be described later through various embodiments below.

[0092] According to one embodiment, the image decoding device (100) can divide the current encoding unit into a plurality of encoding units and determine the encoding unit at a predetermined position.

[0093] According to one embodiment, the image decoding device (100) may use information indicating the location of each of the odd number of encoding units to determine the encoding unit located in the middle among the odd number of encoding units. Referring to FIG. 6, the image decoding device (100) may divide the current encoding unit (600) or the current encoding unit (650) to determine the odd number of encoding units (620a, 620b, 620c) or the odd number of encoding units (660a, 660b, 660c). The image decoding device (100) may determine the middle encoding unit (620b) or the middle encoding unit (660b) by using information regarding the location of the odd number of encoding units (620a, 620b, 620c) or the odd number of encoding units (660a, 660b, 660c). For example, the image decoding device (100) can determine the centrally located encoding unit (620b) by determining the positions of the encoding units (620a, 620b, 620c) based on information indicating the positions of a predetermined sample included in the encoding units (620a, 620b, 620c). Specifically, the image decoding device (100) can determine the centrally located encoding unit (620b) by determining the positions of the encoding units (620a, 620b, 620c) based on information indicating the positions of the upper-left samples (630a, 630b, 630c) of the encoding units (620a, 620b, 620c).

[0094] According to one embodiment, information indicating the location of the upper-left sample (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c) may include information regarding the location or coordinates within the picture of the encoding units (620a, 620b, 620c). According to one embodiment, information indicating the location of the upper-left sample (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c) may include information indicating the width or height of the encoding units (620a, 620b, 620c) included in the current encoding unit (600), and such width or height may correspond to information indicating the difference between coordinates within the picture of the encoding units (620a, 620b, 620c). That is, the image decoding device (100) can determine the centrally located encoding unit (620b) by directly using information about the position or coordinates of the encoding units (620a, 620b, 620c) within the picture, or by using information about the width or height of the encoding unit corresponding to the difference value between the coordinates.

[0095] According to one embodiment, information indicating the location of the upper left sample (630a) of the upper encoding unit (620a) may be represented by the (xa, ya) coordinates, information indicating the location of the upper left sample (530b) of the middle encoding unit (620b) may be represented by the (xb, yb) coordinates, and information indicating the location of the upper left sample (630c) of the lower encoding unit (620c) may be represented by the (xc, yc) coordinates. The image decoding device (100) can determine the middle encoding unit (620b) using the coordinates of the upper left samples (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c). For example, when the coordinates of the upper-left samples (630a, 630b, 630c) are sorted in ascending or descending order, the encoding unit (620b) containing the coordinates (xb, yb) of the sample (630b) located in the middle can be determined as the encoding unit located in the middle among the encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600). However, the coordinates indicating the position of the upper-left samples (630a, 630b, 630c) may represent absolute positions within the picture, and furthermore, based on the position of the upper-left sample (630a) of the upper-left of the upper-left of the middle encoding unit (620b), the (dxb, dyb) coordinates, which represent the relative position of the upper-left sample (630b) of the middle encoding unit (620b), and the (dxc, dyc) coordinates, which represent the relative position of the upper-left sample (630c) of the lower encoding unit (620c) may also be used. In addition, the method of determining the encoding unit of a predetermined position by using the coordinates of the corresponding sample as information indicating the position of the sample included in the encoding unit should not be interpreted as being limited to the method described above, but should be interpreted as various arithmetic methods that can utilize the coordinates of the sample.

[0096] According to one embodiment, the image decoding device (100) can divide the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) and select an encoding unit among the encoding units (620a, 620b, 620c) according to a predetermined criterion. For example, the image decoding device (100) can select an encoding unit (620b) of a different size among the encoding units (620a, 620b, 620c).

[0097] According to one embodiment, the image decoding device (100) can determine the width or height of each of the encoding units (620a, 620b, 620c) using the (xa, ya) coordinates, which are information indicating the location of the upper left sample (630a) of the upper encoding unit (620a), the (xb, yb) coordinates, which are information indicating the location of the upper left sample (630b) of the middle encoding unit (620b), and the (xc, yc) coordinates, which are information indicating the location of the upper left sample (630c) of the lower encoding unit (620c). The image decoding device (100) can determine the size of each of the encoding units (620a, 620b, 620c) using the (xa, ya), (xb, yb), and (xc, yc) coordinates, which are information indicating the location of the encoding units (620a, 620b, 620c). According to one embodiment, the image decoding device (100) may determine the width of the upper encoding unit (620a) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the upper encoding unit (620a) as yb-ya. According to one embodiment, the image decoding device (100) may determine the width of the middle encoding unit (620b) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the middle encoding unit (620b) as yc-yb. According to one embodiment, the image decoding device (100) may determine the width or height of the lower encoding unit using the width or height of the current encoding unit and the width and height of the upper encoding unit (620a) and the middle encoding unit (620b). The video decoding device (100) can determine a encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (620a, 620b, 620c).Referring to FIG. 6, the image decoding device (100) can determine a middle encoding unit (620b) having a size different from that of the upper encoding unit (620a) and the lower encoding unit (620c) as the encoding unit of a predetermined position. However, since the process of the image decoding device (100) described above determining the encoding unit having a size different from other encoding units is merely one embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, various processes of determining the encoding unit of a predetermined position by comparing the size of the encoding unit determined according to the predetermined sample coordinates may be used.

[0098] The image decoding device (100) can determine the width or height of each of the encoding units (660a, 660b, 660c) using the (xd, yd) coordinates, which are information indicating the location of the upper-left sample (670a) of the left encoding unit (660a), the (xe, ye) coordinates, which are information indicating the location of the upper-left sample (670b) of the middle encoding unit (660b), and the (xf, yf) coordinates, which are information indicating the location of the upper-left sample (670c) of the right encoding unit (660c). The image decoding device (100) can determine the size of each of the encoding units (660a, 660b, 660c) using the (xd, yd), (xe, ye), and (xf, yf) coordinates, which are information indicating the location of the encoding units (660a, 660b, 660c).

[0099] According to one embodiment, the image decoding device (100) may determine the width of the left encoding unit (660a) as xe-xd. The image decoding device (100) may determine the height of the left encoding unit (660a) as the height of the current encoding unit (650). According to one embodiment, the image decoding device (100) may determine the width of the middle encoding unit (660b) as xf-xe. The image decoding device (100) may determine the height of the middle encoding unit (660b) as the height of the current encoding unit (600). According to one embodiment, the image decoding device (100) may determine the width or height of the right encoding unit (660c) using the width or height of the current encoding unit (650) and the width and height of the left encoding unit (660a) and the middle encoding unit (660b). The image decoding device (100) can determine a encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (660a, 660b, 660c). Referring to FIG. 6, the image decoding device (100) can determine a middle encoding unit (660b) having a different size from the left encoding unit (660a) and the right encoding unit (660c) as the encoding unit of a predetermined position. However, since the process of the image decoding device (100) described above determining a encoding unit having a different size from other encoding units is merely one embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, various processes of determining the encoding unit of a predetermined position by comparing the size of the encoding unit determined according to the predetermined sample coordinates may be used.

[0100] However, the sample location considered to determine the location of the encoding unit should not be interpreted as being limited to the upper left corner described above, and can be interpreted as allowing the use of information regarding the location of any sample included in the encoding unit.

[0101] According to one embodiment, the image decoding device (100) may select an encoding unit at a predetermined position among an odd number of encoding units determined by dividing the current encoding unit, taking into account the shape of the current encoding unit. For example, if the current encoding unit is a non-square shape where the width is longer than the height, the image decoding device (100) may determine an encoding unit at a predetermined position according to the horizontal direction. That is, the image decoding device (100) may determine one of the encoding units that set a different position in the horizontal direction and impose a restriction on that encoding unit. If the current encoding unit is a non-square shape where the height is longer than the width, the image decoding device (100) may determine an encoding unit at a predetermined position according to the vertical direction. That is, the image decoding device (100) may determine one of the encoding units that set a different position in the vertical direction and impose a restriction on that encoding unit.

[0102] According to one embodiment, the image decoding device (100) may use information indicating the location of each of the even number of encoding units to determine the encoding unit at a predetermined location among the even number of encoding units. The image decoding device (100) may determine the even number of encoding units by dividing (binary division) the current encoding unit and may determine the encoding unit at a predetermined location using information regarding the locations of the even number of encoding units. Since the specific process for this may correspond to the process of determining the encoding unit at a predetermined location (e.g., the middle location) among the odd number of encoding units described above in FIG. 6, it is omitted.

[0103] According to one embodiment, when a current encoding unit in a non-square shape is divided into a plurality of encoding units, certain information regarding the encoding unit at a certain position may be used during the division process to determine the encoding unit at a certain position among the plurality of encoding units. For example, the image decoding device (100) may use at least one of block shape information and division shape mode information stored in a sample included in the middle encoding unit during the division process to determine the encoding unit located in the middle among the encoding units into which the current encoding unit is divided into a plurality of encoding units.

[0104] Referring to FIG. 6, the image decoding device (100) can divide the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) based on the division form mode information, and can determine the encoding unit (620b) located in the middle among the plurality of encoding units (620a, 620b, 620c). Furthermore, the image decoding device (100) can determine the encoding unit (620b) located in the middle by considering the location where the division form mode information is obtained. That is, the segmentation mode information of the current encoding unit (600) can be obtained from a sample (640) located in the middle of the current encoding unit (600), and based on the segmentation mode information, if the current encoding unit (600) is divided into a plurality of encoding units (620a, 620b, 620c), the encoding unit (620b) containing the sample (640) can be determined as the encoding unit located in the middle. However, the information used to determine the encoding unit located in the middle should not be interpreted as being limited to segmentation mode information, and various types of information may be used in the process of determining the encoding unit located in the middle.

[0105] According to one embodiment, a predetermined information for identifying a coding unit at a predetermined location may be obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, an image decoding device (100) may use a segmentation mode information obtained from a sample at a predetermined location within the current coding unit (600) (for example, a sample at the center of the current coding unit (600)) to determine a coding unit at a predetermined location (for example, a coding unit located in the center of the multiple divided coding units) among a plurality of coding units (620a, 620b, 620c) determined by dividing the current coding unit (600). That is, the image decoding device (100) can determine a sample at the predetermined position by considering the block shape of the current encoding unit (600), and the image decoding device (100) can determine a encoding unit (620b) containing a sample from which certain information (e.g., division shape mode information) can be obtained among a plurality of encoding units (620a, 620b, 620c) from which the current encoding unit (600) is divided and determined, and can impose a certain limit. Referring to FIG. 6, according to one embodiment, the image decoding device (100) can determine a sample (640) located in the middle of the current encoding unit (600) as a sample from which certain information can be obtained, and the image decoding device (100) can impose a certain limit on the encoding unit (620b) containing such a sample (640) during the decoding process. However, the location of the sample from which the specified information can be obtained should not be interpreted as being limited to the location described above, but can be interpreted as samples at any location included in the encoding unit (620b) to be determined for the purpose of imposing a limit.

[0106] According to one embodiment, the location of a sample from which a predetermined information can be obtained may be determined according to the shape of the current encoding unit (600). According to one embodiment, block shape information may determine whether the shape of the current encoding unit is square or non-square, and may determine the location of a sample from which a predetermined information can be obtained according to the shape. For example, the image decoding device (100) may determine a sample located on a boundary that divides at least one of the width and height of the current encoding unit in half using at least one of the information regarding the width and height of the current encoding unit as a sample from which a predetermined information can be obtained. As another example, if the block shape information related to the current encoding unit indicates that it is a non-square shape, the image decoding device (100) may determine one of the samples including a boundary that divides the long side of the current encoding unit in half as a sample from which a predetermined information can be obtained.

[0107] According to one embodiment, when the image decoding device (100) divides the current encoding unit into a plurality of encoding units, it may use division form mode information to determine the encoding unit at a predetermined position among the plurality of encoding units. According to one embodiment, the image decoding device (100) may obtain division form mode information from a sample at a predetermined position included in the encoding unit, and the image decoding device (100) may divide the plurality of encoding units generated by dividing the current encoding unit using the division form mode information obtained from a sample at a predetermined position included in each of the plurality of encoding units. That is, the encoding unit may be recursively divided using the division form mode information obtained from a sample at a predetermined position included in each of the encoding units. Since the recursive division process of the encoding unit has been described in detail through FIG. 5, a detailed explanation will be omitted.

[0108] According to one embodiment, the image decoding device (100) can determine at least one encoding unit by dividing the current encoding unit, and can determine the order in which the at least one encoding unit is decoded according to a predetermined block (e.g., the current encoding unit).

[0109] FIG. 7 illustrates the order in which a plurality of encoding units are processed when an image decoding device determines a plurality of encoding units by dividing a current encoding unit according to one embodiment.

[0110] According to one embodiment, the image decoding device (100) may determine a second encoding unit (710a, 710b) by dividing a first encoding unit (700) in a vertical direction according to the splitting form mode information, determine a second encoding unit (730a, 730b) by dividing the first encoding unit (700) in a horizontal direction, or determine a second encoding unit (750a, 750b, 750c, 750d) by dividing the first encoding unit (700) in both a vertical and a horizontal direction.

[0111] Referring to FIG. 7, the image decoding device (100) can determine the order of processing the determined second encoding units (710a, 710b) in the horizontal direction (710c) by dividing the first encoding unit (700) in the vertical direction. The image decoding device (100) can determine the processing order of the determined second encoding units (730a, 730b) in the vertical direction (730c) by dividing the first encoding unit (700) in the horizontal direction. The image decoding device (100) can determine the second encoding unit (750a, 750b, 750c, 750d) determined by dividing the first encoding unit (700) into vertical and horizontal directions, according to a predetermined order in which encoding units located in one row are processed and then encoding units located in the next row are processed (e.g., raster scan order or z scan order (750e), etc.).

[0112] According to one embodiment, the image decoding device (100) can recursively divide the encoding units. Referring to FIG. 7, the image decoding device (100) can divide the first encoding unit (700) to determine a plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d), and can recursively divide each of the determined plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d). A method of dividing multiple encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may be a method corresponding to a method of dividing the first encoding unit (700). Accordingly, the multiple encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may each be independently divided into multiple encoding units. Referring to FIG. 7, the image decoding device (100) may determine the second encoding units (710a, 710b) by dividing the first encoding unit (700) in a vertical direction, and furthermore, may determine whether to independently divide or not divide each of the second encoding units (710a, 710b).

[0113] According to one embodiment, the image decoding device (100) may divide the second encoding unit (710a) on the left side horizontally into third encoding units (720a, 720b), and may not divide the second encoding unit (710b) on the right side.

[0114] According to one embodiment, the processing order of the encoding units may be determined based on the process of dividing the encoding units. In other words, the processing order of the divided encoding units may be determined based on the processing order of the encoding units immediately before they are divided. The image decoding device (100) may determine the processing order of the third encoding units (720a, 720b), which are determined by dividing the second encoding unit (710a) on the left, independently of the second encoding unit (710b) on the right. Since the third encoding units (720a, 720b) ​​are determined by dividing the second encoding unit (710a) on the left in a horizontal direction, the third encoding units (720a, 720b) ​​may be processed in a vertical direction (720c). In addition, since the processing order of the second encoding unit (710a) on the left and the second encoding unit (710b) on the right corresponds to the horizontal direction (710c), the third encoding unit (720a, 720b) ​​included in the second encoding unit (710a) on the left can be processed in the vertical direction (720c) before the right encoding unit (710b) is processed. The above description is intended to explain the process in which the processing order of the encoding units is determined according to the encoding unit before division, and therefore should not be interpreted as being limited to the above-described embodiment, but should be interpreted as being used in various ways in which encoding units determined by division in various forms can be processed independently according to a predetermined order.

[0115] FIG. 8 illustrates a process in which, according to one embodiment, an image decoding device determines that the current encoding unit is divided into an odd number of encoding units when the encoding unit cannot be processed in a predetermined order.

[0116] According to one embodiment, the image decoding device (100) may determine that the current encoding unit is divided into an odd number of encoding units based on acquired segmentation mode information. Referring to FIG. 8, a square-shaped first encoding unit (800) may be divided into non-square-shaped second encoding units (810a, 810b), and the second encoding units (810a, 810b) may each be independently divided into third encoding units (820a, 820b, 820c, 820d, 820e). According to one embodiment, the image decoding device (100) can determine a plurality of third encoding units (820a, 820b) by dividing the left encoding unit (810a) among the second encoding units in a horizontal direction, and the right encoding unit (810b) can be divided into an odd number of third encoding units (820c, 820d, 820e).

[0117] According to one embodiment, the image decoding device (100) can determine whether there exists an odd number of divided encoding units by determining whether the third encoding units (820a, 820b, 820c, 820d, 820e) can be processed in a predetermined order. Referring to FIG. 8, the image decoding device (100) can determine the third encoding units (820a, 820b, 820c, 820d, 820e) by recursively dividing the first encoding unit (800). The video decoding device (100) can determine whether the first encoding unit (800), the second encoding unit (810a, 810b), or the third encoding unit (820a, 820b, 820c, 820d, 820e) are divided into an odd number of encoding units based on at least one of block form information and division form mode information. For example, the encoding unit located on the right among the second encoding units (810a, 810b) may be divided into an odd number of third encoding units (820c, 820d, 820e). The order in which a plurality of encoding units included in the first encoding unit (800) are processed may be a predetermined order (e.g., z-scan order (830)), and the image decoding device (100) may determine whether the right second encoding unit (810b) is divided into an odd number of determined third encoding units (820c, 820d, 820e) can be processed according to the predetermined order.

[0118] According to one embodiment, the image decoding device (100) can determine whether the third encoding unit (820a, 820b, 820c, 820d, 820e) included in the first encoding unit (800) satisfies a condition that the third encoding unit (820a, 820b, 820c, 820d, 820e) can be processed in a predetermined order, and the condition relates to whether at least one of the width and height of the second encoding unit (810a, 810b) is divided in half according to the boundary of the third encoding unit (820a, 820b, 820c, 820d, 820e). For example, the third encoding unit (820a, 820b) determined by dividing the height of the left second encoding unit (810a) in a non-square shape in half can satisfy the condition. Since the boundaries of the third encoding units (820c, 820d, 820e), which are determined by dividing the right second encoding unit (810b) into three encoding units, do not divide the width or height of the right second encoding unit (810b) in half, the third encoding units (820c, 820d, 820e) may be determined not to satisfy the condition. In the case of such non-satisfaction of the condition, the image decoding device (100) determines that there is a disconnection in the scan order, and based on the result of the determination, the right second encoding unit (810b) may be determined to be divided into an odd number of encoding units. According to one embodiment, when the image decoding device (100) is divided into an odd number of encoding units, it may place a certain restriction on the encoding unit at a certain position among the divided encoding units, and since the details of such restriction or the certain position, etc., have been described in detail through various embodiments, a detailed explanation will be omitted.

[0119] FIG. 9 illustrates a process in which an image decoding device divides a first encoding unit to determine at least one encoding unit according to one embodiment.

[0120] According to one embodiment, the image decoding device (100) can divide the first encoding unit (900) based on the segmentation shape mode information obtained through the receiver (110). The first encoding unit (900) in a square shape can be divided into four square-shaped encoding units or into a plurality of non-square-shaped encoding units. For example, referring to FIG. 9, the first encoding unit (900) is square and the segmentation shape mode information indicates that it is divided into non-square encoding units, so the image decoding device (100) can divide the first encoding unit (900) into a plurality of non-square encoding units. Specifically, when the splitting mode information indicates that the first encoding unit (900) is divided in a horizontal or vertical direction to determine an odd number of encoding units, the image decoding device (100) can divide the square-shaped first encoding unit (900) into an odd number of encoding units, such as a second encoding unit (910a, 910b, 910c) determined by dividing in a vertical direction or a second encoding unit (920a, 920b, 920c) determined by dividing in a horizontal direction.

[0121] According to one embodiment, the image decoding device (100) can determine whether the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c) included in the first encoding unit (900) satisfies a condition that the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c) can be processed in a predetermined order, and the condition relates to whether at least one of the width and height of the first encoding unit (900) is divided in half according to the boundary of the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c). Referring to FIG. 9, the boundaries of the second encoding units (910a, 910b, 910c), which are determined by dividing the square-shaped first encoding unit (900) in the vertical direction, do not divide the width of the first encoding unit (900) in half, so the first encoding unit (900) may be determined not to satisfy the condition of being processed in a predetermined order. Additionally, the boundaries of the second encoding units (920a, 920b, 920c), which are determined by dividing the square-shaped first encoding unit (900) in the horizontal direction, do not divide the width of the first encoding unit (900) in half, so the first encoding unit (900) may be determined not to satisfy the condition of being processed in a predetermined order. The image decoding device (100) determines that if these conditions are not satisfied, there is a disconnection in the scan order, and based on the result of the determination, the first encoding unit (900) may be divided into an odd number of encoding units. According to one embodiment, when the image decoding device (100) is divided into an odd number of encoding units, it may place a certain restriction on the encoding unit at a certain position among the divided encoding units. Since the details of such restriction or the certain position have been described in detail through various embodiments, a detailed explanation will be omitted.

[0122] According to one embodiment, the image decoding device (100) can divide the first encoding unit to determine various forms of encoding units.

[0123] Referring to FIG. 9, the image decoding device (100) can divide a square-shaped first encoding unit (900) and a non-square-shaped first encoding unit (930 or 950) into various types of encoding units.

[0124] FIG. 10 illustrates that, according to one embodiment, when a video decoding device divides a first encoding unit and a second encoding unit of a non-square shape determined by the division satisfies a predetermined condition, the shape in which the second encoding unit can be divided is limited.

[0125] According to one embodiment, the image decoding device (100) may decide to divide a square-shaped first encoding unit (1000) into non-square-shaped second encoding units (1010a, 1010b, 1020a, 1020b) based on division shape mode information obtained through a receiver (110). The second encoding units (1010a, 1010b, 1020a, 1020b) may be divided independently. Accordingly, the image decoding device (100) may decide to divide into a plurality of encoding units or not divide based on division shape mode information related to each of the second encoding units (1010a, 1010b, 1020a, 1020b). According to one embodiment, the image decoding device (100) may determine a third encoding unit (1012a, 1012b) by dividing the left second encoding unit (1010a), which is a non-square shape determined by dividing the first encoding unit (1000) in the vertical direction, in the horizontal direction. However, when the image decoding device (100) divides the left second encoding unit (1010a) in the horizontal direction, the right second encoding unit (1010b) may be restricted so that it cannot be divided in the same horizontal direction as the left second encoding unit (1010a). If the right second encoding unit (1010b) is divided in the same direction to determine the third encoding unit (1014a, 1014b), the left second encoding unit (1010a) and the right second encoding unit (1010b) may be divided independently in the horizontal direction to determine the third encoding unit (1012a, 1012b, 1014a, 1014b). However, this is the same result as the image decoding device (100) dividing the first encoding unit (1000) into four square-shaped second encoding units (1030a, 1030b, 1030c, 1030d) based on the division shape mode information, and this may be inefficient in terms of image decoding.

[0126] According to one embodiment, the image decoding device (100) may determine a third encoding unit (1022a, 1022b, 1024a, 1024b) by dividing a first encoding unit (1000) in a horizontal direction and a second encoding unit (1020a or 1020b) in a non-square shape in a vertical direction. However, if the image decoding device (100) divides one of the second encoding units (e.g., the upper second encoding unit (1020a)) in a vertical direction, it may restrict the other second encoding unit (e.g., the lower encoding unit (1020b)) from being divided in the same vertical direction as the upper second encoding unit (1020a) in accordance with the above-described reason.

[0127] FIG. 11 illustrates the process of a video decoder dividing square-shaped encoding units when, according to one embodiment, the divided shape mode information cannot be divided into four square-shaped encoding units.

[0128] According to one embodiment, the image decoding device (100) can determine the second encoding unit (1110a, 1110b, 1120a, 1120b, etc.) by dividing the first encoding unit (1100) based on the division shape mode information. The division shape mode information may include information on various shapes in which the encoding unit can be divided, but the information on various shapes may not include information for dividing into four square-shaped encoding units. According to this division shape mode information, the image decoding device (100) cannot divide the square-shaped first encoding unit (1100) into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d). Based on the segmented form mode information, the image decoding device (100) can determine a non-square second encoding unit (1110a, 1110b, 1120a, 1120b, etc.).

[0129] According to one embodiment, the image decoding device (100) can independently divide each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) in a non-square shape. Each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) can be divided in a predetermined order through a recursive method, and this may be a division method corresponding to the method in which the first encoding unit (1100) is divided based on division shape mode information.

[0130] For example, the image decoding device (100) can determine a square-shaped third encoding unit (1112a, 1112b) by dividing the left second encoding unit (1110a) in a horizontal direction, and can determine a square-shaped third encoding unit (1114a, 1114b) by dividing the right second encoding unit (1110b) in a horizontal direction. Furthermore, the image decoding device (100) can determine a square-shaped third encoding unit (1116a, 1116b, 1116c, 1116d) by dividing both the left second encoding unit (1110a) and the right second encoding unit (1110b) in a horizontal direction. In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).

[0131] As another example, the video decoding device (100) may determine a square-shaped third encoding unit (1122a, 1122b) by dividing the upper second encoding unit (1120a) in a vertical direction, and determine a square-shaped third encoding unit (1124a, 1124b) by dividing the lower second encoding unit (1120b) in a vertical direction. Furthermore, the video decoding device (100) may determine a square-shaped third encoding unit (1126a, 1126b, 1126a, 1126b) by dividing both the upper second encoding unit (1120a) and the lower second encoding unit (1120b) in a vertical direction. In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).

[0132] FIG. 12 illustrates that, according to one embodiment, the processing order between a plurality of encoding units may vary depending on the division process of the encoding unit.

[0133] According to one embodiment, the image decoding device (100) may divide a first encoding unit (1200) based on division shape mode information. When the block shape is square and the division shape mode information indicates that the first encoding unit (1200) is divided in at least one of the horizontal direction and the vertical direction, the image decoding device (100) may divide the first encoding unit (1200) to determine a second encoding unit (e.g., 1210a, 1210b, 1220a, 1220b, etc.). Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) in a non-square shape determined by dividing the first encoding unit (1200) only in the horizontal direction or the vertical direction may be divided independently based on the division shape mode information for each. For example, the video decoding device (100) can determine the third encoding unit (1216a, 1216b, 1216c, 1216d) by dividing the second encoding unit (1210a, 1210b) generated by dividing the first encoding unit (1200) in the vertical direction, and can determine the third encoding unit (1226a, 1226b, 1226c, 1226d) by dividing the second encoding unit (1220a, 1220b) generated by dividing the first encoding unit (1200) in the horizontal direction, respectively, in the horizontal direction. Since the process of dividing these second encoding units (1210a, 1210b, 1220a, 1220b) has been described in detail in relation to FIG. 11, a detailed explanation will be omitted.

[0134] According to one embodiment, the image decoding device (100) can process encoding units in a predetermined order. Since the characteristics of processing encoding units in a predetermined order have been described in detail in relation to FIG. 7, a detailed explanation will be omitted. Referring to FIG. 12, the image decoding device (100) can divide a square-shaped first encoding unit (1200) to determine four square-shaped third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d). According to one embodiment, the image decoding device (100) can determine the processing order of the third encoding unit (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) according to the form in which the first encoding unit (1200) is divided.

[0135] According to one embodiment, the image decoding device (100) can determine the third encoding unit (1216a, 1216b, 1216c, 1216d) by dividing the second encoding unit (1210a, 1210b) generated by dividing in the vertical direction into the horizontal direction, and the image decoding device (100) can process the third encoding unit (1216a, 1216b, 1216c, 1216d) according to the order (1217) of first processing the third encoding unit (1216a, 1216c) included in the left second encoding unit (1210a) in the vertical direction, and then processing the third encoding unit (1216b, 1216d) included in the right second encoding unit (1210b) in the vertical direction.

[0136] According to one embodiment, the image decoding device (100) can determine the third encoding unit (1226a, 1226b, 1226c, 1226d) by dividing the second encoding unit (1220a, 1220b) generated by dividing in the horizontal direction into the vertical direction, and the image decoding device (100) can process the third encoding unit (1226a, 1226b, 1226c, 1226d) according to the order (1227) of first processing the third encoding unit (1226a, 1226b) included in the upper second encoding unit (1220a) in the horizontal direction, and then processing the third encoding unit (1226c, 1226d) included in the lower second encoding unit (1220b) in the horizontal direction.

[0137] Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) are each divided to determine the square-shaped third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d). The second encoding unit (1210a, 1210b) determined by dividing in the vertical direction and the second encoding unit (1220a, 1220b) determined by dividing in the horizontal direction are divided into different forms, but according to the third encoding unit (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) determined thereafter, the result is that the first encoding unit (1200) is divided into encoding units of the same form. Accordingly, the image decoding device (100) recursively divides the encoding unit through different processes based on the division form mode information, so that even if the encoding units of the same form are determined as a result, the multiple encoding units determined in the same form can be processed in different orders.

[0138] FIG. 13 illustrates a process in which, according to one embodiment, a encoding unit is recursively divided to determine a plurality of encoding units, and the depth of the encoding unit is determined as the shape and size of the encoding unit change.

[0139] According to one embodiment, the image decoding device (100) may determine the depth of the encoding unit according to a predetermined standard. For example, the predetermined standard may be the length of the long side of the encoding unit. The image decoding device (100) may determine that if the length of the long side of the current encoding unit is divided by 2n (n>0) times the length of the long side of the encoding unit before division, the depth of the current encoding unit is increased by n compared to the depth of the encoding unit before division. In the following, the encoding unit with increased depth is expressed as a lower depth encoding unit.

[0140] Referring to FIG. 13, according to one embodiment, based on block shape information indicating that it is a square shape (for example, the block shape information may indicate '0: SQUARE'), an image decoding device (100) can determine a second encoding unit (1302), a third encoding unit (1304), etc. of a lower depth by dividing a first encoding unit (1300) that is square in shape. If the size of the first encoding unit (1300) that is square in shape is 2Nx2N, the second encoding unit (1302), which is determined by dividing the width and height of the first encoding unit (1300) by half, may have a size of NxN. Furthermore, the third encoding unit (1304), which is determined by dividing the width and height of the second encoding unit (1302) by half, may have a size of N / 2xN / 2. In this case, the width and height of the third encoding unit (1304) correspond to 1 / 4 times the width and height of the first encoding unit (1300). When the depth of the first encoding unit (1300) is D, the depth of the second encoding unit (1302), which is 1 / 2 times the width and height of the first encoding unit (1300), may be D+1, and the depth of the third encoding unit (1304), which is 1 / 4 times the width and height of the first encoding unit (1300), may be D+2.

[0141] According to one embodiment, based on block shape information representing a non-square shape (for example, the block shape information may represent '1: NS_VER' indicating that the height is longer than the width, or '2: NS_HOR' indicating that the width is longer than the height), the image decoding device (100) may divide a first encoding unit (1310 or 1320) that is a non-square shape to determine a second encoding unit (1312 or 1322), a third encoding unit (1314 or 1324), etc. of a lower depth.

[0142] The image decoding device (100) can determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by dividing at least one of the width and height of a first encoding unit (1310) of size Nx2N. That is, the image decoding device (100) can determine a second encoding unit (1302) of size NxN or a second encoding unit (1322) of size NxN / 2 by dividing the first encoding unit (1310) in a horizontal direction, and can also determine a second encoding unit (1312) of size N / 2xN by dividing it in a horizontal direction and a vertical direction.

[0143] According to one embodiment, the image decoding device (100) may determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by dividing at least one of the width and height of a first encoding unit (1320) of size 2NxN. That is, the image decoding device (100) may determine a second encoding unit (1302) of size NxN or a second encoding unit (1312) of size N / 2xN by dividing the first encoding unit (1320) in the vertical direction, and may determine a second encoding unit (1322) of size NxN / 2 by dividing it in the horizontal and vertical directions.

[0144] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1302) of size NxN. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 by dividing the second encoding unit (1302) in a vertical direction and a horizontal direction, or determine a third encoding unit (1314) of size N / 4xN / 2, or determine a third encoding unit (1324) of size N / 2xN / 4.

[0145] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1312) of size N / 2xN. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 or a third encoding unit (1324) of size N / 2xN / 4 by dividing the second encoding unit (1312) in a horizontal direction, or determine a third encoding unit (1314) of size N / 4xN / 2 by dividing it in a vertical direction and a horizontal direction.

[0146] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1322) of size NxN / 2. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 or a third encoding unit (1314) of size N / 4xN / 2 by dividing the second encoding unit (1322) in the vertical direction, or determine a third encoding unit (1324) of size N / 2xN / 4 by dividing it in the vertical and horizontal directions.

[0147] According to one embodiment, the image decoding device (100) may divide square-shaped encoding units (e.g., 1300, 1302, 1304) in a horizontal or vertical direction. For example, a first encoding unit (1300) of size 2Nx2N may be divided in a vertical direction to determine a first encoding unit (1310) of size Nx2N, or divided in a horizontal direction to determine a first encoding unit (1320) of size 2NxN. According to one embodiment, when the depth is determined based on the length of the longest side of the encoding unit, the depth of the encoding unit determined by dividing the first encoding unit (1300) of size 2Nx2N in a horizontal or vertical direction may be the same as the depth of the first encoding unit (1300).

[0148] According to one embodiment, the width and height of the third encoding unit (1314 or 1324) may correspond to 1 / 4 times the width and height of the first encoding unit (1310 or 1320). If the depth of the first encoding unit (1310 or 1320) is D, the depth of the second encoding unit (1312 or 1322), which is 1 / 2 times the width and height of the first encoding unit (1310 or 1320), may be D+1, and the depth of the third encoding unit (1314 or 1324), which is 1 / 4 times the width and height of the first encoding unit (1310 or 1320), may be D+2.

[0149] FIG. 14 illustrates a depth and part index (hereinafter PID) for distinguishing between coding units that can be determined according to the shape and size of the coding units according to one embodiment.

[0150] According to one embodiment, the image decoding device (100) can determine various shapes of second encoding units by dividing a square-shaped first encoding unit (1400). Referring to FIG. 14, the image decoding device (100) can determine second encoding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) by dividing the first encoding unit (1400) in at least one of a vertical direction and a horizontal direction according to the division shape mode information. That is, the image decoding device (100) can determine the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) based on the segmented form mode information for the first encoding unit (1400).

[0151] According to one embodiment, the depth of the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d), which is determined according to the segmented shape mode information for the first encoding unit (1400) in a square shape, can be determined based on the length of the longer side. For example, since the length of one side of the first encoding unit (1400) in a square shape and the length of the longer side of the second encoding unit (1402a, 1402b, 1404a, 1404b) in a non-square shape are the same, the depth of the first encoding unit (1400) and the second encoding unit (1402a, 1402b, 1404a, 1404b) in a non-square shape can be considered to be the same as D. In contrast, when the video decoding device (100) divides the first encoding unit (1400) into four square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) based on the division shape mode information, since the length of one side of the square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) is half the length of one side of the first encoding unit (1400), the depth of the second encoding units (1406a, 1406b, 1406c, 1406d) may be a depth of D+1, which is one depth lower than the depth D of the first encoding unit (1400).

[0152] According to one embodiment, the image decoding device (100) may divide a first encoding unit (1410), in which the height is longer than the width, into a plurality of second encoding units (1412a, 1412b, 1414a, 1414b, 1414c) by dividing it in a horizontal direction according to the division shape mode information. According to one embodiment, the image decoding device (100) may divide a first encoding unit (1420), in which the width is longer than the height, into a plurality of second encoding units (1422a, 1422b, 1424a, 1424b, 1424c) by dividing it in a vertical direction according to the division shape mode information.

[0153] According to one embodiment, a second encoding unit (1412a, 1412b, 1414a, 1414b, 1414c, 1422a, 1422b, 1424a, 1424b, 1424c) determined according to the segmented shape mode information for a first encoding unit (1410 or 1420) of a non-square shape may have its depth determined based on the length of the longer side. For example, since the length of one side of the square-shaped second encoding unit (1412a, 1412b) is half the length of one side of the non-square-shaped first encoding unit (1410) in which the height is longer than the width, the depth of the square-shaped second encoding unit (1412a, 1412b) is D+1, which is one depth lower than the depth D of the non-square-shaped first encoding unit (1410).

[0154] Furthermore, the image decoding device (100) may divide a first encoding unit (1410) in a non-square shape into an odd number of second encoding units (1414a, 1414b, 1414c) based on the division shape mode information. The odd number of second encoding units (1414a, 1414b, 1414c) may include a second encoding unit (1414a, 1414c) in a non-square shape and a second encoding unit (1414b) in a square shape. In this case, since the length of the longer side of the non-square second encoding unit (1414a, 1414c) and the length of one side of the square second encoding unit (1414b) are half the length of one side of the first encoding unit (1410), the depth of the second encoding unit (1414a, 1414b, 1414c) may be a depth of D+1, which is one depth lower than the depth D of the first encoding unit (1410). The image decoding device (100) may determine the depth of the encoding units associated with the non-square first encoding unit (1420), in a manner corresponding to the above method of determining the depth of the encoding units associated with the first encoding unit (1410).

[0155] According to one embodiment, when determining an index (PID) for distinguishing divided encoding units, the video decoding device (100) may determine the index based on the size ratio between the encoding units when the odd number of divided encoding units are not of the same size. Referring to FIG. 14, the encoding unit (1414b) located in the middle among the odd number of divided encoding units (1414a, 1414b, 1414c) may have the same width as the other encoding units (1414a, 1414c) but may have twice the height of the other encoding units (1414a, 1414c). That is, in this case, the encoding unit (1414b) located in the middle may include two of the other encoding units (1414a, 1414c). Accordingly, if the index (PID) of the encoding unit (1414b) located in the middle according to the scan order is 1, the encoding unit (1414c) located in the next order may have an index of 3, which is an increase of 2. That is, there may be a discontinuity in the index values. According to one embodiment, the image decoding device (100) may determine whether the encoding units divided into an odd number are not of the same size based on whether there is a discontinuity in the index for distinguishing between these divided encoding units.

[0156] According to one embodiment, the image decoding device (100) may determine whether a plurality of encoding units determined by dividing from the current encoding unit are divided into a specific division form based on the value of an index for distinguishing the plurality of encoding units. Referring to FIG. 14, the image decoding device (100) may divide a first encoding unit (1410) in the shape of a rectangle whose height is greater than its width to determine an even number of encoding units (1412a, 1412b) or an odd number of encoding units (1414a, 1414b, 1414c). The image decoding device (100) may use an index (PID) representing each encoding unit to distinguish each of the plurality of encoding units. According to one embodiment, the PID may be obtained from a sample at a predetermined position of each encoding unit (e.g., the upper left sample).

[0157] According to one embodiment, the image decoding device (100) can determine a coding unit at a predetermined position among the coding units determined by division using an index for distinguishing the coding units. According to one embodiment, if the division shape mode information for a first coding unit (1410) in the form of a rectangle whose height is longer than its width indicates that it is divided into three coding units, the image decoding device (100) can divide the first coding unit (1410) into three coding units (1414a, 1414b, 1414c). The image decoding device (100) can assign an index to each of the three coding units (1414a, 1414b, 1414c). The image decoding device (100) can compare the indices for each coding unit to determine the middle coding unit among the odd number of divided coding units. The image decoding device (100) may determine a encoding unit (1414b) having an index corresponding to the middle value among the indices based on the indices of the encoding units, as the encoding unit at the middle position among the encoding units determined by dividing the first encoding unit (1410). According to one embodiment, when determining an index for distinguishing the divided encoding units, the image decoding device (100) may determine the index based on the size ratio between the encoding units if the encoding units are not of the same size. Referring to FIG. 14, the encoding unit (1414b) generated by dividing the first encoding unit (1410) may have the same width as the other encoding units (1414a, 1414c) but may have a height twice that of the other encoding units (1414a, 1414c). In this case, if the index (PID) of the encoding unit (1414b) located in the middle is 1, the encoding unit (1414c) located in the next order may have an index of 3, which is increased by 2.In cases where the index increases uniformly but the rate of increase changes, such as in this case, the image decoding device (100) may determine that the current encoding unit is divided into a plurality of encoding units, including encoding units having different sizes from other encoding units. In one embodiment, if the division type mode information indicates that the current encoding unit is divided into an odd number of encoding units, the image decoding device (100) may divide the current encoding unit in such a way that the encoding unit at a predetermined position among the odd number of encoding units (e.g., the middle encoding unit) has a different size from other encoding units. In this case, the image decoding device (100) may determine the middle encoding unit having a different size by using an index (PID) for the encoding unit. However, the aforementioned index, the size or position of the encoding unit at a predetermined position to be determined, is specific for the purpose of explaining one embodiment and should not be interpreted as being limited thereto, and should be interpreted as allowing various indices, positions, and sizes of encoding units to be used.

[0158] According to one embodiment, the image decoding device (100) may use a predetermined data unit in which recursive division of the encoding unit begins.

[0159] FIG. 15 illustrates that a plurality of encoding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.

[0160] According to one embodiment, a predetermined data unit may be defined as a data unit in which the encoding unit begins to recursively divide using the division form mode information. That is, it may correspond to the highest depth encoding unit used in the process of determining multiple encoding units that divide the current picture. For convenience of explanation, such a predetermined data unit will be referred to as a reference data unit below.

[0161] According to one embodiment, the reference data unit may have a predetermined size and shape. According to one embodiment, the reference encoding unit may include MxN samples. Here, M and N may be the same and may be integers expressed as powers of 2. That is, the reference data unit may have a square or non-square shape and may subsequently be divided into an integer number of encoding units.

[0162] According to one embodiment, the image decoding device (100) can divide the current picture into a plurality of reference data units. According to one embodiment, the image decoding device (100) can divide the current picture into a plurality of reference data units using division form mode information for each reference data unit. This division process of reference data units may correspond to a division process using a quad-tree structure.

[0163] According to one embodiment, the image decoding device (100) can predetermine the minimum size that a reference data unit included in the current picture may have. Accordingly, the image decoding device (100) can determine reference data units of various sizes having a size greater than or equal to the minimum size, and can determine at least one encoding unit using segmentation form mode information based on the determined reference data unit.

[0164] Referring to FIG. 15, the image decoding device (100) may use a square-shaped reference encoding unit (1500) or a non-square-shaped reference encoding unit (1502). According to one embodiment, the shape and size of the reference encoding unit may be determined according to various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum encoding unit, etc.) that may include at least one reference encoding unit.

[0165] According to one embodiment, the receiver (110) of the image decoding device (100) may obtain at least one of information regarding the shape of the reference encoding unit and information regarding the size of the reference encoding unit from the bitstream for each of the various data units. The process of determining at least one encoding unit included in the square-shaped reference encoding unit (1500) has been described in detail through the process of dividing the current encoding unit (300) of FIG. 3, and the process of determining at least one encoding unit included in the non-square-shaped reference encoding unit (1502) has been described in detail through the process of dividing the current encoding unit (400 or 450) of FIG. 4, so a detailed explanation is omitted.

[0166] According to one embodiment, the image decoding device (100) may use an index to identify the size and shape of a reference encoding unit in order to determine the size and shape of a reference encoding unit according to a portion of data units that are predetermined based on a predetermined condition. That is, the receiving unit (110) may obtain only an index for identifying the size and shape of a reference encoding unit for each data unit (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum encoding unit, etc.) among the various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum encoding unit, etc.) that satisfies a predetermined condition (e.g., a data unit having a size smaller than or equal to a slice) from the bitstream. By using the index, the image decoding device (100) can determine the size and shape of a reference data unit for each data unit that satisfies the predetermined condition. When information regarding the form of the reference encoding unit and information regarding the size of the reference encoding unit are obtained from the bitstream for each data unit of a relatively small size and used, the utilization efficiency of the bitstream may be poor; therefore, instead of directly obtaining information regarding the form of the reference encoding unit and information regarding the size of the reference encoding unit, only the index may be obtained and used. In this case, at least one of the size and form of the reference encoding unit corresponding to the index representing the size and form of the reference encoding unit may be predetermined. That is, the image decoding device (100) can determine at least one of the size and form of the reference encoding unit included in the data unit that serves as the basis for obtaining the index by selecting at least one of the predetermined size and form of the reference encoding unit according to the index.

[0167] According to one embodiment, the image decoding device (100) may utilize at least one reference encoding unit included in one maximum encoding unit. That is, the maximum encoding unit that divides the image may include at least one reference encoding unit, and the encoding unit may be determined through a recursive division process of each reference encoding unit. According to one embodiment, at least one of the width and height of the maximum encoding unit may correspond to an integer multiple of at least one of the width and height of the reference encoding unit. According to one embodiment, the size of the reference encoding unit may be the size obtained by dividing the maximum encoding unit n times according to a quad tree structure. That is, the image decoding device (100) may determine the reference encoding unit by dividing the maximum encoding unit n times according to a quad tree structure, and according to various embodiments, the reference encoding unit may be divided based on at least one of block form information and division form mode information.

[0168] According to one embodiment, the image decoding device (100) may obtain and use block form information indicating the form of the current encoding unit or division form mode information indicating a method of dividing the current encoding unit from a bitstream. The division form mode information may be included in bitstreams associated with various data units. For example, the image decoding device (100) may use division form mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. Furthermore, the image decoding device (100) may obtain and use syntax elements corresponding to the block form information or division form mode information from the bitstream for each maximum encoding unit, reference encoding unit, and processing block.

[0169] A method for determining a division rule according to one embodiment of the present disclosure will be described in detail below.

[0170] The image decoding device (100) can determine the segmentation rule of the image. The segmentation rule may be predetermined between the image decoding device (100) and the image encoding device (2200). The image decoding device (100) can determine the segmentation rule of the image based on information obtained from a bitstream. The image decoding device (100) can determine the segmentation rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. The image decoding device (100) can determine the segmentation rule differently depending on the frame, slice, tile, temporal layer, maximum encoding unit, or encoding unit.

[0171] The image decoding device (100) can determine a partitioning rule based on the block shape of the encoding unit. The block shape may include the size, shape, ratio of width and height, and orientation of the encoding unit. The image decoding device (100) may predetermine that it will determine a partitioning rule based on the block shape of the encoding unit. However, it is not limited thereto. The image decoding device (100) can determine a partitioning rule based on information obtained from a received bitstream.

[0172] The shape of the encoding unit may include square and non-square. If the width and height of the encoding unit are the same, the image decoder (100) may determine the shape of the encoding unit as square. Additionally, if the width and height of the encoding unit are not the same, the image decoder (100) may determine the shape of the encoding unit as non-square.

[0173] The size of the encoding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the encoding unit may be classified according to the length of the long side, the length of the short side, or the width of the encoding unit. The image decoding device (100) may apply the same partitioning rule to encoding units classified into the same group. For example, the image decoding device (100) may classify encoding units having the same long side length into the same size. Additionally, the image decoding device (100) may apply the same partitioning rule to encoding units having the same long side length.

[0174] The ratio of width to height of a encoding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, or 1:32, etc. Additionally, the direction of the encoding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the width of the encoding unit is longer than the height. The vertical direction may indicate a case where the width of the encoding unit is shorter than the height.

[0175] The image decoder (100) can adaptively determine a splitting rule based on the size of the encoding unit. The image decoder (100) can determine different acceptable splitting mode types based on the size of the encoding unit. For example, the image decoder (100) can determine whether splitting is allowed based on the size of the encoding unit. The image decoder (100) can determine the splitting direction according to the size of the encoding unit. The image decoder (100) can determine an acceptable splitting type according to the size of the encoding unit.

[0176] Determining the division rule based on the size of the encoding unit may be a division rule predetermined between the image decoding devices (100). Additionally, the image decoding device (100) may determine the division rule based on information obtained from the bitstream.

[0177] The image decoder (100) can adaptively determine a partitioning rule based on the position of the encoding unit. The image decoder (100) can adaptively determine a partitioning rule based on the position occupied by the encoding unit in the image.

[0178] Additionally, the video decoding device (100) can determine a splitting rule so that encoding units generated by different splitting paths do not have the same block shape. However, this is not limited thereto, and encoding units generated by different splitting paths may have the same block shape. Encoding units generated by different splitting paths may have different decoding processing orders. Since the decoding processing order has been explained together with FIG. 12, a detailed explanation is omitted.

[0179] Figure 16 is a block diagram of an image encoding and decoding system.

[0180] The encoder (1610) of the video encoding and decoding system (1600) transmits an encoded bitstream of the video, and the decoder (1650) receives the bitstream and decodes it to output a restored video. Here, the decoder (1650) may have a configuration similar to that of the video decoding device (100).

[0181] In the encoding unit (1610), the inter-prediction encoding unit (1605) generates motion information of the current block pointing to a reference block of a reference picture temporally adjacent to the current picture when the prediction mode of the current block is the inter-prediction mode. The inter-prediction encoding unit (1605) can determine prediction samples of the current block using samples of the reference blocks. The intra-prediction encoding unit (1610) can determine intra-prediction information indicating the direction in which neighbor samples similar to the current block are located or the method of determining prediction samples so that the prediction samples of the current block can be determined using neighbor samples spatially adjacent to the current block. The inter-prediction encoding unit (1605) can determine reference samples to be used for prediction of the current block from among the first restored samples stored in the DPB (Decoded Picture Buffer) (1648).

[0182] The conversion unit (1620) performs a conversion on the residual sample values ​​obtained by subtracting the prediction samples generated by the inter-prediction encoding unit (1605) or the intra-prediction encoding unit (1610) from the original sample of the current block, and outputs conversion coefficients. The quantization unit (1625) quantizes the conversion coefficients output from the conversion unit (1620) and outputs the quantized conversion coefficients. The entropy encoding unit (1630) can encode the quantized conversion coefficients into residual syntax elements including level values ​​and output them in the form of a bitstream.

[0183] The quantized conversion coefficients output from the quantization unit (1625) can be inversely quantized and inversely converted through the inverse quantization unit (1633) and inverse conversion unit (1635) to generate residual sample values ​​again.

[0184] In the adder (1615), the residual sample values ​​and the predicted sample values ​​are combined to output the restored sample values. The post-restoration filtering unit (1640) performs post-restoration filtering on the restored samples, and the restored sample values ​​updated through post-restoration filtering can be used as reference sample values ​​for intra prediction to be performed in the intra prediction unit (1610). The post-restoration filtering unit (1640) can perform Hadamard transformation region filtering or bilateral filtering on the restored sample values.

[0185] The in-loop filtering unit (1645) can perform at least one of deblocking filtering and adaptive loop filtering on the restored samples updated through post-restoration filtering. The restored sample values ​​updated through the filtering of the in-loop filtering unit (1645) can be stored in the DPB (1648) and can be used as reference sample values ​​for inter prediction to be performed in the inter prediction unit (1605).

[0186] The entropy decoding unit (1655) of the decoder (1650) can perform entropy decoding on the received bitstream to parse residual syntax elements containing level values. Quantized transformation coefficients can be recovered from the residual syntax elements. The inverse quantization unit (1660) can perform inverse quantization on the quantized transformation coefficients to output transformation coefficients, and the inverse transformation unit (1665) can perform inverse transformation on the transformation coefficients to output residual sample values.

[0187] The inter-prediction encoding unit (1670) of the decoder (1650) can determine a reference picture temporally adjacent to the current picture using the motion information of the current block parsed by the entropy decoder (1655), and can determine a reference block within the reference picture. The inter-prediction encoding unit (1670) can determine prediction samples of the current block using samples of the reference blocks. The intra-prediction encoding unit (1675) of the decoder (1650) can determine reference samples spatially adjacent to the current block using intra-prediction information using the motion information of the current block parsed by the entropy decoder (1655), and can determine prediction samples of the current block using the determined neighbor samples. The inter-prediction encoding unit (1670) can determine reference samples to be used for prediction of the current block from among the previously restored samples stored in the DPB (Decoded Picture Buffer) (1690).

[0188] In the adder (1695) of the decoder (1650), the residual sample values ​​and the predicted sample values ​​are combined to output the restored sample value of the current block. The post-restoration filtering unit (1680) of the decoder (1650) can perform Hadamard transformation region filtering or bilateral filtering on the restored sample values. The restored sample values ​​updated through the filtering of the post-restoration filtering unit (1680) can be used as reference sample values ​​for intra prediction to be performed in the intra prediction unit (1675).

[0189] The in-loop filtering unit (1685) of the decoder (1650) can perform at least one of deblocking filtering and adaptive loop filtering using the restored samples updated through post-restoration filtering. The restored sample values ​​updated through the filtering of the in-loop filtering unit (1685) are stored in the DPB (1690) and can be used as reference sample values ​​for inter prediction to be performed in the inter prediction unit (1670).

[0190] A video encoding method and decoding method, a video encoding device and a decoding device according to one embodiment propose a method for performing quantization or inverse quantization based on a data unit determined in the video encoding device and video decoding device described above with reference to FIGS. 1 to 16. Hereinafter, a video encoding method and device or a video decoding method and device that performs quantization or inverse quantization by determining a quantization parameter (QP) according to one embodiment disclosed in this specification with reference to FIGS. 17 to 40 is described in detail.

[0191] FIG. 17 illustrates a block diagram of a video decoding device according to one embodiment.

[0192] A video decoding device (1700) according to one embodiment includes an acquisition unit (1710) and a decoding unit (1720). The video decoding device (1700) acquires a bitstream generated as a result of encoding an image, identifies the locations of blocks divided from a picture based on information included in the bitstream, and can decode blocks such as a maximum encoding unit and an encoding unit.

[0193] The video decoding device (1700) may include one or more data storage units (not shown) in which input / output data of the acquisition unit (1710) and the decoding unit (1720) is stored. The video decoding device (1700) may also include a memory control unit (not shown) that controls the data input / output of the data storage unit (not shown).

[0194] The video decoding device (1700) can perform video decoding operations including prediction by operating in conjunction with an internally mounted video decoding processor or an external video decoding processor to restore a video through video decoding. In one embodiment, the internal video decoding processor of the video decoding device (1700) may implement basic video decoding operations by including a video decoding processing module not only in a separate processor but also in a central processing unit or a graphics processing unit.

[0195] The video decoding device (1700) may be included in the aforementioned image decoding device (100). For example, the acquisition unit (1710) and the decoding unit (1720) may correspond to the decoding unit (120) of the image decoding device (100). The video decoding device (1700) may correspond to the decoder (1650) of the aforementioned image encoding and decoding system with reference to FIG. 16. For example, the decoding unit (1720) may include the function of the inverse quantization unit (1633) of the decoder (1650).

[0196] A video decoder (1700) receives a bitstream generated as a result of encoding a video. The bitstream may contain information about the current picture. The picture may contain one or more maximum encoding units. The video decoder (1700) may determine the location of the current block within the picture based on information obtained from the bitstream. The current block is a block created by dividing the picture according to a tree structure, and may correspond, for example, to a maximum encoding unit or an encoding unit. The video decoder (1700) may determine whether the current block will be further divided into lower-depth lower blocks and may determine the tree structure of the current block. The lower depth may be determined by increasing the number of divisions from the current block to the lower block relative to the current depth of the current block. Among the blocks forming the tree structure included in the current picture, the blocks located at the tree leaves are blocks that are no longer divided. Accordingly, the video decoding device (1700) can decode blocks by performing inverse quantization, inverse transformation, and prediction on one or more blocks that are no longer divided.

[0197] The video decoder (1700) can generate predicted samples of the current block by performing a prediction on the current block. The video decoder (1700) can generate residual samples of the current block by performing an inverse transformation on the current block. The restoration unit (1730) can generate restored samples of the current block using the predicted samples of the current block and the residual samples of the current block. The video decoder (1700) can restore the current picture by restoring samples for each block.

[0198] For example, when the prediction mode of the current block is an intra mode, the video decoder (1700) can determine a reference sample among samples of spatial neighbor blocks located in the intra prediction direction using the intra prediction information of the current block, and determine prediction samples corresponding to the current block using the reference sample.

[0199] For example, if the prediction mode of the current block is inter-mode, the video decoder (1700) can restore the current block using the motion vector of the current block. The video decoder (1700) can determine a reference block within a reference picture using the motion vector of the current block, and determine prediction samples corresponding to the current block from the reference samples included in the reference block. The video decoder (1700) can restore the transformation coefficients using the transformation coefficient levels obtained from the bitstream, and restore residual samples by performing inverse quantization and inverse transformation on the transformation coefficients. The video decoder (1700) can determine the restored samples of the current block by combining the prediction samples corresponding to the current block and the residual samples.

[0200] If the current block is predicted to be in skip mode, the video decoder (1700) does not need to parse the transform coefficients of the current block from the bitstream. The video decoder (1700) can determine the restored samples of the current block by using the predicted samples of the current block as they are.

[0201] A video decoder (1700) according to one embodiment uses a quantization parameter (QP) to perform inverse quantization. The QP is set per encoding unit, and one QP may be applied to the transform coefficients included in the encoding unit. A picture may include one or more slices, and one slice may include one or more encoding units. To determine the QP per encoding unit, the video decoder (1700) may obtain information necessary to determine the QP per encoding unit, per encoding unit, per slice, or per picture from a bitstream.

[0202] According to one embodiment, the acquisition unit (1710) can acquire information necessary to determine a QP for each encoding unit from the encoding unit-related bitstream syntax. The acquisition unit (1710) can acquire information necessary to determine a QP for each slice from the slice header syntax. The acquisition unit (1710) can acquire information necessary to determine a QP for each picture from the picture header syntax.

[0203] First, the video decoder (1700) can determine at the picture parameter set level whether to acquire QP difference values ​​per picture or per slice.

[0204] According to one embodiment, the acquisition unit (1710) can acquire an initial QP value to be applied to the current picture from a picture parameter set. Additionally, the acquisition unit (1710) can acquire picture header QP difference value information from the picture parameter set, which indicates whether QP difference value information exists in the picture header of the current picture. If the picture header QP difference value information indicates that QP difference value information exists in the picture header, the acquisition unit (1710) can acquire a first QP difference value for the current picture from the picture header. If the picture header QP difference value information indicates that QP difference value information does not exist in the picture header, the acquisition unit (1710) can acquire a second QP difference value for the current slice from the slice header of the current slice included in the current picture.

[0205] According to one embodiment, the decoding unit (1720) can determine a QP for an encoding unit included in the current picture using a QP initial value and a first QP difference value when picture header QP difference value information indicates that QP difference value information exists in the picture header. The decoding unit (1720) can perform inverse quantization on the encoding units included in the current picture using the QP with the first QP difference value.

[0206] According to one embodiment, the decoding unit (1720) can determine a QP for an encoding unit included in the current slice using a QP initial value and a second QP difference value when the picture header QP difference value information indicates that there is no QP difference value information in the picture header. The decoding unit (1720) can perform inverse quantization on the encoding units included in the current slice using the QP determined using the second QP difference value.

[0207] Referring to FIG. 18 below, the process of a video decoder (1700) acquiring QP difference value information by picture or by slice and performing inverse quantization by encoding unit is described in detail.

[0208] FIG. 18 illustrates a flowchart of a video decoding method according to one embodiment.

[0209] In step 1810, the acquisition unit (1710) can acquire QP initial value and picture header QP difference value information to be applied to the current picture from the picture parameter set. According to one embodiment, the picture header QP difference value information may indicate whether QP difference value information exists in the picture header of the current picture.

[0210] In step 1820, if the picture header QP difference value information indicates that there is QP difference value information in the picture header of the current picture, the acquisition unit (1810) can acquire a first QP difference value for the current picture from the picture header.

[0211] In step 1830, the decoding unit (1820) can determine the QP for the encoding unit included in the current picture using the QP initial value and the first QP difference value.

[0212] In step 1840, the decoding unit (1820) can obtain the conversion coefficient of the encoding unit by performing inverse quantization on the encoding unit using the QP determined using the first QP difference value. That is, inverse quantization can be performed on the encoding units included in the current picture using the QP determined using the first QP difference value.

[0213] In step 1850, the decoding unit (1820) can restore the encoding unit using the conversion coefficients of the encoding unit obtained in step 1840. The decoding unit (1820) can obtain residual samples by performing an inverse conversion on the conversion coefficients and determine the restored samples of the encoding unit using the residual samples.

[0214] According to one embodiment, if the picture header QP difference value information indicates that there is no QP difference value information in the picture header, the acquisition unit (1710) can obtain a second QP difference value for the current slice from the slice header of the current slice included in the current picture. The decoding unit (1720) can determine a QP for a coding unit included in the current slice using the QP initial value and the second QP difference value. The decoding unit (1720) can obtain conversion coefficients of the coding unit by performing inverse quantization on the coding unit using the QP determined using the second QP difference value. The decoding unit (1720) can restore the coding unit using the conversion coefficients. That is, inverse quantization can be performed on the coding units included in the current slice using the QP determined using the second QP difference value.

[0215] In step 1820, if the picture header QP difference value information indicates that QP difference value information exists in the picture header of the current picture, the acquisition unit (1810) can obtain the first QP difference value for the luminance component of the current picture from the picture header. The decoding unit (1820) can determine the QP for the luminance component of the slices included in the current picture by adding the QP initial value and the first QP difference value for the luminance component. The decoding unit (1820) can determine the QP of the encoding unit included in the slices included in the current picture that are included in the current picture by using the QP for the luminance component of the slices.

[0216] In step 1820, the acquisition unit (1710) can acquire a QP difference value for the encoding unit from the bitstream. The decoding unit (1820) can determine the QP for the luminance component of the encoding unit using the QP for the luminance component of the slices and the QP difference value for the encoding unit. The decoding unit (1820) can perform inverse quantization on the transform coefficients included in the encoding unit using the QP for the encoding unit. The residual samples of the encoding unit can be decoded by performing an inverse transform on the inversely quantized transform coefficients.

[0217] According to another embodiment, the acquisition unit (1710) may not acquire a QP difference value for the encoding unit from the bitstream. In this case, the decoding unit (1810) may determine the QP for the luma component of the encoding unit using the predicted QP value for the encoding unit.

[0218] According to one embodiment, if the picture header QP difference value information indicates that there is no QP difference value information in the picture header of the current picture, the acquisition unit (1810) can acquire a second QP difference value for the luminance component of the current slice from the slice header. The decoding unit (1820) can determine the QP for the luminance component of the current slice by adding the QP initial value and the second QP difference value for the luminance component. The decoding unit (1820) can determine the QP of the encoding unit included in the current slice using the QP for the luminance component of the current slice. The decoding unit (1820) can perform inverse quantization on the transform coefficients included in the encoding unit using the QP for the encoding unit. The residual samples of the encoding unit can be decoded by performing an inverse transform on the inversely quantized transform coefficients. If the picture header QP difference value information indicates that there is no QP difference value information in the picture header of the current picture, the acquisition unit (1810) can acquire the QP difference value for the encoding unit included in the current slice from the bitstream. The decoding unit (1820) can determine the QP for the luma component of the current encoding unit included in the current slice using the QP difference value for the encoding unit.

[0219] In the case where the picture header QP difference value information indicates that there is no QP difference value information in the picture header of the current picture, the acquisition unit (1810) can acquire the Cb QP difference value for the Cb chroma component of the current slice and the Cr QP difference value for the Cr chroma component of the current slice from the slice header. The decoding unit (1820) can determine the Cb QP for the Cb chroma component of the current coding unit by updating the QP for the Cb chroma component of the current coding unit included in the current slice using the Cb QP difference value for the Cb chroma component of the current slice. The decoding unit (1820) can determine the Cr QP for the Cr chroma component of the current coding unit by updating the QP for the Cr chroma component of the current coding unit included in the current slice using the Cr QP difference value for the Cr chroma component of the current slice.

[0220] FIG. 19 illustrates a block diagram of a video encoding device according to one embodiment.

[0221] Referring to FIG. 19, a video encoding device (1900) according to one embodiment may include a quantization unit (1910) and an information encoding unit (1920).

[0222] A video encoding device (1900) according to one embodiment may include a central processor (not shown) that controls a quantization unit (1910) and an information encoding unit (1920). Alternatively, the quantization unit (1910) and the information encoding unit (1920) may each be operated by their own processors (not shown), and the video encoding device (1900) may be operated as a whole as the processors (not shown) operate organically with each other. Alternatively, the quantization unit (1910) and the information encoding unit (1920) may be controlled according to the control of an external processor (not shown) of the video encoding device (1900).

[0223] The video encoding device (1900) may include one or more data storage units (not shown) in which input / output data of the quantization unit (1910) and the information encoding unit (1920) is stored. The video encoding device (1900) may also include a memory control unit (not shown) that controls the data input / output of the data storage unit (not shown).

[0224] The video encoding device (1900) can perform video encoding operations, including prediction, by operating in conjunction with an internally mounted video encoding processor or an external video encoding processor for video encoding. The internal video encoding processor of the video encoding device (1900) according to one embodiment may implement basic video encoding operations by including a video encoding processing module not only in a separate processor but also in a central processing unit or a graphics processing unit.

[0225] The video encoding device (1900) may correspond to the encoder (1600) of the image encoding and decoding system described above with reference to FIG. 16. For example, the information encoding unit (1920) may correspond to the entropy encoding unit (1630) of the encoder (1600). The quantization unit (1910) may correspond to the quantization unit (1625) of the encoder (1600).

[0226] A video encoding device (1900) according to one embodiment can divide a picture into a plurality of maximum encoding units and encode each maximum encoding unit by dividing it into blocks of various sizes and shapes.

[0227] For example, when the prediction mode of the current block is an intra mode, the video encoding device (1900) can determine a reference sample among the samples of spatial neighbor blocks located in the intra prediction direction of the current block, and can determine the prediction samples of the current block using the reference sample. It can determine residual samples which are the difference between the prediction samples and the samples of the current block, generate transformation coefficients by transforming the residual samples based on a transformation block, and generate quantized transformation coefficients by performing quantization on the transformation coefficients.

[0228] For example, if the current block is predicted to be in skip mode, the video encoding device (1900) can determine a motion vector for predicting the current block. The video encoding device (1900) can determine a reference block of the current block within a reference picture and determine a motion vector pointing from the current block to the reference block. In the case of skip mode, encoding of the residual block is not required.

[0229] For example, if the prediction mode of the current block is inter mode, the video encoding device (1900) can determine a motion vector for predicting the current block. The video encoding device (1900) can determine a reference block of the current block within a reference picture and determine a motion vector pointing from the current block to the reference block. The video encoding device (1900) can determine prediction samples of the current block using reference samples included in the reference block, determine residual samples which are the difference between the prediction samples and the samples of the current block, and generate quantized transformation coefficients by performing transformation and quantization on the residual samples based on a transformation block.

[0230] The current block is a block created by dividing the image according to a tree structure, and may correspond, for example, to a maximum encoding unit, an encoding unit, or a conversion unit. The video encoding device (1900) can encode the blocks included in the picture according to the encoding order.

[0231] A video encoding device (1900) according to one embodiment uses a QP to perform quantization. The QP is set per encoding unit, and one QP may be applied to the transform coefficients included in the encoding unit. A picture may include one or more slices, and one slice may include one or more encoding units. The video encoding device (1900) determines a QP per encoding unit and may encode information necessary to determine a QP per encoding unit, slice, or picture to signal.

[0232] An information encoding unit (1920) according to one embodiment may encode information necessary to determine a QP for each encoding unit and output it in the form of bitstream syntax related to the encoding unit. An information encoding unit (1920) may encode information necessary to determine a QP for each slice and output it in the form of slice header syntax. An information encoding unit (1920) may encode information necessary to determine a QP for each picture and output it in the form of picture header syntax.

[0233] First, the video encoding device (1900) can determine at the picture parameter set level whether to transmit QP difference values ​​per picture or per slice.

[0234] A quantization unit (1910) according to one embodiment can determine an initial QP value to be applied to the current picture.

[0235] When determining a QP difference value for each picture, the information encoding unit (1920) can determine a first QP difference value between the QP used in the current picture and the QP initial value. The information encoding unit (1920) can generate a picture header for the current picture containing the first QP difference value.

[0236] When determining QP difference values ​​per slice, the information encoding unit (1920) can determine a second QP difference value between the QP used in the current slice included in the current picture and the QP initial value. The information encoding unit (1920) can generate a slice header for the current slice that includes the second QP difference value.

[0237] An information encoding unit (1920) according to one embodiment can generate a picture parameter set including picture header QP difference value information and a QP initial value indicating whether QP difference value information exists in the picture header of the current picture.

[0238] Referring to FIG. 20 below, the process of a video encoding device (1900) signaling QP difference value information by picture or by slice is described in detail.

[0239] FIG. 20 illustrates a flowchart of a video encoding method according to one embodiment.

[0240] In step 2010, the quantization unit (1910) can determine the initial QP value to be applied to the current picture.

[0241] In step 2020, when determining a QP difference value per picture, the information encoding unit (1920) can determine a first QP difference value between the QP used in the current picture and the QP initial value, and generate a picture header for the current picture containing the first QP difference value.

[0242] In step 2030, the information encoding unit (1920) can generate a picture parameter set including picture header QP difference value information and QP initial value indicating whether QP difference value information exists in the picture header of the current picture.

[0243] According to one embodiment, when determining a QP difference value per slice, the information encoding unit (1920) can determine a second QP difference value between the QP used in the current slice included in the current picture and the QP initial value, and generate a slice header for the current slice including the second QP difference value.

[0244] In step 2020, when the quantization unit (1910) determines a QP difference value per picture, it can determine a QP for the luminance component of the slices included in the current picture. The information encoding unit (1920) can determine a first QP difference value for the luminance component of the current picture by using the difference between the QP for the luminance component of the slices included in the current picture and the QP initial value. The information encoding unit (1920) can determine a QP difference value for the encoding unit by using the difference between the QP for the luminance component of the encoding unit and the QP for the luminance component of the slices. The information encoding unit (1920) can encode the QP difference value for the encoding unit.

[0245] In step 2030, when the quantization unit (1910) determines a QP difference value per slice, it can determine a QP for the luminance component of the current slice. The information encoding unit (1920) can determine a second QP difference value for the luminance component of the current slice by using the difference value between the QP for the luminance component of the current slice and the QP initial value. The information encoding unit (1920) can determine a QP difference value for the encoding unit by subtracting the QP for the luminance component of the current slice from the QP for the luminance component of the encoding unit. The information encoding unit (1920) can encode the QP difference value for the encoding unit.

[0246] According to another embodiment, the quantization unit (1910) may determine a QP for a luma component of a encoding unit using a predicted QP value for an encoding unit, and may perform quantization for the encoding unit using the QP. In this case, the information encoding unit (1920) may not encode the QP difference value for the encoding unit.

[0247] In step 2030, when encoding QP difference values ​​per slice, the information encoding unit (1920) can determine a Cb QP difference value for the Cb chroma component of the current slice to determine the QP of the Cb chroma component of the encoding unit included in the current slice. Additionally, the information encoding unit (1920) can determine a Cr QP difference value for the Cr chroma component of the current slice to determine the QP of the Cr chroma component of the encoding unit included in the current slice. The information encoding unit (1920) can encode the Cb QP difference value and the Cr QP difference value for the Cr chroma component of the current slice, and generate a slice header for the current slice containing the Cb QP difference value and the Cr QP difference value.

[0248] The quantization unit (1910) can generate quantized conversion coefficients of the encoding unit by performing quantization on the conversion coefficients of the encoding unit using QP. The information encoding unit (1920) can generate a bitstream by performing entropy encoding on the information regarding the quantized conversion coefficients.

[0249] A video decoding device (1700) according to one embodiment and a video encoding device (1900) according to one embodiment can selectively signal QP difference values ​​by picture or by slice. Accordingly, the video encoding device (1900) according to one embodiment determines whether to signal QP difference values ​​by picture or by slice based on the characteristics of the data picture or the data transmission efficiency, and can signal QP difference values ​​according to the method with high transmission efficiency. The video decoding device (1700) according to one embodiment determines whether to acquire QP difference values ​​by picture or by slice based on information obtained from a picture parameter set, and can determine QP by picture or QP by slice. Accordingly, when QP difference values ​​are signaled by picture, there is no need to signal QP difference values ​​by slice included in the picture, so data for signaling QP can be reduced.

[0250] FIG. 21 illustrates a schematic diagram for inducing QP at the picture level or slice level according to one embodiment.

[0251] In conventional video codecs, the initial value of the QP is generally set in the picture parameter set (PPS), and the difference value of the initial QP of each slice is transmitted through the slice header, thereby setting the QP for each slice.

[0252] In contrast, in a video decoding device (1700) according to one embodiment, a picture header can be obtained for each picture, and information about QP can be signaled from the picture header. In the present invention, between the video decoding device (1700) and the video encoding device (1900), a choice can be made as to whether to signal QP difference values ​​per picture or QP difference values ​​per slice, so that the signaling structure of QP can be simplified.

[0253] First, in step 2100, the video decoder (1700) can obtain an initial value of QP from a picture parameter set PPS or a sequence parameter set (SPS) that is at a higher level than the picture header. Additionally, in step 2110, the video decoder (1700) can obtain picture header QP difference value (dQP) information from the PPS or SPS. Based on the picture header QP difference value information, the video decoder (1700) can determine whether to determine QP at the picture level or QP at the slice level.

[0254] Specifically, when the picture header QP difference value information is not 0 (for example, when the picture header QP difference value information is 1), that is, when a QP difference value (delta value) exists in the picture header, the video decoder (1700) can obtain the QP difference value from the picture header in step 2120. The video decoder (1700) can determine the QP for each picture using the QP difference value obtained from the picture header and the QP initial value obtained from the PPS or SPS.

[0255] When the picture header QP difference value information is 0, that is, when there is no QP difference value in the picture header, the video decoder (1700) can obtain a QP difference value from the slice header in step 2130. The video decoder (1700) can determine the QP for each slice using the QP difference value obtained from the slice header and the QP initial value obtained from the PPS or SPS.

[0256] For the operation of steps 2100 to 2130 of the video decoding device (1700), the video encoding device (1900) may determine whether to determine the QP at the picture level or the slice level. Additionally, the video encoding device (1900) may encode picture header QP difference value information indicating whether to determine the QP at the picture level or at the slice level.

[0257] Specifically, when the video encoding device (1900) determines a QP for each picture, it can encode a QP difference value for each picture. Accordingly, the video encoding device (1900) can generate a picture header of the current picture that includes the QP difference value of the current picture. In this case, the picture header QP difference value information can be encoded to indicate 1 to indicate that the QP difference value exists in the picture header of the current picture.

[0258] When the video encoding device (1900) determines a QP for each slice, it can encode a QP difference value for each slice. Accordingly, the video encoding device (1900) can generate a slice header of the current slice that includes the QP difference value of the current slice. In this case, the picture header QP difference value information can be encoded to show 0 to indicate that there is no QP difference value in the picture header.

[0259] A video encoding device (1900) according to one embodiment can generate a PPS or SPS including an initial value of QP and picture header QP difference value information.

[0260] As described above, if the same QP is set for the encoding units included in the current picture at the picture level, the QP can be signaled only in the picture header, thereby reducing the amount of bits required for signaling the QP. In other words, instead of needing to signal the QP through the corresponding slice header for each slice included in the current picture, the QP difference value can be signaled only once in the current picture header. If the characteristics of the slices included in the current picture differ, a separate QP can be set for each slice to configure the QP more precisely, and the QP difference value can be signaled for each slice header.

[0261] Syntax structures for signaling picture header QP difference value information are described below with reference to FIGS. 22 to 24.

[0262] FIG. 22 illustrates a picture parameter set containing picture header QP difference value information according to one embodiment.

[0263] The video encoding device (1900) may include the syntax elements pps_init_qp_minus26 (2210) and pps_qp_delta_info_in_ph_flag (2220) in the picture parameter set syntax (2200). The syntax element pps_qp_delta_info_in_ph_flag (2220) may indicate whether a QP difference value for the current picture exists in the picture header of the current picture.

[0264] The video decoder (1700) can parse the syntax elements pps_init_qp_minus26 (2210) and pps_qp_delta_info_in_ph_flag (2220) from the picture parameter set syntax (2200). The video decoder (1700) can obtain an initial value of QP applicable to the current picture or slices included in the current picture from the syntax element pps_init_qp_minus26 (2210). The video decoder (1700) can determine from the syntax element pps_qp_delta_info_in_ph_flag (2220) whether a QP difference value for the current picture exists in the picture header of the current picture.

[0265] The syntax element pps_init_qp_minus26 (2210) may represent an initial value of QP SliceQpY applicable to the current picture or slices contained in the current picture. If the picture's QP difference value ph_qp_delta is decoded as a non-zero value in the picture header, the initial value of SliceQpY at the picture level may be adjusted using the QP difference value. If the slice's QP difference value sh_qp_delta is decoded as a non-zero value in the slice header, the initial value of SliceQpY at the slice level may be adjusted using the QP difference value. The value of pps_init_qp_minus26 (2210) may be within the range of -(26 + QpBdOffset) to +37. QpBdOffset may be determined by the bit depth. SliceQpY can be determined according to the following equation depending on whether ph_qp_delta or sh_qp_delta is decoded.

[0266] SliceQpY = 26 + pps_init_qp_minus26 + ph_qp_delta

[0267] SliceQpY = 26 + pps_init_qp_minus26 + sh_qp_delta

[0268] Therefore, the QP SliceQpY of the lumens component of the slice can be determined in the range from -QpBdOffset to +63.

[0269] FIG. 23 illustrates a picture header containing the QP difference value of the current picture according to one embodiment.

[0270] The video encoding device (1900) may include a syntax element ph_qp_delta (2320) in the picture header syntax (2300). The syntax element ph_qp_delta (2320) may represent a QP difference value applicable to the current picture. Specifically, the syntax element ph_qp_delta (2320) may be included in the picture header syntax (2300) when pps_qp_delta_info_in_ph_flag (2220) included in the PPS (2200) indicates 1 (2310).

[0271] The video decoding device (1700) can obtain the syntax element ph_qp_delta (2320) from the picture header syntax (2300). Specifically, the syntax element ph_qp_delta (2320) can be obtained from the picture header syntax (2300) when pps_qp_delta_info_in_ph_flag (2220), previously obtained from the PPS (2200), indicates 1 (2310). In this case, the QP of the picture can be determined by adding the syntax element pps_init_qp_minus26 (2210) and ph_qp_delta (2320) for the current picture corresponding to the picture header syntax (2300), and the QP of the picture can be applied to all encoding units included in the current picture. When the QP difference value of a coding unit is obtained from a syntax structure corresponding to each coding unit, the QP of the coding unit can be determined by adding the QP difference value of the coding unit and the QP of the picture. The video decoder (1700) can perform inverse quantization on the converted samples of the coding unit using the QP determined for each coding unit.

[0272] FIG. 24 illustrates a slice header containing the QP difference value of the current slice according to one embodiment.

[0273] The video encoding device (1900) may include a syntax element sh_qp_delta (2420) in the slice header syntax (2400). The syntax element sh_qp_delta (2420) may represent the QP difference value of the luma component applicable to the current slice. Specifically, the syntax element sh_qp_delta (2420) may be included in the slice header syntax (2400) when pps_qp_delta_info_in_ph_flag (2220) included in the PPS (2200) indicates 0 (2410). Additionally, the video encoding device (1900) may include syntax elements sh_cb_qp_offset and sh_cr_qp_offset (2430) in the slice header syntax (2400). The syntax elements sh_cb_qp_offset and sh_cr_qp_offset (2430) represent the QP difference value of the chroma Cb component and the QP difference value of the chroma Cr component, respectively.

[0274] The video decoder (1700) can obtain the syntax element sh_qp_delta (2420) from the slice header syntax (2400). Specifically, the syntax element sh_qp_delta (2420) can be obtained from the slice header syntax (2400) when the pps_qp_delta_info_in_ph_flag (2220) obtained from the PPS (2200) indicates 0 (2410). In this case, the QP of the luminance component of the slice can be determined by adding the syntax element pps_init_qp_minus26 (2210) and sh_qp_delta (2420) for the current slice corresponding to the slice header syntax (2400), and the QP of the luminance component of the slice can be applied to all encoding units included in the current slice. When the QP difference value of the luminance component of a coding unit is obtained from the syntax structure corresponding to each coding unit, the QP of the luminance component of the coding unit can be determined by adding the QP difference value of the luminance component of the coding unit and the QP of the luminance component of the slice.

[0275] Additionally, the video decoder (1700) can parse the syntax elements sh_cb_qp_offset and sh_cr_qp_offset (2430) from the slice header syntax (2400). From the syntax elements sh_cb_qp_offset and sh_cr_qp_offset (2430), the QP difference value of the chroma Cb component and the QP difference value of the chroma Cr component can be obtained, respectively. Accordingly, the video decoder (1700) can determine the QP for the chroma Cb components of the encoding units included in the current slice using the QP difference value of the chroma Cb component, and determine the QP for the chroma Cr components of the encoding units included in the current slice using the QP difference value of the chroma Cr component. The video decoder (1700) can perform inverse quantization on the transformed samples of the encoding unit using the QP determined for each encoding unit.

[0276] sh_cb_qp_offset and sh_cr_qp_offset (2430) can each be values ​​in the range of -12 to 12.

[0277] The offset of the QP of the Cb component in the slice can be determined as pps_cb_qp_offset + sh_cb_qp_offset, and the value of pps_cb_qp_offset + sh_cb_qp_offset can be determined within the range from -12 to +12. Similarly, the offset of the QP of the Cr component in the slice can be determined as pps_cr_qp_offset + sh_cr_qp_offset, and the value of pps_cr_qp_offset + sh_cr_qp_offset can be determined within the range from -12 to +12.

[0278] Additionally, when signaling a QP difference value (delta QP) at the encoding unit level, the QP determined at the start of a tile, the start of a slice, the picture header, or the slice header may be used as the initial value of the QP. For example, if the QP is determined at the picture header and slices or tiles exist within the picture, the QP determined at the picture header at the start of the corresponding slice or tile may be used as the initial value. Accordingly, the QP of the corresponding encoding unit may be determined by adding the QP difference value of the encoding unit signaled at the encoding unit level and the initial value of the QP determined at the start of the tile or the start of the slice.

[0279] As another example, when signaling the Picture Order Counter (POC), information can be included only in the picture header rather than the slice header. In such cases, it may be difficult to determine which picture a specific slice belongs to. However, the index of the picture to which the slice belongs can be identified by using a timestamp or sequence number to be signaled at the system level. Additionally, it can be determined by receiving notification from an external system that information regarding a specific slice or picture header has been lost.

[0280] Hereinafter, with reference to FIGS. 25 to 32, syntax structures for selectively signaling parameters available in various tools at the picture level or slice level are described in detail. Through a flag signaled in a picture sequence set, it can be determined whether a tool-related parameter is signaled in the picture header or in the slice header.

[0281] FIG. 25 illustrates a set of picture parameters containing information indicating whether the picture header includes deblocking filter-related parameters according to one embodiment.

[0282] The video encoding device (1900) may include pps_dbf_info_in_ph_flag (2510) in the picture parameter set syntax (2500). The syntax element pps_dbf_info_in_ph_flag (2510) may indicate whether there is a deblocking filtering related parameter difference value for the current picture in the picture header of the current picture.

[0283] The video decoder (1700) can parse pps_dbf_info_in_ph_flag (2510) from the picture parameter set syntax (2500). The video decoder (1700) can determine from the syntax element pps_dbf_info_in_ph_flag (2510) whether there are parameters related to deblocking filtering for the current picture in the current picture header.

[0284] FIG. 26 illustrates a picture header containing parameters related to a deblocking filter of the current picture according to one embodiment.

[0285] The video encoding device (1900) may include syntax elements ph_luma_beta_offset_div2, ph_luma_tc_offset_div2, ph_cb_beta_offset_div2, ph_cb_tc_offset_div2, ph_cr_beta_offset_div2, ph_cr_tc_offset_div2 (2620) in the picture header syntax (2600). Specifically, when pps_dbf_info_in_ph_flag (2510) included in the PPS (2500) above indicates 1 (2610), the picture header syntax (2600) may include syntax elements ph_luma_beta_offset_div2, ph_luma_tc_offset_div2, ph_cb_beta_offset_div2, ph_cb_tc_offset_div2, ph_cr_beta_offset_div2, ph_cr_tc_offset_div2 (2620).

[0286] The video decoding device (1700) can obtain syntax elements ph_luma_beta_offset_div2, ph_luma_tc_offset_div2, ph_cb_beta_offset_div2, ph_cb_tc_offset_div2, ph_cr_beta_offset_div2, ph_cr_tc_offset_div2 (2620) from the picture header syntax (2600). Specifically, when pps_dbf_info_in_ph_flag (2510) included in the PPS (2500) above indicates 1 (2610), syntax elements ph_luma_beta_offset_div2, ph_luma_tc_offset_div2, ph_cb_beta_offset_div2, ph_cb_tc_offset_div2, ph_cr_beta_offset_div2, ph_cr_tc_offset_div2 (2620) can be obtained from the picture header syntax (2600).

[0287] The syntax element ph_luma_beta_offset_div2 can represent an offset for the deblocking parameter β applied to the lumina components of the slices in the current picture. The syntax element ph_luma_tC_offset_div2 can represent an offset for the deblocking parameter tC applied to the lumina components of the slices in the current picture. The syntax element ph_cb_beta_offset_div2 can represent an offset for the deblocking parameter β applied to the Cb components of the slices in the current picture. The syntax element ph_cb_tC_offset_div2 can represent an offset for the deblocking parameter tC applied to the Cb components of the slices in the current picture. The syntax element ph_cr_beta_offset_div2 can represent an offset for the deblocking parameter β applied to the Cr components of the slices in the current picture. The syntax element ph_cr_tC_offset_div2 may represent an offset for the deblocking parameter tC applied to the Cr components of the slices in the current picture. The video decoder (1700) may perform deblocking filtering on the boundaries of the encoding units included in the current picture using the deblocking filtering related parameter obtained from the picture header.

[0288] FIG. 27 illustrates a slice header containing parameters related to the deblocking filter of the current slice according to one embodiment.

[0289] The video encoding device (1900) may include syntax elements sh_luma_beta_offset_div2, sh_luma_tc_offset_div2, sh_cb_beta_offset_div2, sh_cb_tc_offset_div2, sh_cr_beta_offset_div2, sh_cr_tc_offset_div2 (2720) in the slice header syntax (2700). Specifically, when pps_dbf_info_in_ph_flag (2510) included in the PPS (2500) above indicates 0 (2710), the slice header syntax (2700) may include syntax elements sh_luma_beta_offset_div2, sh_luma_tc_offset_div2, sh_cb_beta_offset_div2, sh_cb_tc_offset_div2, sh_cr_beta_offset_div2, sh_cr_tc_offset_div2 (2720).

[0290] The video decoding device (1700) can obtain syntax elements sh_luma_beta_offset_div2, sh_luma_tc_offset_div2, sh_cb_beta_offset_div2, sh_cb_tc_offset_div2, sh_cr_beta_offset_div2, sh_cr_tc_offset_div2 (2720) from the slice header syntax (2700). Specifically, when pps_dbf_info_in_ph_flag (2510) included in the PPS (2500) above indicates 0 (2710), syntax elements sh_luma_beta_offset_div2, sh_luma_tc_offset_div2, sh_cb_beta_offset_div2, sh_cb_tc_offset_div2, sh_cr_beta_offset_div2, sh_cr_tc_offset_div2 (2720) can be obtained from the slice header syntax (2700).

[0291] The syntax element sh_luma_beta_offset_div2 may represent an offset for the deblocking parameter β applied to the lumina components of the current slice. The syntax element sh_luma_tC_offset_div2 may represent an offset for the deblocking parameter tC applied to the lumina components of the current slice. The syntax element sh_cb_beta_offset_div2 may represent an offset for the deblocking parameter β applied to the Cb components of the current slice. The syntax element sh_cb_tC_offset_div2 may represent an offset for the deblocking parameter tC applied to the Cb components of the current slice. The syntax element sh_cr_beta_offset_div2 may represent an offset for the deblocking parameter β applied to the Cr components of the current slice. The syntax element sh_cr_tC_offset_div2 may represent an offset for the deblocking parameter tC applied to the Cr components of the current slice. The video decoder (1700) may perform deblocking filtering on the boundaries of the encoding units included in the current slice using the deblocking filtering related parameter obtained from the slice header.

[0292] FIG. 28 illustrates a set of picture parameters containing information indicating whether various tool-related parameters are included in the picture header according to one embodiment.

[0293] The video encoding device (1900) may include pps_rpl_info_in_ph_flag (2810), pps_sao_info_in_ph_flag (2820), pps_alf_info_in_ph_flag (2830), and pps_wp_info_in_ph_flag (2840) in the picture parameter set syntax (2800). The syntax element pps_rpl_info_in_ph_flag (2810) may indicate whether there is a reference picture list related parameter for the current picture in the picture header of the current picture. The syntax element pps_sao_info_in_ph_flag (2820) may indicate whether there is a Sample Adaptive Offset (SAO) related parameter for the current picture in the picture header of the current picture. The syntax element pps_alf_info_in_ph_flag (2830) can indicate whether there are Adaptive Loop Filtering (ALF) related parameters for the current picture in the picture header of the current picture. The syntax element pps_wp_info_in_ph_flag (2840) can indicate whether there are Weighted Prediction related parameters for the current picture in the picture header of the current picture.

[0294] The video decoder (1700) can parse pps_rpl_info_in_ph_flag (2810), pps_sao_info_in_ph_flag (2820), pps_alf_info_in_ph_flag (2830), and pps_wp_info_in_ph_flag (2840) from the picture parameter set syntax (2800). The video decoder (1700) can determine from the syntax element pps_rpl_info_in_ph_flag (2810) whether there is a reference picture list related parameter for the current picture in the picture header of the current picture. The video decoder (1700) can check from the syntax element pps_sao_info_in_ph_flag (2820) whether there are parameters related to SAO (Sample Adaptive Offset) for the current picture in the picture header of the current picture. The video decoder (1700) can check from the syntax element pps_alf_info_in_ph_flag (2830) whether there are parameters related to ALF (Adaptive Loop Filtering) for the current picture in the picture header of the current picture. The video decoder (1700) can check from the syntax element pps_wp_info_in_ph_flag (2840) whether there are parameters related to Weighted Prediction for the current picture in the picture header of the current picture.

[0295] FIG. 29 illustrates a picture header containing parameters related to weight prediction of the current picture, parameters related to SAO (sample adaptive offset), and parameters related to the reference picture list according to one embodiment.

[0296] The video encoding device (1900) may include a weight prediction syntax pred_weight_table() (2920) in the picture header syntax (2900). Specifically, the weight prediction syntax pred_weight_table() (2920) may be included in the picture header syntax (2900) when pps_wp_info_in_ph_flag (2840) included in the PPS (2800) indicates 1 (2910).

[0297] The video decoder (1700) can call the weight prediction syntax pred_weight_table() (2920) from the picture header syntax (2900). Specifically, the weight prediction syntax pred_weight_table() (2920) can be called from the picture header syntax (2900) when pps_wp_info_in_ph_flag (2840) included in the PPS (2800) indicates 1 (2910).

[0298] The video decoder (1700) can obtain parameters for determining the weights of the luminance components and the weights of the chroma components necessary to perform weight prediction from the weight prediction syntax pred_weight_table( ) (2920). The video decoder (1700) can perform weight prediction for blocks included in the current picture using the weights of the luminance components and the weights of the chroma components.

[0299] The video encoding device (1900) may include the syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag (2940) in the picture header syntax (2900). Specifically, the syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag (2940) in the picture header syntax (2900) may be included when pps_sao_info_in_ph_flag (2820) included in the PPS (2800) indicates 1 (2930).

[0300] The video decoding device (1700) can obtain the syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag (2940) from the picture header syntax (2900). Specifically, the syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag (2940) can be obtained from the picture header syntax (2900) when pps_sao_info_in_ph_flag (2820) included in the PPS (2800) indicates 1 (2930).

[0301] The video decoder (1700) can determine from the syntax element ph_sao_luma_enabled_flag whether SAO is performed for the lumina component of the current picture. The video decoder (1700) can determine from the syntax element ph_sao_chroma_enabled_flag whether SAO is performed for the chroma component of the current picture. The video decoder (1700) can perform SAO on the lumina component and the chroma component of the maximum encoding units included in the current picture, respectively, based on the syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag (2940).

[0302] The video encoding device (1900) may include a reference picture list syntax ref_pic_lists() (2960) in the picture header syntax (2900). Specifically, the reference picture list syntax ref_pic_lists() (2960) may be included in the picture header syntax (2900) when pps_rpl_info_in_ph_flag (2810) included in the PPS (2800) indicates 1 (2950).

[0303] The video decoding device (1700) can call the reference picture list syntax ref_pic_lists() (2960) from the picture header syntax (2900). Specifically, the reference picture list syntax ref_pic_lists() (2960) from the picture header syntax (2900) can be called when pps_rpl_info_in_ph_flag (2810) included in the PPS (2800) indicates 1 (2950).

[0304] The video decoder (1700) can obtain parameters for determining reference picture lists in blocks of the current picture from the reference picture list syntax ref_pic_lists() (2960). The video decoder (1700) can use the parameters obtained from the reference picture list syntax ref_pic_lists() (2960) to determine reference picture lists for blocks included in the current picture and perform inter-prediction using the reference picture lists for each block.

[0305] FIG. 30 illustrates a picture header containing ALF (Adaptive loop filter) related parameters of the current picture according to one embodiment.

[0306] The video encoding device (1900) may include the syntax elements ph_num_alf_aps_ids_luma, ph_alf_aps_id_luma[i], ph_alf_cb_enabled_flag, ph_alf_cr_enabled_flag, ph_alf_aps_id_chroma, ph_alf_cc_cb_enabled_flag, ph_alf_cc_cb_aps_id, ph_alf_cc_cr_enabled_flag, ph_alf_cc_cr_aps_id (3020) in the picture header syntax (3000). Specifically, when pps_alf_info_in_ph_flag (2830) included in the PPS (2800) above indicates 1 (3010), the picture header syntax (3000) may include syntax elements ph_num_alf_aps_ids_luma, ph_alf_aps_id_luma[i], ph_alf_cb_enabled_flag, ph_alf_cr_enabled_flag, ph_alf_aps_id_chroma, ph_alf_cc_cb_enabled_flag, ph_alf_cc_cb_aps_id, ph_alf_cc_cr_enabled_flag, ph_alf_cc_cr_aps_id (3020).

[0307] The video encoding device (1900) can obtain syntax elements ph_num_alf_aps_ids_luma, ph_alf_aps_id_luma[i], ph_alf_cb_enabled_flag, ph_alf_cr_enabled_flag, ph_alf_aps_id_chroma, ph_alf_cc_cb_enabled_flag, ph_alf_cc_cb_aps_id, ph_alf_cc_cr_enabled_flag, ph_alf_cc_cr_aps_id (3020) from the picture header syntax (3000). Specifically, when pps_alf_info_in_ph_flag (2830) included in the PPS (2800) above indicates 1 (3010), the syntax elements ph_num_alf_aps_ids_luma, ph_alf_aps_id_luma[i], ph_alf_cb_enabled_flag, ph_alf_cr_enabled_flag, ph_alf_aps_id_chroma, ph_alf_cc_cb_enabled_flag, ph_alf_cc_cb_aps_id, ph_alf_cc_cr_enabled_flag, ph_alf_cc_cr_aps_id (3020) can be obtained from the picture header syntax (3000).

[0308] The syntax element ph_num_alf_aps_ids_luma indicates the number of ALF APS referenced by the slices included in the current picture. The syntax element ph_alf_aps_id_luma[i] indicates the aps_adaptation_parameter_set_id of the i-th ALF APS referenced by the luminance components of the slices included in the current picture. The syntax element ph_alf_cb_enabled_flag indicates whether ALF is enabled for the Cb component of the current picture. The syntax element ph_alf_cr_enabled_flag indicates whether ALF is enabled for the Cr component of the current picture. The syntax element ph_alf_aps_id_chroma indicates the aps_adaptation_parameter_set_id of the ALF APS referenced by the chroma components of the slices included in the current picture. The syntax element ph_alf_cc_cb_enabled_flag indicates whether cross-component ALF is allowed for the Cb component of the current picture. The syntax element ph_alf_cc_cb_aps_id indicates the aps_adaptation_parameter_set_id of the ALF APS referenced by the Cb components of the slices included in the current picture. The syntax element ph_alf_cc_cr_enabled_flag indicates whether cross-component ALF is allowed for the Cr component of the current picture. The syntax element ph_alf_cc_cr_aps_id indicates the aps_adaptation_parameter_set_id of the ALF APS referenced by the Cr components of the slices included in the current picture.

[0309] The video decoder (1700) can perform ALF on the luminance component and the chroma component for each maximum encoding unit of the current picture using the acquired syntax elements ph_num_alf_aps_ids_luma, ph_alf_aps_id_luma[i], ph_alf_cb_enabled_flag, ph_alf_cr_enabled_flag, ph_alf_aps_id_chroma, ph_alf_cc_cb_enabled_flag, ph_alf_cc_cb_aps_id, ph_alf_cc_cr_enabled_flag, ph_alf_cc_cr_aps_id (3020).

[0310] FIG. 31 illustrates a slice header containing reference picture list related parameters, weight prediction related parameters, and SAO related parameters of the current slice according to one embodiment.

[0311] The video encoding device (1900) may include a reference picture list syntax ref_pic_lists() (3120) in the slice header syntax (3100). Specifically, the reference picture list syntax ref_pic_lists() (3120) may be included in the slice header syntax (3100) when pps_rpl_info_in_ph_flag (2810) included in the PPS (2800) indicates 0 (3110).

[0312] The video decoding device (1700) can call the reference picture list syntax ref_pic_lists() (3120) from the slice header syntax (3100). Specifically, the reference picture list syntax ref_pic_lists() (3120) from the slice header syntax (3100) can be called when pps_rpl_info_in_ph_flag (2810) included in the PPS (2800) indicates 0 (3110).

[0313] The video decoder (1700) can obtain parameters for determining reference picture lists in blocks of the current slice from the reference picture list syntax ref_pic_lists() (3120). The video decoder (1700) can determine reference picture lists for blocks included in the current slice using the parameters obtained from the reference picture list syntax ref_pic_lists() (3120), and perform inter prediction using the reference picture lists for each block.

[0314] The video encoding device (1900) may include a weight prediction syntax pred_weight_table() (3140) in the slice header syntax (3100). Specifically, the weight prediction syntax pred_weight_table() (3140) may be included in the slice header syntax (3100) when the pps_wp_info_in_ph_flag (2840) included in the PPS (2800) above indicates 0 (3130).

[0315] The video decoder (1700) can call the weight prediction syntax pred_weight_table() (3140) from the slice header syntax (3100). Specifically, the weight prediction syntax pred_weight_table() (3140) from the slice header syntax (3100) can be called when pps_wp_info_in_ph_flag (2840) included in the PPS (2800) indicates 0 (3130).

[0316] The video decoder (1700) can obtain parameters for determining the weights of the luminance components and the weights of the chroma components necessary to perform weight prediction from the weight prediction syntax pred_weight_table( ) (3140). The video decoder (1700) can perform weight prediction using the weights of the luminance components and the weights of the chroma components for the blocks included in the current slice.

[0317] The video encoding device (1900) may include the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag (3160) in the slice header syntax (3100). Specifically, the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag (3160) in the slice header syntax (3100) may be included when the pps_sao_info_in_ph_flag (2820) included in the PPS (2800) above indicates 0 (3150).

[0318] The video decoding device (1700) can obtain the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag (3160) from the slice header syntax (3100). Specifically, the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag (3160) can be obtained from the slice header syntax (3100) when the pps_sao_info_in_ph_flag (2820) included in the PPS (2800) above indicates 0 (3150).

[0319] The video decoder (1700) can determine from the syntax element sh_sao_luma_used_flag whether SAO is used for the lumina component of the current slice. The video decoder (1700) can determine from the syntax element sh_sao_chroma_used_flag whether SAO is used for the chroma component of the current slice. The video decoder (1700) can perform SAO on the lumina component and the chroma component of the maximum encoding units included in the current slice, respectively, based on the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag (3160).

[0320] FIG. 32 illustrates a slice header containing ALF-related parameters of the current slice according to one embodiment.

[0321] The video encoding device (1900) may include the syntax elements sh_num_alf_aps_ids_luma, sh_alf_aps_id_luma[i], sh_alf_cb_enabled_flag, sh_alf_cr_enabled_flag, sh_alf_aps_id_chroma, sh_alf_cc_cb_enabled_flag, sh_alf_cc_cb_aps_id, sh_alf_cc_cr_enabled_flag, sh_alf_cc_cr_aps_id (3220) in the slice header syntax (3200). Specifically, when pps_alf_info_in_ph_flag (2830) included in the PPS (2800) above indicates 0 (3210), the slice header syntax (3200) may include syntax elements sh_num_alf_aps_ids_luma, sh_alf_aps_id_luma[i], sh_alf_cb_enabled_flag, sh_alf_cr_enabled_flag, sh_alf_aps_id_chroma, sh_alf_cc_cb_enabled_flag, sh_alf_cc_cb_aps_id, sh_alf_cc_cr_enabled_flag, sh_alf_cc_cr_aps_id (3220).

[0322] The video encoding device (1900) can obtain syntax elements sh_num_alf_aps_ids_luma, sh_alf_aps_id_luma[i], sh_alf_cb_enabled_flag, sh_alf_cr_enabled_flag, sh_alf_aps_id_chroma, sh_alf_cc_cb_enabled_flag, sh_alf_cc_cb_aps_id, sh_alf_cc_cr_enabled_flag, sh_alf_cc_cr_aps_id (3220) from the slice header syntax (3200). Specifically, when pps_alf_info_in_ph_flag (2830) included in the PPS (2800) above indicates 0 (3210), the syntax elements sh_num_alf_aps_ids_luma, sh_alf_aps_id_luma[i], sh_alf_cb_enabled_flag, sh_alf_cr_enabled_flag, sh_alf_aps_id_chroma, sh_alf_cc_cb_enabled_flag, sh_alf_cc_cb_aps_id, sh_alf_cc_cr_enabled_flag, sh_alf_cc_cr_aps_id (3220) can be obtained from the slice header syntax (3200).

[0323] The syntax element sh_num_alf_aps_ids_luma indicates the number of ALF APS referenced by the current slice. The syntax element sh_alf_aps_id_luma[i] indicates the aps_adaptation_parameter_set_id of the i-th ALF APS referenced by the luminar component of the current slice. The syntax element sh_alf_cb_enabled_flag indicates whether ALF is enabled for the Cb component of the current slice. The syntax element sh_alf_cr_enabled_flag indicates whether ALF is enabled for the Cr component of the current slice. The syntax element sh_alf_aps_id_chroma indicates the aps_adaptation_parameter_set_id of the ALF APS referenced by the chroma component of the current slice. The syntax element sh_alf_cc_cb_enabled_flag indicates whether cross-component ALF is allowed for the Cb component of the current slice. The syntax element sh_alf_cc_cb_aps_id indicates the aps_adaptation_parameter_set_id of the ALF APS referenced by the Cb component of the current slice. The syntax element sh_alf_cc_cr_enabled_flag indicates whether cross-component ALF is allowed for the Cr component of the current slice. The syntax element sh_alf_cc_cr_aps_id indicates the aps_adaptation_parameter_set_id of the ALF APS referenced by the Cr component of the current slice.

[0324] The video decoder (1700) can perform ALF on the luminance component and the chroma component for each maximum encoding unit of the current slice using the acquired syntax elements sh_num_alf_aps_ids_luma, sh_alf_aps_id_luma[i], sh_alf_cb_enabled_flag, sh_alf_cr_enabled_flag, sh_alf_aps_id_chroma, sh_alf_cc_cb_enabled_flag, sh_alf_cc_cb_aps_id, sh_alf_cc_cr_enabled_flag, sh_alf_cc_cr_aps_id (3220).

[0325] A video decoding device (1700) according to one embodiment and a video encoding device (1900) according to one embodiment can selectively signal deblocking filtering related parameters, reference picture list related parameters, weight prediction related parameters, SAO related parameters, and ALF related parameters, respectively, by picture or by slice. Accordingly, the video encoding device (1900) according to one embodiment determines whether to signal the related parameters by tool per picture or by tool per slice based on the characteristics of the data picture or the data transmission efficiency, and can signal the related parameters by tool according to the method with high transmission efficiency. The video decoding device (1700) according to one embodiment determines whether to acquire the related parameters by tool per picture or by tool per slice based on information obtained from a set of picture parameters, and can acquire the related parameters by tool per picture or by tool per slice. Therefore, when relevant parameters are signaled for each picture and each tool, there is no need to signal relevant parameters for each slice included in the picture and each tool, so data for signaling relevant parameters for each tool can be reduced.

[0326] Meanwhile, the embodiments of the present disclosure described above can be written as a program that can be executed on a computer, and the written program can be stored on a medium.

[0327] A medium may be a device that continuously stores programs executable by a computer, or a device that temporarily stores them for execution or download. Additionally, a medium may be a variety of recording or storage means in the form of a single or multiple pieces of hardware combined; it is not limited to a medium directly connected to a computer system, but may also exist distributed over a network. Examples of media include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as CD-ROMs and DVDs; magneto-optical media such as floptical disks; and devices configured to store program instructions, including ROM, RAM, and flash memory. A device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, "non-transitory storage medium" simply means a tangible device that does not contain a signal (e.g., electromagnetic waves), and this term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily. For example, a 'non-transient storage medium' may include a buffer where data is temporarily stored.

[0328] In addition, other examples of media include recording media or storage media managed by app stores that distribute applications, or sites and servers that supply or distribute various other software.

[0329] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or distributed online (e.g., download or upload) through an application store (e.g., Play Store™) or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product (e.g., downloadable app) may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.

[0330] Although the technical concept of the present disclosure has been described in detail with reference to preferred embodiments, the technical concept of the present disclosure is not limited to the above embodiments, and various modifications and changes can be made by those skilled in the art within the scope of the technical concept of the present disclosure.

Claims

Claim 1 A step of obtaining an initial value of QP (Quantization Parameter) to be applied to the current picture from a set of picture parameters; A step of obtaining a QP difference value flag from the picture parameter set above, indicating whether a QP difference value exists in the picture header of the current picture; if the QP difference value flag indicates that the QP difference value does not exist in the picture header, a step of obtaining a first QP difference value for the first slice from the slice header of the first slice included in the current picture, determining a first QP for the first slice using the first QP difference value obtained for the first slice and the QP initial value, and performing inverse quantization on the transform coefficients included in the first slice using the first QP; if the QP difference value flag indicates that the QP difference value does not exist in the picture header, a step of obtaining a second QP difference value for the second slice from the slice header of the second slice included in the current picture, determining a second QP for the second slice using the second QP difference value obtained for the second slice and the QP initial value, and using the second QP, the A step of performing inverse quantization on the transformation coefficients included in the second slice;A video decoding method comprising the steps of: when the above QP difference value flag indicates that a QP difference value exists in the picture header of the current picture, obtaining a third QP difference value for the current picture from the picture header; determining a third QP for at least one slice included in the current picture using the third QP difference value obtained for the current picture and the QP initial value; and performing inverse quantization on the transform coefficients included in the at least one slice using the third QP; wherein when the third QP difference value is obtained from the picture header of the current picture according to the QP difference value flag, the QP difference value for the at least one slice included in the current picture is not separately obtained from the slice header of the at least one slice. Claim 2 In a video encoding device, an encoding unit that performs quantization on the transform coefficients of a current picture; The bitstream generation unit includes a QP (Quantization Parameter) initial value to be applied to the current picture, and a QP difference value flag indicating whether a QP difference value exists in the picture header of the current picture, thereby generating a picture parameter set including the QP initial value and the QP difference value flag; if the QP difference value flag is encoded to indicate that the QP difference value does not exist in the picture header, the encoding unit performs quantization on the transform coefficients included in the first slice using a first QP for a first slice included in the current picture, the bitstream generation unit encodes a first QP difference value between the first QP of the first slice included in the current picture and the QP initial value, and generates a first slice header for the first slice including the first QP difference value for the first slice, and if the QP difference value flag is encoded to indicate that the QP difference value does not exist in the picture header, the encoding unit includes the Quantization is performed on the transform coefficients included in the second slice using a second QP for the second slice, and the bitstream generator encodes a second QP difference value between the second QP of the second slice included in the current picture and the QP initial value, and generates a second slice header for the second slice including the second QP difference value for the second slice, and if the QP difference value flag is encoded to indicate that the QP difference value exists in the picture header of the current picture, the encoder performs quantization on the transform coefficients included in the at least one slice using a third QP for at least one slice included in the current picture.A video encoding device characterized in that the bitstream generating unit encodes a third QP difference value between the third QP and the QP initial value, generates a picture header for the current picture including the third QP difference value, and when the third QP difference value exists in the picture header of the current picture, the bitstream generating unit does not separately include a QP difference value for the at least one slice included in the current picture in the slice header of the at least one slice. Claim 3 In a computer-readable recording medium on which a bitstream generated by a video encoding method is recorded, the bitstream comprises a set of picture parameters including an initial value of a Quantization Parameter (QP) to be applied to a current picture and a QP difference value flag indicating whether a QP difference value exists in the picture header of the current picture; when the QP difference value flag is encoded to indicate that the QP difference value does not exist in the picture header, quantization is performed on a transform coefficient included in a first slice using a first QP for a first slice included in the current picture, a first QP difference value between the first QP of the first slice included in the current picture and the initial value of the QP is encoded, and a first slice header for the first slice including the first QP difference value for the first slice is generated; and when the QP difference value flag is encoded to indicate that the QP difference value does not exist in the picture header, a transform included in the second slice using a second QP for a second slice included in the current picture When quantization is performed on the coefficients, and a second QP difference value between the second QP of the second slice included in the current picture and the QP initial value is encoded, and a second slice header for the second slice including the second QP difference value for the second slice is generated, and when the QP difference value flag is encoded to indicate that the QP difference value exists in the picture header of the current picture, quantization is performed on the transform coefficients included in the at least one slice using a third QP for at least one slice included in the current picture, and a third QP difference value between the third QP and the QP initial value is encoded, and a picture header for the current picture including the third QP difference value is generated, and when the third QP difference value exists in the picture header of the current picture,A recording medium characterized in that the slice header of the at least one slice does not separately include a QP difference value for the at least one slice included in the current picture.