Video decoding method and apparatus for obtaining quantization parameter, and video encoding method and apparatus for transmitting quantization parameter

By dynamically determining the QP difference of the encoding and decoding units in the video decoding and encoding methods, the reconstruction quality problem caused by uniform square encoding and decoding units in high-resolution images is solved, thereby improving data transmission efficiency and image quality.

CN121486569APending Publication Date: 2026-02-06SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511323275.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2020-01-10
Filing Date
2021-01-08
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

In existing technologies, the use of uniform square shapes in the encoding and decoding units of high-resolution images leads to a deterioration in the quality of the reconstructed image.

Method used

In video decoding and encoding methods, the initial value and difference information of quantization parameter (QP) are obtained based on the image parameter set, and the QP of the encoding and decoding unit is dynamically determined. Inverse quantization is used to process the transform coefficients to reconstruct the encoding and decoding unit.

Benefits of technology

It effectively sends and receives QP differences, improving data transmission efficiency and image quality, and adapting to different image characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121486569A_ABST
    Figure CN121486569A_ABST
Patent Text Reader

Abstract

Provided is a video decoding method including: obtaining a quantization parameter (QP) initial value to be applied to a current picture from a picture parameter set; obtaining a QP difference value mark indicating whether a QP difference value exists in a picture header of the current picture or not from the picture parameter set; when the QP difference flag indicates that no QP difference exists in the picture header, obtaining a first QP difference of a current slice included in the current picture from a slice header of the current slice, determining a first QP for being included in the current slice in the current picture using a QP initial value and the first QP difference obtained for the current slice, and performing inverse quantization on transform coefficients in a codec unit included in the current slice using the first QP of the current slice.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the patent application with the application date of 2021.01.08, the application number of 202180020581.3, and the invention name of "Video decoding method and apparatus for obtaining quantization parameter, and video encoding method and apparatus for transmitting quantization parameter". TECHNICAL FIELD

[0002] The disclosure relates to a video decoding method and apparatus and a video encoding method and apparatus, and more particularly, to a method and apparatus for encoding and decoding a video by efficiently performing a quantization parameter (QP). BACKGROUND

[0003] In a general compression method, a square coding unit is determined through a recursive partitioning process in which, while determining the size of the coding unit, it is determined whether to partition the coding unit included in a picture, and then the coding unit is uniformly divided into four coding units of the same size. However, recently, deterioration of image quality of a reconstructed image caused by using a coding unit having a uniform square shape for a high-resolution image has become a problem. Therefore, a method and apparatus for partitioning a high-resolution image into coding units of various shapes have been proposed. SUMMARY

[0004] TECHNICAL PROBLEM

[0005] The disclosure relates to a video decoding method and apparatus and a video encoding method and apparatus, and the purpose is to provide a method by which a video encoding apparatus efficiently transmits a quantization parameter (QP) difference value and a method by which a video decoding apparatus efficiently obtains a QP difference value.

[0006] TECHNICAL SOLUTION

[0007] A video decoding method according to an embodiment of the disclosure can include obtaining a quantization parameter (QP) initial value to be applied to a current picture from a picture parameter set, and obtaining picture header QP difference information indicating whether QP difference information exists in a picture header of the current picture from the picture parameter set, when the picture header QP difference information indicates that the QP difference information exists in the picture header of the current picture, obtaining a first QP difference value of the current picture from the picture header, determining a QP of a coding unit included in the current picture by using the QP initial value and the first QP difference value, obtaining a transform coefficient of the coding unit by performing inverse quantization on the coding unit by using the QP, and reconstructing the coding unit by using the transform coefficient.

[0008] More specifically, according to an embodiment of the present disclosure, a video decoding method is provided, comprising: obtaining, from a picture parameter set, a quantization parameter (QP) initial value to be applied to a current picture; obtaining, from the picture parameter set, a QP difference value flag indicating whether a QP difference value is present in a picture header of the current picture; when the QP difference value flag indicates that the QP difference value is not present in the picture header, obtaining, from a slice header of a current slice included in the current picture, a first QP difference value of the current slice, determining a first QP for the current slice included in the current picture using the QP initial value and the first QP difference value obtained for the current slice, and performing inverse quantization on transform coefficients in coding units included in the current slice using the first QP of the current slice; and when the QP difference value flag indicates that the QP difference value is present in the picture header, obtaining, from the picture header, a second QP difference value for the current picture, determining a second QP for the current picture using the QP initial value and the second QP difference value obtained for the current picture, and performing inverse quantization on transform coefficients in coding units included in at least one slice included in the current picture using the second QP of the current picture; wherein the second QP difference value is not obtained from the slice header of the current slice when the second QP difference value is obtained from the picture header of the current picture according to the QP difference value flag, wherein a picture Cb QP difference value of a Cb chroma component included in the current picture and a picture Cr QP difference value of a Cr chroma component included in the current picture are obtained from the picture parameter set of the current picture, wherein a slice Cb QP difference value of the Cb chroma component of the current slice and a slice Cr QP difference value of the Cr chroma component of the current slice in the at least one slice in the current picture are obtained from the slice header of the current slice, wherein a Cb QP of the Cb chroma component of the current slice is determined using the picture Cb QP difference value and the slice Cb QP difference value, and wherein a Cr QP of the Cr chroma component of the current slice is determined using the picture Cr QP difference value and the slice Cr QP difference value.

[0009] Advantageous Effects

[0010] According to the video encoding method and the video decoding method according to the embodiments, a method of transmitting a difference value of a quantization parameter (QP) can be determined according to data transmission efficiency or characteristics of a picture, and the difference value of the QP can be signaled according to the method. BRIEF DESCRIPTION OF DRAWINGS

[0011] Brief descriptions of each of the accompanying drawings are provided in order to better understand the drawings cited herein.

[0012] Figure 1 is a schematic block diagram of an image decoding apparatus according to an embodiment.

[0013] Figure 2 is a flowchart of an image decoding method according to an embodiment.

[0014] Figure 3 A process of determining at least one coding unit by partitioning a current coding unit performed by an image decoding apparatus according to an embodiment is shown.

[0015] Figure 4 A process of determining at least one coding unit by partitioning a non-square coding unit performed by an image decoding apparatus according to an embodiment is shown.

[0016] Figure 5 A process of partitioning a coding unit based on at least one of block shape information or partition shape mode information performed by an image decoding apparatus according to an embodiment is shown.

[0017] Figure 6 A method of determining a particular coding unit from among an odd number of coding units performed by an image decoding apparatus according to an embodiment is shown.

[0018] Figure 7 An order of processing a plurality of coding units when an image decoding apparatus determines the plurality of coding units by partitioning a current coding unit according to an embodiment is shown.

[0019] Figure 8 A process of determining that a current coding unit will be partitioned into an odd number of coding units performed by an image decoding apparatus according to an embodiment when a coding unit cannot be processed in a particular order is shown.

[0020] Figure 9 A process of determining at least one coding unit by partitioning a first coding unit performed by an image decoding apparatus according to an embodiment is shown.

[0021] Figure 10 A shape into which a second coding unit having a non-square shape determined when a first coding unit is partitioned by an image decoding apparatus can be partitioned is limited when the second coding unit satisfies a particular condition according to an embodiment.

[0022] Figure 11 A process of partitioning a square coding unit performed by an image decoding apparatus according to an embodiment when partition shape mode information cannot indicate that the square coding unit is partitioned into four square coding units is shown.

[0023] Figure 12 An order of processing a plurality of coding units can change depending on a process of partitioning a coding unit according to an embodiment is shown.

[0024] Figure 13A process of determining a depth of a coding unit as the shape and size of the coding unit change when the coding unit is recursively divided to determine a plurality of coding units according to an embodiment is shown.

[0025] Figure 14 A depth that can be determined based on a shape and size of a coding unit and a part index (PID) used to distinguish a part of the coding unit according to an embodiment is shown.

[0026] Figure 15 A plurality of coding units is determined based on a plurality of specific data units included in a picture according to an embodiment is shown.

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

[0028] Figure 17 is a block diagram of a video decoding apparatus according to an embodiment.

[0029] Figure 18 is a flowchart of a video decoding method according to an embodiment.

[0030] Figure 19 is a block diagram of a video encoding apparatus according to an embodiment.

[0031] Figure 20 is a flowchart of a video encoding method according to an embodiment.

[0032] Figure 21 is an overview of introducing a quantization parameter (QP) in a picture level or slice level according to an embodiment.

[0033] Figure 22 A picture parameter set including picture header QP difference information according to an embodiment is shown.

[0034] Figure 23 A picture header including a QP difference of a current picture according to an embodiment is shown.

[0035] Figure 24 A slice header including a QP difference of a current slice according to an embodiment is shown.

[0036] Figure 25 A picture parameter set including information indicating whether a picture header includes a deblocking filter related parameter according to an embodiment is shown.

[0037] Figure 26 A picture header including a deblocking filter related parameter of a current picture according to an embodiment is shown.

[0038] Figure 27 A slice header including a deblocking filter related parameter of a current slice according to an embodiment is shown.

[0039] Figure 28 A picture parameter set including information indicating whether a picture header includes a plurality of tool-related parameters is shown according to an embodiment.

[0040] Figure 29 A picture header including weighted prediction-related parameters, sample adaptive offset (SAO)-related parameters, and reference picture list-related parameters of a current picture is shown according to an embodiment.

[0041] Figure 30 A picture header including adaptive loop filter (ALF)-related parameters of a current picture is shown according to an embodiment.

[0042] Figure 31 A slice header including reference picture list-related parameters, weighted prediction-related parameters, and SAO-related parameters of a current slice is shown according to an embodiment.

[0043] Figure 32 A slice header including ALF-related parameters of a current slice is shown according to an embodiment.

[0044] Best mode

[0045] A video decoding method according to an embodiment provided by the disclosure includes obtaining, from a picture parameter set, a quantization parameter (QP) initial value to be applied to a current picture, and obtaining, from the picture parameter set, picture header QP difference information indicating whether QP difference information is present in a picture header of the current picture; when the picture header QP difference information indicates that the QP difference information is present in the picture header of the current picture, obtaining, from the picture header, a first QP difference value of the current picture; determining a QP of a coding unit included in the current picture by using the QP initial value and the first QP difference value; obtaining a transform coefficient of the coding unit by performing inverse quantization on the coding unit by using the QP; and reconstructing the coding unit by using the transform coefficient.

[0046] According to an embodiment, the video decoding method can further include, when the picture header QP difference information indicates that the QP difference information is not present in the picture header, obtaining, from a slice header of a current slice included in the current picture, a second QP difference value of the current slice; determining a QP of a coding unit included in the current slice by using the QP initial value and the second QP difference value; obtaining a transform coefficient of the coding unit by performing inverse quantization on the coding unit by using the QP; and reconstructing the coding unit by using the transform coefficient.

[0047] According to an embodiment, obtaining transform coefficients of the coding unit by performing inverse quantization on the coding unit using the QP can include obtaining a QP difference value of a luma component of the current picture from a picture header; determining a QP of the luma component of a slice included in the current picture by adding a QP initial value and the first QP difference value of the luma component; and determining a QP of the coding unit included in the current picture and in the slice by using the QP of the luma component of the slice.

[0048] According to an embodiment, determining the QP of the coding unit can include obtaining a QP difference value of the coding unit from a bitstream; and determining a QP of a luma component of the coding unit by using the QP of the luma component of the slice and the QP difference value of the coding unit.

[0049] According to an embodiment, obtaining transform coefficients of the coding unit by performing inverse quantization on the coding unit using the QP can include obtaining a second QP difference value of a luma component of the current slice from a slice header; determining a QP of the luma component of the current slice by adding a QP initial value and the second QP difference value of the luma component; and determining a QP of the coding unit included in the current slice by using the QP of the luma component of the current slice.

[0050] According to an embodiment, determining the QP of the coding unit can include obtaining a QP difference value of the coding unit from a bitstream; and determining a QP of a luma component of the coding unit by using the QP of the luma component of the current slice and the QP difference value of the coding unit.

[0051] According to an embodiment, obtaining transform coefficients of the coding unit by performing inverse quantization on the coding unit using the QP can include obtaining a Cb QP difference value of a Cb chroma component of the current slice and a Cr QP difference value of a Cr chroma component of the current slice from a slice header; updating a QP of the Cb chroma component of the current coding unit by using the Cb QP difference value of the Cb chroma component of the current slice to determine a Cb QP of the Cb chroma component of the current coding unit included in the current slice; and updating a QP of the Cr chroma component of the current coding unit by using the Cr QP difference value of the Cr chroma component of the current slice to determine a Cr QP of the Cr chroma component of the current coding unit.

[0052] A video decoding apparatus according to an embodiment provided by the disclosure includes an obtainer configured to obtain, from a picture parameter set, a QP initial value to be applied to a current picture, obtain, from the picture parameter set, picture header QP difference information indicating whether QP difference information is included in a picture header of the current picture, and when the picture header QP difference information indicates that the QP difference information is included in the picture header, obtain a first QP difference value of the current picture from the picture header; and a decoder configured to, when the picture header QP difference information indicates that the QP difference information is included in the picture header, determine a QP of a coding unit included in the current picture by using the QP initial value and the first QP difference value, obtain transform coefficients of the coding unit by performing inverse quantization on the coding unit using the QP, and reconstruct the coding unit by using the transform coefficients of the coding unit.

[0053] A video encoding method according to an embodiment provided by the disclosure includes determining a QP initial value to be applied to a current picture, when the QP initial value is determined for each picture, determining a first QP difference value between the QP initial value and a QP used in the current picture, and generating a picture header for the current picture, the picture header including the first QP difference value, and generating a picture parameter set including the QP initial value and picture header QP difference information indicating whether QP difference information exists in the picture header of the current picture.

[0054] According to an embodiment, the video encoding method can further include, when the QP initial value is determined for each slice, determining a second QP difference value between the QP initial value and a QP used in a current slice included in the current picture, and generating a slice header of the current slice, the slice header including the second QP difference value.

[0055] According to an embodiment, the generating of the picture header of the current picture including the first QP difference value can include determining a QP of a luminance component of a slice included in the current picture, and determining the first QP difference value of the luminance component of the current picture by using a difference value between the QP initial value and the QP of the luminance component of the slice included in the current picture.

[0056] According to an embodiment, the determining of the first QP difference value can include determining a QP difference value of a coding unit by using a difference value between a QP of a luminance component of the coding unit and the QP of the luminance component of the slice, and encoding the QP difference value of the coding unit.

[0057] According to an embodiment, the generating of the slice header of the current slice including the second QP difference value can include determining a QP of a luminance component of the current slice, and determining the second QP difference value of the luminance component of the current slice by using a difference value between the QP of the luminance component of the current slice and the QP initial value.

[0058] According to an embodiment, determining the second QP difference value can comprise determining the QP difference value of the coding unit by subtracting the QP of the luma component of the current slice from the QP of the luma component of the coding unit, and encoding the QP difference value of the coding unit.

[0059] According to an embodiment, determining the second QP difference value can comprise determining a Cb QP difference value of a Cb chroma component of a current coding unit included in the current slice, the Cb QP difference value being used to determine a QP of the Cb chroma component of the current coding unit, determining a Cr QP difference value of a Cr chroma component of the current coding unit, the Cr QP difference value being used to determine a QP of the Cr chroma component of the current coding unit, and encoding the Cb QP difference value of the Cb chroma component of the current slice and the Cr QP difference value of the Cr chroma component of the current slice, and generating a slice header of the current slice, the slice header including the Cb QP difference value and the Cr QP difference value.

[0060] A computer-readable recording medium having recorded thereon a program for executing on a computer a video decoding method according to an embodiment of the disclosure.

[0061] A computer-readable recording medium having recorded thereon a program for executing on a computer a video encoding method according to an embodiment of the disclosure. DETAILED DESCRIPTION

[0062] Since the present disclosure allows various changes and numerous examples, specific embodiments will be shown in the drawings and described in detail in the written description. However, this is not intended to limit the present disclosure to a specific mode of practice, and it will be understood that all changes, equivalents, and substitutes not departing from the spirit and technical scope of the present disclosure are included in the present disclosure.

[0063] In the description of the embodiments, when it is considered that certain detailed explanations of related art can unnecessarily obscure the essence of the present disclosure, these explanations are omitted. Also, the numbers used in the description of the specification (e.g., first, second, etc.) are merely identifier codes to distinguish one element from another.

[0064] Also, in the present specification, it will be understood that when elements are "connected" or "coupled" to each other, the elements can be directly connected or coupled to each other, but can be optionally connected or coupled to each other through intermediate elements therebetween, unless otherwise specified.

[0065] In the present specification, regarding elements expressed as “unit” or “module”, two or more elements can be combined into one element according to a subdivided function, or one element can be divided into two or more elements. In addition, each element described below can perform part or all of the functions performed by another element in addition to its own main function, and some main functions of each element can be performed entirely by another component.

[0066] In addition, in the present specification, “image” or “picture” can mean a still image or a moving image, i.e., a video itself, of a video.

[0067] In addition, in the present specification, “sample” means data assigned to a sampling position of an image, i.e., data to be processed. For example, a pixel value of an image in a spatial domain and a transform coefficient on a transform region can be a sample. A unit including at least one such sample can be defined as a block.

[0068] In addition, in the present specification, “current block” can mean a block of a maximum coding unit, a coding unit, a prediction unit, or a transform unit of a current image to be encoded or decoded.

[0069] In the present specification, a motion vector in a list 0 direction can mean a motion vector for indicating a block in a reference picture included in a list 0, and a motion vector in a list 1 direction can mean a motion vector for indicating a block in a reference picture included in a list 1. In addition, a single-direction motion vector can mean a motion vector for indicating a block in a reference picture included in a list 0 or a list 1, and a bi-directional motion vector can mean a motion vector including a motion vector in a list 0 direction and a motion vector in a list 1 direction.

[0070] In addition, in the present specification, “binary split” of a block means a split for generating two sub-blocks whose width or height is half of the width or height of the block. In detail, when “binary vertical split” is performed on a current block, a split is performed in a vertical direction (portrait direction) with a half width of the current block, and thus two sub-blocks having a half width of the current block and the same height as the current block can be generated. When “binary horizontal split” is performed on a current block, a split is performed in a horizontal direction (landscape direction) with a half height of the current block, and thus two sub-blocks having a half height of the current block and the same width as the current block can be generated.

[0071] Further, in the present specification, "triple split" of a block means a split for generating three sub-blocks whose width or height is 1:2:1 of the width or height of the block. In detail, when "triple vertical split" is performed on a current block, a split is performed in a vertical direction (longitudinal direction) at a point of 1:2:1 of the width of the current block, and thus two sub-blocks having a width of 1 / 4 of the width of the current block and the same height as the current block, and one sub-block having a width of 2 / 4 of the width of the current block and the same height as the current block can be generated. When "triple horizontal split" is performed on a current block, a split is performed in a horizontal direction (transverse direction) at a point of 1:2:1 of the height of the current block, and thus two sub-blocks having a height of 1 / 4 of the height of the current block and the same width as the current block, and one sub-block having a height of 2 / 4 of the height of the current block and the same width as the current block can be generated.

[0072] Further, in the present specification, "quad split" of a block means a split for generating four sub-blocks whose width and height are 1:1 of the width and height of the block. In detail, when "quad split" is performed on a current block, a split is performed in a vertical direction (longitudinal direction) at a half width of the current block, a split is performed in a horizontal direction (transverse direction) at a half height of the current block, and thus four sub-blocks having a width of 1 / 2 of the width of the current block and a height of 1 / 2 of the height of the current block can be generated.

[0073] Hereinafter, a method of determining a data unit of an image according to an embodiment will be described with reference to Figures 1 to 16 An image encoding apparatus and an image decoding apparatus according to an embodiment and an image encoding method and an image decoding method according to an embodiment will be described with reference to Figures 3 to 16 A method of determining a data unit of an image according to an embodiment will be described, and a method of encoding / decoding a video according to an embodiment using the determined data unit will be described with reference to Figures 17 to 20 A method of encoding / decoding a video according to an embodiment using the determined data unit will be described with reference to

[0074] Hereinafter, a method of encoding / decoding a video according to an embodiment will be described with reference to Figure 1 and Figure 2 A method and an apparatus for adaptive selection of multiple shapes of coding units according to an embodiment of the disclosure will be described.

[0075] Figure 1 is a schematic block diagram of an image decoding apparatus according to an embodiment.

[0076] The image decoding apparatus 100 can include a receiver 110 and a decoder 120. The receiver 110 and the decoder 120 can include at least one processor. Further, the receiver 110 and the decoder 120 can include a memory storing instructions to be executed by the at least one processor.

[0077] The receiver 110 can receive a bitstream. The bitstream includes information of an image encoded by an image encoding apparatus 2200 described later. Also, the bitstream can be transmitted from the image encoding apparatus 2200. The image encoding apparatus 2200 and the image decoding apparatus 100 can be connected via a wired or wireless connection, and the receiver 110 can receive the bitstream via a wired or wireless. The receiver 110 can receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoder 120 can reconstruct an image based on information obtained from the received bitstream. The decoder 120 can obtain syntax elements for reconstructing an image from the bitstream. The decoder 120 can reconstruct an image based on the syntax elements.

[0078] The operation of the image decoding apparatus 100 will be described in detail with reference to Figure 2 The operation of the image decoding apparatus 100 will be described in detail with reference to

[0079] Figure 2 is a flowchart of an image decoding method according to an embodiment.

[0080] According to an embodiment of the disclosure, the receiver 110 receives a bitstream.

[0081] The image decoding apparatus 100 obtains a bin string corresponding to a division shape mode of a coding unit from the bitstream (operation 210). The image decoding apparatus 100 determines a division rule of the coding unit (operation 220). Also, the image decoding apparatus 100 divides the coding unit into a plurality of coding units based on at least one of the bin string corresponding to the division shape mode or the division rule (operation 230). The image decoding apparatus 100 can determine a first range of allowable sizes of the coding unit according to an aspect ratio of the coding unit, thereby determining the division rule. The image decoding apparatus 100 can determine a second range of allowable sizes of the coding unit according to a division shape mode of the coding unit, thereby determining the division rule.

[0082] Hereinafter, the division of the coding unit will be described in detail according to an embodiment of the disclosure.

[0083] First, one picture can be divided into one or more slices or one or more tiles. One slice or one tile can be a sequence of one or more largest coding units (coding tree units (CTUs)). There is a largest coding block (coding tree block (CTB)) in concept compared to the largest coding unit (CTU).

[0084] The largest coding unit (CTB) denotes an NxN block (N is an integer) including NxN samples. Each color component can be divided into one or more largest coding blocks.

[0085] When a picture includes three sample arrays (sample arrays of Y, Cr, and Cb components), a largest coding unit (CTU) includes a largest coding block of luma samples, two corresponding largest coding blocks of chroma samples, and a syntax structure for coding the luma samples and the chroma samples. When a picture is a monochrome picture, a largest coding unit includes a largest coding block of monochrome samples and a syntax structure for coding the monochrome samples. When a picture is a picture coded in color planes separated according to color components, a largest coding unit includes the picture and a syntax structure for coding the samples of the picture.

[0086] A largest coding block (CTB) can be divided into M x N coding blocks including M x N samples (M and N are integers).

[0087] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and a syntax structure for coding the luma samples and the chroma samples. When a picture is a monochrome picture, a coding unit includes a coding block of monochrome samples and a syntax structure for coding the monochrome samples. When a picture is a picture coded in color planes separated according to color components, a coding unit includes the picture and a syntax structure for coding the samples of the picture.

[0088] As described above, a largest coding block and a largest coding unit are conceptually different from each other, and a coding block and a coding unit are conceptually different from each other. That is, a (largest) coding unit refers to a data structure including a (largest) coding block including corresponding samples and a syntax structure corresponding to the (largest) coding block. However, because it is understood by one of ordinary skill in the art that a (largest) coding unit or a (largest) coding block refers to a block of a specific size including a specific number of samples, a largest coding block and a largest coding unit or a coding block and a coding unit are referred to without distinction in the following description unless otherwise described.

[0089] A picture can be divided into largest coding units (CTUs). The size of each largest coding unit can be determined based on information obtained from a bitstream. The shape of each largest coding unit can be a square of the same size. However, the disclosure is not limited thereto.

[0090] For example, information about a maximum size of a luma coding block can be obtained from a bitstream. For example, a maximum size of a luma coding block indicated by the information about the maximum size of the luma coding block can be one of 4 x 4, 8 x 8, 16 x 16, 32 x 32, 64 x 64, 128 x 128, and 256 x 256.

[0091] For example, information on a luma block size difference and a maximum size of a luma coding block that is divisible by two can be obtained from the bitstream. The information on the luma block size difference can refer to a size difference between a luma maximum coding unit and a maximum luma coding block that is divisible by two. Thus, when the information on the maximum size of the luma coding block that is divisible by two and the information on the luma block size difference obtained from the bitstream are combined with each other, a size of the luma maximum coding unit can be determined. A size of a chroma maximum coding unit can be determined by using the size of the luma maximum coding unit. For example, when a ratio of Y:Cb:Cr is 4:2:0 according to a color format, a size of a chroma block can be half of a size of a luma block, and a size of the chroma maximum coding unit can be half of a size of the luma maximum coding unit.

[0092] According to an embodiment, because information on a maximum size of a luma coding block that is divisible by two is obtained from the bitstream, the maximum size of the luma coding block that is divisible by two can be variably determined. In contrast, a maximum size of a luma coding block that is divisible by three can be fixed. For example, the maximum size of the luma coding block that is divisible by three can be 32x32 in an I picture, and the maximum size of the luma coding block that is divisible by three can be 64x64 in a P picture or a B picture.

[0093] Further, a maximum coding unit can be hierarchically divided into coding units based on division shape mode information obtained from the bitstream. At least one of information indicating whether or not quad division is performed, information indicating whether or not multi-division is performed, division direction information, or division type information can be obtained as the division shape mode information from the bitstream.

[0094] For example, the information indicating whether or not quad division is performed can indicate whether or not a current coding unit is to be quad divided (QUAD_SPLIT).

[0095] When the current coding unit is not quad divided, the information indicating whether or not multi-division is performed can indicate whether or not the current coding unit is no longer divided (NO_SPLIT) or is binary / trinary divided.

[0096] When the current coding unit is binary divided or trinary divided, the division direction information indicates that the current coding unit is divided in one of a horizontal direction and a vertical direction.

[0097] When the current coding unit is divided in the horizontal direction or the vertical direction, the division type information indicates whether or not the current coding unit is binary divided or trinary divided.

[0098] The split mode of the current coding unit can be determined according to the split direction information and the split type information. The split mode of the current coding unit when the current coding unit is bi-split in the horizontal direction can be determined as a bi-split horizontal split mode (SPLIT_BT_HOR), the split mode of the current coding unit when the current coding unit is tri-split in the horizontal direction can be determined as a tri-split horizontal split mode (SPLIT_TT_HOR), the split mode of the current coding unit when the current coding unit is bi-split in the vertical direction can be determined as a bi-split vertical split mode (SPLIT_BT_VER), and the split mode of the current coding unit when the current coding unit is tri-split in the vertical direction can be determined as a tri-split vertical split mode SPLIT_BT_VER.

[0099] The image decoding apparatus 100 can obtain a bin string of the split shape mode information from the bitstream. The form of the bitstream received by the image decoding apparatus 100 can include a fixed length bin code, a unary code, a truncated unary code, a predetermined bin code, etc. The bin string is information in a binary number. The bin string can include at least one bit. The image decoding apparatus 100 can obtain the split shape mode information corresponding to the bin string based on a split rule. The image decoding apparatus 100 can determine whether to quad-split a coding unit, whether to split a coding unit, a split direction, and a split type based on one bin string.

[0100] The coding unit can be smaller than or equal to the maximum coding unit. For example, because the maximum coding unit is a coding unit having the largest size, the maximum coding unit is one of the coding units. When the split shape mode information about the maximum coding unit indicates that no split is performed, the coding unit determined in the maximum coding unit has the same size as the maximum coding unit. When the split shape mode information about the maximum coding unit indicates that a split is performed, the maximum coding unit can be split into coding units. Also, when the split shape mode information about a coding unit indicates that a split is performed, the coding unit can be split into smaller coding units. However, the split of the image is not limited thereto, and can not distinguish between the maximum coding unit and the coding unit. This will be described in detail with reference to FIGS. 2 to 4. Figures 3 to 16 The split of the coding unit is described in detail.

[0101] Also, one or more prediction blocks for prediction can be determined from the coding unit. The prediction block can be the same as or smaller than the coding unit. Also, one or more transform blocks for transform can be determined from the coding unit. The transform block can be the same as or smaller than the coding unit.

[0102] The shapes and sizes of the transform block and the prediction block can be irrelevant to each other.

[0103] In another embodiment, prediction can be performed by using a coding unit as a prediction unit. Further, transform can be performed by using a coding unit as a transform block.

[0104] The partitioning of a coding unit will be described with reference to Figures 3 to 16 A current block of a current coding unit is a block that is currently being decoded or encoded or a block that is currently being partitioned. A neighboring block can be a block that is reconstructed before the current block. The neighboring block can be spatially or temporally adjacent to the current block. The neighboring block can be located in one of a lower-left, left, upper-left, top, upper-right, right, lower-right of the current block.

[0105] Figure 3 A process of determining at least one coding unit by partitioning a current coding unit performed by an image decoding apparatus according to an embodiment is illustrated.

[0106] A block shape can include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N. Here, N can be a positive integer. Block shape information is information indicating at least one of a shape, a direction, an aspect ratio, or a size of a coding unit.

[0107] A shape of a coding unit can include a square and a non-square. When lengths of a width and a height of a coding unit are the same (i.e., when a block shape of the coding unit is 4Nx4N), the image decoding apparatus 100 can determine block shape information of the coding unit as a square. The image decoding apparatus 100 can determine a shape of the coding unit as a non-square.

[0108] When the width and the height of the coding unit are not the same as each other (i.e., when the block shape of the coding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the image decoding apparatus 100 can determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is a non-square, the image decoding apparatus 100 can determine an aspect ratio in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, or 32:1. Further, the image decoding apparatus 100 can determine whether the coding unit is in a horizontal direction or a vertical direction based on a width length and a height length of the coding unit. Further, the image decoding apparatus 100 can determine a size of the coding unit based on at least one of a width length, a height length, or an area of the coding unit.

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

[0110] The image decoding apparatus 100 can obtain the partition shape mode information from the bitstream. However, embodiments are not limited thereto, and the image decoding apparatus 100 and the image encoding apparatus 2200 can determine the pre-agreed partition shape mode information based on the block shape information. The image decoding apparatus 100 can determine the pre-agreed partition shape mode information with respect to the maximum coding unit or the minimum coding unit. For example, the image decoding apparatus 100 can determine the partition shape mode information with respect to the maximum coding unit as quad partitioning. Also, the image decoding apparatus 100 can determine the partition shape mode information with respect to the minimum coding unit as "no partitioning". Specifically, the image decoding apparatus 100 can determine the size of the maximum coding unit as 256x256. The image decoding apparatus 100 can determine the pre-agreed partition shape mode information as quad partitioning. Quad partitioning is a kind of partition shape mode in which the width and the height of a coding unit are both bisected. Based on the partition shape mode information, the image decoding apparatus 100 can obtain a coding unit of 128x128 size from the maximum coding unit of 256x256 size. Also, the image decoding apparatus 100 can determine the size of the minimum coding unit as 4x4. The image decoding apparatus 100 can obtain the partition shape mode information indicating "no partitioning" with respect to the minimum coding unit.

[0111] According to an embodiment, the image decoding apparatus 100 can use the block shape information indicating that the current coding unit has a square shape. For example, the image decoding apparatus 100 can determine whether to partition the square coding unit, whether to vertically partition the square coding unit, whether to horizontally partition the square coding unit, or whether to partition the square coding unit into four coding units based on the partition shape mode information. Referring to Figure 3 When the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 can determine that the coding unit 310a having the same size as the current coding unit 300 is not partitioned based on the partition shape mode information indicating no partitioning, or can determine that the coding units 310b, 310c, 310d, 310e, or 310f are partitioned based on the partition shape mode information indicating a specific partitioning method.

[0112] Referring to Figure 3According to embodiments, the image decoding apparatus 100 can determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction, based on the division shape mode information indicating that the division is performed in the vertical direction. The image decoding apparatus 100 can determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction, based on the division shape mode information indicating that the division is performed in the horizontal direction. The image decoding apparatus 100 can determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions, based on the division shape mode information indicating that the division is performed in the vertical and horizontal directions. According to embodiments, the image decoding apparatus 100 can determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction, based on the division shape mode information indicating that the ternary division is performed in the vertical direction. The image decoding apparatus 100 can determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction, based on the division shape mode information indicating that the ternary division is performed in the horizontal direction. However, the division method of the square coding unit is not limited to the above-described methods, and the division shape mode information can indicate various methods. Certain division methods of dividing the square coding unit will be described in detail below in connection with various embodiments.

[0113] Figure 4 A process of determining at least one coding unit by dividing a non-square coding unit performed by an image decoding apparatus according to an embodiment is shown.

[0114] According to embodiments, the image decoding apparatus 100 can use the block shape information indicating that the current coding unit has a non-square shape. The image decoding apparatus 100 can determine whether to divide the non-square current coding unit or whether to divide the non-square current coding unit by using a certain division method, based on the division shape mode information. Referring to FIGS. 4 and 5, the image decoding apparatus 100 can determine whether to divide the non-square current coding unit 400 or 450, based on the division shape mode information. Figure 4 When the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the image decoding apparatus 100 can determine that the coding unit 410 or 460 having the same size as the current coding unit 400 or 450 is not divided, based on the division shape mode information indicating no division, or determine that the coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c are divided, based on the division shape mode information indicating a certain division method. Certain division methods of dividing the non-square coding unit will be described in detail below in connection with various embodiments.

[0115] According to an embodiment, the image decoding apparatus 100 can determine a partitioning method of a coding unit by using the partition shape mode information, in which case the partition shape mode information can indicate a number of one or more coding units generated by partitioning the coding unit. Referring to Figure 4 When the partition shape mode information indicates that the current coding unit 400 or 450 is partitioned into two coding units, the image decoding apparatus 100 can determine two coding units 420a and 420b or 470a and 470b included in the current coding unit 400 or 450 by partitioning the current coding unit 400 or 450 based on the partition shape mode information.

[0116] According to an embodiment, when the image decoding apparatus 100 partitions the non-square current coding unit 400 or 450 based on the partition shape mode information, the image decoding apparatus 100 can partition the current coding unit considering a position of a long side of the non-square current coding unit 400 or 450. For example, the image decoding apparatus 100 can determine a plurality of coding units by partitioning a long side of the current coding unit 400 or 450, considering a shape of the current coding unit 400 or 450.

[0117] According to an embodiment, when the partition shape mode information indicates that the coding unit is partitioned (ternary split) into an odd number of blocks, the image decoding apparatus 100 can determine an odd number of coding units included in the current coding unit 400 or 450. For example, when the partition shape mode information indicates that the current coding unit 400 or 450 is partitioned into three coding units, the image decoding apparatus 100 can partition the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.

[0118] According to an embodiment, the aspect ratio of the current coding unit 400 or 450 can be 4:1 or 1:4. When the aspect ratio is 4:1, the block shape information can be horizontal direction because the length of the width is longer than the length of the height. When the aspect ratio is 1:4, the block shape information can be vertical direction because the length of the width is shorter than the length of the height. The image decoding apparatus 100 can determine to divide the current coding unit into an odd number of blocks based on the division shape mode information. In addition, the image decoding apparatus 100 can determine a division direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 is in a vertical direction, the image decoding apparatus 100 can determine the coding units 430a to 430c by dividing the current coding unit 400 in a horizontal direction. In addition, when the current coding unit 450 is in a horizontal direction, the image decoding apparatus 100 can determine the coding units 480a to 480c by dividing the current coding unit 450 in a vertical direction.

[0119] According to an embodiment, the image decoding apparatus 100 can determine an odd number of coding units included in the current coding unit 400 or 450, and not all of the determined coding units can have the same size. For example, a specific coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c can have a size different from the other coding units 430a and 430c or 480a and 480c. That is, the coding units that can be determined by dividing the current coding unit 400 or 450 can have a variety of sizes, and in some cases, all of the odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c can have different sizes.

[0120] According to an embodiment, when the division shape mode information indicates to divide the coding unit into an odd number of blocks, the image decoding apparatus 100 can determine an odd number of coding units included in the current coding unit 400 or 450, and in addition, can impose a specific restriction on at least one coding unit among the odd number of coding units generated by dividing the current coding unit 400 or 450. Referring to Figure 4, the image decoding apparatus 100 can set a decoding process with respect to a center located coding unit 430b or 480b among three coding units 430a, 430b, and 430c or 480a, 480b, and 480b generated when the current coding unit 400 or 450 is divided differently from other coding units 430a and 430c, 480a or 480c. For example, unlike other coding units 430a and 430c or 480a and 480c, the image decoding apparatus 100 can limit the center located coding unit 430b or 480b not to be divided any more or to be divided only a certain number of times.

[0121] Figure 5 A process of dividing a coding unit based on at least one of block shape information or division shape mode information performed by an image decoding apparatus according to an embodiment is illustrated.

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

[0123] According to an embodiment, based on the division shape mode information, the image decoding apparatus 100 can determine to divide or not to divide the determined second coding unit 510 into coding units. Referring to Figure 5, the image decoding apparatus 100 can divide the second coding unit 510 determined by dividing the first coding unit 500 into one or more third coding units 520a or 520b, 520c, and 520d based on the division shape mode information, or can not be divided. The image decoding apparatus 100 can obtain the division shape mode information, and can obtain a plurality of second coding units (for example, the second coding unit 510) of various shapes by dividing the first coding unit 500 based on the obtained division shape mode information, and can divide the second coding unit 510 by using the division method of the first coding unit 500 based on the division shape mode information. According to an embodiment, when the first coding unit 500 is divided into the second coding unit 510 based on the division shape mode information of the first coding unit 500, the second coding unit 510 can also be divided into the third coding unit 520a or 520b, 520c, and 520d based on the division shape mode information of the second coding unit 510. That is, the coding units can be recursively divided based on the division shape mode information of each coding unit. Accordingly, the square coding unit can be determined by dividing the non-square coding unit, and the non-square coding unit can be determined by recursively dividing the square coding unit.

[0124] Referring to Figure 5 A particular coding unit (for example, a coding unit located at a center position or a square coding unit) among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 can be recursively divided. According to an embodiment, the square third coding unit 520b among the odd number of third coding units 520b, 520c, and 520d can be divided into a plurality of fourth coding units in a horizontal direction. The non-square fourth coding units 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d can be again divided into a plurality of coding units. For example, the non-square fourth coding units 530b or 530d can be again divided into an odd number of coding units. Methods that can be used for recursively dividing coding units will be described below in connection with various embodiments.

[0125] According to an embodiment, the image decoding apparatus 100 can divide each of the third coding units 520a or 520b, 520c, and 520d into coding units based on the division shape mode information. Further, the image decoding apparatus 100 can determine not to divide the second coding unit 510 based on the division shape mode information. According to an embodiment, the image decoding apparatus 100 can divide the second coding unit 510, which is not a square, into an odd number of third coding units 520b, 520c, and 520d. The image decoding apparatus 100 can apply a specific restriction to a specific third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding apparatus 100 can restrict the third coding unit 520c, which is located at a center position among the odd number of third coding units 520b, 520c, and 520d included in the second coding unit 510, which is not a square, from being divided again or from being divided a number of times that can be set by using a specific division method (e.g., divided only into four coding units or divided by using the division method of the second coding unit 510) or divided only a specific number of times (e.g., divided only n times (where n > 0)).

[0126] Referring to Figure 5 , the image decoding apparatus 100 can restrict the third coding unit 520c, which is located at a center position among the odd number of third coding units 520b, 520c, and 520d included in the second coding unit 510, which is not a square, from being divided again, divided by using a specific division method (e.g., divided only into four coding units or divided by using the division method of the second coding unit 510), or divided only a specific number of times (e.g., divided only n times (where n > 0)). However, the restriction on the third coding unit 520c, which is located at the center position, is not limited to the above-described examples and can include various restrictions for decoding the third coding unit 520c, which is located at the center position, differently from the other third coding units 520b and 520d.

[0127] According to an embodiment, the image decoding apparatus 100 can obtain the division shape mode information for dividing the current coding unit from a specific position in the current coding unit.

[0128] Figure 6 A method of determining a specific coding unit from among an odd number of coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0129] Referring to Figure 6 , the division shape mode information of the current coding unit 600 or 650 can be obtained from a sample at a specific position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the specific position in the current coding unit 600 from which at least one piece of division shape mode information can be obtained is not limited to Figure 6The center position can be a position of a center of a current coding unit, and can include various positions (e.g., top, bottom, left, right, upper left, lower left, upper right, and lower right positions) included in the current coding unit 600. The image decoding apparatus 100 can obtain the partition shape mode information from a specific position, and can determine whether to partition the current coding unit into coding units of various shapes and various sizes.

[0130] According to an embodiment, when the current coding unit is partitioned into a specific number of coding units, the image decoding apparatus 100 can select one of the coding units. Various methods can be used to select one of the plurality of coding units, as will be described below with respect to various embodiments.

[0131] According to an embodiment, the image decoding apparatus 100 can partition the current coding unit into a plurality of coding units, and can determine a coding unit at a specific position.

[0132] According to an embodiment, the image decoding apparatus 100 can use information indicating positions of the odd number of coding units to determine a coding unit located at a center position from among the odd number of coding units. Referring to Figure 6 , the image decoding apparatus 100 can determine the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c by partitioning the current coding unit 600 or the current coding unit 650. The image decoding apparatus 100 can determine the middle coding unit 620b or the middle coding unit 660b by using information about positions of the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c. For example, the image decoding apparatus 100 can determine the coding unit 620b at the center position by determining positions of the coding units 620a, 620b, and 620c based on information indicating positions of specific samples included in the coding units 620a, 620b, and 620c. In detail, the image decoding apparatus 100 can determine the coding unit 620b located at the center position by determining positions of the coding units 620a, 620b, and 620c based on information indicating positions of upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c.

[0133] According to an embodiment, the information indicating the positions of the top-left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, can include information on positions or coordinates of the coding units 620a, 620b, and 620c in the picture. According to an embodiment, the information indicating the positions of the top-left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, can include information indicating widths or heights of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the widths or heights can correspond to information indicating differences between the coordinates of the coding units 620a, 620b, and 620c in the picture. That is, the image decoding apparatus 100 can determine the coding unit 620b located at the center position by directly using the information on the positions or coordinates of the coding units 620a, 620b, and 620c in the picture, or by using the information on the widths or heights of the coding units corresponding to the difference values between the coordinates.

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

[0135] According to an embodiment, the image decoding apparatus 100 can divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and can select one of the coding units 620a, 620b, and 620c based on a certain criterion. For example, the image decoding apparatus 100 can select the coding unit 620b having a size different from other coding units from among the coding units 620a, 620b, and 620c.

[0136] According to an embodiment, the image decoding apparatus 100 can determine a width or a height of each of the coding units 620a, 620b, and 620c by using a coordinate (xa, ya) that is information indicating a position of the top-left sample 630a of the top coding unit 620a, a coordinate (xb, yb) that is information indicating a position of the top-left sample 630b of the middle coding unit 620b, and a coordinate (xc, yc) that is information indicating a position of the top-left sample 630c of the bottom coding unit. The image decoding apparatus 100 can determine respective sizes of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating positions of the coding units 620a, 620b, and 620c. According to an embodiment, the image decoding apparatus 100 can determine a width of the top coding unit 620a as a width of the current coding unit 600. The image decoding apparatus 100 can determine a height of the top coding unit 620a as yb-ya. According to an embodiment, the image decoding apparatus 100 can determine a width of the middle coding unit 620b as a width of the current coding unit 600. The image decoding apparatus 100 can determine a height of the middle coding unit 620b as yc-yb. According to an embodiment, the image decoding apparatus 100 can determine a width or a height of the bottom coding unit 620c by using a width or a height of the current coding unit 600 or a width or a height of the top coding unit 620a and the middle coding unit 620b. The image decoding apparatus 100 can determine a coding unit having a size different from other coding units based on the determined widths and heights of the coding units 620a to 620c. Referring to Figure 6 , the image decoding apparatus 100 can determine the middle coding unit 620b having a size different from those of the top coding unit 620a and the bottom coding unit 620c as the coding unit in the certain position. However, the above-described method of determining a coding unit having a size different from those of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining a coding unit in a certain position by using sizes of coding units determined based on coordinates of samples, and thus various methods of determining a coding unit in a certain position by comparing sizes of coding units determined based on coordinates of certain samples can be used.

[0137] The image decoding apparatus 100 can determine the width or height of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) as information indicating the position of the top-left sample 670a of the left coding unit 660a, the coordinates (xe, ye) as information indicating the position of the top-left sample 670b of the middle coding unit 660b, and the coordinates (xf, yf) as information indicating the position of the top-left sample 670c of the right coding unit 660c. The image decoding apparatus 100 can determine the respective sizes of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.

[0138] According to an embodiment, the image decoding apparatus 100 can determine the width of the left coding unit 660a as xe-xd. The image decoding apparatus 100 can determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the image decoding apparatus 100 can determine the width of the middle coding unit 660b as xf-xe. The image decoding apparatus 100 can determine the height of the middle coding unit 660b as the height of the current coding unit 600. According to an embodiment, the image decoding apparatus 100 can determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 or the width or height of the left coding unit 660a and the middle coding unit 660b. The image decoding apparatus 100 can determine a coding unit having a size different from other coding units based on the determined widths and heights of the coding units 660a to 660c. Referring to Figure 6 , the image decoding apparatus 100 can determine the middle coding unit 660b having a size different from those of the left coding unit 660a and the right coding unit 660c as a coding unit in a specific position. However, the above-described method of determining a coding unit having a size different from those of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining a coding unit in a specific position by using the sizes of the coding units determined based on the coordinates of the samples, and thus various methods of determining a coding unit in a specific position by comparing the sizes of the coding units determined based on the coordinates of specific samples can be used.

[0139] However, the positions of the samples considered to determine the positions of the coding units are not limited to the above-described top-left positions, and information on arbitrary positions of the samples included in the coding units can be used.

[0140] According to an embodiment, the image decoding apparatus 100 can select a coding unit at a specific position from among the odd number of coding units determined by partitioning the current coding unit, in consideration of a shape of the current coding unit. For example, when the current coding unit has a non-square shape with a width greater than a height, the image decoding apparatus 100 can determine a coding unit at a specific position in a horizontal direction. That is, the image decoding apparatus 100 can determine one of the coding units having different positions in the horizontal direction and impose a restriction on the coding unit. When the current coding unit has a non-square shape with a height greater than a width, the image decoding apparatus 100 can determine a coding unit at a specific position in a vertical direction. That is, the image decoding apparatus 100 can determine one of the coding units having different positions in the vertical direction and impose a restriction on the coding unit.

[0141] According to an embodiment, the image decoding apparatus 100 can determine a coding unit at a specific position from among the even number of coding units using information indicating respective positions of the even number of coding units. The image decoding apparatus 100 can determine the even number of coding units by partitioning (binary partitioning) the current coding unit and can determine a coding unit at a specific position by using information about positions of the even number of coding units. Operations related thereto can correspond to operations of determining a coding unit at a specific position (e.g., a center position) from among the odd number of coding units, which have been described in detail above with respect to FIGS. 1 to 3, and thus a detailed description thereof is not provided here. Figure 6

[0142] According to an embodiment, when a non-square current coding unit is partitioned into a plurality of coding units, specific information about a coding unit at a specific position can be used in a partitioning operation to determine a coding unit at the specific position from among the plurality of coding units. For example, the image decoding apparatus 100 can use at least one of block shape information or partition shape mode information stored in a sample included in an intermediate coding unit in the partitioning operation to determine a coding unit at a center position from among the plurality of coding units determined by partitioning the current coding unit.

[0143] Referring to Figure 6 ​, the image decoding apparatus 100 can divide the current coding unit 600 into the plurality of coding units 620a, 620b, and 620c based on the division shape mode information, and can determine the coding unit 620b at the center position from among the plurality of coding units 620a, 620b, and 620c. Also, the image decoding apparatus 100 can determine the coding unit 620b at the center position in consideration of a position from which the division shape mode information is obtained. That is, the division shape mode information of the current coding unit 600 can be obtained from the sample 640 located at the center position of the current coding unit 600, and when the current coding unit 600 is divided into the plurality of coding units 620a, 620b, and 620c based on the division shape mode information, the coding unit 620b including the sample 640 can be determined as the coding unit at the center position. However, the information for determining the coding unit at the center position is not limited to the division shape mode information, and various types of information can be used to determine the coding unit at the center position.

[0144] According to an embodiment, the specific information for identifying the coding unit at the specific position can be obtained from a specific sample included in the coding unit to be determined. Referring to Figure 6 , the image decoding apparatus 100 can determine the coding unit at the specific position (e.g., the coding unit at the center position among the plurality of divided coding units) from among the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600 using the division shape mode information obtained from the sample at the specific position (e.g., the sample at the center position of the current coding unit 600). That is, the image decoding apparatus 100 can determine the sample at the specific position by considering the block shape of the current coding unit 600, determine the coding unit 620b including the sample from which the specific information (e.g., the division shape mode information) can be obtained from among the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and can apply the specific restriction to the coding unit 620b. Referring to Figure 5 , according to an embodiment, in the decoding operation, the image decoding apparatus 100 can determine the sample 640 at the center position of the current coding unit 600 as the sample from which the specific information can be obtained, and can apply the specific restriction to the coding unit 620b including the sample 640. However, the position of the sample from which the specific information can be obtained is not limited to the above-described position, and can include any position of the sample included in the coding unit 620b to be determined for the restriction.

[0145] According to an embodiment, the position of the sample from which the specific information can be obtained can be determined based on the shape of the current coding unit 600. According to an embodiment, the block shape information can indicate whether the current coding unit is a square or a non-square, and the position of the sample from which the specific information can be obtained can be determined based on the shape. For example, the image decoding apparatus 100 can determine a sample located on a boundary for dividing at least one of a width or a height of the current coding unit into two as a sample from which the specific information can be obtained by using at least one of information about the width of the current coding unit or information about the height of the current coding unit. As another example, when the block shape information of the current coding unit indicates a non-square shape, the image decoding apparatus 100 can determine one of samples including a boundary for dividing a long side of the current coding unit into two as a sample from which the predetermined information can be obtained.

[0146] According to an embodiment, when the current coding unit is divided into a plurality of coding units, the image decoding apparatus 100 can determine a coding unit at a specific position from among the plurality of coding units using the division shape mode information. According to an embodiment, the image decoding apparatus 100 can obtain the division shape mode information from a sample at a specific position in the coding unit, and divide the plurality of coding units generated by dividing the current coding unit by using the division shape mode information obtained from the sample at the specific position in each of the plurality of coding units. That is, the coding units can be recursively divided based on the division shape mode information obtained from the sample at the specific position in each coding unit. The operation of recursively dividing the coding units has been described above with respect to FIGS. 6A to 6D, and thus a detailed description thereof will not be provided here. Figure 7 The operation of recursively dividing the coding units has been described above with respect to FIGS. 6A to 6D, and thus a detailed description thereof will not be provided here.

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

[0148] Figure 7 FIGS. 7A to 7D illustrate an order in which the image decoding apparatus processes a plurality of coding units when the image decoding apparatus determines the plurality of coding units by dividing a current coding unit according to an embodiment.

[0149] According to an embodiment, based on the division shape mode information, the image decoding apparatus 100 can determine the second coding units 710a and 710b by dividing the first coding unit 700 in a vertical direction, determine the second coding units 730a and 730b by dividing the first coding unit 700 in a horizontal direction, or determine the second coding units 750a to 750d by dividing the first coding unit 700 in a vertical and horizontal direction.

[0150] Referring to Figure 7 , the image decoding apparatus 100 can determine to process the second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction in a horizontal direction order 710c. The image decoding apparatus 100 can determine to process the second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction in a vertical direction order 730c. The image decoding apparatus 100 can determine to process the second coding units 750a to 750d determined by dividing the first coding unit 700 in the vertical and horizontal directions in a particular order of processing coding units in one row and then processing coding units in the next row (e.g., in a raster scan order or a Z-scan order 750e).

[0151] According to an embodiment, the image decoding apparatus 100 can recursively divide coding units. Referring to Figure 7 , the image decoding apparatus 100 can determine a plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d by dividing the first coding unit 700, and recursively divide each of the determined plurality of coding units 710b, 730a and 730b, or 750a to 750d. The division method of the plurality of coding units 710b, 730a and 730b, or 750a to 750d can correspond to the division method of the first coding unit 700. As such, each of the plurality of coding units 710b, 730a and 730b, or 750a to 750d can be independently divided into a plurality of coding units. Referring to Figure 8 , the image decoding apparatus 100 can determine the second coding units 710a and 710b by dividing the first coding unit 700 in the vertical direction, and can determine to independently divide or not to divide each of the second coding units 710a and 710b.

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

[0153] According to an embodiment, a processing order of a coding unit can be determined based on an operation of partitioning the coding unit. In other words, a processing order of a coding unit can be determined based on a processing order of a coding unit immediately before partitioning. The image decoding apparatus 100 can determine a processing order of the third coding units 720a and 720b determined by partitioning the left second coding unit 710a independently of the right second coding unit 710b. Since the third coding units 720a and 720b are determined by partitioning the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b can be processed in a vertical direction order 720c. Since the left and right second coding units 710a and 710b are processed in a horizontal direction order 710c, the right second coding unit 710b can be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in the vertical direction order 720c. The operation of determining a processing order of a coding unit based on a coding unit before partitioning is not limited to the above-described example, and various methods can be used to independently process coding units partitioned and determined to be various shapes in a specific order.

[0154] Figure 8 A process of determining, by an image decoding apparatus, that a current coding unit is to be divided into an odd number of coding units when the coding units cannot be processed in a predetermined order is shown according to an embodiment.

[0155] According to an embodiment, the image decoding apparatus 100 can determine whether a current coding unit is divided into an odd number of coding units based on the obtained partition shape mode information. Referring to Figure 8 , the first coding unit 800, which is a square, can be divided into the second coding units 810a and 810b, which are not squares, and the second coding units 810a and 810b can be independently divided into the third coding units 820a and 820b and 820c to 820e. According to an embodiment, the image decoding apparatus 100 can determine the plurality of third coding units 820a and 820b by partitioning the left second coding unit 810a in the horizontal direction, and can divide the right second coding unit 810b into an odd number of third coding units 820c to 820e.

[0156] According to an embodiment, the image decoding apparatus 100 can determine whether any coding unit is divided into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c to 820e can be processed in a specific order. Referring to Figure 9, the image decoding apparatus 100 can determine the third coding units 820a and 820b and 820c to 820e by recursively partitioning the first coding unit 800. The image decoding apparatus 100 can determine whether any one of the first coding unit 800, the second coding units 810a and 810b, and the third coding units 820a and 820b and 820c to 820e is partitioned into an odd number of coding units based on at least one of the block shape information or the partition shape mode information. For example, the right second coding unit 810b among the second coding units 810a and 810b can be partitioned into an odd number of third coding units 820c, 820d, and 820e. The processing order of the plurality of coding units included in the first coding unit 800 can be a specific order (e.g., a Z-scan order 830), and the image decoding apparatus 100 can determine whether the third coding units 820c, 820d, and 820e determined by partitioning the right second coding unit 810b into an odd number of coding units satisfy a condition for processing in the specific order.

[0157] According to an embodiment, the image decoding apparatus 100 can determine whether the third coding units 820a and 820b and 820c to 820e included in the first coding unit 800 satisfy a condition for processing in a specific order, and the condition relates to whether at least one of the width or the height of the second coding units 810a and 810b is halved along the boundaries of the third coding units 820a and 820b and 820c to 820e. For example, the third coding units 820a and 820b determined when the height of the left second coding unit 810a, which is non-square, is halved can satisfy the condition. It can be determined that the third coding units 820c to 820e do not satisfy the condition because the boundaries of the third coding units 820c to 820e determined when the right second coding unit 810b is partitioned into three coding units cannot divide the width or the height of the right second coding unit 810b by half. When the condition is not satisfied as described above, the image decoding apparatus 100 can determine the disconnection of the scan order, and can determine that the right second coding unit 810b is partitioned into an odd number of coding units based on the determined result. According to an embodiment, when a coding unit is partitioned into an odd number of coding units, the image decoding apparatus 100 can impose a specific restriction on a coding unit at a specific position among the partitioned coding units. The restriction or the specific position has been described above with respect to various embodiments, and thus a detailed description thereof will not be provided any more.

[0158] Figure 9 A process of determining at least one coding unit by partitioning a first coding unit performed by an image decoding apparatus according to an embodiment is illustrated.

[0159] According to an embodiment, the image decoding apparatus 100 can divide the first coding unit 900 based on the division shape mode information obtained through the receiver 110. The square first coding unit 900 can be divided into four square coding units, or can be divided into a plurality of non-square coding units. For example, referring to Figure 9 When the division shape mode information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding apparatus 100 can divide the first coding unit 900 into a plurality of non-square coding units. In detail, when the division shape mode information indicates that an odd number of coding units are determined by dividing the first coding unit 900 in a horizontal direction or a vertical direction, the image decoding apparatus 100 can divide the square first coding unit 900 into the odd number of coding units, for example, the second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in the vertical direction, or the second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction.

[0160] According to an embodiment, the image decoding apparatus 100 can determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for processing in a particular order, and the condition relates to whether at least one of the width or the height of the first coding unit 900 is divided into two halves along the boundaries of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Referring to Figure 9 Since the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in the vertical direction do not divide the width of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a particular order. Also, since the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction do not divide the width of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a predetermined order. When the condition is not satisfied as described above, the image decoding apparatus 100 can decide the disconnection of the scan order, and can determine that the first coding unit 900 is divided into an odd number of coding units based on the result of the decision. According to an embodiment, when the coding units are divided into an odd number of coding units, the image decoding apparatus 100 can impose a particular restriction on the coding units at a particular position among the divided coding units. The restriction or the particular position has been described with respect to various embodiments above, and thus a detailed description thereof will not be provided any more.

[0161] According to an embodiment, the image decoding apparatus 100 can determine various shapes of coding units by partitioning the first coding unit.

[0162] Referring to Figure 10 , the image decoding apparatus 100 can partition the square first coding unit 900 or the non-square first coding unit 930 or 950 into various shapes of coding units.

[0163] Figure 11 It is shown that, according to an embodiment, when a second coding unit having a non-square shape determined when the image decoding apparatus partitions the first coding unit satisfies a certain condition, shapes into which the second coding unit can be partitioned are limited.

[0164] According to an embodiment, based on the partition shape mode information obtained by the receiver 110, the image decoding apparatus 100 can determine to partition the square first coding unit 1000 into the non-square second coding units 1010a and 1010b or 1020a and 1020b. The second coding units 1010a and 1010b or 1020a and 1020b can be independently partitioned. As such, the image decoding apparatus 100 can determine to partition or not to partition each of the second coding units 1010a and 1010b or 1020a and 1020b into a plurality of coding units based on the partition shape mode information of each of the second coding units 1010a and 1010b or 1020a and 1020b. According to an embodiment, the image decoding apparatus 100 can determine the third coding units 1012a and 1012b by partitioning the non-square left second coding unit 1010a determined by partitioning the first coding unit 1000 in the vertical direction in the horizontal direction. However, when the left second coding unit 1010a is partitioned in the horizontal direction, the image decoding apparatus 100 can limit the right second coding unit 1010b not to be partitioned in the horizontal direction in which the left second coding unit 1010a is partitioned. When the third coding units 1014a and 1014b are determined by partitioning the right second coding unit 1010b in the same direction, because the left second coding unit 1010a and the right second coding unit 1010b are independently partitioned in the horizontal direction, the third coding units 1012a and 1012b or 1014a and 1014b can be determined. However, this case is equivalent to a case in which the image decoding apparatus 100 partitions the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the partition shape mode information, and can be inefficient in terms of image decoding.

[0165] According to an embodiment, the image decoding apparatus 100 can determine the third coding units 1022a and 1022b or 1024a and 1024b by dividing the non-square second coding units 1020a or 1020b determined by dividing the first coding unit 1000 in the horizontal direction in the vertical direction. However, when a second coding unit (e.g., the upper second coding unit 1020a) is divided in the vertical direction, the image decoding apparatus 100 can restrict another second coding unit (e.g., the lower second coding unit 1020b) from being divided in the vertical direction in which the upper second coding unit 1020a is divided due to the above-described reason.

[0166] Figure 12 A process of dividing a square coding unit performed by an image decoding apparatus when division shape mode information cannot indicate that a square coding unit is divided into four square coding units according to an embodiment is illustrated.

[0167] According to an embodiment, the image decoding apparatus 100 can determine the second coding units 1110a and 1110b or 1120a and 1120b, etc. by dividing the first coding unit 1100 based on division shape mode information. The division shape mode information can include information on various methods of dividing a coding unit, but information on various division methods can not include information for dividing a coding unit into four square coding units. According to such division shape mode information, the image decoding apparatus 100 can not divide a square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. The image decoding apparatus 100 can determine the non-square second coding units 1110a and 1110b or 1120a and 1120b, etc. based on the division shape mode information.

[0168] According to an embodiment, the image decoding apparatus 100 can independently divide the non-square second coding units 1110a and 1110b or 1120a and 1120b, etc. Each of the second coding units 1110a and 1110b or 1120a and 1120b, etc. can be recursively divided in a certain order, and the division method can correspond to a method of dividing the first coding unit 1100 based on the division shape mode information.

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

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

[0171] Figure 12 It is shown that the processing order between a plurality of coding units according to an embodiment can change according to a process of dividing the coding units.

[0172] According to an embodiment, the image decoding apparatus 100 can divide the first coding unit 1200 based on the division shape mode information. When the block shape indicates a square and the division shape mode information indicates to divide the first coding unit 1200 in at least one of the horizontal direction or the vertical direction, the image decoding apparatus 100 can determine second coding units 1210a and 1210b or 1220a and 1220b, etc. by dividing the first coding unit 1200. Referring to FIG. 12, the image decoding apparatus 100 can determine square second coding units 1210a and 1210b by dividing the first coding unit 1200 in the horizontal direction, and can determine square second coding units 1220a and 1220b by dividing the first coding unit 1200 in the vertical direction. Figure 11, the non-square second coding units 1210a and 1210b or 1220a and 1220b determined by partitioning the first coding unit 1200 in only the horizontal direction or the vertical direction can be independently partitioned based on the partition shape mode information of each coding unit. For example, the image decoding apparatus 100 can determine third coding units 1216a, 1216b, 1216c, and 1216d by partitioning the second coding units 1210a and 1210b generated by partitioning the first coding unit 1200 in the vertical direction in the horizontal direction, and can determine third coding units 1226a, 1226b, 1226c, and 1226d by partitioning the second coding units 1220a and 1220b generated by partitioning the first coding unit 1200 in the horizontal direction in the horizontal direction. The operation of partitioning the second coding units 1210a and 1210b or 1220a and 1220b has been described above, and thus a detailed description thereof will not be provided here. Figure 7 The operation of partitioning the second coding units 1210a and 1210b or 1220a and 1220b has been described above, and thus a detailed description thereof will not be provided here.

[0173] According to an embodiment, the image decoding apparatus 100 can process the coding units in a certain order. The operation of processing the coding units in a predetermined order has been described above, and thus a detailed description thereof will not be provided here. With reference to Figure 12 The operation of processing the coding units in a predetermined order has been described above, and thus a detailed description thereof will not be provided here. With reference to Figure 12 , the image decoding apparatus 100 can determine four square third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d by partitioning the square first coding unit 1200. According to an embodiment, the image decoding apparatus 100 can determine a processing order of the third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d based on a partition method of the first coding unit 1200.

[0174] According to an embodiment, the image decoding apparatus 100 can determine third coding units 1216a, 1216b, 1216c, and 1216d by partitioning second coding units 1210a and 1210b generated by partitioning the first coding unit 1200 in the vertical direction in the horizontal direction, and can process the third coding units 1216a, 1216b, 1216c, and 1216d in the vertical direction in a processing order 1217 for initially processing third coding units 1216a and 1216c included in a left second coding unit 1210a, and then process third coding units 1216b and 1216d included in a right second coding unit 1210b in the vertical direction.

[0175] According to an embodiment, the image decoding apparatus 100 can determine the third coding units 1226a, 1226b, 1226c, and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction, and can process the third coding units 1226a, 1226b, 1226c, and 1226d in the horizontal direction in the processing order 1227 for initially processing the third coding units 1226a and 1226b included in the upper second coding unit 1220a, and then process the third coding units 1226c and 1226d included in the lower second coding unit 1220b in the horizontal direction.

[0176] Referring to Figure 13 The square third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d can be determined by dividing the second coding units 1210a and 1210b and 1220a and 1220b, respectively. Although the second coding units 1210a and 1210b are determined by dividing the first coding unit 1200 in the vertical direction differently from the second coding units 1220a and 1220b determined by dividing the first coding unit 1200 in the horizontal direction, the third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d therefrom finally show coding units of the same shape divided from the first coding unit 1200. As such, by recursively dividing coding units differently based on the division shape mode information, even when the coding units are finally determined to be of the same shape, the image decoding apparatus 100 can process the plurality of coding units in different orders.

[0177] Figure 13 A process of determining depths of coding units as shapes and sizes of the coding units change when the coding units are recursively divided to determine a plurality of coding units according to an embodiment is shown.

[0178] According to an embodiment, the image decoding apparatus 100 can determine the depth of a coding unit based on a certain criterion. For example, the certain criterion can be the length of the long side of the coding unit. When the length of the long side of the coding unit before division is 2n times (n > 0) the length of the long side of the current coding unit after division, the image decoding apparatus 100 can determine that the depth of the current coding unit is increased by n from the depth of the coding unit before division. In the following description, a coding unit having an increased depth is denoted as a coding unit of a deeper depth.

[0179] Referring to Figure 14According to an embodiment, the image decoding apparatus 100 can determine the second coding unit 1302 and the third coding unit 1304 of a deeper depth by dividing the first coding unit 1300 of a square shape based on the block shape information indicating the square shape (for example, the block shape information can be expressed as "0: SQUARE").

[0180] According to an embodiment, the image decoding apparatus 100 can determine the second coding unit 1312 or 1322 and the third coding unit 1314 or 1324 of a deeper depth by dividing the first coding unit 1310 or 1320 of a non-square shape based on the block shape information indicating the non-square shape (for example, the block shape information can be expressed as "1: NS_VER" indicating a non-square shape of which height is longer than width, or as "2: NS_HOR" indicating a non-square shape of which width is longer than height).

[0181] The image decoding apparatus 100 can determine the second coding unit 1302, 1312, or 1322 by dividing at least one of the width or the height of the first coding unit 1310 having the size of N×2N. That is, the image decoding apparatus 100 can determine the second coding unit 1302 having the size of N×N or the second coding unit 1322 having the size of N×N / 2 by dividing the first coding unit 1310 in the horizontal direction, or can determine the second coding unit 1312 having the size of N / 2×N by dividing the first coding unit 1310 in the horizontal and vertical directions.

[0182] According to an embodiment, the image decoding apparatus 100 can determine the second coding units 1302, 1312, or 1322 by dividing at least one of the width or the height of the first coding unit 1320 having a size of 2N×N. That is, the image decoding apparatus 100 can determine the second coding unit 1302 having a size of N×N or the second coding unit 1312 having a size of N / 2×N by dividing the first coding unit 1320 in a vertical direction, or can determine the second coding unit 1322 having a size of N×N / 2 by dividing the first coding unit 1320 in a horizontal and vertical direction.

[0183] According to an embodiment, the image decoding apparatus 100 can determine the third coding units 1304, 1314, or 1324 by dividing at least one of the width or the height of the second coding unit 1302 having a size of N×N. That is, the image decoding apparatus 100 can determine the third coding unit 1304 having a size of N / 2×N / 2, the third coding unit 1314 having a size of N / 4×N / 2, or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1302 in a vertical and horizontal direction.

[0184] According to an embodiment, the image decoding apparatus 100 can determine the third coding units 1304, 1314, or 1324 by dividing at least one of the width or the height of the second coding unit 1312 having a size of N / 2×N. That is, the image decoding apparatus 100 can determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1312 in a horizontal direction, or can determine the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1312 in a vertical and horizontal direction.

[0185] According to an embodiment, the image decoding apparatus 100 can determine the third coding units 1304, 1314, or 1324 by dividing at least one of the width or the height of the second coding unit 1322 having a size of N×N / 2. That is, the image decoding apparatus 100 can determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1322 in a vertical direction, or can determine the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1322 in a vertical and horizontal direction.

[0186] According to an embodiment, the image decoding apparatus 100 can divide the square coding unit 1300, 1302, or 1304 in a horizontal or vertical direction. For example, the image decoding apparatus 100 can determine a first coding unit 1310 having a size of N×2N by dividing the first coding unit 1300 having a size of 2N×2N in a vertical direction, or can determine a first coding unit 1320 having a size of 2N×N by dividing the first coding unit 1300 in a horizontal direction. According to an embodiment, when a depth is determined based on a length of a longest side of a coding unit, the depth of a coding unit determined by dividing the first coding unit 1300 having a size of 2N×2N in a horizontal or vertical direction can be the same as the depth of the first coding unit 1300.

[0187] According to an embodiment, the width and height of the third coding unit 1314 or 1324 can be 1 / 4 times those of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322 having a width and height of 1 / 2 times those of the first coding unit 1310 or 1320 can be D+1, and the depth of the third coding unit 1314 or 1324 having a width and height of 1 / 4 times those of the first coding unit 1310 or 1320 can be D+2.

[0188] Figure 14 It is shown that a depth that can be determined based on a shape and size of a coding unit and a part index (PID) for distinguishing the coding unit according to an embodiment.

[0189] According to an embodiment, the image decoding apparatus 100 can determine second coding units of various shapes by dividing the square first coding unit 1400. Referring to Figure 14 , the image decoding apparatus 100 can determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d by dividing the first coding unit 1400 in at least one of a vertical direction or a horizontal direction based on the division shape mode information. That is, the image decoding apparatus 100 can determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape mode information of the first coding unit 1400.

[0190] According to an embodiment, depths of the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d determined based on the partition shape mode information of the square first coding unit 1400 can be determined based on lengths of long sides thereof. For example, because the side length of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 1404a and 1404b, the first coding unit 2100 and the non-square second coding units 1402a and 1402b and 1404a and 1404b can have the same depth, e.g., D. However, because the side length of the square second coding units 1406a, 1406b, 1406c, and 1406d is 1 / 2 times the side length of the first coding unit 1400, the depths of the second coding units 1406a, 1406b, 1406c, and 1406d can be D+1 deeper than the depth D of the first coding unit 1400.

[0191] According to an embodiment, the image decoding apparatus 100 can determine a plurality of second coding units 1412a and 1412b and 1414a, 1414b, and 1414c by partitioning the first coding unit 1410 having a longer height than width in a horizontal direction based on the partition shape mode information. According to an embodiment, the image decoding apparatus 100 can determine a plurality of second coding units 1422a and 1422b and 1424a, 1424b, and 1424c by partitioning the first coding unit 1420 having a longer width than height in a vertical direction based on the partition shape mode information.

[0192] According to an embodiment, depths of the second coding units 1412a and 1412b and 1414a, 1414b, and 1414c or 1422a and 1422b and 1424a, 1424b, and 1424c determined based on the partition shape mode information of the non-square first coding unit 1410 or 1420 can be determined based on lengths of long sides thereof. For example, because the side length of the square second coding units 1412a and 1412b is 1 / 2 times the length of the long side of the first coding unit 1410 having a non-square shape and having a longer height than width, the depth of the square second coding units 1412a and 1412b is D+1 deeper than the depth D of the non-square first coding unit 1410.

[0193] Further, the image decoding apparatus 100 can divide the first coding unit 1410, which is not a square, into an odd number of second coding units 1414a, 1414b, and 1414c based on the division shape mode information. The odd number of second coding units 1414a, 1414b, and 1414c can include the second coding units 1414a and 1414c, which are not squares, and the second coding unit 1414b, which is a square. In this case, because the length of the long side of the second coding units 1414a and 1414c, which are not squares, and the length of the side of the second coding unit 1414b, which is a square, are 1 / 2 times the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c can be D+1, which is 1 deeper than the depth D of the first coding unit 1410, which is not a square. The image decoding apparatus 100 can determine the depth of the coding units divided from the first coding unit 1410 having a non-square shape in which the width is longer than the height by using the above-described method of determining the depth of the coding units divided from the first coding unit 1410.

[0194] According to an embodiment, when the odd number of divided coding units do not have equal sizes, the image decoding apparatus 100 can determine the PIDs for identifying the divided coding units based on a size ratio between the coding units. Referring to FIG. 14, the image decoding apparatus 100 can determine the PIDs for identifying the divided coding units based on a size ratio between the coding units when the odd number of divided coding units do not have equal sizes. Figure 14 Among the odd number of divided coding units 1414a, 1414b, and 1414c, the coding unit 1414b at the center position can have a width equal to that of the other coding units 1414a and 1414c and a height twice that of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the center position can include two other coding units 1414a or 1414c. Accordingly, when the PID of the coding unit 1414b at the center position is 1 based on the scanning order, the PID of the coding unit 1414c located next to the coding unit 1414b can increase by 2 and thus can be 3. That is, there can be a discontinuity in the PID values. According to an embodiment, the image decoding apparatus 100 can determine whether the odd number of divided coding units do not have equal sizes based on whether there is a discontinuity in the PIDs for identifying the divided coding units.

[0195] According to an embodiment, the image decoding apparatus 100 can determine whether to use a certain division method based on the PID values for identifying a plurality of coding units determined by dividing a current coding unit. Referring to FIG. 14, the image decoding apparatus 100 can determine whether to use a certain division method based on the PID values for identifying a plurality of coding units determined by dividing a current coding unit when the odd number of divided coding units do not have equal sizes. Figure 14, the image decoding apparatus 100 can determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a rectangular shape in which the height is longer than the width. The image decoding apparatus 100 can identify a corresponding coding unit using a PID indicating the corresponding coding unit. According to an embodiment, the PID can be obtained from a sample at a specific position (e.g., a top-left sample) of each coding unit.

[0196] According to an embodiment, by using the PID for distinguishing the coding units, the image decoding apparatus 100 can determine a coding unit at a specific position from among the divided coding units. According to an embodiment, when the division shape mode information of the first coding unit 1410 having a rectangular shape in which the height is longer than the width indicates that the coding unit is divided into three coding units, the image decoding apparatus 100 can divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 can assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 can compare the PIDs of the odd number of divided coding units to determine a coding unit at a center position from among the coding units. The image decoding apparatus 100 can determine the coding unit 1414b having a PID corresponding to an intermediate value among the PIDs of the coding units as a coding unit at the center position from among the coding units determined by dividing the first coding unit 1410. According to an embodiment, when the divided coding units do not have equal sizes, the image decoding apparatus 100 can determine the PID for distinguishing the divided coding units based on a size ratio between the coding units. Referring to Figure 15, the coding unit 1414b generated by dividing the first coding unit 1410 can have an equal width and twice the height of the other coding units 1414a and 1414c. In this case, when the PID of the coding unit 1414b located at the center position is 1, the PID of the coding unit 1414c located next to the coding unit 1414b can increase by 2 and thus can be 3. When the PIDs are not uniformly increased as described above, the image decoding apparatus 100 can determine that the coding unit is divided into a plurality of coding units including a coding unit having a size different from those of the other coding units. According to an embodiment, when the division shape mode information indicates that the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 can divide the current coding unit in such a manner that a coding unit at a specific position (e.g., a coding unit at the center position) among the odd number of coding units has a size different from those of the other coding units. In this case, the image decoding apparatus 100 can determine the coding unit at the center position having the different size by using the PIDs of the coding units. However, the PIDs and the size or position of the coding unit at the specific position are not limited to the above-described examples, and various PIDs and various positions and sizes of the coding units can be used.

[0197] According to an embodiment, the image decoding apparatus 100 can use a specific data unit in which the coding unit starts to be recursively divided.

[0198] Figure 15 It is shown that a plurality of coding units is determined based on a plurality of specific data units included in a picture according to an embodiment.

[0199] According to an embodiment, the specific data unit can be defined as a data unit in which the coding unit starts to be recursively divided by using the division shape mode information. That is, the specific data unit can correspond to a coding unit of the highest depth, which is used to determine a plurality of coding units divided from a current picture. In the following description, for convenience of explanation, the specific data unit is referred to as a reference data unit.

[0200] According to an embodiment, the reference data unit can have a specific size and a specific size shape. According to an embodiment, the reference data unit can include MxN samples. Here, M and N can be equal to each other and can be an integer expressed as a power of 2. That is, the reference data unit can have a square or non-square shape and can be divided into an integer number of coding units.

[0201] According to an embodiment, the image decoding apparatus 100 can divide the current picture into a plurality of reference data units. According to an embodiment, the image decoding apparatus 100 can divide the plurality of reference data units divided from the current picture by using the division shape mode information of each of the reference data units. The operation of dividing the reference data units can correspond to the operation of division using a quad-tree structure.

[0202] According to an embodiment, the image decoding apparatus 100 can determine a minimum size of a reference data unit allowed in the current picture in advance. Accordingly, the image decoding apparatus 100 can determine various reference data units having a size equal to or greater than the minimum size, and can determine one or more coding units by using the division shape mode information with reference to the determined reference data units.

[0203] Referring to Figure 3 , the image decoding apparatus 100 can use a square reference coding unit 1500 or a non-square reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit can be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a largest coding unit, etc.) capable of including one or more reference coding units.

[0204] According to an embodiment, the receiver 110 of the image decoding apparatus 100 can obtain at least one of reference coding unit shape information or reference coding unit size information about each of the various data units from the bitstream. The operation of dividing the square reference coding unit 1500 into one or more coding units has been described above with respect to the operation of dividing the current coding unit 300 of FIG. 15A, and the operation of dividing the non-square reference coding unit 1502 into one or more coding units has been described above with respect to the operation of dividing the current coding unit 400 or 450 of FIG. 15B. Accordingly, a detailed description thereof is not provided again. Figure 4 Figure 12 According to an embodiment, the receiver 110 of the image decoding apparatus 100 can obtain at least one of reference coding unit shape information or reference coding unit size information about each of the various data units from the bitstream. The operation of dividing the square reference coding unit 1500 into one or more coding units has been described above with respect to the operation of dividing the current coding unit 300 of FIG. 15A, and the operation of dividing the non-square reference coding unit 1502 into one or more coding units has been described above with respect to the operation of dividing the current coding unit 400 or 450 of FIG. 15B. Accordingly, a detailed description thereof is not provided again.

[0205] ​According to an embodiment, the image decoding apparatus 100 can use the PID for identifying the size and shape of the reference coding unit to determine the size and shape of the reference coding unit according to the partial data unit predetermined based on a certain condition. That is, the receiver 110 can obtain only the PID for identifying the size and shape of the reference coding unit with respect to each data unit satisfying a predetermined condition (e.g., a data unit having a size equal to or smaller than that of a slice) among various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, largest coding unit, etc.) from the bitstream. The image decoding apparatus 100 can determine the size and shape of the reference data unit with respect to each data unit satisfying a certain condition by using the PID. When the reference coding unit shape information and the reference coding unit size information are obtained from the bitstream according to each data unit having a relatively small size and used, the efficiency of using the bitstream can not be high, and thus, the PID can be obtained and used only, instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit can be predetermined. That is, the image decoding apparatus 100 can determine at least one of the size or shape of the reference coding unit included in the data unit serving as a unit of obtaining the PID by selecting at least one of the previously determined size or shape of the reference coding unit based on the PID.

[0206] According to an embodiment, the image decoding apparatus 100 can use one or more reference coding units included in the largest coding unit. That is, the largest coding unit partitioned from a picture can include one or more reference coding units, and a coding unit can be determined by recursively partitioning each reference coding unit. According to an embodiment, at least one of the width or height of the largest coding unit can be an integer multiple of at least one of the width or height of the reference coding unit. According to an embodiment, the size of the reference coding unit can be obtained by partitioning the largest coding unit n times based on a quad-tree structure. That is, according to various embodiments, the image decoding apparatus 100 can determine the reference coding unit by partitioning the largest coding unit n times based on a quad-tree structure, and can partition the reference coding unit based on at least one of block shape information or partition shape mode information.

[0207] According to an embodiment, the image decoding apparatus 100 can obtain block shape information indicating a shape of a current coding unit or partition shape mode information indicating a partitioning method of the current coding unit from a bitstream, and can use the obtained information. The partition shape mode information can be included in the bitstream related to various data units. For example, the image decoding apparatus 100 can use the partition shape mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, or a tile group header. Also, the image decoding apparatus 100 can obtain syntax elements corresponding to the block shape information or the partition shape mode information from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and can use the obtained syntax elements.

[0208] Hereinafter, a method of determining a partitioning rule according to an embodiment of the disclosure will be described in detail.

[0209] The image decoding apparatus 100 can determine a partitioning rule of an image. The partitioning rule can be determined in advance between the image decoding apparatus 100 and the image encoding apparatus 2200. The image decoding apparatus 100 can determine the partitioning rule of the image based on information obtained from a bitstream. The image decoding apparatus 100 can determine the partitioning 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, or a tile group header. The image decoding apparatus 100 can determine the partitioning rule differently according to a frame, a slice, a tile, a temporal layer, a maximum coding unit, or a coding unit.

[0210] The image decoding apparatus 100 can determine the partitioning rule based on a block shape of a coding unit. The block shape can include a size, a shape, an aspect ratio, and a direction of the coding unit. The image decoding apparatus 100 can determine the partitioning rule based on block shape information of the coding unit in advance. However, the disclosure is not limited thereto. The image decoding apparatus 100 can determine the partitioning rule of an image based on information obtained from a received bitstream.

[0211] A shape of a coding unit can include a square and a non-square. When lengths of a width and a height of the coding unit are the same, the image decoding apparatus 100 can determine the shape of the coding unit as a square. Also, when the lengths of the width and the height of the coding unit are not the same, the image decoding apparatus 100 can determine the shape of the coding unit as a non-square.

[0212] The size of the coding unit can include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8,..., 256x256. The size of the coding unit can be classified based on the length of the long side, the length of the short side, or the area of the coding unit. The image decoding apparatus 100 can apply the same division rule to the coding units classified into the same group. For example, the image decoding apparatus 100 can classify the coding units having the same length of the long side as having the same size. Also, the image decoding apparatus 100 can apply the same division rule to the coding units having the same length of the long side.

[0213] The aspect ratio of the coding unit can include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, 1:32, etc. Also, the direction of the coding unit can include a horizontal direction and a vertical direction. The horizontal direction can indicate a case where the width length of the coding unit is greater than the height length thereof. The vertical direction can indicate a case where the width length of the coding unit is shorter than the height length thereof.

[0214] The image decoding apparatus 100 can adaptively determine the division rule based on the size of the coding unit. The image decoding apparatus 100 can differently determine the allowable division shape mode based on the size of the coding unit. For example, the image decoding apparatus 100 can determine whether to allow division based on the size of the coding unit. The image decoding apparatus 100 can determine the division direction according to the size of the coding unit. The image decoding apparatus 100 can determine the allowable division type according to the size of the coding unit.

[0215] The division rule determined based on the size of the coding unit can be a division rule determined in advance in the image decoding apparatus 100. Also, the image decoding apparatus 100 can determine the division rule based on information obtained from the bitstream.

[0216] The image decoding apparatus 100 can adaptively determine the division rule based on the position of the coding unit. The image decoding apparatus 100 can adaptively determine the division rule based on the position of the coding unit in the image.

[0217] Also, the image decoding apparatus 100 can determine the division rule such that the coding units generated via different division paths do not have the same block shape. However, the disclosure is not limited thereto, and the coding units generated via different division paths have the same block shape. The coding units generated via different division paths can have different decoding processing orders. Because the decoding processing order has been described above, details thereof are not provided any more. Figure 16

[0218] Figures 1 to 16 is a block diagram of an image encoding and decoding system.​

[0219] The encoding apparatus 1610 of the image encoding and decoding system (1600) transmits an encoded bitstream of an image, and the decoding apparatus 1650 outputs a reconstructed image by receiving and decoding the bitstream. Here, the decoding apparatus 1650 can have a configuration similar to that of the image decoding apparatus 100.

[0220] At the encoding end 1610, when the prediction mode of the current block is an inter prediction mode, the inter prediction encoder 1605 generates motion information of the current block, the motion information indicating a reference block of a reference picture temporally neighboring the current picture. The inter prediction encoder 1605 can determine prediction samples of the current block by using samples of the reference block. The intra prediction encoder 1610 can determine intra prediction information indicating a method of determining the prediction samples or a direction in which neighboring samples similar to the current block are located, so that the prediction samples of the current block are determined by using the neighboring samples spatially neighboring the current block. The inter prediction encoder 1605 can determine reference samples to be used for predicting the current block from among previously reconstructed samples stored in a decoded picture buffer (DPB) 1648.

[0221] The transformer 1620 outputs transform coefficients by performing a transform on residual sample values obtained by subtracting prediction samples generated by the inter prediction encoder 1605 or the intra prediction encoder 1610 from original samples of the current block. The quantizer 1625 quantizes the transform coefficients output from the transformer 1620 and outputs quantized transform coefficients. The entropy encoder 1630 can encode the quantized transform coefficients with residual syntax elements including level values and output them in the form of a bitstream.

[0222] The quantized transform coefficients output from the quantizer 1625 can be inverse quantized and inverse transformed via the inverse quantizer 1633 and the inverse transformer 1635, and thus the residual sample values can be generated again.

[0223] The residual sample values and the prediction sample values are added at the adder 1615 and thus output reconstructed sample values. The post-reconstruction filter 1640 performs post-reconstruction filtering on the reconstructed samples, and the reconstructed sample values updated via the post-reconstruction filtering can be used as reference sample values for intra prediction to be performed by the intra prediction encoder 1610. The post-reconstruction filter 1640 can perform Hadamard transform domain filtering or bilateral filtering on the reconstructed sample values.

[0224] The loop filter 1645 can perform at least one of deblocking filtering or adaptive loop filtering on the reconstructed samples updated via the post-reconstruction filtering. The reconstructed sample values updated via the loop filter 1645 can be stored in the DPB 1648 and can be used as reference sample values for inter prediction to be performed by the inter prediction encoder 1605.

[0225] The entropy decoder 1655 of the decoding device 1650 can perform entropy decoding on the received bitstream to parse residual syntax elements including level values. Quantized transform coefficients can be reconstructed from the residual syntax elements. The inverse quantizer 1660 can output transform coefficients by performing inverse quantization on the quantized transform coefficients, and the inverse transformer 1665 can output residual sample values by performing inverse transform on the transform coefficients.

[0226] The inter prediction encoder 1670 of the decoding device 1650 can determine a reference picture temporally neighboring a current picture and determine a reference block in the reference picture by using motion information of the current block parsed using the entropy decoder 1655. The inter prediction encoder 1670 can determine prediction samples of the current block by using samples of the reference block. The intra prediction encoder 1675 of the decoding device 1650 can determine prediction samples of the current block by using intra prediction information, by using motion information of the current block parsed using the entropy decoder 1655, and by using determined neighboring samples. The inter prediction encoder 1670 can determine reference samples to be used for predicting the current block from among previously reconstructed samples stored in the DPB 1690.

[0227] The residual sample values and the prediction sample values are added at the adder 1695 of the decoding device 1650 and thus output reconstructed sample values of the current block. The post-reconstruction filter 1680 of the decoding device 1650 can perform Hadamard transform domain filtering or bilateral filtering on the reconstructed sample values. The reconstructed sample values updated via the post-reconstruction filter 1680 can be used as reference sample values for intra prediction to be performed by the intra prediction encoder 1675.

[0228] The loop filter 1685 of the decoding device 1650 can perform at least one of deblocking filtering or adaptive loop filtering on the reconstructed samples updated via the post-reconstruction filtering. The reconstructed sample values updated via the loop filter 1685 can be stored in the DPB 1690 and can be used as reference sample values for inter prediction to be performed by the inter prediction encoder 1670.

[0229] The video encoding and decoding method and the video encoding and decoding apparatus according to the embodiments propose a method of encoding and decoding a video based on the above-described Figures 17 to 20The described video encoding apparatus and video decoding apparatus determine a data unit to perform quantization or inverse quantization. Hereinafter, the method for performing quantization or inverse quantization will be described with reference to Figure 17 A video encoding method and apparatus or a video decoding method and apparatus for performing quantization or inverse quantization by determining a quantization parameter (QP) according to an embodiment of the disclosure are described.

[0230] Figure 16 is a block diagram of a video decoding apparatus according to an embodiment.

[0231] The video decoding apparatus 1700 according to an embodiment includes an obtainer 1710 and a decoder 1720. The video decoding apparatus 1700 can obtain a bitstream generated as a result of encoding an image, determine a position of a block partitioned from a picture based on information included in the bitstream, and decode the block (e.g., a largest coding unit and a coding unit).

[0232] The video decoding apparatus 1700 can include at least one data storage (not shown) that stores input and output data of the obtainer 1710 and the decoder 1720. The video decoding apparatus 1700 can include a memory controller (not shown) for controlling data input and output of the data storage.

[0233] The video decoding apparatus 1700 can perform an image decoding operation including prediction by operating in connection with an internal video decoding processor or an external video decoding processor, so as to reconstruct an image via image decoding. The internal video decoding processor of the video decoding apparatus 1700 according to an embodiment can perform a basic image decoding operation as a separate processor, or a central processing device or a graphic processing device including an image decoding processing module can perform the basic image decoding operation.

[0234] The video decoding apparatus 1700 can be included in the above-described image decoding apparatus 100. For example, the obtainer 1710 and the decoder 1720 can correspond to the decoder 120 of the image decoding apparatus 100. The video decoding apparatus 1700 can correspond to the video decoding apparatus 100 described above with reference to Figure 18 The decoding device 1650 of the described image encoding and decoding system is described. For example, the decoder 1720 can include the function of the inverse quantizer 1633 of the decoding device 1650.

[0235] Video decoding device 1700 receives a bitstream generated as a result of encoding a picture. The bitstream can include information about the current picture. The picture can include one or more largest coding units. Video decoding device 1700 can determine a location of a current block in the picture based on information obtained from the bitstream. The current block is a block generated when the picture is partitioned according to a tree structure, and can correspond to a largest coding unit or a coding unit, for example. Video decoding device 1700 determines whether to further partition the current block into sub-blocks of a lower depth, and can determine a tree structure of the current block. The lower depth can be determined by adding a number of partitions from the current block to the sub-blocks to a current depth of the current block. Among blocks forming a tree structure included in the current picture, a block at a leaf is a block that is no longer partitioned. Thus, video decoding device 1700 can decode one or more blocks that are no longer partitioned by performing inverse quantization, inverse transform, and prediction on the blocks.

[0236] Video decoding device 1700 can generate predicted samples of the current block by performing prediction on the current block. Video decoding device 1700 can generate residual samples of the current block by performing inverse transform on the current block. Reconstructor 1730 can generate reconstructed samples of the current block by using the predicted samples of the current block and the residual samples of the current block. Video decoding device 1700 can reconstruct the current picture by reconstructing samples of each block.

[0237] For example, when the prediction mode of the current block is an intra mode, video decoding device 1700 can determine reference samples among samples of spatial neighboring blocks located in an intra prediction direction by using intra prediction information of the current block, and determine predicted samples corresponding to the current block by using the reference samples.

[0238] For example, when the prediction mode of the current block is an inter mode, video decoding device 1700 can reconstruct the current block by using a motion vector of the current block. Video decoding device 1700 can determine a reference block in a reference picture by using the motion vector of the current block, and determine predicted samples corresponding to the current block from reference samples included in the reference block. Video decoding device 1700 can reconstruct transform coefficients by using transform coefficient levels obtained from the bitstream, and reconstruct residual samples by performing inverse quantization and inverse transform on the transform coefficients. Video decoding device 1700 can determine reconstructed samples of the current block by combining the predicted samples and the residual samples corresponding to the current block.

[0239] When the current block is predicted in a skip mode, video decoding device 1700 can not need to parse transform coefficients of the current block from the bitstream. Video decoding device 1700 can determine reconstructed samples of the current block by using predicted samples of the current block as they are.

[0240] The video decoding apparatus 1700 according to an embodiment performs inverse quantization using a quantization parameter (QP). The QP is set for each coding unit, and one QP can be applied to transform coefficients included in the coding unit. A picture can include one or more slices, and one slice can include one or more coding units. To determine the QP of each coding unit, the video decoding apparatus 1700 can obtain a plurality of pieces of information required to determine the QP of each coding unit, each slice, or each picture from a bitstream.

[0241] The obtainer 1710 according to an embodiment can obtain information required to determine the QP of each coding unit from coding unit-related bitstream syntax. The obtainer 1710 can obtain information required to determine the QP of each slice from slice header syntax. The obtainer 1710 can obtain information required to determine the QP of each picture from picture header syntax.

[0242] First, the video decoding apparatus 1700 can determine whether to obtain a QP difference value for each picture or to obtain a QP difference value for each slice in a picture parameter set level.

[0243] The obtainer 1710 according to an embodiment can obtain a QP initial value to be applied to a current picture from a picture parameter set. In addition, the obtainer 1710 can obtain picture header QP difference information indicating whether QP difference information is present in a picture header of the current picture from the picture parameter set. When the picture header QP difference information indicates that the QP difference information is present in the picture header, the obtainer 1710 can obtain a first QP difference value for the current picture from the picture header. When the picture header QP difference information indicates that the QP difference information is not present in the picture header, the obtainer 1710 can obtain a second QP difference value for a current slice included in the current picture from a slice header of the current slice.

[0244] When the picture header QP difference information indicates that the QP difference information is present in the picture header, the decoder 1720 according to an embodiment can determine QPs of coding units included in the current picture by using the QP initial value and the first QP difference value. The decoder 1720 can perform inverse quantization on the coding units included in the current picture by using the QPs determined by using the first QP difference value.

[0245] When the picture header QP difference information indicates that the QP difference information is not present in the picture header, the decoder 1720 can determine QPs of coding units included in the current slice by using the QP initial value and the second QP difference value. The decoder 1720 can perform inverse quantization on the coding units included in the current slice by using the QPs determined by using the second QP difference value.

[0246] Hereinafter, a description will be given of a method of determining a QP of a coding unit according to an embodiment, with reference to FIGS. 10 to 13. Figure 18The video decoding apparatus 1700 describes a process of performing inverse quantization on each coding unit by obtaining QP difference information for each picture or each slice.

[0247] Figure 19 is a flowchart of a video decoding method according to an embodiment.

[0248] In operation 1810, the obtainer 1710 can obtain, from a picture parameter set, picture header QP difference information to be applied to a current picture and a QP initial value. The picture header QP difference information according to an embodiment can indicate whether QP difference information is present in a picture header of the current picture.

[0249] In operation 1820, when the picture header QP difference information indicates that QP difference information is present in the picture header of the current picture, the obtainer 1810 can obtain a first QP difference of the current picture from the picture header.

[0250] In operation 1830, the decoder 1820 can determine QPs of coding units included in the current picture by using the QP initial value and the first QP difference.

[0251] In operation 1840, the decoder 1820 can obtain transform coefficients of the coding units by performing inverse quantization on the coding units by using the QPs determined by using the first QP difference. In other words, inverse quantization can be performed on the coding units included in the current picture by using the QPs determined by using the first QP difference.

[0252] In operation 1850, the decoder 1820 can reconstruct the coding units by using the transform coefficients of the coding units obtained in operation 1840. The decoder 1820 can obtain residual samples by performing inverse transform on the transform coefficients and determine reconstructed samples of the coding units by using the residual samples.

[0253] According to an embodiment, when the picture header QP difference information indicates that QP difference information is not present in the picture header, the obtainer 1710 can obtain a second QP difference of a current slice included in the current picture from a slice header of the current slice. The decoder 1720 can determine QPs of coding units included in the current slice by using the QP initial value and the second QP difference. The decoder 1720 can obtain transform coefficients of the coding units by performing inverse quantization on the coding units by using the QPs determined by using the second QP difference. The decoder 1720 can reconstruct the coding units by using the transform coefficients. In other words, inverse quantization can be performed on the coding units included in the current slice by using the QPs determined by using the second QP difference.

[0254] In operation 1820, the obtainer 1810 can obtain a first QP difference value of a luma component of a current picture from a picture header when the picture header QP difference information indicates that the QP difference information is present in the picture header of the current picture. The decoder 1820 can determine a QP of a luma component of a slice included in the current picture by adding the QP initial value and the first QP difference value of the luma component. The decoder 1820 can determine a QP of a coding unit included in the slice of the current picture by using the QP of the luma component of the slice.

[0255] In operation 1820, the obtainer 1710 can obtain a QP difference value of a coding unit from a bitstream. The decoder 1820 can determine a QP of a luma component of the coding unit by using the QP of the luma component of the slice and the QP difference value of the coding unit. The decoder 1820 can perform inverse quantization of transform coefficients included in the coding unit by using the QP of the coding unit. Residual samples of the coding unit can be decoded by performing inverse transform on the inverse quantized transform coefficients.

[0256] The obtainer 1710 according to another embodiment can not obtain a QP difference value of a coding unit from a bitstream. In this case, the decoder 1810 can determine a QP of a luma component of the coding unit by using a QP prediction value predicted for the coding unit.

[0257] According to an embodiment, when the picture header QP difference information indicates that the QP difference information is not present in the picture header of the current picture, the obtainer 1810 can obtain a second QP difference value of a luma component of a current slice from a slice header. The decoder 1820 can determine a QP of the luma component of the current slice by adding the QP initial value and the second QP difference value of the luma component. The decoder 1820 can determine a QP of a coding unit included in the current slice by using the QP of the luma component of the current slice. The decoder 1820 can perform inverse quantization of transform coefficients included in the coding unit by using the QP of the coding unit. Residual samples of the coding unit can be decoded by performing inverse transform on the inverse quantized transform coefficients. When the picture header QP difference information indicates that the QP difference information is not present in the picture header of the current picture, the obtainer 1810 can obtain a QP difference value of a coding unit included in the current slice from a bitstream. The decoder 1820 can determine a QP of a luma component of the current coding unit included in the current slice by using the QP difference value of the coding unit.

[0258] When the picture header QP difference information indicates that the QP difference information is not present in the picture header of the current picture, the obtainer 1810 can obtain, from the slice header, a Cb QP difference of a Cb chroma component of the current slice and a Cr QP difference of a Cr chroma component of the current slice. The decoder 1820 can determine a Cb QP of the Cb chroma component of the current coding unit included in the current slice by updating a QP of the Cb chroma component of the current coding unit using the Cb QP difference of the Cb chroma component of the current slice. The decoder 1820 can determine a Cr QP of the Cr chroma component of the current coding unit included in the current slice by updating a QP of the Cr chroma component of the current coding unit using the Cr QP difference of the Cr chroma component of the current slice.

[0259] Figure 19 is a block diagram of a video encoding apparatus according to an embodiment.

[0260] Referring to Figure 16 The video encoding apparatus 1900 according to an embodiment can include a quantizer 1910 and an information encoder 1920.

[0261] The video encoding apparatus 1900 according to an embodiment can include a central processor (not shown) for controlling the quantizer 1910 and the information encoder 1920. Alternatively, the quantizer 1910 and the information encoder 1920 can be operated by their own processors (not shown), respectively, and the processors can be systematically operated so that the video encoding apparatus 1900 as a whole is operated. Alternatively, the quantizer 1910 and the information encoder 1920 can be controlled under the control of an external processor (not shown) of the video encoding apparatus 1900.

[0262] The video encoding apparatus 1900 can include at least one data storage (not shown) storing input and output data of the quantizer 1910 and the information encoder 1920. The video encoding apparatus 1900 can include a memory controller (not shown) for controlling data input and output of the data storage.

[0263] The video encoding apparatus 1900 can perform an image encoding operation including prediction by operating in connection with an internal video encoding processor or an external video encoding processor in order to encode an image. The internal video encoding processor of the video encoding apparatus 1900 according to an embodiment performs a basic image encoding operation as a separate processor, or a central processing device or a graphic processing device including an image encoding processing module can perform the basic image encoding operation.

[0264] The video encoding apparatus 1900 can correspond to the above-described video encoding apparatus 1000 with reference to Figure 20An encoding device 1600 of the described image encoding and decoding system is described. For example, the information encoder 1920 can correspond to the entropy encoder 1630 of the encoding device 1600. The quantizer 1910 can correspond to the quantizer 1625 of the encoding device 1600.

[0265] The video encoding apparatus 1900 according to an embodiment can divide a picture into a plurality of largest coding units and divide each of the largest coding units into blocks having various sizes and various shapes for encoding.

[0266] For example, when the prediction mode of the current block is the intra mode, the video encoding apparatus 1900 can determine reference samples among the samples of the spatial neighboring block located in the intra prediction direction by using the intra prediction information of the current block, and determine prediction samples of the current block by using the reference samples. Residual samples that are differences between the prediction samples and the samples of the current block can be determined, transform coefficients can be generated by transforming the residual samples based on a transform block, and quantized transform coefficients can be generated by performing quantization on the transform coefficients.

[0267] For example, when the current block is predicted in the skip mode, the video encoding apparatus 1900 can determine a motion vector for predicting the current block. The video encoding apparatus 1900 can determine a reference block of the current block from a reference picture and determine a motion vector indicating the reference block from the current block. In the skip mode, a residual block can not need to be encoded.

[0268] For example, when the prediction mode of the current block is the inter mode, the video encoding apparatus 1900 can determine a motion vector to predict the current block. The video encoding apparatus 1900 can determine a reference block of the current block from a reference picture and determine a motion vector indicating the reference block from the current block. The video encoding apparatus 1900 can determine prediction samples of the current block by using reference samples included in the reference block, determine residual samples that are differences between the prediction samples and the samples of the current block, and generate quantized transform coefficients by performing transformation and quantization on the residual samples based on a transform block.

[0269] The current block is a block generated when a picture is divided according to a tree structure, and for example, can correspond to a largest coding unit, a coding unit, or a transform unit. The video encoding apparatus 1900 can encode blocks included in a picture according to an encoding order.

[0270] The video encoding apparatus 1900 according to an embodiment uses a QP to perform quantization. A QP is set for each coding unit, and one QP can be applied to transform coefficients included in the coding unit. A picture can include one or more slices, and one slice can include one or more coding units. The video encoding apparatus 1900 can determine a QP for each coding unit, and encode a plurality of pieces of information required to determine the QP for each coding unit, each slice, or each picture for signaling.

[0271] The information encoder 1920 according to an embodiment can encode information required to determine a QP for each coding unit, and output the same in the form of a coding unit-related bitstream syntax. The information encoder 1920 can encode information required to determine a QP for each slice, and output the same in the form of a slice header syntax. The information encoder 1920 can encode information required to determine a QP for each picture, and output the same in the form of a picture header syntax.

[0272] First, the video encoding apparatus 1900 can determine whether to transmit a QP difference value for each picture or a QP difference value for each slice in a picture parameter set level.

[0273] The quantizer 1910 according to an embodiment can determine a QP initial value to be applied to a current picture.

[0274] When a QP difference value is determined for each picture, the information encoder 1920 can determine a first QP difference value between the QP initial value and a QP used in the current picture. The information encoder 1920 can generate a picture header of the current picture including the first QP difference value.

[0275] When a QP difference value is determined for each slice, the information encoder 1920 can determine a second QP difference value between the QP initial value and a QP used in a current slice included in the current picture. The information encoder 1920 can generate a slice header of the current slice including the second QP difference value.

[0276] The information encoder 1920 according to an embodiment can generate a picture parameter set including a QP initial value and picture header QP difference value information indicating whether QP difference value information exists in a picture header of a current picture.

[0277] Hereinafter, a process in which the video encoding apparatus 1900 signals QP difference value information for each picture or each slice will be described with reference to Figure 20

[0278] Figure 21 is a flowchart of a video encoding method according to an embodiment.

[0279] ​In operation 2010, the quantizer 1910 can determine a QP initial value to be applied to a current picture.

[0280] In operation 2020, when the QP difference value is determined for each picture, the information encoder 1920 can determine a first QP difference value between the QP initial value and a QP used in the current picture, and generate a picture header of the current picture including the first QP difference value.

[0281] In operation 2030, the information encoder 1920 can generate a picture parameter set including the QP initial value and picture header QP difference information indicating whether QP difference information exists in the picture header of the current picture.

[0282] According to an embodiment, when the QP difference value is determined for each slice, the information encoder 1920 can determine a second QP difference value between the QP initial value and a QP used in a current slice included in the current picture, and generate a slice header of the current slice including the second QP difference value.

[0283] In operation 2020, when the QP difference value is determined for each picture, the quantizer 1910 can determine a QP of a luma component of a slice included in the current picture. The information encoder 1920 can determine a first QP difference value of the luma component of the current picture by using a difference value between the QP initial value and the QP of the luma component of the slice included in the current picture. The information encoder 1920 can determine a QP difference value of a coding unit by using a difference value between the QP of the luma component of the slice and the QP of the luma component of the coding unit. The information encoder 1920 can encode the QP difference value of the coding unit.

[0284] In operation 2030, when the QP difference value is determined for each slice, the quantizer 1910 can determine a QP of a luma component of the current slice. The information encoder 1920 can determine a second QP difference value of the luma component of the current slice by using a difference value between the QP initial value and the QP of the luma component of the current slice. The information encoder 1920 can determine a QP difference value of a coding unit by subtracting the QP of the luma component of the current slice from the QP of the luma component of the coding unit. The information encoder 1920 can encode the QP difference value of the coding unit.

[0285] The quantizer 1910 according to another embodiment can determine a QP of a luma component of a coding unit by using a QP prediction value predicted for the coding unit, and perform quantization on the coding unit by using the QP. In this case, the information encoder 1920 can not encode a QP difference value of the coding unit.

[0286] In operation 2030, when the QP difference value is encoded for each slice, the information encoder 1920 can determine a Cb QP difference value for a Cb chroma component of a current slice, the Cb QP difference value being used to determine QPs of the Cb chroma component of coding units included in the current slice. Also, the information encoder 1920 can determine a Cr QP difference value for a Cr chroma component of the current slice, the Cr QP difference value being used to determine QPs of the Cr chroma component of the coding units included in the current slice. The information encoder 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 of the current slice including the Cb QP difference value and the Cr QP difference value.

[0287] The quantizer 1910 can generate quantized transform coefficients of the coding unit by performing quantization on the transform coefficients of the coding unit using the QP. The information encoder 1920 can generate a bitstream by performing entropy encoding on a plurality of pieces of information about the quantized transform coefficients.

[0288] The video decoding apparatus 1700 according to an embodiment and the video encoding apparatus 1900 according to an embodiment can selectively signal the QP difference value for each picture or each slice. Accordingly, the video encoding apparatus 1900 according to an embodiment can determine whether to signal the QP difference value for each picture or the QP difference value for each slice according to data transmission efficiency or characteristics of a data picture, and signal the QP difference value according to a method having high transmission efficiency. The video decoding apparatus 1700 according to an embodiment can determine whether to obtain the QP difference value for each picture or the QP difference value for each slice based on information obtained from a picture parameter set, and determine the QP for each picture or the QP for each slice. Accordingly, when the QP difference value is signaled for each picture, there is no need to signal the QP difference value for each slice included in the picture, and thus the amount of data for signaling the QP can be reduced.

[0289] Figures 22 to 24 is an overview of a method for introducing QP in a picture level or a slice level according to an embodiment.

[0290] In a general video codec, a QP initial value is generally configured in a picture parameter set (PPS), and a difference value of the QP initial value for a slice is transmitted through a slice header, and thus the QP is configured for each slice.

[0291] On the other hand, the video decoding apparatus 1700 according to an embodiment can obtain a picture header for each picture and signaling information about QP from the picture header. In the present disclosure, whether to signal the QP difference value for each picture or the QP difference value for each slice is selected between the video decoding apparatus 1700 and the video encoding apparatus 1900, and thus the signaling structure of the QP can be simplified.

[0292] First, in operation 2100, the video decoding apparatus 1700 can obtain a QP initial value from a higher-level sequence parameter set (SPS) or a PPS that is a picture header. Also, in operation 2110, the video decoding apparatus 1700 can obtain picture header QP delta (dQP) information from the PPS or the SPS. The video decoding apparatus 1700 can determine whether to determine a QP at a picture level or at a slice level according to the picture header dQP information.

[0293] In detail, when the picture header dQP information is not 0 (for example, when the picture header dQP information is 1), that is, when a QP delta (delta) value exists in the picture header, in operation 2120, the video decoding apparatus 1700 can obtain the QP delta value from the picture header. The video decoding apparatus 1700 can determine a QP for each picture by using the QP delta value obtained from the picture header and the QP initial value obtained from the PPS or the SPS.

[0294] When the picture header dQP information is 0, that is, when a QP delta value does not exist in the picture header, in operation 2130, the video decoding apparatus 1700 can obtain the QP delta value from a slice header. The video decoding apparatus 1700 can determine a QP for each slice by using the QP delta value obtained from the slice header and the QP initial value obtained from the PPS or the SPS.

[0295] For operations 2100 to 2130 of the video decoding apparatus 1700, the video encoding apparatus 1900 can determine whether to determine a QP at a picture level or at a slice level. Also, the video encoding apparatus 1900 can encode picture header dQP information indicating whether to determine a QP at a picture level or at a slice level.

[0296] In detail, when a QP is determined for each picture, the video encoding apparatus 1900 can encode a QP delta value for each picture. Accordingly, the video encoding apparatus 1900 can generate a picture header of a current picture including the QP delta value of the current picture. In this case, the picture header dQP information can be encoded to indicate 1, indicating that the QP delta value exists in the picture header of the current picture.

[0297] When a QP is determined for each slice, the video encoding apparatus 1900 can encode a QP delta value for each slice. Accordingly, the video encoding apparatus 1900 can generate a slice header of a current slice including the QP delta value of the current slice. In this case, the picture header dQP information can be encoded to indicate 0, indicating that the QP delta value does not exist in the picture header.

[0298] The video encoding apparatus 1900 according to an embodiment can generate a PPS or an SPS including a QP initial value and picture header dQP information.

[0299] As described above, when the same QP is configured for the coding units included in the current picture in the picture level, the QP is signaled only from the picture header, and thus the number of bits for signaling the QP can be reduced. In other words, the QP difference value can be signaled only once from the picture header of the current picture, without being signaled through the slice header of each slice included in the current picture. When the characteristics of the slices included in the current picture are different from each other, the QP can be separately configured for each slice to configure the QP in more detail, and the QP difference value can be signaled to each slice for each slice header.

[0300] Hereinafter, a description will be made with reference to Figure 22 A syntax structure for signaling the picture header dQP information will be described.

[0301] Figure 23 A picture parameter set including the picture header dQP information according to an embodiment is shown.

[0302] The video encoding apparatus 1900 can include the syntax elements pps_init_qp_minus26 2210 and pps_qp_delta_info_in_ph_flag 2220 of the picture parameter set syntax 2200. The syntax element pps_qp_delta_info_in_ph_flag 2220 can indicate whether the QP difference value of the current picture is present in the picture header of the current picture.

[0303] The video decoding apparatus 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 decoding apparatus 1700 can obtain the QP initial value applicable to the current picture or the slice included in the current picture from the syntax element pps_init_qp_minus26 2210. The video decoding apparatus 1700 can identify whether the QP difference value of the current picture is present in the picture header of the current picture from the syntax element pps_qp_delta_info_in_ph_flag 2220.

[0304] The syntax element pps_init_qp_minus26 2210 can indicate an initial value of QP SliceQpY that can be applied to the current picture or a slice included in the current picture. When the QP difference value ph_qp_delta for the picture is decoded to a value other than 0 in the picture header, the initial value of SliceQpY can be adjusted by using the QP difference value in the picture level. When the QP difference value sh_qp_delta for the slice is decoded to a value other than 0 in the slice header, the initial value of SliceQpY can be adjusted by using the QP difference value in the slice level. The value of pps_init_qp_minus26 2210 can be in the range from -(26 + QpBdOffset) to +37. QpBdOffset can be determined according to the bit depth. Depending on whether ph_qp_delta or sh_qp_delta is decoded, SliceQpY can be determined according to the following equations.

[0305] SliceQpY = 26 + pps_init_qp_minus26 + ph_qp_delta

[0306] SliceQpY = 26 + pps_init_qp_minus26 + sh_qp_delta

[0307] Thus, QP SliceQpY for the luma component of the slice can be determined in the range from -QpBdOffset to +63.

[0308] Figure 24 A picture header including a QP difference value for a current picture according to an embodiment is shown.

[0309] The video encoding device 1900 can include the syntax element ph_qp_delta 2320 of the picture header syntax 2300. The syntax element ph_qp_delta 2320 can indicate a QP difference value applicable to the current picture. In detail, when pps_qp_delta_info_in_ph_flag 2220 included in the PPS 2200 indicates 1 (2310), the syntax element ph_qp_delta 2320 can be included in the picture header syntax 2300.

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

[0311] Figures 25 to 32 A slice header including QP delta of a current slice according to an embodiment is illustrated.

[0312] Video encoding device 1900 can include syntax element sh_qp_delta 2420 for slice header syntax 2400. Syntax element sh_qp_delta 2420 can indicate QP delta applicable to a luminance component of a current slice. In detail, when pps_qp_delta_info_in_ph_flag 2220 included in PPS 2200 indicates 0 (2410), syntax element sh_qp_delta 2420 can be included in slice header syntax 2400. In addition, video encoding device 1900 can include syntax elements sh_cb_qp_offset and sh_cr_qp_offset 2430 to slice header syntax 2400. Syntax elements sh_cb_qp_offset and sh_cr_qp_offset 2430 indicate QP delta of a chrominance Cb component and QP delta of a chrominance Cr component, respectively.

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

[0314] Further, video decoding device 1700 can parse syntax elements sh_cb_qp_offset and sh_cr_qp_offset 2430 from slice header syntax 2400. A QP difference value for the chroma Cb component and a QP difference value for the chroma Cr component can be obtained from syntax elements sh_cb_qp_offset and sh_cr_qp_offset 2430, respectively. Accordingly, video decoding device 1700 can determine the QP of the chroma Cb component of a coding unit included in the current slice by using the QP difference value for the chroma Cb component, and determine the QP of the chroma Cr component of a coding unit included in the current slice by using the QP difference value for the chroma Cr component. Video decoding device 1700 can perform inverse quantization on transform samples of a coding unit by using the QP of each coding unit.

[0315] sh_cb_qp_offset and sh_cr_qp_offset 2430 can each have a value ranging between -12 and 12.

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

[0317] In addition, when the QP difference value (delta QP) is signaled in the coding unit level, the QP determined in the beginning of a slice, the beginning of a slice, a picture header, or a slice header can be used as a QP initial value. For example, when the QP is determined in the picture header and there is a slice or a tile in the picture, the QP determined in the picture header at the beginning of the slice or the tile can be used as the QP initial value. Accordingly, the QP of the coding unit can be determined by adding the QP difference value of the coding unit signaled in the coding unit level and the QP initial value determined at the beginning of the slice or the tile.

[0318] As another example, when a picture order counter (POC) is signaled, the POC information can be included only in the picture header, not in the slice header. In this case, it can be difficult to identify which picture a certain slice belongs to. However, the index of the picture to which the slice belongs is identified by using a timestamp or a sequence number to be signaled at the system level. In addition, the loss of information about a certain slice or picture header can be determined by receiving a notification from an external system of the codec.

[0319] According to the video encoding method and the video decoding method according to the embodiments, a method of transmitting a difference value of QP can be determined according to data transmission efficiency or characteristics of a picture, and the difference value of QP can be signaled according to the method.

[0320] Hereinafter, a video encoding method and a video decoding method according to embodiments will be described with reference to the accompanying drawings. Figure 25 Syntax structures for selectively signaling parameters available in various tools at a picture level or a slice level are described. Whether a tool-related parameter is signaled from a picture header or a slice header can be determined by a flag signaled from a picture sequence set.

[0321] Figure 26 A picture parameter set including information indicating whether a picture header includes deblocking filter-related parameter difference is shown according to an embodiment.

[0322] The video encoding apparatus 1900 can include the pps_dbf_info_in_ph_flag 2510 to the picture parameter set syntax 2500. The syntax element pps_dbf_info_in_ph_flag 2510 can indicate whether deblocking filter-related parameter difference for the current picture is present in the picture header of the current picture.

[0323] Video decoding device 1700 can parse pps dbf info in ph flag 2510 from the picture parameter set syntax 2500. Video decoding device 1700 can identify from the syntax element pps dbf info in ph flag 2510 whether deblocking filter related parameters for the current picture are present in the current picture header.

[0324] Figure 27 A picture header including deblocking filter related parameters for a current picture according to an embodiment is shown.

[0325] Video encoding device 1900 can include syntax elements ph luma beta offset div 2, ph luma tc offset div 2, ph cb beta offset div 2, ph cb tc offset div 2, ph cr beta offset div 2, and ph cr tc offset div 2 2620 for the picture header syntax 2600. In detail, when pps dbf info in ph flag 2510 included in PPS 2500 indicates 1 (2610), syntax elements ph luma beta offset div 2, ph luma tc offset div 2, ph cb beta offset div 2, ph cb tc offset div 2, ph cr beta offset div 2, and ph cr tc offset div 2 2620 can be included in the picture header syntax 2600.

[0326] 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, and ph cr tc offset div2 2620 from the picture header syntax 2600. In detail, when pps dbf info in ph flag 2510 included in PPS 2500 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, and ph cr tc offset div2 2620 can be obtained from the picture header syntax 2600.

[0327] Syntax element ph luma beta offset div2 can indicate an offset of a deblocking parameter β applied to a luma component of a slice in the current picture. Syntax element ph luma tc offset div2 can indicate an offset of a deblocking parameter tC applied to the luma component of the slice in the current picture. Syntax element ph cb beta offset div2 can indicate an offset of a deblocking parameter β applied to a Cb component of the slice in the current picture. Syntax element ph cb tc offset div2 can indicate an offset of a deblocking parameter tC applied to the Cb component of the slice in the current picture. Syntax element ph cr beta offset div2 can indicate an offset of a deblocking parameter β applied to a Cr component of the slice in the current picture. Syntax element ph cr tc offset div2 can indicate an offset of a deblocking parameter tC applied to the Cr component of the slice in the current picture. Video decoding device 1700 can perform deblocking filtering on a boundary of a coding unit included in the current picture by using the deblocking filtering related parameters obtained from the picture header.

[0328] Figure 28 A slice header including deblocking filter related parameters of a current slice according to an embodiment is shown.

[0329] Video encoding device 1900 can 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, and sh_cr_tc_offset_div2 2720 for slice header syntax 2700. In detail, when pps_dbf_info_in_ph_flag 2510 included in PPS 2500 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, and sh_cr_tc_offset_div2 2720 can be included in slice header syntax 2700.

[0330] 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, and sh_cr_tc_offset_div2 2720 from slice header syntax 2700. In detail, when pps_dbf_info_in_ph_flag 2510 included in PPS 2500 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, and sh_cr_tc_offset_div2 2720 can be obtained from slice header syntax 2700.

[0331] The syntax element sh_luma_beta_offset_div2 can indicate an offset to the deblocking parameter β applied to the luma component of the current slice. The syntax element sh_luma_tc_offset_div2 can indicate an offset to the deblocking parameter tC applied to the luma component of the current slice. The syntax element sh_cb_beta_offset_div2 can indicate an offset to the deblocking parameter β applied to the Cb component of the current slice. The syntax element sh_cb_tc_offset_div2 can indicate an offset to the deblocking parameter tC applied to the Cb component of the current slice. The syntax element sh_cr_beta_offset_div2 can indicate an offset to the deblocking parameter β applied to the Cr component of the current slice. The syntax element sh_cr_tc_offset_div2 can indicate an offset to the deblocking parameter tC applied to the Cr component of the current slice. Video decoding device 1700 can perform deblocking filtering on boundaries of coding units included in the current slice by using deblocking filtering related parameters obtained from the slice header.

[0332] Figure 29 A picture parameter set including information indicating whether a picture header includes various tool related parameters is shown in accordance with an embodiment.

[0333] Video encoding device 1900 can 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 for picture parameter set syntax 2800. Syntax element pps_rpl_info_in_ph_flag 2810 can indicate whether reference picture list related parameters for the current picture are present in the picture header for the current picture. Syntax element pps_sao_info_in_ph_flag 2820 can indicate whether sample adaptive offset (SAO) related parameters for the current picture are present in the picture header for the current picture. Syntax element pps_alf_info_in_ph_flag 2830 can indicate whether adaptive loop filtering (ALF) related parameters for the current picture are present in the picture header for the current picture. Syntax element pps_wp_info_in_ph_flag 2840 can indicate whether weighted prediction related parameters for the current picture are present in the picture header for the current picture.

[0334] Video decoding device 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 picture parameter set syntax 2800. Video decoding device 1700 can identify from syntax element pps rpl info in ph flag 2810 whether reference picture list related parameters for the current picture are present in the picture header for the current picture. Video decoding device 1700 can identify from syntax element pps sao info in ph flag 2820 whether SAO related parameters for the current picture are present in the picture header for the current picture. Video decoding device 1700 can identify from syntax element pps alf info in ph flag 2830 whether ALF related parameters for the current picture are present in the picture header for the current picture. Video decoding device 1700 can identify from syntax element pps wp info in ph flag 2840 whether weighted prediction related parameters for the current picture are present in the picture header for the current picture.

[0335] Figure 30 A picture header including weighted prediction related parameters, SAO related parameters, and reference picture list related parameters for a current picture according to an embodiment is shown.

[0336] Video encoding device 1900 can include weighted prediction syntax pred_weight_table() 2920 to picture header syntax 2900. In detail, when pps wp info in ph flag 2840 included in PPS 2800 indicates 1 (2910), weighted prediction syntax pred_weight_table() 2920 can be included in picture header syntax 2900.

[0337] Video decoding device 1700 can invoke weighted prediction syntax pred_weight_table() 2920 from picture header syntax 2900. In detail, when pps wp info in ph flag 2840 included in PPS 2800 indicates 1 (2910), weighted prediction syntax pred_weight_table() 2920 can be invoked from picture header syntax 2900.

[0338] Video decoding device 1700 can obtain, from the weighted prediction syntax pred_weight_table() 2920, parameters for determining weights for luma components and weights for chroma components needed to perform weighted prediction. Video decoding device 1700 can perform weighted prediction on blocks included in the current picture by using the weights for luma components and the weights for chroma components.

[0339] Video encoding device 1900 can include syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag 2940 of the picture header syntax 2900. In detail, when pps_sao_info_in_ph_flag 2820 included in the PPS 2800 indicates 1 (2930), the syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag 2940 can be included in the picture header syntax 2900.

[0340] 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. In detail, when pps_sao_info_in_ph_flag 2820 included in the PPS 2800 indicates 1 (2930), the syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag 2940 can be obtained from the picture header syntax 2900.

[0341] Video decoding device 1700 can identify, from the syntax element ph_sao_luma_enabled_flag, whether to perform SAO on luma components of the current picture. Video decoding device 1700 can identify, from the syntax element ph_sao_chroma_enabled_flag, whether to perform SAO on chroma components of the current picture. Video decoding device 1700 can perform SAO on each of luma components and chroma components of largest coding units included in the current picture based on the syntax elements ph_sao_luma_enabled_flag and ph_sao_chroma_enabled_flag 2940.

[0342] Video encoding device 1900 can include reference picture list syntax ref_pic_lists() 2960 to picture header syntax 2900. In detail, when pps_rpl_info_in_ph_flag 2810 included in PPS 2800 indicates 1 (2950), reference picture list syntax ref_pic_lists() 2960 can be included in picture header syntax 2900.

[0343] Video decoding device 1700 can invoke reference picture list syntax ref_pic_lists() 2960 from picture header syntax 2900. In detail, when pps_rpl_info_in_ph_flag 2810 included in PPS 2800 indicates 1 (2950), reference picture list syntax ref_pic_lists() 2960 can be invoked from picture header syntax 2900.

[0344] Video decoding device 1700 can obtain parameters for determining reference picture lists from blocks of a current picture from reference picture list syntax ref_pic_lists() 2960. Video decoding device 1700 can determine reference picture lists for blocks included in the current picture by using the parameters obtained from reference picture list syntax ref_pic_lists() 2960, and perform inter prediction using the reference picture lists for each block.

[0345] Figure 31 A picture header including ALF-related parameters of a current picture according to an embodiment is shown.

[0346] Video encoding device 1900 can 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, and ph alf cc cr aps id 3020 for picture header syntax 3000. In detail, when pps alf info in ph flag 2830 included in PPS 2800 indicates 1 (3010), 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, and ph alf cc cr aps id 3020 can be included in picture header syntax 3000.

[0347] 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, and ph alf cc cr aps id 3020 from picture header syntax 3000. In detail, when pps alf info in ph flag 2830 included in PPS 2800 indicates 1 (3010), 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, and ph alf cc cr aps id 3020 can be obtained from picture header syntax 3000.

[0348] The syntax element ph num alf aps ids luma indicates the number of ALF APSs referred by 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 referred by the luma component of slices included in the current picture. The syntax element ph alf cb enabled flag indicates whether ALF is allowed for the Cb component of the current picture. The syntax element ph alf cr enabled flag indicates whether ALF is allowed 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 referred by the chroma component of 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 referred by the Cb component of 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 referred by the Cr component of slices included in the current picture.

[0349] The video decoding device 1700 can perform ALF on the luma component and the chroma component of each largest coding unit of the current picture by using the obtained 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, and ph alf cc cr aps id 3020

[0350] Figure 32 A slice header including reference picture list related parameters, weighted prediction related parameters, and SAO related parameters of a current slice according to an embodiment is shown.

[0351] Video encoding device 1900 can include reference picture list syntax ref_pic_lists() 3120 for slice header syntax 3100. In detail, when pps rpl info in ph flag 2810 included in PPS 2800 indicates 0 (3110), reference picture list syntax ref_pic_lists() 3120 can be included in slice header syntax 3100.

[0352] Video decoding device 1700 can invoke reference picture list syntax ref_pic_lists() 3120 from slice header syntax 3100. In detail, when pps rpl info in ph flag 2810 included in PPS 2800 indicates 0 (3110), reference picture list syntax ref_pic_lists() 3120 can be invoked from slice header syntax 3100.

[0353] Video decoding device 1700 can obtain parameters for determining reference picture lists from blocks of a current slice from reference picture list syntax ref_pic_lists() 3120. Video decoding device 1700 can determine reference picture lists for blocks included in the current slice by using the parameters obtained from reference picture list syntax ref_pic_lists() 3120, and perform inter prediction using the reference picture lists for each block.

[0354] Video encoding device 1900 can include weighted prediction syntax pred_weight_table() 3140 to slice header syntax 3100. In detail, when pps wp info in ph flag 2840 included in PPS 2800 indicates 0 (3130), weighted prediction syntax pred_weight_table() 3140 can be included in slice header syntax 3100.

[0355] Video decoding device 1700 can invoke weighted prediction syntax pred_weight_table() 3140 from slice header syntax 3100. In detail, when pps wp info in ph flag 2840 included in PPS 2800 indicates 0 (3130), weighted prediction syntax pred_weight_table() 3140 can be invoked from slice header syntax 3100.

[0356] Video decoding device 1700 can obtain, from the weighted prediction syntax pred_weight_table() 3140, parameters for determining weights for luma components and weights for chroma components needed to perform weighted prediction. Video decoding device 1700 can perform weighted prediction on blocks included in the current slice by using the weights for luma components and the weights for chroma components.

[0357] Video encoding device 1900 can include syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag 3160 to the slice header syntax 3100. In detail, when pps_sao_info_in_ph_flag 2820 included in the PPS 2800 indicates 0 (3150), the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag 3160 can be included in the slice header syntax 3100.

[0358] Video decoding device 1700 can obtain, from the slice header syntax 3100, the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag 3160. In detail, when pps_sao_info_in_ph_flag 2820 included in the PPS 2800 indicates 0 (3150), the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag 3160 can be obtained from the slice header syntax 3100.

[0359] Video decoding device 1700 can identify, from the syntax element sh_sao_luma_used_flag, whether SAO is used for luma components of the current slice. Video decoding device 1700 can identify, from the syntax element sh_sao_chroma_used_flag, whether SAO is used for chroma components of the current slice. Video decoding device 1700 can perform SAO on each of luma components and chroma components of largest coding units included in the current slice based on the syntax elements sh_sao_luma_used_flag and sh_sao_chroma_used_flag 3160.

[0360] ​ A slice header including ALF-related parameters for a current slice according to an embodiment is shown.

[0361] Video encoding device 1900 can 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, and sh alf cc cr aps id 3220 for slice header syntax 3200. In detail, when pps alf info in ph flag 2830 included in PPS 2800 indicates 0 (3210), 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, and sh alf cc cr aps id 3220 can be included in slice header syntax 3200.

[0362] 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, and sh alf cc cr aps id 3220 from slice header syntax 3200. In detail, when pps alf info in ph flag 2830 included in PPS 2800 indicates 0 (3210), 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, and sh alf cc cr aps id 3220 can be obtained from slice header syntax 3200.

[0363] The syntax element sh num alf aps ids luma indicates the number of ALF APSs referred to 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 referred to by the luma component of the current slice. The syntax element sh alf cb enabled flag indicates whether ALF is allowed for the Cb component of the current slice. The syntax element sh alf cr enabled flag indicates whether ALF is allowed 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 referred to 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 referred to 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 referred to by the Cr component of the current slice.

[0364] The video decoding device 1700 can perform ALF on the luma component and the chroma component of each largest coding unit of the current slice by using the obtained 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, and sh alf cc cr aps id 3220.

[0365] The video decoding apparatus 1700 according to an embodiment and the video encoding apparatus 1900 according to an embodiment can selectively signal the deblocking filter-related parameters, the reference picture list-related parameters, the weighted prediction-related parameters, the SAO-related parameters, and the ALF-related parameters for each picture or each slice. Accordingly, the video encoding apparatus 1900 according to an embodiment can determine whether to signal the tool-related parameters for each picture or to signal the tool-related parameters for each slice according to data transmission efficiency or characteristics of data pictures, and signal the tool-related parameters according to a method having high transmission efficiency. The video decoding apparatus 1700 according to an embodiment can determine whether to obtain the tool-related parameters for each picture or to obtain the tool-related parameters for each slice based on information obtained from a picture parameter set, and obtain the tool-related parameters for each picture or each slice. Accordingly, when the tool-related parameters are signaled for each picture, there is no need to signal the tool-related parameters for each slice included in the picture, and thus data for signaling the tool-related parameters can be reduced.

[0366] Meanwhile, the above-disclosed embodiments can be written as a computer executable program that can be stored in a medium.

[0367] The medium can continuously store the computer executable program, or temporarily store the computer executable program or instructions for execution or download. In addition, the medium can be any one of various recording media or storage media in which a single piece or multiple pieces of hardware are combined, and the medium is not limited to a medium directly connected to a computer system, but can be distributed over a network. Examples of the medium include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as optical floppy disks, and ROMs, RAMs, and flash memories configured to store program instructions. The machine-readable storage medium can be provided in the form of a non-transitory storage medium. Here, the "non-transitory storage medium" only means a tangible device, and does not include a signal (e.g., an electromagnetic wave). The term does not distinguish between the case where data is semi-permanently stored in the storage medium and the case where data is temporarily stored in the storage medium. For example, the "non-transitory storage medium" can include a buffer that temporarily stores data.

[0368] Other examples of the medium include recording media and storage media managed by an application store that distributes applications, or websites, servers, etc. that provide or distribute other various types of software.

[0369] According to an embodiment, a method according to various embodiments disclosed in the present specification can be provided by being included in a computer program product. The computer program product is a product that can be traded between a seller and a buyer. The computer program product can be distributed in the form of a machine-readable storage medium (e.g., a compact disc read only memory (CD-ROM)) or be distributed through an application store (e.g., Play Store®) providing a user with applications. In the case of distribution through the application store, the computer program product can be stored in a storage medium of the application store, and can be distributed to the user in the form of at least one of a file belonging to the computer program product, an installation file of the computer program product, and an executable file of the computer program product. In addition, the computer program product can be distributed to the user by being directly installed in a server on the cloud.TM ) or distributed (e.g., downloaded or uploaded) directly or online between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product (e.g., a downloadable application) can be generated at least temporarily or stored temporarily in a machine-readable storage medium, such as a memory of a manufacturer's server, a server of an application store, or a relay server.

[0370] While one or more embodiments of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that various alterations can be made and equivalents can be used without departing from the spirit and scope of the disclosure as defined by the appended claims.

Claims

1. A video decoding method, comprising: Obtain the initial values ​​of the quantization parameters (QP) to be applied to the current image from the image parameter set; Obtain the QP difference flag from the image parameter set, which indicates whether a QP difference exists in the image header of the current image; When the QP difference flag indicates that no QP difference exists in the image header, the first QP difference for the current slice included in the current image is obtained from the slice header of the current slice. The initial QP value and the first QP difference obtained for the current slice are used to determine the first QP to be included in the current slice in the current image. Inverse quantization is then performed on the transform coefficients in the codec units included in the current slice using the first QP of the current slice. When the QP difference flag indicates that a QP difference exists in the image header, a second QP difference for the current image is obtained from the image header. The initial QP value and the second QP difference obtained for the current image are used to determine a second QP for the current image. The second QP for the current image is then used to perform inverse quantization on the transform coefficients in the encoding / decoding units included in at least one stripe included in the current image. Specifically, when the second QP difference is obtained from the image header of the current image based on the QP difference flag, the second QP difference is not obtained from the strip header of the current strip. Specifically, the image Cb QP difference for the Cb chromaticity component and the image Cr QP difference for the Cr chromaticity component in the current image are obtained from the image parameter set of the current image. Specifically, the Cb QP difference of the Cb chromaticity component and the Cr QP difference of the Cr chromaticity component of the current band in the current image are obtained from the band header of the current band. Specifically, the Cb QP difference of the image and the Cb QP difference of the strip are used to determine the Cb QP of the Cb chromaticity component of the current strip. Specifically, the Cr QP difference between the image and the Cr QP difference between the strip is used to determine the Cr QP of the Cr chromaticity component of the current strip.

2. A video encoding method, comprising: To perform quantization on the transform coefficients included in the current image; Encode the initial values ​​of the quantization parameters (QP) to be applied to the current image; Encode the QP difference flag, which indicates whether a QP difference exists in the image header of the current image; as well as Generate an image parameter set including QP initial values ​​and QP difference flags. in: When determining the QP difference for each stripe included in the current image, quantization is performed on the transform coefficients in the encoding / decoding units included in each stripe of the current image using the first QP for the current stripe, and the first QP difference for the current stripe between the first QP for the current stripe and the initial QP value is encoded, and the stripe header for the current stripe is generated to include the first QP difference for the current stripe, wherein a QP difference flag is encoded to indicate that the first QP difference does not exist in the image header of the current image, and When determining the QP difference for the current image, the transform coefficients in the encoding / decoding units included in at least one stripe of the current image are quantized using the second QP for the current image, and the second QP difference for the current image between the second QP and the initial QP value is encoded. An image header for the current image is generated to include the second QP difference for the current image without encoding the QP difference for each of the at least one stripe into the header of each of the at least one stripe, wherein a QP difference flag is encoded to indicate the presence of the second QP difference in the image header of the current image. Specifically, the image Cb QP difference of the Cb chromaticity component and the image Cr QP difference of the Cr chromaticity component in the current image are encoded into the image parameter set of the current image. Specifically, the Cb QP difference of the Cb chromaticity component and the Cr QP difference of the Cr chromaticity component of the current strip in the current image are encoded into the strip header of the current strip. Among them, the image Cb QP difference and the strip Cb QP difference correspond to the Cb QP of the Cb chromaticity component of the current strip; Among them, the image Cr QP difference and the strip Cr QP difference correspond to the Cr QP of the Cr chromaticity component of the current strip.

3. A method for transmitting a bitstream generated from encoded video, comprising: To perform quantization on the transform coefficients included in the current image; Encode the initial values ​​of the quantization parameters (QP) to be applied to the current image; Encode the QP difference flag, which indicates whether a QP difference exists in the image header of the current image; as well as Generate a set of image parameters (PPS) including the initial QP value and QP difference flags. The output includes a bitstream of PPS. in: When determining the QP difference for each stripe included in the current image, quantization is performed on the transform coefficients in the encoding / decoding units included in each stripe of the current image using the first QP for the current stripe. The first QP for the current stripe is encoded, the first QP difference for the current stripe is between the initial QP value and the first QP for the current stripe, and the stripe header for the current stripe is generated to include the first QP difference for the current stripe, wherein a QP difference flag is encoded to indicate that the first QP difference does not exist in the image header of the current image. When determining the QP difference for the current image, the transform coefficients in the encoding / decoding units included in at least one stripe of the current image are quantized using the second QP for the current image, and the second QP difference for the current image between the second QP and the initial QP value is encoded. An image header for the current image is generated to include the second QP difference for the current image without encoding the QP difference for each of the at least one stripe into the header of each of the at least one stripe, wherein a QP difference flag is encoded to indicate the presence of the second QP difference in the image header of the current image. Specifically, the image Cb QP difference of the Cb chromaticity component and the image Cr QP difference of the Cr chromaticity component in the current image are encoded into the image parameter set of the current image. Specifically, the Cb QP difference of the Cb chromaticity component and the Cr QP difference of the Cr chromaticity component of the current strip in the current image are encoded into the strip header of the current strip. Among them, the image Cb QP difference and the strip Cb QP difference correspond to the Cb QP of the Cb chromaticity component of the current strip; Among them, the image Cr QP difference and the strip Cr QP difference correspond to the Cr QP of the Cr chromaticity component of the current strip.