Video encoding method and apparatus, and video decoding method and apparatus

By extracting multi-transform selection syntax elements from the bitstream and determining the transformation core, the problem of low image encoding and decoding efficiency in the prior art is solved, and efficient processing of high-resolution or high-quality images is achieved.

CN119520830APending Publication Date: 2025-02-25SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411899367.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-06-21
Filing Date
2019-12-20
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently encode and decode high-resolution or high-quality image content, especially when processing data units of various shapes.

Method used

Reconstruction blocks are generated by extracting syntax elements about multi-transform selection (MTS) from the bitstream, horizontal or vertical transformation cores for the current transformation unit are determined, and inverse transformation is performed to obtain the residual signal.

Benefits of technology

Efficient encoding and decoding of images is achieved, especially when processing data units of various shapes, improving the efficiency of image compression and recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520830A_ABST
    Figure CN119520830A_ABST
Patent Text Reader

Abstract

The invention relates to a video encoding method and apparatus, and a video decoding method and apparatus. Provided is an image decoding method, comprising: obtaining, from a bitstream, a syntax element with respect to a multi-transform selection (MTS) technology for a current coding unit or a current transform unit included in the current coding unit; determining a horizontal transform kernel or a vertical transform kernel for the current transform unit based on the obtained syntax element; obtaining a residual signal by performing inverse transformation on the current transformation unit based on the determined horizontal transformation kernel or vertical transformation kernel for the current transformation unit; and generating a reconstructed block including the current coding unit or the current transform unit based on the residual signal for the current transform unit.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with an application date of December 20, 2019, application number 201980092531.9, and invention name “Video encoding method and device and video decoding method and device”. Technical Field

[0002] A method and apparatus according to an embodiment can encode or decode an image by using a coding unit, a prediction unit, or a transformation unit having various shapes and included in the image. A method and apparatus according to an embodiment can encode or decode an image by performing transformation or inverse transformation on a data unit having various shapes. Background Art

[0003] As hardware capable of reproducing and storing high-resolution or high-quality image content has been developed and has become popular, there is a great demand for codecs capable of efficiently encoding or decoding high-resolution or high-quality image content. The encoded image content can be decoded to be reproduced. At present, a method for efficiently compressing high-resolution or high-quality image content has been realized. For example, an efficient image compression method is realized by a process in which the image to be encoded is processed in an arbitrary manner.

[0004] Various data units may be used to compress an image, and there may be an inclusion relationship between the data units. The data units to be used to compress the image may be divided by various methods, and the image may be encoded or decoded by determining the optimal data unit according to the characteristics of the image. Summary of the invention

[0005] Solution to the problem

[0006] According to an embodiment of the present disclosure, an image decoding method includes: obtaining a syntax element about a multiple transform selection (MTS) for a current coding unit or a current transform unit included in the current coding unit from a bit stream; determining a horizontal transform kernel or a vertical transform kernel for the current transform unit based on the obtained syntax element; obtaining a residual signal by performing an inverse transform on the current transform unit based on the determined horizontal transform kernel or vertical transform kernel for the current transform unit; and generating a reconstructed block including the current coding unit or the current transform unit based on the residual signal for the current transform unit.

[0007] The step of obtaining a syntax element indicating whether to use the MTS from the bitstream may include obtaining a syntax element regarding the MTS from a syntax structure different from a residual coding syntax structure.

[0008] The step of obtaining, from a bitstream, a syntax element indicating whether MTS is used for a current coding unit or a current transformation unit may include obtaining, from the bitstream, a syntax element indicating at least one of the following items: whether MTS is used for the current coding unit or the current transformation unit, and a mode included in multiple modes of MTS.

[0009] When the obtained syntax element indicates that the MTS is not used for the current coding unit or the current transform unit, the method may further include determining a transform kernel for the current transform unit as a discrete cosine transform (DCT)2.

[0010] When the obtained syntax element indicates a mode included in multiple modes of MTS for the current coding unit or the current transformation unit, the method may further include: based on the one mode indicated by the syntax element, determining the horizontal transform kernel or the vertical transform kernel for the current coding unit or the current transformation unit as one of the discrete sine transform (DST) 7 and the discrete cosine transform (DCT) 8.

[0011] The step of obtaining, from a bitstream, a syntax element about an MTS for a current coding unit or a current transform unit included in the current coding unit may include:

[0012] When the tree type is not dual-tree chroma, the size of the current coding unit is less than or equal to a predetermined size, and the coding block flag for the luma component indicates that the luma transform block includes at least one transform coefficient level that is not 0, when the prediction mode of the current coding unit is inter mode, and a flag indicating whether MTS is enabled in inter mode obtained from a sequence parameter set (SPS) indicates that MTS is enabled, or when the prediction mode of the current coding unit is intra mode, and a flag indicating whether MTS is enabled in intra mode obtained from the SPS indicates that MTS is enabled, a syntax element about MTS for the current coding unit or a current transform unit included in the current coding unit is obtained.

[0013] A syntax element about the MTS with respect to the current coding unit or the current transformation unit included in the current coding unit may not be included in the residual encoding syntax structure, but may be included in the syntax structure of the coding unit or the syntax structure of the transformation unit.

[0014] The method may further include: obtaining a flag indicating whether a transform skip mode is used for the current transform unit from a bitstream based on a size of the current transform unit; determining whether the transform skip mode is used for the current transform unit based on the obtained flag; based on the determination, skipping an inverse transform operation for the current transform unit, and obtaining at least one coefficient included in the current transform unit from the bitstream; and generating a reconstructed block including the current transform unit based on the obtained at least one coefficient.

[0015] The step of obtaining, from the bitstream, a flag indicating whether a transform skip mode is used for the current transform unit based on the size of the current transform unit may include obtaining the flag from the bitstream before parsing the residual encoding syntax structure.

[0016] The step of obtaining a flag indicating whether to use a transform skip mode for the current transform unit from a bitstream based on the size of the current transform unit may include:

[0017] When the tree type is not dual-tree chroma, a flag indicating whether a transform skip mode is enabled obtained from a sequence parameter set (SPS) indicates that the transform skip mode is enabled, and the size of the current transform unit is less than or equal to a predetermined size indicated by information about the size of the transform unit in skip mode obtained from the bitstream, when a coding block flag for the luma component indicates that the luma transform block includes at least one transform coefficient level that is not 0, a flag indicating whether a transform skip mode is used for the current transform unit is obtained from the bitstream based on the size of the current transform unit.

[0018] A flag indicating whether a transform skip mode is used for a current transform unit based on the size of the current transform unit may not be included in the residual encoding syntax structure but may be included in the syntax structure of the transform unit.

[0019] When the prediction mode of the current coding unit is an inter mode, the method may further include: determining whether to perform inverse transformation on only one of the two subblocks for the current coding unit or the current transformation unit. In addition, when it is determined to perform inverse transformation on the only one subblock, the method may further include: scanning information about at least one transformation coefficient only for an area included in the only one subblock before inverse transformation.

[0020] When the prediction mode of the current coding unit is an inter-frame mode, the method may further include: determining whether to perform inverse transformation on only one of the two sub-blocks for the current coding unit or the current transformation unit. In addition, when it is determined that the inverse transformation is performed on only the one sub-block, the method may further include: determining the division direction of the current coding unit or the current transformation unit based on the relative relationship between the height and width of the current coding unit or the current transformation unit without parsing information about the division direction of the current coding unit or the current transformation unit.

[0021] According to an embodiment of the present disclosure, an image encoding device includes at least one processor, which is configured to perform the following operations: obtain syntax elements about multiple transform selection (MTS) for a current coding unit or a current transform unit included in the current coding unit from a bitstream; determine a horizontal transform kernel or a vertical transform kernel for the current transform unit based on the obtained syntax elements; obtain a residual signal by performing an inverse transform on the current transform unit based on the determined horizontal transform kernel or vertical transform kernel for the current transform unit; and generate a reconstructed block including the current coding unit or the current transform unit based on the residual signal for the current transform unit.

[0022] According to an embodiment of the present disclosure, an image encoding method includes: determining a horizontal transform kernel or a vertical transform kernel for a current transform unit by performing a transform on the current transform unit based on the horizontal transform kernel or the vertical transform kernel for the current transform unit; and generating a syntax element about a multiple transform selection (MTS) for the current coding unit or the current transform unit included in the current coding unit based on the horizontal transform kernel or the vertical transform kernel for the current transform unit; encoding a transform coefficient generated by performing the transform on the current transform unit; and generating a bit stream, wherein the bit stream includes the encoded transform coefficient for the current transform unit and the syntax element about the MTS.

[0023] A computer program for an image decoding method according to an embodiment of the present disclosure may be recorded on a computer-readable recording medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1a is a block diagram of an image decoding apparatus according to various embodiments.

[0025] Figure 1b is a flowchart of an image decoding method according to various embodiments.

[0026] Figure 1c is a flowchart of an image decoding method according to various embodiments.

[0027] Figure 1d is a flowchart of an image decoding method according to various embodiments.

[0028] Figure 1e is a block diagram of an image decoder according to various embodiments.

[0029] Figure 2a is a block diagram of an image encoding apparatus according to various embodiments.

[0030] Figure 2b is a flowchart of an image encoding method according to various embodiments.

[0031] Figure 2c is a flowchart of an image encoding method according to various embodiments.

[0032] Figure 2d is a flowchart of an image encoding method according to various embodiments.

[0033] Figure 2e is a block diagram of an image encoder according to various embodiments.

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

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

[0036] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by an image decoding apparatus according to an embodiment, is illustrated.

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

[0038] Figure 7 An order in which a plurality of coding units are processed when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.

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

[0040] Fig. 9 A process of determining at least one coding unit by splitting a first coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0041] Fig.10 It is shown that according to an embodiment, when a second coding unit having a non-square shape determined by splitting a first coding unit by an image decoding apparatus satisfies a predetermined condition, shapes into which the second coding unit may be split are restricted.

[0042] Fig.11 A process of splitting a square coding unit performed by an image decoding apparatus when division shape pattern information indicates that the square coding unit is not to be split into four square coding units according to an embodiment is illustrated.

[0043] Fig.12 It is shown that a processing order among a plurality of coding units may be changed according to a process of dividing the coding units according to an embodiment.

[0044] Fig.13 A process of determining a depth of a coding unit when a shape and a size of a coding unit are changed when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.

[0045] Fig.14 Depth that may be determined based on the shape and size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.

[0046] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.

[0047] Fig.16 A processing block serving as a criterion for determining an order of determining reference coding units included in a picture according to an embodiment is illustrated.

[0048] Fig.17a A syntax structure of a transform unit including a syntax element of a multiple transform selection (MTS) and a residual coding syntax structure according to various embodiments are shown.

[0049] Fig.17b A syntax structure of a transform unit including a syntax element for transform selection according to various embodiments is shown.

[0050] Fig.17c A syntax structure of a transform unit including a syntax element for transform selection according to various embodiments is shown.

[0051] Fig.17d A syntax structure of a coding unit including syntax elements of an MTS according to various embodiments is shown.

[0052] Fig.18a A residual coding syntax structure including a transform unit syntax and a transform skip flag according to various embodiments is shown.

[0053] Fig.18b A syntax structure of a transform unit including a transform skip flag according to various embodiments is shown.

[0054] Fig.19a is a diagram for describing a sub-block transform (SBT) mode for a block encoded in an inter mode according to an embodiment.

[0055] Fig.19b is a diagram for describing an SBT mode for a block encoded in an inter mode according to an embodiment.

[0056] Fig.19c is a diagram for describing a process of encoding and decoding coefficients based on SBT for a block encoded in an inter mode according to an embodiment.

[0057] Fig.20a A residual coding syntax structure for determining the size of a scan area according to an embodiment is shown.

[0058] Fig.20b The residual coding semantics of the syntax element indicating the position of the last significant coefficient taking into account the size of the scan region according to an embodiment is shown.

[0059] Fig.20c A syntax structure of a coding unit for determining whether a predetermined split direction and a predetermined split type are allowed based on a size (height or width) of a current coding unit according to an embodiment is shown.

[0060] Best Mode

[0061] According to an embodiment of the present disclosure, an image decoding method includes: obtaining, from a bit stream, syntax elements about multiple transform selection (MTS) for a current coding unit or a current transform unit included in the current coding unit; determining a horizontal transform kernel or a vertical transform kernel for the current transform unit based on the obtained syntax elements; obtaining a residual signal by performing an inverse transform on the current transform unit based on the determined horizontal transform kernel or vertical transform kernel for the current transform unit; and generating a reconstructed block including the current coding unit or the current transform unit based on the residual signal for the current transform unit.

[0062] According to an embodiment of the present disclosure, an image encoding device includes at least one processor, wherein the at least one processor is configured to perform the following operations: obtain syntax elements about multiple transform selection (MTS) for a current coding unit or a current transform unit included in the current coding unit from a bit stream; determine a horizontal transform kernel or a vertical transform kernel for the current transform unit based on the obtained syntax elements; obtain a residual signal by performing an inverse transform on the current transform unit based on the determined horizontal transform kernel or vertical transform kernel for the current transform unit; and generate a reconstructed block including the current coding unit or the current transform unit based on the residual signal for the current transform unit.

[0063] According to an embodiment of the present disclosure, an image encoding method includes: determining a horizontal transform kernel or a vertical transform kernel for a current transform unit by performing a transform on the current transform unit based on the horizontal transform kernel or the vertical transform kernel for the current transform unit; and generating a syntax element about a multiple transform selection (MTS) for the current coding unit or the current transform unit included in the current coding unit based on the horizontal transform kernel or the vertical transform kernel for the current transform unit; encoding a transform coefficient generated by performing the transform on the current transform unit; and generating a bit stream, wherein the bit stream includes the encoded transform coefficient for the current transform unit and the syntax element about the MTS.

[0064] A computer program for an image decoding method according to an embodiment of the present disclosure may be recorded on a computer-readable recording medium. DETAILED DESCRIPTION

[0065] From the following description of the embodiments of the present disclosure in conjunction with the accompanying drawings, the advantages and features of the embodiments of the present disclosure set forth herein and the methods for achieving them will be apparent. However, the present disclosure is not limited to the embodiments of the present disclosure set forth herein, and may be implemented in many different forms. The embodiments of the present disclosure are provided only to make the present disclosure thorough and complete, and the embodiments of the present disclosure will fully convey the scope of the present disclosure to those of ordinary skill in the art.

[0066] The terms used herein will be briefly described, and then the embodiments of the present disclosure set forth herein will be described in detail.

[0067] In this specification, considering the functions of the present disclosure, currently widely used general terms are selected where possible, but non-general terms may be selected according to the intentions of those skilled in the art, precedents or new technologies, etc. Some terms may be arbitrarily selected by the applicant. In this case, the meanings of these terms will be explained in detail in the corresponding parts of the present disclosure. Therefore, the terms used here should not be defined based on their names but on their meanings and the entire context of the present disclosure.

[0068] As used herein, the singular forms are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0069] It will be understood that when an element is referred to as “comprising” another element, the element may further include other elements unless otherwise stated.

[0070] The term "unit" used here should be understood as a software component or hardware component that performs a predetermined function. However, the term "unit" is not limited to software or hardware. The term "unit" can be configured to be stored in an addressable storage medium or reproduce one or more processors. Therefore, the term "unit" can include, for example, components (such as software components, object-oriented software components, class components and task components), processes, functions, attributes, procedures, subroutines, program code fragments, drivers, firmware, microcodes, circuits, data, databases, data structures, tables, arrays and parameters. The functions provided in components and "units" can be combined into a small number of components and "units", or can be divided into subcomponents and "subunits".

[0071] According to an embodiment of the present disclosure, a “unit” may be implemented with a processor and a memory. The term “processor” should be broadly interpreted to include a general-purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, and the like. In some cases, a “processor” may refer to an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), and the like. The term “processor” may refer to a combination of processing devices, such as a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors and a DSP core, or a combination of any other configuration.

[0072] The term "memory" should be interpreted broadly to include any electronic component capable of storing electronic information. The term "memory" may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage devices, registers, etc. When a processor is able to read information from and / or write information to the memory, the memory may be said to be in electronic communication with the processor. Memory integrated into a processor is in electronic communication with the processor.

[0073] The term "image" when used herein should be understood to include static images (such as still images of a video) as well as moving pictures (ie, dynamic images) as a video.

[0074] The term "sample" as used herein refers to data assigned to a sampling position of an image, i.e., data to be processed. For example, a sample may be a pixel value in the spatial domain and a transform coefficient in the transform domain. A unit comprising at least one such sample may be defined as a block.

[0075] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement the embodiments of the present disclosure. In addition, parts irrelevant to the description will be omitted to clearly describe the present disclosure.

[0076] In the following, reference will be made to Figures 1a to 20c An image encoding device and an image decoding device as well as an image encoding method and an image decoding method according to various embodiments are described. Figures 3 to 16 , a method for determining a data unit of an image according to various embodiments will be described, and reference will be made to Figures 1a to 1e , Figure 2a to Figure 2e as well as Figures 17a to 20c , an image encoding device and an image decoding device as well as an image encoding method and an image decoding method for performing transformation or inverse transformation on a data unit determined in various shapes according to various embodiments will be described.

[0077] Hereinafter, an encoding or decoding method and apparatus for encoding or decoding an image based on data units of various shapes according to an embodiment of the present disclosure will now be described with reference to FIGS. 1 and 2 .

[0078] Figure 1a is a block diagram of an image decoding apparatus according to various embodiments.

[0079] The image decoding device 100 according to various embodiments may include an obtainer 105 and an image decoder 110. The obtainer 105 and the image decoder 110 may include at least one processor. In addition, the obtainer 105 and the image decoder 110 may include a memory storing instructions to be executed by the at least one processor. The image decoder 110 may be implemented as hardware separate from the obtainer 105, or the image decoder 110 may include the obtainer 105.

[0080] Hereinafter, an operation of the image decoding apparatus 100 performing inverse transform on a current block based on a syntax element regarding multiple transform selection is described.

[0081] The obtainer 105 may obtain, from a bitstream, a syntax element about multiple transform selection with respect to a current coding unit or a current transform unit included in the current coding unit.

[0082] Here, multi-transform selection refers to a method of performing inverse transformation by determining one of various candidate transform cores as a horizontal transform core or a vertical transform core according to the size of the current transform unit (or the current coding unit) and using the determined horizontal transform core and vertical transform core instead of using a single transform core (such as discrete cosine transform (DCT) 2 for inverse transformation).

[0083] For example, the obtainer 105 may obtain, from a bitstream, a syntax element regarding multiple transform selection included in a syntax structure of a current coding unit or a syntax structure of a current transform unit.

[0084] Here, the syntax element may refer to an element of data indicated by the bitstream, and the syntax structure may refer to one or more elements (sets) also included in the bitstream according to a specific order. Here, the parameter may refer to a syntax element included in a sequence parameter set (SPS), a picture parameter set (PPS), an adaptation parameter set (APS), etc.

[0085] The obtainer 105 may obtain, from the bitstream, a syntax element regarding multi-transform selection included in a syntax structure other than the residual coding syntax structure. Here, the syntax element regarding multi-transform selection may be a syntax element indicating at least one of the following items: indicating whether multi-transform selection is used for the current coding unit or the current transform unit, and indicating one mode included in multiple modes according to multi-transform selection. For example, the syntax element may include a multi-transform selection flag mts_flag indicating whether multi-transform selection is used and a multi-transform selection index mts_idx indicating one mode among multiple modes according to multi-transform selection. According to each mode, the image decoding device 100 may determine a horizontal transform kernel and a vertical transform kernel corresponding to each mode.

[0086] Alternatively, the syntax element may be index information indicating one of a plurality of modes according to multiple transform selection together with whether the multiple transform selection is used.

[0087] A syntax element about multi-transform selection for a current coding unit or a current transformation unit included in the current coding unit may not be included in the residual encoding syntax structure, but may be included in a syntax structure of the coding unit or a syntax structure of the transformation unit.

[0088] Therefore, according to an embodiment, the image decoding apparatus 100 can immediately parse the syntax elements about (inverse) transform including the syntax elements about multi-transform selection, and the parsing delay until the residual coding syntax structure is parsed may not occur. In addition, the image decoding apparatus 100 can perform parsing independently for (inverse) transform, and thus can perform parallel processing.

[0089] When the syntax element about the multiple transform selection indicates that the multiple transform selection is not used for the current coding unit or the current transform unit, the image decoder 110 may determine the transform kernel for the current transform unit as DCT2.

[0090] When the syntax element about the multiple transform selection indicates one of the multiple transform modes selected according to the multiple transform for the current coding unit or the current transform unit, the image decoder 110 may determine the transform kernel in the horizontal direction or the vertical direction for the current coding unit or the current transform unit as one of discrete sine transform (DST) 7 and DST 8 based on the one mode indicated by the syntax element. When the size of the current coding unit is greater than or equal to the predetermined first size or less than or equal to the predetermined second size, the image decoder 110 may determine the transform kernel in the horizontal direction or the vertical direction as DCT2.

[0091] When the tree type is not dual-tree chroma, the size of the current coding unit is less than or equal to the predetermined size, and the coding block flag for the luminance component indicates that the luminance transform block includes at least one transform coefficient level that is not 0, the obtainer 105 may obtain a syntax element about multi-transform selection for the current transform unit included in the current coding unit from the bitstream. Here, the tree type refers to a type indicating a relationship between a block partition tree structure of an image of a luminance component and one partition tree structure of an image of a chrominance component, wherein when the tree type is a single tree, the partition tree structure of the image of the chrominance component shares the partition tree structure of the image of the luminance component, and when the tree type is a single tree, it may indicate that the current block is included in the partition tree structure of one image, and because the partition tree structure is shared by all color components, the partition tree structure is independent of the color components of the current block.

[0092] When the tree type is a dual tree, the partition tree structure of the image of the chrominance component may be separated from the partition tree structure of the image of the luma component. In detail, when the tree type is dual tree chrominance, it may indicate that the current block is included in the partition tree structure of the image of the chrominance component, and when the tree type is dual tree luma, it may indicate that the current block is included in the partition tree structure of the image of the luma component. Therefore, when the tree type is not dual tree chrominance, the current tree type may be a single tree or dual tree luma.

[0093] When the tree type is not dual-tree chroma, the size of the current coding unit is less than or equal to a predetermined size, and the coding block flag for the luminance component indicates that the luminance transform block includes at least one transform coefficient level that is not 0, and when the prediction mode of the current coding unit is an inter-frame mode and a flag indicating whether multi-transform selection is enabled in the inter-frame mode obtained from a sequence parameter set (SPS) indicates that multi-transform selection is enabled, or when the prediction mode of the current coding unit is an intra-frame mode and a flag indicating whether multi-transform selection is enabled in the intra-frame mode obtained from the SPS indicates that multi-transform selection is enabled, the obtainer 105 may obtain a syntax element about multi-transform selection for the current coding unit or a current transform unit included in the current coding unit.

[0094] Based on the syntax element about the multi-transform selection, the image decoder 110 may determine a horizontal transform kernel or a vertical transform kernel for the current transform unit. The image decoder 110 may determine one of the various candidate transform kernels as the horizontal transform kernel or the vertical transform kernel. Here, the various candidate transform kernels may include DCT2, DCT8, and DST7. However, it will be understood by those of ordinary skill in the art that the candidate transform kernels are not limited thereto and may include various transform kernels (DST4, DCT4, etc.).

[0095] The image decoder 110 may obtain a residual signal (e.g., a residual block) by performing inverse transform on the current transform unit based on the horizontal transform kernel or the vertical transform kernel determined for the current transform unit. The image decoder 110 may obtain information about at least one transform coefficient included in the current transform unit, and may obtain the at least one transform coefficient based on the information about the at least one transform coefficient. The image decoder 110 may obtain a residual signal by performing inverse transform on the at least one transform coefficient included in the current transform unit based on the horizontal transform kernel or the vertical transform kernel determined for the current transform unit.

[0096] The image decoder 110 may generate a reconstructed block including the current coding unit or the current transformation unit based on the residual signal for the current transformation unit. The image decoder 110 may generate a prediction block for the current coding unit or the current transformation unit by performing inter prediction, intra prediction, etc. The image decoder 110 may generate a reconstructed block for the current coding unit or the current transformation unit by combining the residual block including the residual signal for the current transformation unit and the prediction block for the current coding unit or the current transformation unit.

[0097] Hereinafter, a description is given of a configuration in which the image decoding apparatus 100 skips inverse transform based on a syntax element indicating whether a transform skip mode is used and reconstructs a current block.

[0098] The obtainer 105 may obtain a flag (hereinafter, a transform skip flag) indicating whether a transform skip mode is used for the current transform unit from the bitstream based on the size of the current transform unit. The obtainer 105 may obtain the transform skip flag from the bitstream before parsing the residual coding syntax structure. The transform skip flag may not be included in the residual coding syntax structure but may be included in the syntax structure of the transform unit.

[0099] When the tree type is not dual-tree chroma and the flag indicating whether the transform skip mode is enabled obtained from the SPS indicates that the transform skip mode is enabled, the obtainer 105 may obtain the transform skip flag from the bitstream. When the tree type is not dual-tree chroma, the flag indicating whether the transform skip mode is enabled obtained from the SPS indicates that the transform skip mode is enabled, and the coded block flag (referred to as cbf) for the luma component indicates that the luma transform block includes at least one transform coefficient level that is not 0, the obtainer 105 may obtain the transform skip flag from the bitstream. The coded block flag indicates whether the corresponding transform block includes at least one transform coefficient level that is not 0.

[0100] When the tree type is not dual-tree chroma, the flag indicating whether the transform skip mode is enabled obtained from the SPS indicates that the transform skip mode is enabled, and the size of the current transform unit is less than or equal to a predetermined size indicated by the transform unit size information of the transform skip mode obtained from the bitstream, and when the coding block flag for the luminance component indicates that the luminance transform block includes at least one transform coefficient level that is not 0, the obtainer 105 may obtain the transform skip flag from the bitstream.

[0101] When the above conditions are met, and when it is determined that multiple transform selection is used, the obtainer 105 may obtain a transform skip flag from the bitstream. It is not limited thereto. Conversely, when it is determined that multiple transform selection is not used, the obtainer 105 may obtain a transform skip flag from the bitstream. Alternatively, the obtainer 105 may obtain a transform skip flag from the bitstream, and when the value of the transform skip flag is 0, the obtainer 105 may obtain a syntax element about multiple transform selection (MTS) from the bitstream.

[0102] Based on the transform skip flag, the image decoder 110 may determine whether to use the transform skip mode for the current transform unit.

[0103] Based on a result of determining whether the transform skip mode is used for the current transform unit, the image decoder 110 may skip inverse transform of the current transform unit, and may obtain at least one coefficient included in the current transform unit from a bitstream. Based on a result of determining whether the transform skip mode is used for the current transform unit, the image decoder 110 may skip inverse transform of the current transform unit, obtain information about at least one coefficient included in the current transform unit from a bitstream, and obtain the at least one coefficient included in the current transform unit based on the information about the at least one coefficient.

[0104] The image decoder 110 may generate a reconstructed block including the current transformation unit based on the at least one coefficient. The image decoder 110 may generate a prediction block for the current transformation unit or the current coding unit including the current transformation unit by performing inter prediction, intra prediction, etc. The image decoder 110 may generate a reconstructed block for the current transformation unit or the current coding unit by combining a residual block for the current transformation unit including the at least one coefficient and a prediction block for the current coding unit or the current transformation unit.

[0105] Hereinafter, a description is given of a configuration in which the image decoding apparatus 100 performs sub-block transform (SBT) in which inverse transform is performed only on a region (sub-block) of an inter residual block.

[0106] When the prediction mode of the current coding unit is an inter mode, the image decoder 110 may determine whether to perform inverse transformation on only one of the two subblocks for the current coding unit or the current transformation unit. Here, when the current block is a coding unit, the subblock may be a transformation unit. That is, the current coding unit may include two transformation units. When the current block is a transformation unit, the subblock may be a sub-transformation unit.

[0107] When the prediction mode of the current coding unit is the inter mode, the obtainer 105 may obtain a flag sbt_flag indicating whether inverse transformation is performed on only one of the two sub-blocks of the current coding unit or the current transformation unit, and the image decoder 110 may determine whether inverse transformation is performed on only one of the two sub-blocks for the current coding unit or the current transformation unit based on the flag sbt_flag.

[0108] When it is determined that inverse transform is performed on only one of the two subblocks for the current coding unit or the current transformation unit, the obtainer 105 may obtain a flag cu_sbt_quad_flag or tu_sbt_quad_flag indicating that the current coding unit or the current transformation unit is divided into a plurality of subblocks including a subblock with a size of 1 / 2 or 1 / 4 from the bitstream. The image decoder 110 may determine whether to divide the current coding unit or the current transformation unit into a plurality of subblocks including a subblock with a size of 1 / 2 or 1 / 4 based on the flag cu_sbt_quad_flag or tu_sbt_quad_flat.

[0109] The obtainer 105 may obtain a flag cu_sbt_horizontal_flag or tu_sbt_horizontal_flag indicating whether the current coding unit or the current transformation unit is split horizontally or vertically from the bitstream. The image decoder 110 may determine whether the current coding unit or the current transformation unit is split horizontally or vertically based on the flag cu_sbt_horizontal_flag or tu_sbt_horizontal_flag.

[0110] The obtainer 105 may obtain a flag cu_sbt_pos_flag or tu_sbt_pos_flag indicating the position of one block on which inverse transformation is performed among two subblocks included in the current coding unit or the current transformation unit from the bitstream. The image decoder 110 may determine the one block on which inverse transformation is performed among two subblocks included in the current coding unit or the current transformation unit based on the flag cu_sbt_pos_flag or tu_sbt_pos_flag.

[0111] When it is determined that inverse transformation is performed on only one subblock of the current coding unit or the current transformation unit, the image decoder 110 may obtain the at least one transformation coefficient based on information about at least one transformation coefficient, which is entropy decoded and scanned before inverse transformation, for only a region included in the subblock on which inverse transformation is performed. Here, scanning refers to a method of transforming one-dimensionally arranged information into two-dimensionally arranged information according to a scanning order.

[0112] The image decoder 110 may scan the information about the at least one transform coefficient for only an area (hereinafter, a scan area) included in one sub-block according to the size of the current block. At least one of the height and width of the scan area may be 1 / 2 of the sub-block. In this case, the position of the last significant coefficient may be determined within a range of a pixel at the upper left edge of the scan area to a pixel at the lower right end of the scan area in terms of the x position and the y position.

[0113] When the prediction mode of the current coding unit is the inter mode, the image decoder 110 may determine whether to perform inverse transformation on only one of two subblocks for the current coding unit or the current transformation unit.

[0114] When it is determined that the inverse transform is performed on only one sub-block, the image decoder 110 may determine the split direction of the current coding unit or the current transformation unit without parsing the information about the split direction of the current coding unit or the current transformation unit. When it is determined that the inverse transform is performed on only one sub-block, the image decoder 110 may determine the split direction of the current coding unit or the current transformation unit based on at least one of the height and width of the current coding unit or the current transformation unit without parsing the information about the split direction of the current coding unit or the current transformation unit. When it is determined that the inverse transform is performed on only one sub-block, the image decoder 110 may determine the split direction of the current coding unit or the current transformation unit based on the relative relationship between the height and width of the current coding unit or the current transformation unit without parsing the information about the split direction of the current coding unit or the current transformation unit. For example, when the height or width of the current coding unit or the current transformation unit is greater than a predetermined height or a predetermined width, the image decoder 110 may determine that the height or width of the current coding unit or the current transformation unit is allowed to be vertically split or horizontally split. When the image decoder 110 does not obtain information about the division direction for the current coding unit or the current transformation unit from the bitstream, and when the flag cu_sbt_quad_flag is 1 (i.e., when the current coding unit or the current transformation unit is divided into multiple sub-blocks including sub-blocks with a size of 1 / 4), the image decoder 110 may determine the division direction as horizontal division based on whether the current coding unit or the current transformation unit is allowed to be horizontally divided into multiple sub-blocks including sub-blocks with a size of 1 / 4 (whether allowSbtHorQ is 1).

[0115] When the image decoder 110 does not obtain information about the division direction for the current coding unit or the current transformation unit from the bitstream, and when the flag cu_sbt_quad_flag is 0 (i.e., when the current coding unit or the current transformation unit is divided into multiple sub-blocks including sub-blocks with a size of 1 / 2), the image decoder 110 may determine the division direction as horizontal division based on whether the current coding unit or the current transformation unit is allowed to be horizontally divided into multiple sub-blocks including sub-blocks with a size of 1 / 2 (whether allowSbtHorH is 1).

[0116] Above, the configurations in which the image decoding device 100 performs decoding according to MTS, transform skip mode, and SBT are described separately. However, it is not limited thereto. It will be appreciated by those skilled in the art that the image decoding device 100 can perform a decoding operation by combining at least a portion of each configuration unless there is incompatibility between them.

[0117] The image decoder 110 may determine a coding unit or a transformation unit in a decoding operation as described below.

[0118] The image decoder 110 may determine a plurality of luminance / chrominance coding units in the current luminance / chrominance image by hierarchically dividing the current luminance / chrominance image based on the division shape pattern of the current luminance / chrominance image. For each coding unit, there may be a division shape pattern of the current luminance / chrominance image. That is, after the current block is divided into a plurality of coding units according to the division shape pattern of the current block, the corresponding coding unit may be further divided according to the division shape pattern of the divided block. The division shape pattern of the current luminance image may be determined by obtaining information about the division shape pattern of the current luminance image from the bitstream. The division shape pattern may be a pattern based on a division shape pattern including one of four divisions, two divisions, and three divisions. The transform unit may be determined based on the coding unit and may have the same size as the coding unit. However, the transform unit is not limited thereto. When the size of the coding unit is greater than the size of the maximum transform unit, the coding unit may be divided. Therefore, the coding unit may include at least one transform unit.

[0119] Figure 1b is a flowchart of an image decoding method according to various embodiments.

[0120] In operation S105, the image decoding apparatus 100 may obtain a syntax element about an MTS for a current coding unit or a current transformation unit included in the current coding unit from a bitstream. Here, the syntax element may be included in a syntax structure of the coding unit or the transformation unit, and may not be included in a residual coding syntax structure.

[0121] In operation S110 , the image decoding apparatus 100 may determine a transformation kernel in a horizontal direction or a vertical direction for a current transformation unit based on the syntax element.

[0122] In operation S115 , the image decoding apparatus 100 may obtain a residual signal by performing inverse transformation on the current transformation unit based on a transformation kernel in a horizontal direction or a vertical direction determined with respect to the current transformation unit.

[0123] In operation S120, a reconstructed block including the current coding unit or the current transformation unit may be generated based on a residual signal with respect to the current transformation unit.

[0124] Figure 1c is a flowchart of an image decoding method according to various embodiments.

[0125] In operation S125, the image decoding apparatus 100 may obtain a flag indicating whether a transform skip mode is used for the current transform unit from the bitstream based on the size of the current transform unit. For example, the image decoding apparatus 100 may obtain information indicating a maximum size of a block to which transform skip is applied from the bitstream, and may determine the maximum size of a block to which transform skip is applied based on the information. When the size of the current transform unit is less than or equal to the maximum size of a block to which transform skip is applied, the image decoding apparatus 100 may obtain a flag indicating whether a transform skip mode is used for the current transform unit from the bitstream.

[0126] A flag indicating whether the transform skip mode is used may be included in the syntax structure of the transform unit and may not be included in the residual encoding syntax structure.

[0127] In operation S130, the image decoding apparatus 100 may determine whether to use a transform skip mode for a current transform unit based on the obtained flag.

[0128] In operation S135, the image decoding apparatus 100 may skip an inverse transform operation for the current transform unit, and may obtain at least one coefficient included in the current transform unit from a bitstream. The image decoding apparatus 100 may obtain information about at least one coefficient included in the current transform unit from a bitstream, may skip an inverse transform operation for the current transform unit, and may obtain the at least one coefficient based on the information about the at least one coefficient included in the current transform unit. Here, the at least one coefficient may be dequantized.

[0129] In operation S140, the image decoding apparatus 100 may generate a reconstructed block including the current transformation unit based on the obtained at least one coefficient.

[0130] Figure 1d is a flowchart of an image decoding method according to various embodiments.

[0131] In operation S145, when the prediction mode of the current coding unit is the inter mode, the image decoding apparatus 100 may determine whether to perform inverse transformation on only one of the two subblocks for the current coding unit or the current transformation unit. The image decoding apparatus 100 may obtain a flag indicating whether inverse transformation is performed on only one of the two subblocks of the current coding unit or the current transformation unit from the bitstream, and may determine whether to perform inverse transformation on only one of the two subblocks of the current coding unit or the current transformation unit based on the flag.

[0132] In operation S150, when the image decoding device 100 determines to perform inverse transformation on only one sub-block, the image decoding device 100 may scan information about at least one transform coefficient only for an area included in the one sub-block from the bitstream before inverse transformation. However, it is not limited thereto. The image decoding device 100 may scan information about at least one transform coefficient only for some areas (hereinafter, scan areas) included in the one sub-block according to the size of the current block. At least one of the height and width of the scan area may be 1 / 2 of the sub-block. In this case, the position of the last significant coefficient may be determined within the range of the pixel at the upper left edge of the scan area to the pixel at the lower right end of the scan area in the x position and the y position. Parsing of the significant coefficient flag at the position of the last significant coefficient may be omitted.

[0133] In operation S155, the image decoding apparatus 100 may generate the at least one coefficient by inversely transforming the at least one transform coefficient based on the scanned information about the at least one transform coefficient. The image decoding apparatus 100 may obtain the at least one transform coefficient based on the scanned information about the at least one transform coefficient, and may generate the at least one coefficient by inversely transforming the at least one transform coefficient.

[0134] In operation S160, the image decoding apparatus 100 may generate a reconstructed block including at least one transformation unit included in the current coding unit, based on the at least one coefficient.

[0135] Above, by referring to Figure 1b to Figure 1d , methods for decoding an image according to MTS, transform skip mode, and sub-block transform respectively performed by the image decoding device 100 are described according to various embodiments. Above, the method for decoding an image performed by the image decoding device 100 is described separately for each figure. However, it can be understood by those skilled in the art that unless there is incompatibility between each decoding method, at least a portion of each decoding method shown in the figures can be combined with each other to perform the decoding operation in a logical order.

[0136] Figure 1e is a block diagram of an image decoder 6000 according to various embodiments.

[0137] The image decoder 6000 according to various embodiments performs operations required for the image decoder 110 of the image decoding apparatus 100 to decode image data.

[0138] Reference Figure 1d, the entropy decoder 6150 parses the encoded image data to be decoded and the encoding information required for decoding from the bit stream 6050. The encoded image data is a quantized transform coefficient, and the inverse quantizer 6200 and the inverse transformer 6250 reconstruct residual data from the quantized transform coefficient.

[0139] The intra predictor 6400 performs intra prediction on each block in the block. The inter predictor 6350 performs inter prediction on each block by using a reference image obtained from the reconstructed picture buffer 6300. The data of the spatial domain of the block of the current image included in the bitstream 6050 can be reconstructed by adding the residual data and the prediction data of each block generated by the intra predictor 6400 or the inter predictor 6350, and the deblocker 6450 and the sample adaptive offset (SAO) executor 6500 can perform loop filtering on the reconstructed data of the spatial domain so that the filtered reconstructed image can be output. The reconstructed image stored in the reconstructed picture buffer 6300 can be output as a reference image. In order for the image decoding device 100 to decode the image data, the image decoder 6000 according to various embodiments can perform the operation of each stage on each block.

[0140] Figure 2a is a block diagram of an image encoding apparatus according to various embodiments.

[0141] The image encoding apparatus 200 according to various embodiments may include an image encoder 205 and a bitstream generator 210 .

[0142] The image encoder 205 and the bitstream generator 210 may include at least one processor. In addition, the image encoder 205 and the bitstream generator 210 may include a memory storing instructions to be executed by the at least one processor. The image encoder 205 may be implemented as hardware separate from the bitstream generator 210, or may include the bitstream generator 210.

[0143] Hereinafter, an operation of the image encoding apparatus 200 performing transformation on a current block according to an MTS and generating syntax elements with respect to the MTS will be described.

[0144] The image encoder 205 may perform transformation on the current transformation unit based on the horizontal transformation kernel or the vertical transformation kernel for the current transformation unit to determine the horizontal transformation kernel or the vertical transformation kernel for the current transformation unit. The image encoder 205 may generate a prediction block for the current coding unit or the current transformation unit by performing inter-frame prediction, intra-frame prediction, etc. The image encoder 205 may generate at least one coefficient included in the current transformation unit based on the prediction block for the current coding unit or the current transformation unit and the original block, and may perform transformation on the at least one coefficient included in the current transformation unit.

[0145] The image encoder 205 may generate a syntax element about the MTS for the current coding unit or the current transformation unit included in the current coding unit, based on the horizontal transformation kernel or the vertical transformation kernel for the current transformation unit.

[0146] The image encoder 205 may encode at least one transform coefficient generated by performing a transform on the current transform unit. That is, the image encoder 205 may quantize and entropy encode at least one transform coefficient generated by performing a transform on the current transform unit, and may generate information about at least one encoded transform coefficient for the current transform unit. The image encoder 205 may determine one of the various candidate transform cores as a horizontal transform core or a vertical transform core. Here, the various candidate transform cores may include DCT2, DCT8, and DST7. However, it will be understood by those of ordinary skill in the art that the candidate transform cores are not limited thereto and may include various transform cores, such as DST4, DCT4, etc.

[0147] The bitstream generator 210 may generate a bitstream including information about at least one encoded transform coefficient and syntax elements about the MTS for a current coding unit.

[0148] For example, the bitstream generator 210 may generate a bitstream including syntax elements about MTS in the syntax structure of the current coding unit or the syntax structure of the current transform unit. That is, the bitstream generator 210 may generate a syntax structure including syntax elements about MTS separate from the residual coding syntax structure, and may generate a bitstream including the generated syntax structure. Here, the syntax element about MTS may be a syntax element indicating at least one of the following items: whether MTS is used for the current coding unit or the current transform unit, and one mode included in multiple modes according to MTS. For example, the syntax element may include a flag indicating whether MTS is used and an MTS index indicating one mode among multiple modes according to MTS. Alternatively, the syntax element may be index information indicating one mode among multiple modes according to MTS together with an indication of whether MTS is used.

[0149] The syntax element about the MTS may not be included in the residual encoding syntax structure, but may be included in the syntax structure of the coding unit or the syntax structure of the transformation unit.

[0150] When the transform kernel for the current transform unit is determined to be DCT2, the image encoder 205 may generate a syntax element indicating that the MTS is not used for the current coding unit or the current transform unit.

[0151] When the horizontal transform kernel or the vertical transform kernel for the current coding unit or the current transformation unit is determined as one of DST7 and DST8, the image encoder 205 may generate a syntax element indicating one of the multiple modes of MTS for the current coding unit or the current transformation unit. Here, the syntax element may also indicate that MTS is used for the current coding unit or the current transformation unit. It is not limited thereto. The image encoder 205 may generate a flag indicating that MTS is used for the current coding unit or the current transformation unit.

[0152] When the tree type is not dual-tree chroma, the size of the current coding unit is less than or equal to a predetermined size, and the luminance transform block includes at least one transform coefficient level that is not 0, the image encoder 205 may generate a syntax element regarding MTS for the current transform unit included in the current coding unit.

[0153] When the tree type is not dual-tree chroma, the size of the current coding unit is less than or equal to the predetermined size, and the luma transform block includes at least one transform coefficient level that is not 0, when the prediction mode of the current coding unit is an inter mode and indicates that MTS is enabled in the inter mode, or when the prediction mode of the current coding unit is an intra mode and indicates that MTS is enabled in the intra mode, the image encoder 205 may generate a syntax element about MTS for the current coding unit or the current transform unit included in the current coding unit. Here, whether MTS is enabled may be determined for each sequence.

[0154] Hereinafter, an operation in which the image encoding apparatus 200 skips an inverse transform operation and encodes coefficients of a current block to generate a syntax element indicating whether a transform skip mode is used will be described.

[0155] The image encoder 205 may skip a transform operation on the current transform unit based on the size of the current transform unit, and may encode at least one coefficient included in the current transform unit. The image encoder 205 may skip a transform operation on the current transform unit, and may quantize and entropy encode at least one coefficient included in the current transform unit.

[0156] The image encoder 205 may encode a flag indicating whether a transform skip mode is used for a current transform unit.

[0157] The bitstream generator 210 may generate a bitstream, wherein the bitstream includes information about at least one encoded transform coefficient for the current transform unit and a syntax element about the MTS. The bitstream generator 210 may generate a bitstream so that the transform skip flag is included in a syntax structure different from the residual coding syntax structure. That is, the transform skip flag may not be included in the residual coding syntax structure, but may be included in the syntax structure of the transform unit.

[0158] When the tree type is not dual-tree chroma and the transform skip mode is enabled, the image encoder 205 may determine whether to perform encoding according to the transform skip mode, and may encode a transform skip flag based on a result of the determination.

[0159] When the tree type is not dual-tree chroma and the transform skip mode is enabled, and when the luma transform block includes at least one transform coefficient level that is not 0, the image encoder 205 may determine whether to perform encoding according to the transform skip mode, and may encode a transform skip flag based on the determination result.

[0160] When the tree type is not dual-tree chroma and the transform skip mode is enabled, and when the size of the current transform unit is less than or equal to a predetermined size (the size of the maximum transform unit of the transform skip mode), and the luma transform block includes at least one transform coefficient level that is not 0, the image encoder 205 may determine whether to perform encoding according to the transform skip mode, and may encode a transform skip flag based on the determined result.

[0161] When the above conditions are met, and when it is determined that MTS is used, the image encoder 205 may encode the transform skip flag. It is not limited thereto. Conversely, when it is determined that MTS is not used, the image encoder 205 may encode the transform skip flag.

[0162] Hereinafter, a description is given of SBT in which the image encoding apparatus 200 performs transform only on a partial region (sub-block) of an inter residual block.

[0163] When the prediction mode of the current coding unit is the inter mode, the image encoder 205 may determine whether to perform transformation on only one of two subblocks for the current coding unit or the current transformation unit.

[0164] In order to determine whether to perform transformation on only one subblock, the image encoder 205 may generate at least one transformation coefficient by performing transformation on only one of the two subblocks of the current coding unit or the current transformation unit, scanning only the area included in the one subblock, and entropy encoding information about the at least one transformation coefficient included in the scanned one subblock. Here, scanning means a method of transforming a two-dimensional arrangement into a one-dimensional arrangement.

[0165] Based on the determination, the image encoder 205 may encode a flag indicating whether transformation is performed on only one of two sub blocks generated by splitting the transformation unit with respect to the current coding unit.

[0166] The image encoder 205 may generate a bitstream including the encoded flag and the entropy-encoded information about the at least one transform coefficient.

[0167] However, it is not limited thereto. The image encoder 205 may scan the at least one transform coefficient for only some areas (hereinafter, scan areas) included in the one sub-block according to the size of the current block. At least one of the height and width of the scan area may be 1 / 2 of the sub-block. In this case, the position of the last valid coefficient may be determined within the range of the x position and the y position from the pixel at the upper left edge of the scan area to the pixel at the lower right end of the scan area, and information about the position of the last valid coefficient within the range may be encoded.

[0168] The image encoder 205 may encode a flag cu_sbt_quad_flag indicating that a current coding unit or a current transformation unit is split into a plurality of sub-blocks including a sub-block having a 1 / 2 size or a 1 / 4 size.

[0169] The image encoder 205 may encode a flag cu_sbt_horizontal_flag indicating whether a current coding unit or a current transformation unit is split in a horizontal direction or a vertical direction.

[0170] The image encoder 205 may encode a flag cu_sbt_pos_flag indicating a position of one block on which inverse transformation is to be performed, among two sub blocks included in a current coding unit or a current transformation unit.

[0171] The image encoder 205 may not encode information about the split direction of the current coding unit or the current transformation unit. For example, when the height or width of the current coding unit or the current transformation unit is greater than a predetermined height or a predetermined width, the image encoder 205 may determine that the height or width of the current coding unit or the current transformation unit is allowed to be vertically split or horizontally split.

[0172] When the current coding unit or the current transformation unit is divided into multiple sub-blocks including sub-blocks with a size of 1 / 4, the image encoder 205 may determine the division direction as horizontal division based on whether the height horizontal division of the current coding unit or the current transformation unit is allowed to be divided into multiple sub-blocks including sub-blocks with a size of 1 / 4, and therefore, the image encoder 205 may not encode information about the division direction of the current coding unit or the current transformation unit.

[0173] When the current coding unit or the current transformation unit is divided into multiple sub-blocks including sub-blocks with a size of 1 / 2, the image encoder 205 may determine the division direction as horizontal division based on whether the height horizontal division of the current coding unit or the current transformation unit is allowed to be divided into multiple sub-blocks including sub-blocks with a size of 1 / 2, and therefore, the image encoder 205 may not encode information about the division direction of the current coding unit or the current transformation unit.

[0174] In the above, the encoding operations of the image encoding device 200 according to MTS, transform skip mode, and sub-block transform are described separately. However, the present disclosure is not limited thereto. It will be understood by those skilled in the art that unless there is incompatibility between each operation, the image encoding device 200 can perform the encoding operation by combining at least a portion of each operation.

[0175] Figure 2b is a flowchart of an image encoding method according to various embodiments.

[0176] In operation S205, the image encoding apparatus 200 may determine a horizontal transform kernel or a vertical transform kernel for the current transform unit by performing transform on the current transform unit based on the horizontal transform kernel or the vertical transform kernel for the current transform unit. The image encoding apparatus 200 may perform the above operation on at least a portion of the image to determine whether to perform transform on the current transform unit based on the horizontal transform kernel or the vertical transform kernel for the current transform unit. As a result, the image encoding apparatus 200 may determine to perform transform on the current transform unit based on the horizontal transform kernel or the vertical transform kernel for the current transform unit. That is, the image encoding apparatus 200 may determine to perform transform on the current transform unit according to the MTS.

[0177] In operation S210, the image encoding apparatus 200 may generate a syntax element about an MTS for a current coding unit or a current transformation unit included in the current coding unit, based on a horizontal transformation kernel or a vertical transformation kernel for the current transformation unit.

[0178] In operation S215, the image encoding apparatus 200 may encode at least one transformation coefficient generated by performing transformation on the current transformation unit.

[0179] In operation S220, the image encoding apparatus 200 may generate a bitstream including information about at least one encoded transform coefficient for the current transform unit and a syntax element about the MTS. Here, the syntax element about the MTS may be included in the syntax structure of the transform unit or the syntax structure of the coding unit, and may not be included in the residual coding structure.

[0180] Figure 2c is a flowchart of an image encoding method according to various embodiments.

[0181] In operation S225, the image encoding apparatus 200 may skip a transform operation on the current transform unit based on the size of the current transform unit, and may encode at least one coefficient included in the current transform unit. For example, when the size of the current transform unit is less than or equal to the maximum size of the transform skip block, the image encoding apparatus 200 may skip a transform operation on the current transform unit, and may encode the at least one coefficient included in the current transform unit.

[0182] In order to determine whether to skip the transformation operation of the current transformation unit based on the size of the current transformation unit and encode the at least one coefficient included in the current transformation unit, the image encoding apparatus 200 may perform the above operation on at least a portion of the image. As a result, the image encoding apparatus 200 may determine whether to use the transformation skip mode for the current transformation unit. In operation S230, the image encoding apparatus 200 may encode a flag indicating whether the transformation skip mode is used for the current transformation unit.

[0183] In operation S235, the image encoding apparatus 200 may generate a bitstream including at least one encoded coefficient for the current transform unit and a flag indicating whether the transform skip mode is used for the current transform unit. Here, the flag indicating whether the transform skip mode is used may be included in the syntax structure of the transform unit and may not be included in the residual encoding syntax structure.

[0184] Figure 2d is a flowchart of an image encoding method according to various embodiments.

[0185] In operation S240, when the prediction mode of the current coding unit is an inter-frame mode, the image encoding device 200 may perform a transform on only one of the two sub-blocks of the current coding unit or the current transformation unit to generate at least one transformation coefficient, scan only the area included in the one sub-block on which the transform is performed, and entropy encode the information about the at least one transformation coefficient included in the scanned one sub-block. However, it is not limited to this. The image encoder 205 may scan the at least one transformation coefficient for only some areas (hereinafter, scanning areas) included in the one sub-block according to the size of the current block. At least one of the height and width of the scanning area may be 1 / 2 of the sub-block. In this case, the position of the last significant coefficient may be determined within the range of the pixel at the upper left edge of the scanning area to the pixel at the lower right end of the scanning area in the x position and the y position, and information about the position of the last significant coefficient within the range may be encoded.

[0186] In order to determine whether to perform transformation on only one of the two subblocks of the current coding unit or the current transformation unit, the image encoding apparatus 200 may perform at least a portion of the above operations on at least a portion of the image. As a result, the image encoding apparatus 200 may determine, for the current coding unit, that transformation is performed on only one of the two subblocks of the current coding unit or the current transformation unit.

[0187] In operation S245, the image encoding apparatus 200 may encode, for a current coding unit, a flag indicating whether transformation is performed on only one of two subblocks of the current coding unit or the current transformation unit.

[0188] In operation S250, the image encoding apparatus 200 may generate a bitstream including the encoded flag and the entropy-encoded information about the at least one transformation coefficient.

[0189] Above, by referring to Figure 2b to Figure 2d , methods for encoding an image according to MTS, transform skip mode, and sub-block transform, respectively, performed by the image encoding apparatus 200 are described according to various embodiments. Above, the method for encoding an image performed by the image encoding apparatus 200 is described separately for each drawing. However, it can be understood by those skilled in the art that, unless there is incompatibility between each encoding method, at least a portion of each encoding method shown in the drawings can be combined with each other to perform encoding operations in a logical order.

[0190] Figure 2e is a block diagram of an image encoder according to various embodiments.

[0191] The image encoder 7000 according to various embodiments performs operations required for the image encoder 205 of the image encoding apparatus 200 to encode image data.

[0192] That is, the intra predictor 7200 performs intra prediction on each of the blocks of the current image 7050 , and the inter predictor 7200 performs inter prediction on each of the blocks by using the current image 7050 and a reference image obtained from the reconstructed picture buffer 7100 .

[0193] The prediction data is subtracted from the data of the block to be encoded in the current image 7050, wherein the prediction data is related to each block and is output from the intra predictor 7200 or the inter predictor 7200, and the transformer 7250 and the quantizer 7300 can output the quantized transform coefficient of each block by performing transform and quantization on the residual data. The dequantizer 7450 and the inverse transformer 7500 can reconstruct the residual data of the spatial domain by performing dequantization and inverse transform on the quantized transform coefficient. The reconstructed residual data of the spatial domain can be added to the prediction data related to each block and output from the intra predictor 7200 or the inter predictor 7200, and thus can be reconstructed into the data of the spatial domain for the block of the current image 7050. The deblocker 7550 and the SAO executor generate a filtered reconstructed image by performing in-loop filtering on the reconstructed data of the spatial domain. The generated reconstructed image is stored in the reconstructed picture buffer 7100. The reconstructed image stored in the reconstructed picture buffer 7100 may be used as a reference image for inter prediction for another image. The entropy encoder 7350 may entropy encode the quantized transform coefficients, and the entropy encoded coefficients may be output as a bitstream 7400 .

[0194] In order to apply the image encoder 7000 according to various embodiments to the image encoding apparatus 200 , the image encoder 7000 according to various embodiments may perform an operation of each stage on each block.

[0195] Hereinafter, the division of coding units will be described in detail according to an embodiment of the present disclosure.

[0196] The image may be divided into maximum coding units. The size of each maximum coding unit may be determined based on information obtained from a bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the embodiment is not limited thereto. In addition, the maximum coding unit may be hierarchically divided into coding units based on the division shape pattern information obtained from the bitstream. The division shape pattern information may include at least one of information indicating whether the division will be performed, division direction information, and division type information. The information indicating whether the division will be performed indicates whether the coding unit will be divided. The division direction information indicates that the division will be performed in one of the horizontal direction or the vertical direction. The division type information indicates that the coding unit will be divided by using one of two divisions, three divisions (also called ternary divisions), or four divisions.

[0197] For ease of description, in the present disclosure, it is assumed that the division shape mode information includes information indicating whether division is to be performed, division direction information, and division type information, but the present disclosure is not limited thereto. The image decoding apparatus 100 may obtain the division shape mode information as a binary bit string from the bit stream. The image decoding apparatus 100 may determine whether to divide the coding unit, the division direction, and the division type based on the one binary bit string.

[0198] The coding unit may be smaller than or equal to the maximum coding unit. For example, when the division shape pattern information indicates that division will not be performed, the coding unit has the same size as the maximum coding unit. When the division shape pattern information indicates that division will be performed, the maximum coding unit may be divided into coding units of a lower depth. When the division shape pattern information about the coding unit of the lower depth indicates division, the coding unit of the lower depth may be divided into smaller coding units. However, the division of the image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished. Referring to Figures 3 to 16 The division of coding units is described in detail.

[0199] In addition, the coding unit may be divided into prediction units for prediction of an image. Each prediction unit may be equal to or smaller than the coding unit. In addition, the coding unit may be divided into transformation units for transformation of an image. Each transformation unit may be equal to or smaller than the coding unit. The shapes and sizes of the transformation unit and the prediction unit may be independent of each other. The coding unit may be distinguished from the prediction unit and the transformation unit, or the coding unit, the prediction unit, and the transformation unit may be equal to each other. The division of the prediction unit and the transformation unit may be performed in the same manner as the division of the coding unit. Figures 3 to 16 The division of the coding unit is described in detail. The current block and the neighboring block of the present disclosure may indicate one of the maximum coding unit, the coding unit, the prediction unit, and the transformation unit. In addition, the current block of the current coding unit is a block currently being decoded or encoded or a block currently being divided. The neighboring block may be a block reconstructed before the current block. The neighboring block may be adjacent to the current block in space or time. The neighboring block may be located at one of the lower left, left side, upper left, upper, upper right, right side, and lower right side of the current block.

[0200] Figure 3 A process of determining at least one coding unit by splitting a current coding unit, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0201] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, or N×4N. Here, N may be a positive integer. The block shape information is information indicating at least one of a shape, a direction, an aspect ratio, or a size of a coding unit.

[0202] The shape of the coding unit may include a square and a non-square. When the width length and height length of the coding unit are the same (that is, when the block shape of the coding unit is 4N×4N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a square. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square.

[0203] When the width length and height length of the coding unit are different from each other (that is, when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, or N×4N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is non-square, the image decoding apparatus 100 may determine the aspect ratio in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, or 8:1. In addition, the image decoding apparatus 100 may determine whether the coding unit is in the horizontal direction or in the vertical direction based on the width length and height length of the coding unit. In addition, the image decoding apparatus 100 may determine the size of the coding unit based on at least one of the width length, height length, or area of ​​the coding unit.

[0204] According to an embodiment, the image decoding apparatus 100 may determine the shape of the coding unit by using the block shape information, and may determine the division method of the coding unit by using the division shape pattern information. That is, the coding unit division method indicated by the division shape pattern information may be determined based on the block shape indicated by the block shape information used by the image decoding apparatus 100.

[0205] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, the embodiment is not limited thereto, and the image decoding device 100 and the image encoding device 200 may obtain the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may obtain the pre-agreed division shape pattern information for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information for the maximum coding unit as four divisions. In addition, the image decoding device 100 may determine the division shape pattern information about the minimum coding unit as "no division is performed". Specifically, the image decoding device 100 may determine the size of the maximum coding unit to be 256×256. The image decoding device 100 may determine the pre-agreed division shape pattern information to be four divisions. Four divisions are division shape patterns in which the width and height of the coding unit are both divided into two equal parts. The image decoding device 100 may obtain a coding unit of 128×128 size from a maximum coding unit of 256×256 size based on the division shape pattern information. In addition, the image decoding device 100 may determine the size of the minimum coding unit to be 4×4. The image decoding apparatus 100 may obtain division shape pattern information indicating “do not perform division” for a minimum coding unit.

[0206] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding apparatus 100 may determine whether to not split the square coding unit, whether to vertically split the square coding unit, whether to horizontally split the square coding unit, or whether to split the square coding unit into four coding units based on the split shape mode information. Figure 3 When the block shape information of the current coding unit 300 indicates a square shape, the image decoder 110 may not divide the coding unit 310a having the same size as the current coding unit 300 based on the division shape pattern information indicating that division is not performed, or may determine the coding unit 310b, 310c or 310d divided based on the division shape pattern information indicating a predetermined division method.

[0207] Reference Figure 3 According to an embodiment, the image decoding apparatus 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that the division is performed in the vertical direction. The image decoding apparatus 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that the division is performed in the horizontal direction. The image decoding apparatus 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical direction and the horizontal direction based on the division shape pattern information indicating that the division is performed in the vertical direction and the horizontal direction. However, the division method of the square coding unit is not limited to the aforementioned method, and may include various methods that may be indicated by the division shape pattern information. A predetermined division method for dividing a square coding unit will be described in detail below with respect to various embodiments.

[0208] Figure 4 A process of determining at least one coding unit by splitting a non-square coding unit, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0209] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding apparatus 100 may determine whether to not split the non-square current coding unit or whether to split the non-square current coding unit by using a predetermined splitting method based on the splitting shape pattern information. Figure 4, when the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the image decoding apparatus 100 may determine a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 based on the division shape pattern information indicating that division is not performed, or may determine coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c divided based on the division shape pattern information indicating a predetermined division method. A predetermined division method for dividing a non-square coding unit will be described in detail below with respect to various embodiments.

[0210] According to an embodiment, the image decoding apparatus 100 may determine a splitting method of a coding unit by using splitting shape pattern information, and in this case, the splitting shape pattern information may indicate the number of one or more coding units generated by splitting the coding unit. Figure 4 When the division shape pattern information indicates that the current coding unit 400 or 450 is divided into two coding units, the image decoding device 100 can determine the two coding units 420a and 420b or 470a and 470b included in the current coding unit 400 or 450 by dividing the current coding unit 400 or 450 based on the division shape pattern information.

[0211] According to an embodiment, when the image decoding apparatus 100 splits the non-square current coding unit 400 or 450 based on the split shape pattern information, the image decoding apparatus 100 may split the current coding unit in consideration of the position of the long side of the non-square current coding unit 400 or 450. For example, the image decoding apparatus 100 may determine a plurality of coding units by splitting the long side of the current coding unit 400 or 450 in consideration of the shape of the current coding unit 400 or 450.

[0212] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (three-divided) into an odd number of blocks, the image decoding apparatus 100 may determine the odd number of coding units included in the current coding unit 400 or 450. For example, when the division shape pattern information indicates that the current coding unit 400 or 450 is divided into three coding units, the image decoding apparatus 100 may divide the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.

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

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

[0215] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and further, may apply a predetermined restriction to at least one of the odd number of coding units generated by dividing the current coding unit 400 or 450. Figure 4, the image decoding apparatus 100 may set a decoding process for a coding unit 430b or 480b that is located at the center of three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated when the current coding unit 400 or 450 is divided to be different from a decoding process of other coding units 430a and 430c or 480a or 480c. For example, unlike other coding units 430a and 430c or 480a and 480c, the image decoding apparatus 100 may restrict the coding unit 430b or 480b at the center position from being further divided or being divided only a predetermined number of times.

[0216] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

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

[0218] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 510 into a plurality of coding units based on at least one of the block shape information and the division shape mode information, or may determine not to split the determined second coding unit 510. Figure 5, the image decoding apparatus 100 may split the non-square second coding unit 510 determined by splitting the first coding unit 500 into one or more third coding units 520a, or 520b, 520c, and 520d based on at least one of the block shape information and the split shape mode information, or may not split the non-square second coding unit 510. The image decoding apparatus 100 may obtain at least one of the block shape information and the split shape mode information, and may obtain a plurality of second coding units (e.g., 510) of various shapes by splitting the first coding unit 500 based on at least one of the obtained block shape information and the obtained split shape mode information, and may split the second coding unit 510 by using the split method of the first coding unit 500 based on at least one of the block shape information and the split shape mode information. According to an embodiment, when the first coding unit 500 is divided into the second coding unit 510 based on at least one of the block shape information and the division shape mode information about the first coding unit 500, the second coding unit 510 may also be divided into the third coding unit 520a, or 520b, 520c, and 520d based on at least one of the block shape information and the division shape mode information about the second coding unit 510. That is, the coding unit may be recursively divided based on at least one of the block shape information and the division shape mode information about each coding unit. Therefore, a square coding unit may be determined by dividing a non-square coding unit, and a non-square coding unit may be determined by recursively dividing a square coding unit.

[0219] Reference Figure 5 , a predetermined coding unit (e.g., a coding unit at a center position or a square coding unit) among the odd-numbered third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 may be recursively divided. According to an embodiment, a square third coding unit 520c among the odd-numbered third coding units 520b, 520c, and 520d may be divided into a plurality of fourth coding units in the horizontal direction. A non-square fourth coding unit 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d may be divided into a plurality of coding units again. For example, a non-square fourth coding unit 530b or 530d may be divided into an odd-numbered coding unit again. A method that can be used to recursively divide coding units will be described below with respect to various embodiments.

[0220] According to an embodiment, the image decoding apparatus 100 may divide each of the third coding unit 520a, or 520b, 520c, and 520d into coding units based on at least one of the block shape information and the division shape mode information. In addition, the image decoding apparatus 100 may determine not to divide the second coding unit 510 based on at least one of the block shape information and the division shape mode information. According to an embodiment, the image decoding apparatus 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding apparatus 100 may impose a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding apparatus 100 may limit the third coding unit 520c at the center position among the odd number of third coding units 520b, 520c, and 520d to no longer be divided or divided a set number of times.

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

[0222] According to an embodiment, the image decoding apparatus 100 may obtain at least one of block shape information and division shape pattern information for dividing the current coding unit from a predetermined position in the current coding unit.

[0223] Figure 6 A method of determining a predetermined coding unit from among odd-numbered coding units, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0224] Reference Figure 6 , at least one of the block shape information and the division shape mode information about the current coding unit 600 or 650 may be obtained from a sample at a predetermined 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 predetermined position in the current coding unit 600 where at least one of the block shape information and the division shape mode information may be obtained is not limited to Figure 6, and may include various positions (e.g., upper, lower, left, right, upper left, lower left, upper right, and lower right positions) included in the current coding unit 600. The image decoding apparatus 100 may obtain at least one of the block shape information and the division shape mode information from a predetermined position, and may determine whether to divide the current coding unit into coding units of various shapes and sizes or may not divide the current coding unit.

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

[0226] According to an embodiment, the image decoding apparatus 100 may split a current coding unit into a plurality of coding units, and may determine a coding unit at a predetermined position.

[0227] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a center position among the odd-numbered coding units using information indicating the positions of the odd-numbered coding units. Figure 6 , the image decoding apparatus 100 may determine the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c by dividing the current coding unit 600 or the current coding unit 650. The image decoding apparatus 100 may determine the intermediate coding unit 620b or the intermediate coding unit 660b by using information about the positions of the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c. For example, the image decoding apparatus 100 may determine the coding unit 620b of the center position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of predetermined samples included in the coding units 620a, 620b, and 620c. In detail, the image decoding apparatus 100 may determine the coding unit 620b at the center position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c.

[0228] According to an embodiment, the information indicating the positions of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture. According to an embodiment, the information indicating the positions of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the width or height may correspond to the information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in the picture. That is, the image decoding apparatus 100 may determine the coding unit 620b at the center position by directly using the information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture or by using the information about the width or height of the coding unit corresponding to the difference between the coordinates.

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

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

[0231] According to an embodiment, the image decoding apparatus 100 may determine the width or height of each of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya) as information indicating the position of the upper left sample point 630a of the upper coding unit 620a, the coordinates (xb, yb) as information indicating the position of the upper left sample point 630b of the middle coding unit 620b, and the coordinates (xc, yc) as information indicating the position of the upper left sample point 630c of the lower coding unit 620c. The image decoding apparatus 100 may determine the size of each of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the image decoding apparatus 100 may determine the width of the upper coding unit 620a as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the upper coding unit 620a as yb-ya. According to an embodiment, the image decoding apparatus 100 may determine the width of the intermediate coding unit 620b as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the intermediate coding unit 620b as yc-yb. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the lower coding unit 620c by using the width or height of the current coding unit 600 or the width or height of the upper coding unit 620a and the intermediate coding unit 620b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 620a to 620c. Referring to Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 620b having a size different from the sizes of the upper coding unit 620a and the lower coding unit 620c as the coding unit at the predetermined position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining the coding unit at the predetermined position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various methods of determining the coding unit at the predetermined position by comparing the size of the coding unit determined based on the coordinates of the predetermined sample points may be used.

[0232] The image decoding apparatus 100 may determine the width or height of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) as information indicating the position of the upper left sample point 670a of the left coding unit 660a, the coordinates (xe, ye) as information indicating the position of the upper left sample point 670b of the middle coding unit 660b, and the coordinates (xf, yf) as information indicating the position of the upper left sample point 670c of the right coding unit 660c. The image decoding apparatus 100 may determine the size of each 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.

[0233] According to an embodiment, the image decoding device 100 may determine the width of the left coding unit 660a as xe-xd. The image decoding device 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the image decoding device 100 may determine the width of the middle coding unit 660b as xf-xe. The image decoding device 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 650. According to an embodiment, the image decoding device 100 may determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 or the width or height of the left coding unit 660a and the middle coding unit 660b. The image decoding device 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 660a to 660c. Referring to Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as the coding unit at the predetermined position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units, performed by the image decoding apparatus 100, corresponds only to an example of determining the coding unit at the predetermined position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various methods of determining the coding unit at the predetermined position by comparing the size of the coding unit determined based on the coordinates of the predetermined sample points may be used.

[0234] However, the position of the sample considered in determining the position of the coding unit is not limited to the above-mentioned upper left position, and information on arbitrary positions of the samples included in the coding unit may be used.

[0235] According to an embodiment, the image decoding device 100 may select a coding unit at a predetermined position from an odd number of coding units determined by dividing the current coding unit based on the shape of the current coding unit. For example, when the current coding unit has a non-square shape in which the width is greater than the height, the image decoding device 100 may determine a coding unit at a predetermined position along the horizontal direction. That is, the image decoding device 100 may determine one of the coding units at different positions along the horizontal direction and impose restrictions on the coding unit. When the current coding unit has a non-square shape in which the height is greater than the width, the image decoding device 100 may determine a coding unit at a predetermined position along the vertical direction. That is, the image decoding device 100 may determine one of the coding units at different positions along the vertical direction and may impose restrictions on the coding unit.

[0236] According to an embodiment, the image decoding apparatus 100 may use information indicating respective positions of even-numbered coding units to determine a coding unit at a predetermined position among the even-numbered coding units. The image decoding apparatus 100 may determine the even-numbered coding units by dividing (dividing into two; binary division) the current coding unit, and may determine the coding unit at the predetermined position by using information about the positions of the even-numbered coding units. Operations related thereto may be similar to those already described above with respect to Figure 6 The operation of determining a coding unit at a predetermined position (eg, a center position) among odd-numbered coding units corresponds to the operation described in detail, and thus a detailed description thereof is not provided here.

[0237] According to an embodiment, when a non-square current coding unit is split into a plurality of coding units, predetermined information about a coding unit at a predetermined position may be used in a splitting operation to determine a coding unit at a predetermined position among the plurality of coding units. For example, the image decoding apparatus 100 may use at least one of block shape information and split shape pattern information stored in samples included in an intermediate coding unit in a splitting process to determine a coding unit at a center position among the plurality of coding units determined by splitting the current coding unit.

[0238] Reference Figure 6, the image decoding apparatus 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on at least one of the block shape information and the division shape mode information, and may determine the coding unit 620b at the center position among the plurality of coding units 620a, 620b, and 620c. In addition, the image decoding apparatus 100 may determine the coding unit 620b at the center position in consideration of the position where at least one of the block shape information and the division shape mode information is obtained. That is, at least one of the block shape information and the division shape mode information about the current coding unit 600 may be obtained from a sample point 640 at the center position of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on at least one of the block shape information and the division shape mode information, the coding unit 620b including the sample point 640 may be determined as the coding unit at the center position. However, information for determining the coding unit at the center position is not limited to at least one of the block shape information and the division shape pattern information, and the coding unit at the center position may be determined using various types of information.

[0239] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from a predetermined sample point included in a coding unit to be determined. Figure 6 , the image decoding apparatus 100 may determine a coding unit at a predetermined position (e.g., a coding unit at a center position of the divided coding units) among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, using at least one of the block shape information and the division shape pattern information obtained from the sample at a predetermined position in the current coding unit 600 (e.g., a sample at a center position of the divided coding unit 600). That is, the image decoding apparatus 100 may determine the sample at the predetermined position based on the block shape of the current coding unit 600, may determine the coding unit 620b including the sample for which the predetermined information (e.g., at least one of the block shape information and the division shape pattern information) may be obtained from the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose a predetermined restriction on the coding unit 620b. Referring to Figure 6 According to an embodiment, in a decoding operation, the image decoding apparatus 100 may determine a sample 640 at a center position of a current coding unit 600 as a sample from which predetermined information may be obtained, and may impose a predetermined restriction on a coding unit 620b including the sample 640. However, the position of the sample from which the predetermined information may be obtained is not limited to the above-mentioned position, and may include any position of the sample included in the coding unit 620b to be determined as subject to restriction.

[0240] According to an embodiment, the position of the sample at which the predetermined information can be obtained may be determined based on the shape of the current coding unit 600. According to an embodiment, the block shape information may indicate whether the current coding unit has a square shape or a non-square shape, and the position of the sample at which the predetermined information can be obtained may be determined based on the shape. For example, the image decoding apparatus 100 may determine a sample located on a boundary for dividing at least one of the width and the height of the current coding unit in half as a sample at which the predetermined information can be obtained, by using at least one of the information about the width of the current coding unit and the 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 may determine one of the samples adjacent to the boundary dividing the long side of the current coding unit in half as a sample at which the predetermined information can be obtained.

[0241] According to an embodiment, when a current coding unit is divided into a plurality of coding units, the image decoding device 100 may use at least one of block shape information and division shape pattern information to determine a coding unit at a predetermined position in the plurality of coding units. According to an embodiment, the image decoding device 100 may obtain at least one of block shape information and division shape pattern information from a sample at a predetermined position in the coding unit, and may divide a plurality of coding units generated by dividing the current coding unit by using at least one of block shape information and division shape pattern information, wherein at least one of the block shape information and division shape pattern information is obtained from a sample at a predetermined position in each of the plurality of coding units. That is, the coding unit may be recursively divided based on at least one of the block shape information and division shape pattern information, wherein at least one of the block shape information and division shape pattern information is obtained from a sample at a predetermined position in each coding unit. As has been described above, Figure 5 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will not be provided here.

[0242] According to an embodiment, the image decoding apparatus 100 may determine one or more coding units by splitting a current coding unit, and may determine an order in which to decode the one or more coding units based on a predetermined block (for example, the current coding unit).

[0243] Figure 7 An order in which a plurality of coding units are processed when the image decoding apparatus 100 determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.

[0244] According to an embodiment, based on at least one of the block shape information and the division shape pattern information, the image decoding device 100 may determine the second coding units 710a and 710b by dividing the first coding unit 700 in a vertical direction, may determine the second coding units 730a and 730b by dividing the first coding unit 700 in a horizontal direction, or may determine the second coding units 750a, 750b, 750c and 750d by dividing the first coding unit 700 in vertical and horizontal directions.

[0245] Reference Figure 7 , the image decoding apparatus 100 may determine to process the second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction in a horizontal direction order 710c. The image decoding apparatus 100 may determine to process the second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction in a vertical direction order 730c. The image decoding apparatus 100 may determine to process the second coding units 750a to 750d determined by dividing the first coding unit 700 in the vertical direction and the horizontal direction in a predetermined order (for example, in a raster scan order or a zigzag scan order 750e), wherein the coding units in one row are processed and then the coding units in the next row are processed in the predetermined order.

[0246] According to an embodiment, the image decoding apparatus 100 may recursively divide the coding unit. Figure 7 , the image decoding apparatus 100 may determine a plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d. A division method of the plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d may correspond to a division method of the first coding unit 700. In this way, each of the plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d may be independently divided into a plurality of coding units. Referring to Figure 7 , the image decoding apparatus 100 may determine the second coding units 710a and 710b by splitting the first coding unit 700 in a vertical direction, and may determine whether to independently split or not split each of the second coding units 710a and 710b.

[0247] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 720a and 720b by splitting the left second coding unit 710a in a horizontal direction, and may not split the right second coding unit 710b.

[0248] According to an embodiment, the processing order of the coding units may be determined based on the operation of dividing the coding units. In other words, the processing order of the coding units after the division may be determined based on the processing order of the coding units immediately before the division. The image decoding apparatus 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the left second coding unit 710a independently of the right second coding unit 710b. Since the third coding units 720a and 720b are determined by dividing the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b may be processed in a vertical direction order 720c. Since the left second coding unit 710a and the right second coding unit 710b are processed in a horizontal direction order 710c, the right second coding unit 710b may be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in a vertical direction order 720c. The operation of determining the processing order of coding units based on the coding units before splitting is not limited to the above example, and coding units split and determined to be various shapes may be independently processed in a predetermined order using various methods.

[0249] Figure 8 1 and 2. A process of determining that a current coding unit is to be split into an odd number of coding units, performed by the image decoding apparatus 100, is illustrated when coding units cannot be processed in a predetermined order according to an embodiment.

[0250] According to an embodiment, the image decoding apparatus 100 may determine that the current coding unit is to be split into an odd number of coding units based on the obtained block shape information and the division shape pattern information. Figure 8 , the square first coding unit 800 may be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b may be independently divided into third coding units 820a and 820b and 820c to 820e. According to an embodiment, the image decoding apparatus 100 may determine a plurality of third coding units 820a and 820b by dividing the left second coding unit 810a in the horizontal direction, and may divide the right second coding unit 810b into an odd number of third coding units 820c to 820e.

[0251] According to an embodiment, the image decoding apparatus 100 may determine whether any coding unit is split into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c to 820e can be processed in a predetermined order. Figure 8, the image decoding apparatus 100 may determine the third coding units 820a and 820b and 820c to 820e by recursively dividing the first coding unit 800. The image decoding apparatus 100 may determine whether any one of the following coding units will be divided into an odd number of coding units: the first coding unit 800, the second coding units 810a and 810b, or the third coding units 820a and 820b and 820c, 820d, and 820e based on at least one of the block shape information and the division shape mode information. For example, the right second coding unit 810b of the second coding units 810a and 810b may be divided into an odd number of third coding units 820c, 820d, and 820e. The processing order of the multiple coding units included in the first coding unit 800 can be a predetermined order (for example, a zigzag scanning order 830), and the image decoding device 100 can determine whether the third coding units 820c, 820d and 820e determined by dividing the right second coding unit 810b into an odd number of coding units meet the conditions for processing in the predetermined order.

[0252] According to an embodiment, the image decoding apparatus 100 may 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 predetermined order, and the condition is related to whether at least one of the width and height of the second coding units 810a and 810b is divided in half along the boundary 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 of a non-square shape is divided in half may satisfy the condition. Because the boundary of the third coding units 820c to 820e determined when the right second coding unit 810b is divided into three coding units fails to divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c to 820e do not satisfy the condition. When the condition is not satisfied as described above, the image decoding apparatus 100 may determine that the scanning order is discontinuous, and may determine that the right second coding unit 810b is divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding unit at a predetermined position in the divided coding unit. The restriction or the predetermined position has been described above with respect to various embodiments, and therefore a detailed description thereof will not be provided here.

[0253] Fig. 9 A process of determining at least one coding unit by splitting the first coding unit 900 , performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0254] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 900 based on at least one of block shape information and division shape mode information obtained by a receiver (not shown). The square first coding unit 900 may be divided into four square coding units, or may be divided into a plurality of non-square coding units. Fig. 9 , when the block shape information indicates that the first coding unit 900 is a square and the division shape pattern information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. In detail, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 900 in a horizontal direction or a vertical direction, the image decoding apparatus 100 may divide the square first coding unit 900 into an odd number of coding units (for example, second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in a vertical direction, or second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in a horizontal direction).

[0255] According to an embodiment, the image decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for processing in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 is divided in half along a boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9 , because the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the first coding unit 900 in the vertical direction do not divide the width of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a predetermined order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the first coding unit 900 in the horizontal direction do not divide the width of the first coding unit 900 in half, 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 may determine that the scanning order is not continuous, and may determine that the first coding unit 900 is divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding unit at a predetermined position in the divided coding unit. The restriction or the predetermined position has been described above with respect to various embodiments, and thus a detailed description thereof will not be provided here.

[0256] According to an embodiment, the image decoding apparatus 100 may determine coding units of various shapes by splitting the first coding unit.

[0257] Reference Fig. 9 , the image decoding apparatus 100 may divide the square first coding unit 900 or the non-square first coding unit 930 or 950 into coding units of various shapes.

[0258] Fig.10 It is shown that shapes into which the second coding unit may be split are restricted when a second coding unit having a non-square shape determined when the image decoding apparatus 100 splits the first coding unit 1000 satisfies a predetermined condition according to an embodiment.

[0259] According to an embodiment, the image decoding apparatus 100 may determine whether to divide the square first coding unit 1000 into non-square second coding units 1010a and 1010b, or 1020a and 1020b, based on at least one of block shape information and division shape mode information obtained by a receiver (not shown). The second coding units 1010a and 1010b, or 1020a and 1020b may be independently divided. Therefore, the image decoding apparatus 100 may determine whether to divide each of the second coding units 1010a and 1010b, or 1020a and 1020b into a plurality of coding units or not to divide each of the second coding units 1010a and 1010b, or 1020a and 1020b, based on at least one of block shape information and division shape mode information about each of the second coding units 1010a and 1010b, or 1020a and 1020b. According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1012a and 1012b by splitting the non-square left second coding unit 1010a determined by splitting the first coding unit 1000 in the vertical direction in the horizontal direction. However, when the left second coding unit 1010a is split in the horizontal direction, the image decoding apparatus 100 may limit the right second coding unit 1010b to not be split in the horizontal direction in which the left second coding unit 1010a is split. When the third coding units 1014a and 1014b are determined by splitting the right second coding unit 1010b in the same direction, since the left second coding unit 1010a and the right second coding unit 1010b are independently split in the horizontal direction, the third coding units 1012a and 1012b, or 1014a and 1014b may be determined. However, this situation has the same effect as the situation in which the image decoding device 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c and 1030d based on at least one of the block shape information and the division shape pattern information, and may be inefficient in terms of image decoding.

[0260] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1022a and 1022b, or 1024a and 1024b, by vertically splitting the non-square second coding unit 1020a or 1020b determined by horizontally splitting the first coding unit 1000. However, when the second coding unit (e.g., the upper second coding unit 1020a) is split in the vertical direction, the image decoding apparatus 100 may limit another second coding unit (e.g., the lower second coding unit 1020b) to not be split in the vertical direction in which the upper second coding unit 1020a is split for the above-mentioned reason.

[0261] Fig.11 A process of splitting a square coding unit performed by the image decoding apparatus 100 when the division shape pattern information indicates that the square coding unit is not to be split into four square coding units according to an embodiment is illustrated.

[0262] According to an embodiment, the image decoding apparatus 100 may determine the second coding units 1110a and 1110b, or 1120a and 1120b, etc. by dividing the first coding unit 1100 based on at least one of the block shape information and the division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding unit, but the information about the various division methods may not include information for dividing the coding unit into four square coding units. Based on the division shape pattern information, the image decoding apparatus 100 does not divide the square first coding unit 1100 into four square coding units 1130a, 1130b, 1130c, and 1130d. The image decoding apparatus 100 may determine the non-square second coding units 1110a and 1110b, or 1120a and 1120b, etc. based on the division shape pattern information.

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

[0264] For example, the image decoding apparatus 100 may determine square third coding units 1112a and 1112b by dividing the left second coding unit 1110a in the horizontal direction, and may determine square third coding units 1114a and 1114b by dividing the right second coding unit 1110b in the horizontal direction. In addition, the image decoding apparatus 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by dividing both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction. In this case, 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 may be determined.

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

[0266] Fig.12 It is shown that a processing order among a plurality of coding units according to an embodiment may be changed according to a process of dividing a coding unit.

[0267] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1200 based on at least one of the block shape information and the division shape mode information. When the block shape information indicates a square shape and the division shape mode information indicates that the first coding unit 1200 is divided in at least one of the horizontal direction and the vertical direction, the image decoding apparatus 100 may determine the second coding units 1210a and 1210b, or 1220a and 1220b, etc. by dividing the first coding unit 1200. Fig.12 , the non-square second coding units 1210a and 1210b, or 1220a and 1220b determined by dividing the first coding unit 1200 only in the horizontal direction or the vertical direction may be independently divided based on at least one of the block shape information and the division shape pattern information about each coding unit. For example, the image decoding device 100 may determine the third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and may 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. As has been described above, Fig.11 An operation of dividing the second coding units 1210a and 1210b, or 1220a and 1220b is described, and thus a detailed description thereof will not be provided here.

[0268] According to an embodiment, the image decoding apparatus 100 may process the coding units in a predetermined order. Figure 7 The operation of processing the encoding units in a predetermined order is described, and thus a detailed description thereof will not be provided here. Fig.12 , the image decoding apparatus 100 may determine four square third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d by dividing the square first coding unit 1200. According to an embodiment, the image decoding apparatus 100 may determine a processing order of the third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d based on a division method of the first coding unit 1200.

[0269] According to an embodiment, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and can process the third coding units 1216a, 1216b, 1216c and 1216d in the following processing order 1217: first, the third coding units 1216a and 1216c included in the left second coding unit 1210a are processed in the vertical direction, and then the third coding units 1216b and 1216d included in the right second coding unit 1210b are processed in the vertical direction.

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

[0271] Reference Fig.12, square third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d may be determined by dividing the second coding units 1210a and 1210b, and 1220a and 1220b, respectively. Although the second coding units 1210a and 1210b determined by splitting the first coding unit 1200 in the vertical direction are different from the second coding units 1220a and 1220b determined by splitting the first coding unit 1200 in the horizontal direction, the third coding units 1216a, 1216b, 1216c, and 1216d and the third coding units 1226a, 1226b, 1226c, and 1226d split from the second coding units 1210a and 1210b and the second coding units 1220a and 1220b ultimately show the same shape of coding units split from the first coding unit 1200. Therefore, by recursively splitting the coding units in different ways based on at least one of the block shape information and the split shape pattern information, the image decoding apparatus 100 may process a plurality of coding units in different orders even if the coding units are ultimately determined to have the same shape.

[0272] Fig.13 A process of determining a depth of a coding unit when a shape and a size of a coding unit are changed when a coding unit is recursively split to determine a plurality of coding units according to an embodiment is illustrated.

[0273] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being divided is 2n (n>0) times the length of the long side of the current coding unit after being divided, the image decoding device 100 may determine that the depth of the current coding unit is increased by n compared to the depth of the coding unit before being divided. In the following description, a coding unit with an increased depth is represented as a coding unit of a lower depth.

[0274] Reference Fig.13According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1302 and a third coding unit 1304 of a lower depth by dividing a square first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may be represented as "0: SQUARE"). Assuming that the size of the square first coding unit 1300 is 2N×2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 into 1 / 2 may have a size of N×N. In addition, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 into 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 of the width and height of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 whose width and height are 1 / 2 of the width and height of the first coding unit 1300 may be D+1, and the depth of the third coding unit 1304 whose width and height are 1 / 4 of the width and height of the first coding unit 1300 may be D+2.

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

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

[0277] According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by dividing at least one of the width and the height of the first coding unit 1320 having a size of 2N×N. That is, the image decoding apparatus 100 may 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 may determine the second coding unit 1322 having a size of N×N / 2 by dividing the first coding unit 1320 in horizontal and vertical directions.

[0278] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1302 having a size of N×N. That is, the image decoding apparatus 100 may 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 the vertical direction and the horizontal direction.

[0279] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1312 having a size of N / 2×N. That is, the image decoding apparatus 100 may 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 may determine the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1312 in a vertical direction and a horizontal direction.

[0280] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1322 having a size of N×N / 2. That is, the image decoding apparatus 100 may 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 may determine the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1322 in a vertical direction and a horizontal direction.

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

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

[0283] Fig.14 Depth that may be determined based on the shape and size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.

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

[0285] According to an embodiment, the depths of the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information of the square first coding unit 1400 may be determined based on the lengths of their long sides. For example, since the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 1404a and 1404b, the first coding unit 1400 and the non-square second coding units 1402a and 1402b and 1404a and 1404b may have the same depth, for example, D. However, when the image decoding device 100 divides the first coding unit 1400 into four square second coding units 1406a, 1406b, 1406c and 1406d based on the division shape pattern information, because the length of the side of the square second coding units 1406a, 1406b, 1406c and 1406d is 1 / 2 of the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1 which is 1 deeper than the depth D of the first coding unit 1400.

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

[0287] According to an embodiment, the depth of the second coding units 1412a and 1412b and 1414a, 1414b and 1414c, or 1422a and 1422b and 1424a, 1424b and 1424c determined based on the division shape pattern information of the non-square first coding unit 1410 or 1420 may be determined based on the length of their long sides. For example, since the length of the side of the square second coding units 1412a and 1412b is 1 / 2 of the length of the long side of the first coding unit 1410 having a non-square shape whose height is longer than the width, the depth of the square second coding units 1412a and 1412b is D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410.

[0288] In addition, the image decoding apparatus 100 may divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division shape pattern information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, since the length of the long side of the non-square second coding units 1414a and 1414c and the length of the side of the square second coding unit 1414b are 1 / 2 of the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c may be D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410. The image decoding apparatus 100 may determine the depths of coding units split from the first coding unit 1420 having a non-square shape having a width longer than a height by using the above-described method of determining the depths of coding units split from the first coding unit 1410 .

[0289] According to an embodiment, when the odd-numbered divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for identifying the divided coding units based on a size ratio between the coding units. Fig.14 , the width of the coding unit 1414b at the center position among the odd-numbered divided coding units 1414a, 1414b, and 1414c may be equal to the width of the other coding units 1414a and 1414c and its height may be twice the height of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the center position may include two other coding units 1414a or 1414c. Therefore, when the PID of the coding unit 1414b at the center position is 1 based on the scanning order, the PID of the coding unit 1414c located at a position adjacent to the coding unit 1414b may increase by 2 and may thus be 3. That is, there may be discontinuity in the PID value. According to an embodiment, the image decoding apparatus 100 may determine whether the odd-numbered divided coding units do not have equal sizes based on whether there is discontinuity in the PID for identifying the divided coding units.

[0290] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting a current coding unit. Fig.14, the image decoding apparatus 100 may determine even-numbered coding units 1412a and 1412b or odd-numbered coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a rectangular shape whose height is longer than its width. The image decoding apparatus 100 may use the PID to identify each coding unit. According to an embodiment, the PID may be obtained from a sample point at a predetermined position of each coding unit (e.g., an upper left sample point).

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

[0292] According to an embodiment, the image decoding apparatus 100 may use a predetermined data unit in which the coding unit is recursively split.

[0293] Fig.15 It is illustrated that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.

[0294] According to an embodiment, a predetermined data unit may be defined as a data unit for recursively dividing a coding unit by starting with at least one of block shape information and division shape mode information. That is, the predetermined data unit may correspond to a coding unit for determining a highest depth of a plurality of coding units divided from a current picture. In the following description, for ease of explanation, the predetermined data unit is referred to as a reference data unit.

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

[0296] According to an embodiment, the image decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the image decoding apparatus 100 may divide the plurality of reference data units divided from the current picture by using the division shape pattern information of each reference data unit. The operation of dividing the reference data unit may correspond to the division operation using a quadtree structure.

[0297] According to an embodiment, the image decoding apparatus 100 may predetermine a minimum size allowed for a reference data unit included in the current picture. Therefore, the image decoding apparatus 100 may determine various reference data units having a size equal to or larger than the minimum size, and may determine one or more coding units by using block shape information and division shape mode information with reference to the determined reference data units.

[0298] Reference Fig.15 , the image decoding apparatus 100 may use a square reference coding unit 1500 or a non-square reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) that may include one or more reference coding units.

[0299] According to an embodiment, a receiver (not shown) of the image decoding apparatus 100 may obtain at least one of reference coding unit shape information and reference coding unit size information for each of various data units from a bitstream. Figure 3 The operation of dividing the current coding unit 300 describes the operation of dividing the square reference coding unit 1500 into one or more coding units, and the above has been about Figure 4 The operation of splitting the current coding unit 400 or 450 describes an operation of splitting the non-square reference coding unit 1502 into one or more coding units. Therefore, a detailed description thereof will not be provided here.

[0300] According to an embodiment, the image decoding apparatus 100 may determine the size and shape of the reference coding unit using a PID for identifying the size and shape of the reference coding unit according to some data units predetermined based on a predetermined condition. That is, a receiver (not shown) may obtain only a PID for identifying the size and shape of the reference coding unit for each slice, each slice segment, or each maximum coding unit from a bitstream, wherein each slice, each slice segment, or each maximum coding unit is a data unit (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) that satisfies a predetermined condition. The image decoding apparatus 100 may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using a PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from a bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the size and shape of the reference coding unit included in the data unit serving as the unit for obtaining the PID by selecting at least one of the size and shape of the reference coding unit predetermined based on the PID.

[0301] According to an embodiment, the image decoding device 100 may use one or more reference coding units included in the maximum coding unit. That is, the maximum coding unit divided from the picture may include one or more reference coding units, and the coding unit may be determined by recursively dividing each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding device 100 may determine the reference coding unit by dividing the maximum coding unit n times based on a quadtree structure, and the reference coding unit may be divided based on at least one of the block shape information and the division shape mode information.

[0302] Fig.16 A processing block serving as a criterion for determining an order of reference coding units included in the picture 1600 according to an embodiment is illustrated.

[0303] According to an embodiment, the image decoding device 100 may determine one or more processing blocks divided from a picture. A processing block is a data unit including one or more reference coding units divided from a picture, and the one or more reference coding units included in the processing block may be determined according to a specific order. That is, the determination order of one or more reference coding units determined in each processing block in the processing block may correspond to one of various types of orders for determining reference coding units, and may vary according to the processing block. The determination order of the reference coding units determined for each processing block may be one of various orders (e.g., raster scanning order, zigzag scanning, N-shaped scanning, upper right diagonal scanning, horizontal scanning, and vertical scanning), but is not limited to the aforementioned scanning order.

[0304] According to an embodiment, the image decoding apparatus 100 may obtain processing block size information and may determine the size of one or more processing blocks included in the picture. The image decoding apparatus 100 may obtain processing block size information from a bitstream and may determine the size of one or more processing blocks included in the picture. The size of the processing block may be a predetermined size of a data unit indicated by the processing block size information.

[0305] According to an embodiment, a receiver (not shown) of the image decoding apparatus 100 may obtain processing block size information from a bitstream according to each specific data unit. For example, the processing block size information may be obtained from a bitstream according to data units such as an image, a sequence, a picture, a slice, a slice segment, etc. That is, the receiver (not shown) may obtain processing block size information from a bitstream according to each of various data units, and the image decoding apparatus 100 may determine the size of one or more processing blocks divided from a picture by using the obtained processing block size information. The size of the processing block may be an integer multiple of the size of the reference coding unit.

[0306] According to an embodiment, the image decoding apparatus 100 may determine the size of the processing blocks 1602 and 1612 included in the picture 1600. For example, the image decoding apparatus 100 may determine the size of the processing block based on the processing block size information obtained from the bitstream. Fig.16 According to an embodiment, the image decoding apparatus 100 may determine the width of the processing blocks 1602 and 1612 to be four times the width of the reference coding unit, and may determine the height of the processing blocks 1602 and 1612 to be four times the height of the reference coding unit. The image decoding apparatus 100 may determine the determination order of one or more reference coding units in one or more processing blocks.

[0307] According to an embodiment, the image decoding apparatus 100 may determine the processing blocks 1602 and 1612 included in the picture 1600 based on the size of the processing blocks, and may determine a determination order of one or more reference coding units in the processing blocks 1602 and 1612. According to an embodiment, the determination of the reference coding unit may include determining the size of the reference coding unit.

[0308] According to an embodiment, the image decoding apparatus 100 may obtain determination order information of one or more reference coding units included in one or more processing blocks from a bitstream, and may determine a determination order for one or more reference coding units based on the obtained determination order information. The determination order information may be defined as an order or direction for determining the reference coding units in the processing block. That is, the determination order of the reference coding units may be determined independently for each processing block.

[0309] According to an embodiment, the image decoding apparatus 100 may obtain the determination order information of the reference coding unit from the bitstream according to each specific data unit. For example, a receiver (not shown) may obtain the determination order information of the reference coding unit from the bitstream according to each data unit (such as an image, a sequence, a picture, a slice, a slice segment, or a processing block). Since the determination order information of the reference coding unit indicates the order of the reference coding unit in the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.

[0310] According to an embodiment, the image decoding apparatus 100 may determine one or more reference coding units based on the determined order.

[0311] According to an embodiment, a receiver (not shown) may obtain determination order information of reference coding units from a bitstream as information related to processing blocks 1602 and 1612, and the image decoding apparatus 100 may determine a determination order of one or more reference coding units included in processing blocks 1602 and 1612, and may determine one or more reference coding units included in the picture 1600 based on the determination order. Fig.16 , the image decoding apparatus 100 may respectively determine determination orders 1604 and 1614 of one or more reference coding units in the processing blocks 1602 and 1612. For example, when determination order information of the reference coding units is obtained for each processing block, different types of determination order information of the reference coding units may be obtained for the processing blocks 1602 and 1612. When the determination order 1604 of the reference coding units in the processing block 1602 is a raster scan order, the reference coding units included in the processing block 1602 may be determined according to the raster scan order. Conversely, when the determination order 1614 of the reference coding units in another processing block 1612 is a reverse raster scan order, the reference coding units included in the processing block 1612 may be determined according to the reverse raster scan order.

[0312] According to an embodiment, the image decoding apparatus 100 may decode the determined one or more reference coding units. The image decoding apparatus 100 may decode the image based on the reference coding units determined as described above. The method of decoding the reference coding units may include various image decoding methods.

[0313] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating the division method of the current coding unit from the bitstream, and may use the obtained information. The block shape information or the division shape pattern information may be included in the bitstream associated with various data units. For example, the image decoding device 100 may use the block shape information or the division shape pattern information included in the sequence parameter set, the picture parameter set, the video parameter set, the slice header, the slice segment header, the parallel block header, or the parallel block group header. In addition, the image decoding device 100 may obtain a syntax element corresponding to the block shape information or the division shape pattern information from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax element.

[0314] Reference Figures 17a to 20c , an image encoding device, an image decoding device, an image encoding method, and an image decoding method for encoding or decoding an image by performing transformation, inverse transformation, etc. on data units determined in various shapes according to various embodiments will be described.

[0315] Fig.17a A syntax structure of a transform unit including syntax elements of an MTS and a residual coding syntax structure according to various embodiments are shown.

[0316] Reference Fig.17a, the image decoding apparatus 100 may parse the flag tu_mts_flag 1705 indicating whether to perform inverse transform on the current transform unit according to the MTS in the transform unit syntax structure 1700. In detail, when the prediction mode CuPredMode of the current coding unit is the intra mode MODE_INTRA and the value of the MTS enable flag sps_mts_intra_enabled_flag in the intra mode obtained from the SPS is 1, or when the prediction mode CuPredMode of the current coding unit is the inter mode MODE_INTER and the value of the MTS enable flag sps_mts_inter_enabled_flag in the inter mode obtained from the SPS is 1, when the width tbWidth of the current transform unit is less than or equal to 32 or the height tbHeight of the current transform unit is less than or equal to 32, when the value of the coding block flag tu_cbf_luma of the current luma transform unit is 1 and the tree type treeType is not dual-tree chroma, the image decoding apparatus 100 may parse the flag tu_mts_flag 1705. When a value of tu_cbf_luma as a coding block flag of a transformation unit of a luma component and tu_cbf_cb or tu_cbf_cr as a coding block flag of a transformation unit of a chroma component cb or cr is 1, the image decoding apparatus 100 may call a residual coding syntax structure residual_coding 1710 .

[0317] The image decoding apparatus 100 may parse an index mts_idx 1715 indicating one of a plurality of modes of MTS from a bitstream in the residual coding syntax structure residual_coding 1710. Here, the index mts_idx may indicate one of the plurality of modes based on available types of the horizontal core and the vertical core. For example, when the available types of the horizontal core and the vertical core are DCT8 or DST7, the plurality of modes may include four modes.

[0318] That is, when the value of tu_mts_flag is 1 and the color index cIdx is 0 (ie, the color component of the current image is a luminance component), the image decoding apparatus 100 may parse the index mts_indx1715 from the bitstream.

[0319] However, according to an embodiment, the image encoding device 200 corresponding to the image decoding device 100 may have to evaluate four modes for MTS for blocks having various sizes (the number of modes when the available type is DCT8 or DST7), and may finally determine the size and mode of the block used in MTS. However, huge time complexity may have to be considered, and therefore, the image encoding device 200 may have difficulty in operating as a real-time encoding device. Therefore, a method is needed whereby the image encoding device 200 can perform transformation according to MTS by using only the minimum number of modes without deteriorating encoding performance.

[0320] In addition, according to an embodiment, both syntax elements for MTS tu_mts_flag 1705 and mts_idx 1715 are not included in the transform unit syntax structure 1700. Instead, only tu_mts_flag 1705 is included in the transform unit syntax structure 1700, and mts_idx 1715 is included in the residual coding syntax structure 1710. Therefore, the image decoding apparatus 100 may parse syntax elements for MTS in different syntax structures in a distributed manner. Therefore, since all syntax elements for transform are not parsed at once, parsing delay may occur, and operations related to (inverse) transform may be performed after parsing of the residual coding structure. Therefore, the image decoding apparatus 100 may not perform separate parsing for transform.

[0321] The image decoding apparatus 100 according to various embodiments may perform operations described below to solve the above-mentioned problems.

[0322] When the prediction mode of the current coding unit is an intra mode or an inter mode, and when the current coding unit is encoded in a merge mode requiring residual encoding, an affine mode, an adaptive motion vector range (AMVR) mode, an advanced motion vector prediction (AMVP) mode, a triangle partitioning mode, a combined inter and intra prediction mode, or a general dual prediction mode, the image decoding device 100 may perform the following decoding operations when MTS is selected as a transform coding method.

[0323] The image decoding apparatus 100 may parse the on / off flag for MTS by coding unit or transformation unit under the following conditions according to the size of the transformation unit to determine whether to use MTS. That is, when the value of the coding block flag cbf is 1, when the decoding of the current coding unit or transformation unit is not dual-tree chroma decoding, the image decoding apparatus 100 may parse the on / off flag for MTS.

[0324] When the on / off flag for MTS indicates off, the image decoding device 100 may set DCT2 as the core for (inverse) transformation, and then may perform parsing of the residual syntax structure and inverse transformation operations based on the set core, and when the on / off flag for MTS indicates on, the image decoding device 100 may perform 1-bit parsing or 2-bit parsing to determine which mode is for MTS.

[0325] When the mode for the MTS is parsed, the image decoding apparatus 100 may complete parsing of a syntax structure of a transform unit or a coding unit, and may then parse a residual encoding syntax structure.

[0326] For example, the image decoding apparatus 100 may parse a 1-bit flag for on / off of MTS by coding unit or transformation unit under the following conditions according to the size of the transformation unit to determine whether to use MTS. That is, when decoding of the current coding unit or transformation unit is not dual-tree chroma decoding, the image decoding apparatus 100 may parse a 1-bit flag for on / off of MTS when the value of the coding block flag cbf is 1.

[0327] When the 1-bit flag for on / off of MTS indicates off, the image decoding device 100 may set DCT2 as the kernel for (inverse) transformation, and then may perform parsing of the residual syntax structure and inverse transformation operation based on the set kernel, and when the 1-bit flag for on / off of MTS indicates on, the image decoding device 100 may additionally perform 1-bit parsing or 2-bit parsing to determine which mode the mode for MTS is. For example, as shown in one of Tables 1 to 4 below, the image decoding device 100 may obtain the parsing bit and determine the horizontal kernel and the vertical kernel based on the value of the parsing bit. When the mode for MTS is parsed, the image decoding device 100 may complete the parsing of the syntax structure of the transform unit or the coding unit, and then may parse the residual coding syntax structure.

[0328] [Table 1]

[0329] Parsing bits Horizontal core Vertical Core 0 (1 bit) DST7 DST7 10 (2 bits) DST7 DCT8 11 (2 bits) DCT8 DST7

[0330] [Table 2]

[0331] Parsing bits Horizontal core Vertical Core 0 (1 bit) DST7 DST7 10 (2 bits) DCT8 DST7 11 (2 bits) DST7 DCT8

[0332] [Table 3]

[0333] Parsing bits Horizontal core Vertical Core 0 (1 bit) DST7 DST7 1 (1 bit) DST7 DCT8

[0334] [Table 4]

[0335] Parsing bits Horizontal core Vertical Core 0 (1 bit) DST7 DST7 1 (1 bit) DCT8 DST7

[0336] Fig.17b A syntax structure of a transform unit including syntax elements of a transform selection method according to various embodiments is shown.

[0337] Reference Fig.17b , the image decoding apparatus 100 may parse tu_mts_flag in the transform unit syntax structure 1720, and when the value of tu_mts_flag is 1 and the color index cIdx is 0, the image decoding apparatus 100 may parse mts_idx. The image decoding apparatus 100 may obtain the parsing bit for mts_idx, and determine the horizontal core and the vertical core based on the value of the parsing bit based on one of Tables 1 to 4.

[0338] For example, the image decoding device 100 may parse the 2-bit flag for on / off of MTS and the mode of MTS by coding unit or transformation unit under the following conditions according to the size of the transformation unit to determine whether to use MTS. That is, when the encoding of the current coding unit or transformation unit is not dual-tree chroma encoding, the image decoding device 100 may parse the 2-bit flag for on / off of MTS and the mode of MTS when the value of the coding block flag cbf is 1. That is, the image decoding device 100 may obtain the parsing bit and determine the horizontal core and the vertical core based on the value of the parsing bit based on one of the tables in Tables 5 and 6 below. When the 2-bit flag is parsed, the image decoding device 100 may complete the parsing of the syntax structure of the transformation unit or coding unit, and may then parse the residual coding syntax structure.

[0339] [Table 5]

[0340]

[0341]

[0342] [Table 6]

[0343] Parsing bits Horizontal core Vertical Core 00(2 bits) DCT2 DCT2 01(2 bits) DST7 DST7 10 (2 bits) DCT8 DST7 11 (2 bits) DST7 DCT8

[0344] Fig.17c A syntax structure of a transform unit including syntax elements of a transform selection method according to various embodiments is shown.

[0345] Reference Fig.17c, the image decoding apparatus 100 may parse tu_mts_flag in the transform unit syntax structure 1730. When the prediction mode CuPredMode of the current coding unit is the intra mode MODE_INTRA and the value of the MTS enabled flag sps_mts_intra_enabled_flag in the intra mode obtained from the SPS is 1, or when the prediction mode CuPredMode of the current coding unit is the inter mode MODE_INTER and the value of the MTS enabled flag sps_mts_inter_enabled_flag in the inter mode obtained from the SPS is 1, when the value of the coding block flag tu_cbf_luma of the current luma transform unit is 1 and the tree type treeType is not dual-tree chroma, the image decoding apparatus 100 may parse tu_mts_flag 1735 when the width tbWidth of the current transform unit is less than or equal to 32 or the height tbHeight of the current transform unit is less than or equal to 32.

[0346] The image decoding apparatus 100 may obtain a parsing bit for tu_mts_flag, and determine a horizontal core and a vertical core based on a value of the parsing bit based on one of Tables 5 and 6.

[0347] When a value of tu_cbf_luma as a coding block flag of a transformation unit of a luma component and tu_cbf_cb or tu_cbf_cr as a coding block flag of a transformation unit of a chroma component cb or cr is 1, the image decoding apparatus 100 may call a residual encoding syntax structure residual_coding.

[0348] According to reference Fig.17b or Fig.17c The various described embodiments can improve the encoding speed of the image encoding apparatus 200 corresponding to the image decoding apparatus 100 without deteriorating the performance of the inverse transform according to the MTS in the image decoding apparatus 100 .

[0349] In addition, since the image decoding apparatus 100 can parse the syntax element according to the MTS in the syntax structure of the coding unit or the transform unit instead of the MTS in the residual coding syntax structure, the parsing delay until the parsing of the residual syntax structure does not occur. Therefore, separate parsing for (inverse) transform is possible, and there may be an advantage of parallel processing.

[0350] Compared to the case where the syntax elements are obtained from the header of the SPS or PPS including the parameters commonly applied to the data units of the lower level, etc., when the image decoding apparatus 100 obtains the syntax elements from the syntax structure of the coding unit, the syntax structure of the transform unit, and the residual coding syntax structure, the image decoding apparatus 100 may first obtain the syntax elements from the syntax structure of the coding unit, then call at least one syntax structure of the transform unit from the syntax structure of the coding unit, and then obtain the syntax elements from the at least one syntax structure of the transform unit. In addition, the image decoding apparatus 100 may call the residual coding syntax structure from the syntax structure of the transform unit, and then obtain the syntax elements from the residual coding syntax structure. That is, when the image decoding apparatus 100 obtains the syntax elements from the syntax structure having a certain depth (the syntax structure of the coding unit / transform unit and the residual coding syntax structure), and when the image decoding apparatus 100 obtains the syntax elements from the syntax structure having a larger depth, a parsing delay may occur compared to when the image decoding apparatus 100 obtains the syntax elements from the syntax structure having a smaller depth. Typically, a syntax structure of a transform unit or a coding unit may include syntax elements mainly corresponding to mode information, and a residual coding syntax structure may include syntax elements associated with values ​​of transform coefficients (i.e., sample data), and therefore, it is desirable to obtain syntax elements related to mode information (such as syntax elements according to MTS) from the syntax structure of the coding unit or the transform unit including syntax elements mainly corresponding to mode information rather than the residual coding syntax structure, and in this case, parsing delay can also be reduced.

[0351] Fig.17d A syntax structure of a coding unit including a syntax element for multiple transform selection according to various embodiments is shown.

[0352] Reference Fig.17d, when the tree type is not dual-tree chroma DUAL_TREE_CHROMA and the value of the transform skip flag transform_skip_flag is 1 in the coding unit syntax structure 1740, the image decoding device 100 may parse mtx_idx 1745 according to the following additional conditions: when the maximum value of the width cbWidth or the height cbHeight of the coding unit is less than or equal to 32, when the value of the sub-block transform flag cu_sbt_flag is 0 and the value of tu_cbf_luma is 1. That is, when the prediction mode CuMode of the current coding unit is the intra mode MODE_INTRA and the value of the MTS enable flag sps_explicit_mts_intra_enabled_flag in the intra mode obtained from the SPS is 1, or when the prediction mode CuPredMode of the current coding unit is the inter mode MODE_INTER and the value of the MTS enable flag sps_explicit_mts_inter_enabled_flag in the inter mode obtained from the SPS is 1, the image decoding device 100 may parse mtx_idx1745. As shown in Table 7 below, the image decoding device 100 may determine the horizontal transform core type trTypeHor and the vertical transform core type trTypeVer according to the value of mtx_idx1745. Here, when the value of the transform core type is 0, the corresponding transform core may represent DCT2, and when the value is 1 or 2, the transform core may represent DST7 or DCT8 (however, the transform core is not limited thereto and may represent one of various transform cores).

[0353] [Table 7]

[0354] mts_idx 0 1 2 3 4 trTypeHor 0 1 2 1 2 trTypeVer 0 1 1 2 2

[0355] According to reference Fig.17d In the various embodiments described, since in the image decoding device 100, the syntax elements according to the MTS are parsed in the syntax structure of the coding unit rather than in the residual coding syntax structure, no parsing delay occurs until the parsing of the residual syntax structure, and therefore, the image decoding device 100 can parse separately for the (inverse) transform and can have the advantage of parallel processing.

[0356] Fig.18a A residual coding syntax structure including a transform unit syntax and a transform skip flag according to various embodiments is shown.

[0357] Reference Fig.18aWhen the value of tu_cbf_luma, which is the coding block flag of the transform unit of the luminance component, and tu_cbf_cb or tu_cbf_cr, which is the coding block flag of the transform unit of the chrominance component cb or cr, is 1 in the transform unit syntax structure 1800, the image decoding device 100 can call and parse the residual coding syntax structure residual_coding1810.

[0358] When the value of the flag transform_skip_enabled_flag indicating whether transform skipping is enabled in the residual coding syntax structure 1810 is 1 and cIdx is not 0 (i.e., the color component is a chroma component), or when it is determined that the (inverse) transform is not performed by using MTS and the value log2TbWidth or log2TbHeight obtained by applying log2 to the width and height of the transform unit is less than or equal to 2 (i.e., when the width and height of the transform unit are less than or equal to 4×4), the image decoding device 100 can parse the transform skip flag transform_skip_flag 1815.

[0359] According to the above embodiment, not all parsing operations are performed in the syntax structure of the transform unit, and the parsing operation is performed in the residual coding syntax structure. In addition, the syntax for (inverse) transform may not be performed in one syntax structure. Therefore, the syntax elements for transform (especially the transform skip flag) may have to be parsed separately, or the position of the syntax for transform skip mode may need to be changed in order to improve the decoding efficiency of the screen content sequence.

[0360] The image encoding apparatus 200 may evaluate whether to skip (inverse) transform in a transform unit separately according to the transform skip mode and the size of the transform skip block to be applied in the transform skip mode. In addition, the image decoding apparatus 100 may parse information on whether to skip (inverse) transform in a transform unit separately according to the transform skip mode and the size of the transform skip block to be applied in the transform skip mode.

[0361] When the tree type is not dual-tree chroma, when the width tbWidth of the transform unit is less than the sps_trans_skip_size obtained from the SPS or the height tbHeight of the transform unit is less than the sps_trans_skip_size, when the value of the flag sps_trans_skip_flag obtained from the SPS indicating whether the transform skip mode is enabled is 1, the image decoding device 100 may parse the flag indicating whether to skip (inverse) transform according to the transform skip mode. Here, sps_trans_skip_size indicates the maximum size of a block used in the transform skip mode, and sps_trans_skip_size may be obtained not only from the SPS but also from the video parameter set (VPS), the picture parameter set (PPS), the parallel block group header, or the slice header. When the value of the transform skip flag is 1, the image decoding device 100 may skip (inverse) transform for the current transform unit according to the transform skip mode. When the value of the transform skip flag is 0, the image decoding device 100 may not apply the transform skip mode for the current transform unit.

[0362] When the cbf tu_cbf_luma of the transform unit of the luma component is 1, the image decoding apparatus 100 may determine whether to skip (inverse) transform for the luma component according to the transform skip mode. Alternatively, when the cbf tu_cbf_cr or tu_cbf_cb of the transform unit of the chroma component cr or cb is 1, the image decoding apparatus 100 may determine whether to skip (inverse) transform for the chroma component cr or cb according to the transform skip mode.

[0363] When tu_cbf_luma is 1 when MTS is used in SPS, the image decoding apparatus 100 may parse a flag indicating whether to skip (inverse) transform according to a transform skip mode according to the following additional conditions: when sps_trans_skip_enable_flag is 1, when the tree type is not dual-tree chroma.

[0364] When the width tbWidth of the current transformation unit is less than or equal to sps_transform_skip_size or the height tbHeight of the current transformation unit is less than or equal to sps_transform_skip_size, the image decoding apparatus 100 may parse a flag indicating whether (inverse) transformation is skipped according to a transform skip mode.

[0365] When the cbf tu_cbf_luma of the transform unit of the luma component is 1, the image decoding apparatus 100 may determine whether to skip (inverse) transform for the luma component according to the transform skip mode. Alternatively, when the cbf tu_cbf_cr or tu_cbf_cb of the transform unit of the chroma component cr or cb is 1, the image decoding apparatus 100 may determine whether to skip (inverse) transform for the chroma component cr or cb according to the transform skip mode.

[0366] The image encoding device 200 can evaluate whether to skip (inverse) transformation in a transformation unit according to a transformation skip mode and other transformation methods and the size of a transformation skip block to be applied in the transformation skip mode, and the image decoding device 100 can parse information about whether to skip (inverse) transformation according to a transformation skip mode and other transformation methods.

[0367] When the tree type is not dual-tree chroma, the image encoding apparatus 200 may parse a flag indicating whether (inverse) transform is skipped according to a transform skip mode from a bitstream according to the following additional condition: when a value of sps_trans_skip_enabled_flag is 1. Alternatively, when MTS is used for a current transform unit and when a value of tu_cbf_luma is 1, the image encoding apparatus 200 may parse a flag indicating whether (inverse) transform is skipped according to a transform skip mode from a bitstream according to the following additional condition: when a value of sps_trans_skip_flag is 1, when the tree type is not dual-tree chroma.

[0368] When the width tbWidth of the transformation unit is less than the sps_trans_skip_size obtained from the SPS or the height tbHeight of the transformation unit is less than the sps_trans_skip_size, the image decoding apparatus 100 may parse a flag indicating whether to skip (inverse) transformation according to the transformation skip mode. Here, sps_trans_skip_size indicates the maximum size of a block used in the transformation skip mode, and sps_trans_skip_size may be obtained not only from the SPS but also from the VPS, PPS, parallel block group header, or slice header. sps_trans_skip_size may be the same as the size of a block to which the MTS is applied.

[0369] The image decoding apparatus 100 may parse the coordinated transform syntax element from the bitstream. The coordinated transform syntax element may indicate whether other transform kernels (DCT2, DST7, DCT8, DST4, and DCT4) and a transform skip mode are applied.

[0370] The coordinated transform syntax element may include codewords composed as shown in Table 8 below.

[0371] [Table 8]

[0372]

[0373] For cases numbered 3 to 6, the vertical core or horizontal core may be determined as a pair of any transforms including DCT2, DST7, DCT8, DST4, and DCT4, and which horizontal core or vertical core each numbered codeword corresponds to may be adaptively determined based on at least one of the block size, the aspect ratio of the block, the prediction type, the intra prediction mode, and the quantization parameter.

[0374] Also, the order of No. 1 to No. 6 may be adaptively determined based on at least one of a size of a block, an aspect ratio of the block, a prediction type, an intra prediction mode, and a quantization parameter.

[0375] The coordinated transform syntax element may include codewords composed as shown in Table 9 below.

[0376] [Table 9]

[0377]

[0378] For cases numbered 3 to 6, the vertical core or horizontal core may be determined as a pair of any transforms including DCT2, DST7, DCT8, DST4, and DCT4, and which horizontal core or vertical core each numbered codeword corresponds to may be adaptively determined based on at least one of the block size, the aspect ratio of the block, the prediction type, the intra prediction mode, and the quantization parameter.

[0379] Also, the order of No. 1 to No. 6 may be adaptively determined based on at least one of a size of a block, an aspect ratio of the block, a prediction type, an intra prediction mode, and a quantization parameter.

[0380] Fig.18b A syntax structure of a transform unit including a transform skip flag according to various embodiments is shown.

[0381] Reference Fig.18b, the image decoding apparatus 100 may parse the flag transform_skip_flag indicating whether to skip (inverse) transform according to the transform skip mode in the transform unit syntax structure 1820. For example, when tu_cbf_luma is 1 and the tree type is not dual-tree chroma, and when the value of sps_transform_skip_enabled_flag is 1 and the width tBWidth of the current transform unit is less than or equal to the maximum skip block size MaxTsSize and the height tBHeight of the current transform unit is less than or equal to the maximum skip block size MaxTsSize, the image decoding apparatus 100 may parse the flag transform_skip_flag 1825 indicating whether to skip (inverse) transform according to the transform skip mode when the value of the flag cu_sbt_flag indicating whether to use SBT is 0.

[0382] When tu_cbf_cb is 1 and the tree type is not dual-tree chroma, and when the value of sps_transform_skip_enabled_flag is 1 and the width wC of the current transform unit of the chroma component cb is less than or equal to the maximum skip block size MaxTsSize and the height hC of the current transform unit of the chroma component cb is less than or equal to the maximum skip block size MaxTsSize, the image decoding device 100 may parse the flag transform_skip_flag 1830 indicating whether to skip the (inverse) transform of the current transform unit for the chroma component cr according to the transform skip mode when the value of the flag cu_sbt_flag indicating whether to use SBT is 0.

[0383] When tu_cbf_cr is 1 and the tree type is not dual-tree chroma, and when tu_cbf_cb is not 1 and the value of tu_joint_cbcr_residual_flag is 1, when the value of the flag cu_sbt_flag indicating whether SBT is used is 0, when the value of sps_transform_skip_enabled_flag is 1 and the width wC of the current transform unit of the chroma component cr is less than or equal to the maximum skip block size MaxTsSize and the height hC of the current transform unit of the chroma component cr is less than or equal to the maximum skip block size MaxTsSize, the image decoding device 100 can parse the flag transform_skip_flag 1835 indicating whether to skip the (inverse) transform of the current transform unit for the chroma component cb according to the transform skip mode. Here, tu_joint_cb_cr_residual_flag is a flag indicating whether to obtain only the residual of the chroma component cb instead of obtaining the residuals of both the chroma components cb and cr, so that the residual of the chroma component cr is generated by using the residual of the chroma component cb.

[0384] Fig.19a is a diagram for describing an SBT mode for a block encoded in an inter mode according to an embodiment.

[0385] Reference Fig.19a , when the prediction mode of the current coding unit is the inter prediction mode, the image decoding apparatus 100 may perform inverse transformation according to the SBT mode. The SBT mode indicates a mode in which the current coding unit is divided into two sub-blocks (transformation units) based on a division direction, a size of a sub-block, and a position of a sub-block, inverse transformation is performed on only one of the two divided sub-blocks without performing inverse transformation on the other sub-block, and all residual values ​​are filled with 0.

[0386] The image decoding apparatus 100 may parse syntax elements regarding the SBT as follows.

[0387] First, the image decoding apparatus 100 may parse the flag cu_sbt_flag indicating whether the SBT is used for the current coding unit. When the value of the flag cu_sbt_flag is 1, the image decoding apparatus 100 may determine that the SBT is used for the current coding unit. When the value of the flag cu_sbt_flag is 0, the image decoding apparatus 100 may determine that the SBT is not used for the current coding unit. When the flag cu_sbt_flag does not exist in the bitstream, the image decoding apparatus 100 may determine that the SBT is not used for the current coding unit.

[0388] In addition, the image decoding apparatus 100 may parse the flag cu_sbt_quad_flag indicating whether the current coding unit is divided into a plurality of sub-blocks including a sub-block having a size of 1 / 4. When the value of the flag cu_sbt_quad_flag is 1, the image decoding apparatus 100 may determine that the current coding unit is divided into a plurality of sub-blocks including a sub-block having a size of 1 / 4. When the value of the flag cu_sbt_quad_flag is 0, the image decoding apparatus 100 may determine that the current coding unit is divided into a plurality of sub-blocks including a sub-block having a size of 1 / 2.

[0389] When the flag cu_sbt_quad_flag does not exist in the bitstream, the image decoding apparatus 100 may determine that the current coding unit is split into a plurality of sub blocks including a sub block having a 1 / 2 size.

[0390] The image decoding apparatus 100 may parse a flag cu_sbt_horizontal_flag indicating whether a current coding unit is horizontally split into two transformation units.

[0391] When the value of the flag cu_sbt_horizontal_flag is 1, the image decoding apparatus 100 may determine that the current coding unit is horizontally split. When the value of the flag cu_sbt_horizontal_flag is 0, the image decoding apparatus 100 may determine that the current coding unit is vertically split.

[0392] When the flag cu_sbt_horizontal_flag does not exist in the bitstream, the image decoding apparatus 100 may decode the flag cu_sbt_horizontal_flag based on (allowSbtHorQ) whether horizontal splitting of the current coding unit into a plurality of sub-blocks including a sub-block having a 1 / 4 size is allowed when the value of the flag cu_sbt_quad_flag is 1.

[0393] When a value of the flag cu_sbt_quad_flag is 0, the image decoding apparatus 100 may decode the flag cu_sbt_horizontal_flag based on whether horizontal splitting of a current coding unit into a plurality of sub blocks including a sub block having a 1 / 2 size is allowed (allowSbtHorH).

[0394] The image decoding apparatus 100 may parse a flag sbt_pos_flag indicating a position of a transformation unit on which inverse transformation is performed (or another transformation unit on which inverse transformation is not performed) among two transformation units, with respect to a current coding unit.

[0395] For example, when the value of the flag cu_pos_flag is 1, the image decoding apparatus 100 may determine, for the current coding unit, that tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr do not exist in the bitstream for the first transformation unit of the two transformation units. When the value of the flag cu_pos_flag is 0, the image decoding apparatus 100 may determine, for the current coding unit, that tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr do not exist in the bitstream for the second transformation unit of the two transformation units.

[0396] For example, when the current coding unit 1900 is vertically split (SBT-V) into two transformation units 1910 and 1915, and when the position is 0, the image decoding apparatus 100 may perform inverse transformation on the transformation unit 1910 having a width of w1 (1 / 2w or 1 / 4w) by using DCT8 as a horizontal transformation kernel and DCT7 as a vertical transformation kernel. For another transformation unit 1915, all residual values ​​may be determined to be 0.

[0397] When the current coding unit 1900 is vertically split (SBT-V) into two transformation units 1910 and 1915, and when the position is 1, the image decoding apparatus 100 may perform inverse transformation on the transformation unit 1910 having a width of w1 (1 / 2w or 1 / 4w) by using DST7 as a horizontal transformation kernel and DST7 as a vertical transformation kernel. For another transformation unit 1915, all residual values ​​may be determined to be 0.

[0398] When the current coding unit 1920 is horizontally split (SBT-V) into two transformation units 1930 and 1935, and when the position is 0, the image decoding apparatus 100 may perform inverse transformation on the transformation unit 1930 having a height of h1 (1 / 2h or 1 / 4h) by using DST7 as a horizontal transformation kernel and DCT8 as a vertical transformation kernel. For another transformation unit 1935, all residual values ​​may be determined to be 0.

[0399] According to the reference Fig.19a In the case of the SBT mode of the described embodiment, only one sub-block is the object of (inverse) transformation, and the area of ​​the other sub-block is not the object for information transmission, and therefore, information loss may occur for the area to which (inverse) transformation is not applied. Fig.19a In the case of the SBT mode of the described embodiment, only one sub-block is the object of (inverse) transformation, and the region of the other sub-block is not the object for information transmission, and therefore, based on this aspect, additional bit reduction can be achieved in terms of coefficient encoding after transformation (in the encoding device) or transform coefficient encoding applied before inverse transformation (in the decoding device).

[0400] According to the reference Fig.19a In the case of the SBT mode of the described embodiment, only one sub-block is the object of (inverse) transformation, and the region of the other sub-block is not the object for information transmission, and therefore, additional bit reduction can be achieved by changing the semantics for the region in which all blocks are encoded as 0 via the coded block flag (CBF).

[0401] In the following, the solution according to the reference Fig.19a Various embodiments of the problem of the SBT mode of embodiment are described.

[0402] Fig.19b is a diagram for describing an SBT mode for a block encoded in an inter mode according to an embodiment.

[0403] Reference Fig.19b , the image decoding apparatus 100 may perform inverse transformation not only on the transformation unit 1945 included in the current coding unit 1940 , but also on the transformation unit 1950 .

[0404] The image decoding apparatus 100 may also perform inverse transformation on the transformation unit 1950 by using a transformation kernel based on one default mode among various transformation kernel sets for the transformation unit 1950. Available default modes 1 to 9 are shown in Table 10 below.

[0405] [Table 10]

[0406]

[0407]

[0408] Those skilled in the art will appreciate that default modes 1 to 9 may be applied to Fig.19a The transformation units 1915 and 1935 on which transformation has not been performed.

[0409] Fig.19c is a diagram for describing a process of encoding and decoding coefficients based on SBT for a block encoded in an inter mode according to an embodiment.

[0410] In the case of SBT, only one sub-block is the object of (inverse) transformation, and the region of the other sub-block is not the object for information transmission, and therefore, based on this aspect, additional bit reduction can be achieved in terms of coefficient encoding after transformation (in the encoding device) or transform coefficient encoding applied before inverse transformation (in the decoding device).

[0411] The image decoding apparatus 100 may determine only an area to which the SBT is applied as a scanning area during coefficient encoding. Fig.19c, the image decoding apparatus 100 may determine only the block 1955 to which the SBT is applied as a scanning area, and may scan information about a transform coefficient for the scanning area according to a scanning order. In detail, the image decoding apparatus 100 may determine an area of ​​the block 1955 to which the SBT is applied as a scanning area according to a size of the block, and may scan information about a transform coefficient for the scanning area according to a scanning order.

[0412] The image decoding apparatus 100 may determine whether to parse information about the position of the x-coordinate and the y-coordinate of the last significant coefficient during the transform coefficient decoding. For example, when the position of the last pixel at the lower right end of the region (or the scan region) to which the SBT is applied during the transform coefficient decoding is the same as the x-coordinate and the y-coordinate of the last significant coefficient during the transform coefficient decoding, the image decoding apparatus 100 may not parse information indicating the x-coordinate and the y-coordinate of the last significant coefficient during the transform coefficient decoding from the bitstream. When the x-coordinate and the y-coordinate of the last significant coefficient parsed from the bitstream do not exist, the image decoding apparatus 100 may determine the x-coordinate and the y-coordinate of the last significant coefficient as the position of the last pixel at the lower right end of the region (or the scan region) to which the SBT is applied.

[0413] During transform coefficient decoding, when the flag of the coding group (CG) overlaps with the flag of the last CG at the lower right end of the region (or scan region) to which the SBT is applied, the image decoding apparatus 100 may also skip parsing the flag of the last CG at the lower right end of the region (or scan region) to which the SBT is applied. Here, the CG is a block of a predetermined size. For example, the CG may be a block of a size of 4×4.

[0414] In addition, when the significant coefficient flag overlaps with the significant coefficient flag at the position of the last pixel at the lower right end of the area (or scan area) to which the SBT is applied during transform coefficient decoding, the image decoding device 100 may also skip parsing the flag of the last pixel at the lower right end of the area (or scan area) to which the SBT is applied.

[0415] The image decoding apparatus 100 may achieve additional bit reduction by changing semantics for a region where all residual values ​​are determined to be 0 by the CBF.

[0416] In the case of cu_cbf for a block (CU or TU) to which SBT is applied, the image decoding apparatus 100 may indicate whether SBT is applied according to the cbf type. In this case, the image decoding apparatus 100 may skip parsing a flag for determining whether SBT is applied.

[0417] When the CBF is 1, the image decoding apparatus 100 may determine that at least one coefficient exists in a block (CU or TU).

[0418] When the CBF is 2, the image decoding apparatus 100 may determine to apply the SBT, there is at least one coefficient in the left subblock of the block (CU or TU), and there is no coefficient in the right subblock.

[0419] When the CBF is 3, the image decoding apparatus 100 may determine to apply the SBT, there is at least one coefficient in the right subblock of the block (CU or TU), and there is no coefficient in the left subblock.

[0420] The image decoding apparatus 100 may determine the value of a flag indicating whether a transform skip mode is used by using MTSIdx. In the case of the transform skip mode, the transform skip mode may operate in a screen content having an image whose characteristics are different from those of an image used in MTS. Here, MTSIdx is an index indicating an MTS mode, and when the value of MTSIdx is 0, the horizontal transform kernel and the vertical transform kernel indicate DCT2, and when the value of MTSIdx is one of 1 to 4, the horizontal transform kernel or the vertical transform kernel may be determined as one of DCT7 and DCT8 based on the value.

[0421] However, according to MTSIdx, without considering the characteristics of the transform skip mode, decoding is inefficiently performed by using the same context modeling as the MTS flag.

[0422] Therefore, the image decoding apparatus 100 according to the embodiment may determine the index indicating the context model during the context modeling of the transform skip flag as follows. The image decoding apparatus 100 may determine the index indicating the context model during the context modeling of the transform skip flag based on the size of the current transform unit. The image decoding apparatus 100 may determine the index indicating the context model during the context modeling of the transform skip flag based on at least one of the height and width of the current transform unit. For example, the index may be determined based on min(log 2 W,log 2 H), average(log 2 W,log 2 H) or log 2 W+log 2 H determines the index indicating the context model. It is not limited thereto. The image decoding apparatus 100 may determine the index indicating the context model during context modeling of the transform skip flag in various shapes based on the size of the current transform unit.

[0423] The image decoding apparatus 100 may determine an index indicating a context model during context modeling of a transform skip flag based on an area of ​​a current transform unit.

[0424] The image decoding apparatus 100 may determine an index indicating a context model during context modeling of a transform skip flag based on a block type of a current transform unit or a current coding unit including the current transform unit. Here, the block type may indicate whether the block is encoded in an inter mode or an intra mode.

[0425] The image decoding apparatus 100 may determine an index indicating a context model during context modeling of a transform skip flag based on a shape (or a ratio between height / width) of a current transform unit.

[0426] The image decoding apparatus 100 may determine an index indicating a context model during context modeling of a transform skip flag based on a prediction type (eg, uni-prediction or bi-prediction) of a current block.

[0427] The image decoding apparatus 100 may determine the index indicating the context model during context modeling of the transform skip flag based on the neighboring skip flag. The image decoding apparatus 100 may determine the index indicating the context model during context modeling of the transform skip flag based on whether the value of MTSIdx is 0. Here, MTSIdx may be for the current block. However, MTSIdx is not limited thereto and may be for a neighboring block.

[0428] The image decoding apparatus 100 may allow SBT in a horizontal direction or SBT in a vertical direction based on the size of a block.

[0429] For example, when the width satisfies the condition of width limitation or the height satisfies the condition of height limitation, the image decoding apparatus 100 may allow SBT in the horizontal direction or SBT in the vertical direction. Here, there is no dependency between the current width and the current height.

[0430] The image decoding apparatus 100 may parse information about the SBT based on the pseudo code 1.

[0431] [Pseudo code 1]

[0432] Parsing SBT_flag

[0433] If SBT_flag = 1

[0434] Parse 1 / 2 or 1 / 4 SBT_type (2:2 or 1:3 / 3:1)

[0435] Parse SBT_dir flag (ctxIdx): Hor or Ver

[0436] ctxIdx=(cuWidth==cuHeight)? 0:(cuWidth <cuHeight?1:2)

[0437] Parsing SBT_pos (p0 or p1)

[0438] That is, according to pseudo code 1, the image decoding device 100 may parse SBT_flag. When the value of SBT_flag is 1, the image decoding device 100 may parse SBT_type indicating 1 / 2 or 1 / 4 and parse SBT_dir_flag based on ctxIdx to determine the division direction. Here, ctxIdx may be determined according to the width cuWidth and the height cuHeight of the current block. The image decoding device 100 may determine whether the position of the transform block is p0 or p1 by parsing SBT_pos indicating the position of the subblock.

[0439] The image decoding apparatus 100 according to an embodiment may determine a division direction of the SBT that is adaptive according to a block shape based on a current size restriction.

[0440] When the width of the current block is greater than the height of the current block, the image decoding apparatus 100 may allow only the SBT in the vertical direction. When the width of the current block is less than the height of the current block, the image decoding apparatus 100 may allow only the SBT in the horizontal direction. When the width and height of the current block are the same as each other, the image decoding apparatus 100 may allow both the SBT in the horizontal direction and the SBT in the vertical direction. This may be because the coefficients of the residual of the wide block or the long block are concentrated on one side of the CU, and therefore, the image decoding apparatus 100 may determine whether to allow the SBT in the horizontal direction or the SBT in the vertical direction to reduce the overhead of the SBT division direction.

[0441] The image decoding apparatus 100 may parse information about the SBT based on the pseudo code 2.

[0442] [Pseudo code 2]

[0443] Parsing SBT flags

[0444] If SBT_flag = 1

[0445] Parse 1 / 2 or 1 / 4 SBT_type (2:2 or 1:3 / 3:1)

[0446] If cuWidth == cuHeight

[0447] Parse SBT_dir flag

[0448] otherwise

[0449] SBT_dir flag = vertical, if cuWidth>cuHeight

[0450] SBT_dir flag = horizontal, if cuWidth <cuHeight

[0451] Parsing SBT_pos (p0 or p1)

[0452] That is, according to pseudo code 2, the image decoding device 100 may parse SBT_flag. When the value of SBT_flag is 1, the image decoding device 100 may parse SBT_type indicating 1 / 2 or 1 / 4, and when the height and width of the current coding unit are the same as each other, the image decoding device 100 may parse SBT_dir_flag to determine the division direction. If this is not the case, for example, when the height of the current coding unit is less than the width of the current coding unit, the image decoding device 100 may not parse SBT_dir_flag, and the division direction may be determined as a vertical direction. When the height of the current coding unit is greater than the width of the current coding unit, the image decoding device 100 may not parse SBT_dir_flag, and the division direction may be determined as a horizontal direction.

[0453] The image decoding apparatus 100 may parse the information about the SBT based on the pseudo code 3.

[0454] [Pseudo code 3]

[0455] Parsing SBT flags

[0456] If SBT flag = 1

[0457] cuWidth <cuHeight

[0458] Parse level 1 / 2 or 1 / 4 of SBT_type (if both 1 / 2 and 1 / 4 are allowed)

[0459] cuWidth>cuHeight

[0460] Parse vertical 1 / 2 or 1 / 4 SBT_type (if 1 / 2, 1 / 4 are both allowed)

[0461] cuWidth == cuHeight

[0462] Parse SBT_dir flag

[0463] Parsing SBT_type

[0464] Parsing SBT_pos (p0 or p1)

[0465] That is, the image decoding apparatus 100 may parse SBT_flag based on pseudo code 3. When the value of SBT_flag is 1, and when the height of the current coding unit is greater than the width (+ when both 1 / 2 and 1 / 4 are allowed), the image decoding apparatus 100 may parse SBT_type of 1 / 2 or 1 / 4 in the horizontal direction.

[0466] The image decoding apparatus 100 may parse SBT_flag. When the value is 1, and when the width of the current coding unit is greater than the height (+ when both 1 / 2 and 1 / 4 are allowed), the image decoding apparatus 100 may parse SBT_type of 1 / 2 or 1 / 4 in the vertical direction.

[0467] When the height of the current coding unit is the same as the width of the current coding unit, the image decoding apparatus 100 may parse SBT_dir_flag and may parse SBT_type.

[0468] The image decoding apparatus 100 may determine whether the position of the transform block is p0 or p1 by parsing SBT_pos.

[0469] However, the dependency of the block shape is not limited to the value of the width or height of the current coding unit, and may be based on the conditions: width>ratio*height and height>ratio*width, where the ratio may be 1, 2, or 4, but is not limited thereto.

[0470] The image decoding apparatus 100 according to an embodiment may determine a division direction of the SBT, wherein the division direction is adaptive according to a block shape based on a current size restriction.

[0471] When the width of the current block is greater than the height of the current block, the image decoding apparatus 100 may allow SBT only in the horizontal direction. When the width of the current block is less than the height of the current block, the image decoding apparatus 100 may allow SBT only in the vertical direction. When the width and height of the current block are the same as each other, the image decoding apparatus 100 may allow both SBT in the horizontal direction and SBT in the vertical direction. This may be because, in a wide block, some residuals are located above or below the horizontal boundary and there are almost no residuals in other areas, while in a long block, some residuals are located on the left or right side of the vertical boundary and there are almost no residuals in other areas, and therefore, based on this characteristic, it may be determined whether to allow SBT in the horizontal direction or the vertical direction to reduce the overhead of the SBT division direction.

[0472] The image decoding apparatus 100 may parse information about the SBT based on pseudo code 4.

[0473] [Pseudo code 4]

[0474] Parsing SBT flags

[0475] If SBT_flag = 1

[0476] Parse 1 / 2 or 1 / 4 SBT_type (2:2 or 1:3 / 3:1)

[0477] If cuWidth == cuHeight

[0478] Parse SBT_dir_flag

[0479] otherwise

[0480] SBT_dir flag = horizontal, if cuWidth>cuHeight

[0481] SBT_dir flag = vertical, if cuWidth <cuHeight

[0482] Parsing SBT_pos (p0 or p1)

[0483] That is, according to pseudo code 4, the image decoding device 100 may parse SBT_flag. When the value of SBT_flag is 1, the image decoding device 100 may parse SBT_type indicating 1 / 2 or 1 / 4, and when the height and width of the current coding unit are the same as each other, the image decoding device 100 may parse SBT_dir_flag to determine the division direction. If it is not the case, for example, when the height of the current coding unit is less than the width of the current coding unit, the image decoding device 100 may not parse SBT_dir_flag, and the division direction may be determined as the horizontal direction. When the height of the current coding unit is greater than the width of the current coding unit, the image decoding device 100 may not parse SBT_dir_flag, and the division direction may be determined as the vertical direction.

[0484] The image decoding apparatus 100 may parse the information about the SBT based on the pseudo code 5.

[0485] [Pseudo code 5]

[0486] Parsing SBT flags

[0487] If SBT flag = 1

[0488] cuWidth <cuHeight

[0489] Parse vertical 1 / 2 or 1 / 4 SBT_type (if 1 / 2, 1 / 4 are both allowed)

[0490] cuWidth>cuHeight

[0491] Parse level 1 / 2 or 1 / 4 of SBT_type (if both 1 / 2 and 1 / 4 are allowed)

[0492] cuWidth == cuHeight

[0493] Parse SBT_dir flag

[0494] Parsing SBT_type

[0495] Parsing SBT_pos (p0 or p1)

[0496] That is, the image decoding apparatus 100 may parse SBT_flag based on pseudo code 5. When the value is 1, and when the height of the current coding unit is greater than the width (+ when both 1 / 2 and 1 / 4 are allowed), the image decoding apparatus 100 may parse SBT_type of 1 / 2 or 1 / 4 in the vertical direction.

[0497] The image decoding apparatus 100 may parse SBT_flag. When the value is 1, and when the width of the current coding unit is greater than the height (+ when both 1 / 2 and 1 / 4 are allowed), the image decoding apparatus 100 may parse SBT_type of 1 / 2 or 1 / 4 in the horizontal direction.

[0498] When the height of the current coding unit is the same as the width of the current coding unit, the image decoding apparatus 100 may parse SBT_dir_flag and may parse SBT_type.

[0499] The image decoding apparatus 100 may determine whether the position of the transform block is p0 or p1 by parsing SBT_pos.

[0500] However, the dependency of the block shape is not limited to the value of the width or height of the current coding unit, and may be based on the conditions: width>ratio*height and height>ratio*width, where the ratio may be 1, 2, or 4, but is not limited thereto.

[0501] Fig.20a A residual coding syntax structure for determining the size of a scan area according to an embodiment is shown.

[0502] Reference Fig.20a, when in the residual coding syntax structure 2000, the value of sps_mts_enabled_flag is 1, the value of cu_sbt_flag is 1, the index of the color component is 0 (that is, the current color component is the luminance component), the value obtained by applying log2 to the width of the current transformation unit is 5, and the value obtained by applying log2 to the height of the current transformation unit is less than 6, the image decoding apparatus 100 may determine the value obtained by applying log2 to the width of the region in the transformation unit (the region being the object of scanning for the transformation unit) to be 4. That is, the width of the region in the transformation unit (the region being the object of scanning for the transformation unit) may be determined to be 16. If this is not the case, the value obtained by applying log2 to the width of the region in the transformation unit (the region being the object of scanning for the transformation unit) may be a value corresponding to a smaller value between 5 and a value obtained by applying log2 to the width of the current transformation unit.

[0503] When, in the residual coding syntax structure 2000, the value of sps_mts_enabled_flag is 1, the value of cu_sbt_flag is 1, the index of the color component is 0 (that is, the current color component is the luminance component), the value obtained by applying log2 to the height of the current transformation unit is 5, and the value obtained by applying log2 to the width of the current transformation unit is less than 6, the image decoding apparatus 100 may determine the value obtained by applying log2 to the height of the region in the transformation unit (the region being the object of scanning for the transformation unit) to be 4. That is, the height of the region in the transformation unit (the region being the object of scanning for the transformation unit) may be determined to be 16. If this is not the case, the value obtained by applying log2 to the height of the region in the transformation unit (the region being the object of scanning for the transformation unit) may be a value corresponding to a smaller value between 5 and a value obtained by applying log2 to the height of the current transformation unit.

[0504] Fig.20b Residual coding semantics of a syntax element indicating the position of the last significant coefficient of a considered scan region according to an embodiment is shown.

[0505] Reference Fig.20b , the range of the prefix of the x position or the prefix of the y position of the last significant coefficient may be determined as 0 to (log2ZoTbWidth<<1)-1 or 0 to (log2ZoTbHeight<<1)-1. That is, the prefix of the x position or the prefix of the y position of the last significant coefficient may be determined in the range between 0 and the x and y positions of the last coefficient in the actual scan area.

[0506] In addition, the range of the suffix of the x position or the suffix of the y position of the last significant coefficient may be determined to be in the range of 0 to (1<<((last_sig_coeff_x_prefix>>1)-1))-1, 0 to (1<<((last_sig_coeff_y_prefix>>1)-1))-1.

[0507] Fig.20c A syntax structure of a coding unit for determining whether a predetermined split direction and a predetermined split type are allowed based on a size (height or width) of a current coding unit according to an embodiment is shown.

[0508] Reference Fig.20c , when the prediction mode of the current coding unit is the inter mode when the value of cu_cbf is 1 in the coding unit syntax structure 2010, when the width of the current coding unit is greater than or equal to 8, when sps_enabled_flag is 1 and the width of the current coding unit is less than or equal to the maximum size of the transformation unit and the height of the current coding unit is less than or equal to the maximum size of the transformation unit, the image decoding device 100 may determine that the SBT in the vertical division direction of the sub-block with a size of 1 / 2 is allowed.

[0509] When the width of the current coding unit is greater than or equal to 16, the image decoding apparatus 100 may determine the SBT in the vertical split direction allowing the sub-blocks having a ¼ size.

[0510] When the height of the current coding unit is greater than or equal to 8, the image decoding apparatus 100 may determine the SBT in the horizontal split direction allowing subblocks having a 1 / 2 size.

[0511] When the height of the current coding unit is greater than or equal to 16, the image decoding apparatus 100 may determine the SBT in the horizontal split direction allowing a subblock having a ¼ size.

[0512] When cu_sbt_horizontal_flag does not exist in the bitstream, the image decoding device 100 may derive the value. For example, when cu_sbt_quad_flag is 1, the image decoding device 100 may set cu_sbt_horizontal_flag to be the same as the value of allowSbtHorQ. When cu_sbt_quad_flag is 0, cu_sbt_horizontal_flag may be set to be the same as the value of allowSbtHorH. Each of allowSbtHorQ and allowSbtHorH may be a value indicating whether SBT in the horizontal division direction of a sub-block of 1 / 4 size or a sub-block of 1 / 2 size is allowed.

[0513] For example, when the width of the current coding unit is greater than or equal to 8 and the height of the current coding unit is less than 8 (when the width of the current coding unit is greater than the height), the image decoding apparatus 100 may not parse cu_sbt_horizontal_flag from the bitstream and may determine the SBT in the horizontal division direction that allows a sub-block having a 1 / 2 size. That is, the image decoding apparatus 100 may determine the division direction for obtaining a sub-block based on the relative relationship between the height and the width of the current coding unit without parsing cu_sbt_horizontal_flag from the bitstream.

[0514] Although the above reference Figures 17a to 20c The operation of the image decoding apparatus 100 is described, but it is obvious to those skilled in the art that the image encoding apparatus 200 may perform an operation similar to that of the image decoding apparatus 100 .

[0515] Various embodiments have been described above. It will be appreciated by those skilled in the art that the present disclosure may be implemented in many different forms without departing from the basic features of the present disclosure. Therefore, the embodiments of the present disclosure set forth herein should be considered only in a descriptive sense, and not for the purpose of limitation. The scope of the present disclosure is set forth in the claims rather than in the foregoing description, and all differences falling within the scope equivalent thereto should be interpreted as being included in the present disclosure.

[0516] The above-mentioned embodiments of the present disclosure may be written as a computer executable program and implemented by a general-purpose digital computer that operates the program via a computer-readable recording medium. The computer-readable recording medium may include storage media such as magnetic storage media (e.g., ROM, floppy disk, hard disk, etc.) and optical recording media (e.g., CD-ROM, DVD, etc.).

Claims

1. An image decoding method, comprising: Obtaining size information about a maximum block size for a transform skip mode from a sequence parameter set in a bitstream; determining the maximum block size for a transform skip mode based on the size information; obtaining, from a transform unit syntax in the bitstream, a flag indicating whether to use a transform skip mode for a current transform unit based on that a size of the current transform unit is smaller than the maximum block size for the transform skip mode and a coded block flag indicating that a current transform block of a luma component includes at least one non-zero transform coefficient level; Based on the obtained flag, determining whether to use a transform skip mode for a current transform unit; When the transform skip mode is used for the current transform unit, obtaining at least one coefficient included in the current transform unit without performing an inverse transform process on the current transform unit; and A reconstructed block is obtained based on the obtained at least one coefficient.

2. An image decoding device, comprising at least one processor, wherein: The at least one processor is configured to perform the following operations: Obtaining size information about a maximum block size for a transform skip mode from a sequence parameter set in a bitstream; determining the maximum block size for a transform skip mode based on the size information; obtaining, from a transform unit syntax in the bitstream, a flag indicating whether to use a transform skip mode for a current transform unit based on that a size of the current transform unit is smaller than the maximum block size for the transform skip mode and a coded block flag indicating that a current transform block of a luma component includes at least one non-zero transform coefficient level; Based on the obtained flag, determining whether to use a transform skip mode for a current transform unit; When the transform skip mode is used for the current transform unit, obtaining at least one coefficient included in the current transform unit without performing an inverse transform process on the current transform unit; and A reconstructed block is obtained based on the obtained at least one coefficient.

3. An image encoding method, comprising: determining a maximum block size for a transform skip mode; determining size information about the maximum block size for a transform skip mode; determining a flag indicating whether to use a transform skip mode for the current transform unit based on that a size of the current transform unit is smaller than the maximum block size for the transform skip mode and the coded block flag indicates that the current transform block of the luma component includes at least one non-zero transform coefficient level; When the transform skip mode is used for the current transform unit, determining at least one coefficient included in the current transform unit without performing a transform process on the current transform unit; encoding the at least one coefficient, the size information, and the flag; as well as A bitstream is generated, the bitstream including the encoded at least one coefficient, the encoded size information, and the encoded flag.

4. A method for sending a bit stream, comprising: determining a maximum block size for a transform skip mode; determining size information about the maximum block size for a transform skip mode; determining a flag indicating whether to use a transform skip mode for the current transform unit based on that a size of the current transform unit is smaller than the maximum block size for the transform skip mode and the coded block flag indicates that the current transform block of the luma component includes at least one non-zero transform coefficient level; When the transform skip mode is used for the current transform unit, determining at least one coefficient included in the current transform unit without performing a transform process on the current transform unit; encoding the at least one coefficient, the size information, and the flag; as well as generating a bitstream, the bitstream comprising the encoded at least one coefficient, the encoded size information, and the encoded flag; as well as The bit stream is transmitted to a computer-readable recording medium.