Image encoding method and apparatus, and image decoding method and apparatus, and device
By dividing the image into layers based on the shape pattern during image encoding and decoding, generating prediction blocks and residual blocks, and performing deblocking filtering at the boundaries, the problem of blocking artifacts in high-resolution images is solved, thereby improving image quality and coding efficiency.
Patent Information
- Application Number
- CN202410949175.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-10-10
- Filing Date
- 2019-07-30
- Publication Date
- 2024-09-24
AI Technical Summary
Existing image encoding and decoding technologies struggle to effectively remove block artifacts when processing high-resolution or high-definition images, thus affecting image quality.
The image is hierarchically divided based on the current image's segmentation shape pattern, generating prediction blocks and residual blocks. Deblocking filtering is performed at the boundaries of the reconstructed blocks. In particular, when the prediction mode of the block is a combination of inter-frame and intra-frame prediction modes, the boundary filtering intensity value is determined to a predetermined value for deblocking filtering.
It effectively reduces block artifacts in images, improving image quality and coding efficiency.
Smart Images

Figure CN118694936A_ABST
Abstract
Description
[0001] This application is a divisional application of an invention patent application with an application date of July 30, 2019, application number 201980051090.8, and invention name “Method and device for image encoding and method and device for image decoding”. Technical Field
[0002] The method and apparatus according to the embodiment can encode or decode an image by using coding units, prediction units or transform units of various shapes included in the image. The method and apparatus according to the embodiment can encode or decode an image by generating a reconstructed block using a residual block and a prediction block and performing deblocking filtering on a boundary of the reconstructed block. Background Art
[0003] With the development and popularization of hardware capable of reproducing and storing high-resolution or high-definition image content, the demand for codecs that effectively encode or decode high-resolution or high-definition image content is increasing. The encoded image content can be reproduced by being decoded. Recently, methods for effectively compressing such high-resolution or high-definition image content have been implemented. For example, an effective image compression method is performed by processing the image to be encoded by an arbitrary method.
[0004] In order to compress an image, various data units may be used, and there may be an inclusion relationship between the data units. In order to determine the size of the data unit used for image compression, the data unit may be divided by using various methods, and the optimal data unit may be determined according to the characteristics of the image, so that encoding or decoding of the image may be performed. Summary of the invention
[0005] Technical solution to the problem
[0006] According to an embodiment of the present disclosure, an image decoding method includes: determining a plurality of blocks in a current image by hierarchically dividing a current image based on a division shape pattern of the current image; generating prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks; generating residual blocks of the plurality of blocks based on residual information about the plurality of blocks obtained from a bitstream; generating reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the residual blocks of the plurality of blocks; and reconstructing the current image by performing deblocking filtering on a boundary of at least one reconstructed block among the plurality of reconstructed blocks, wherein the step of reconstructing the current image by performing deblocking filtering on a boundary of at least one reconstructed block among the plurality of reconstructed blocks includes: when a prediction mode of at least one reconstructed block among blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-intra prediction mode, determining that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and performing deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength.
[0007] The step of performing deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength may include: when the size of the at least one reconstructed block is 4×N or N×4 (where N is an integer equal to or greater than 4), determining that the number of pixels whose pixel values in the at least one reconstructed block are changed in units of rows or columns during deblocking filtering at a vertical boundary corresponding to the size of 4×N or at a horizontal boundary corresponding to the size of N×4 is 1.
[0008] The predetermined value may be 1 or 2.
[0009] The predetermined value may be the same value as a value of the boundary filtering strength used when a prediction mode of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is an intra prediction mode.
[0010] The predetermined value may be the same value as a value of a boundary filtering strength used when a prediction mode of blocks located on both sides of a boundary of the at least one reconstructed block is an inter prediction mode.
[0011] When a prediction mode of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-intra prediction mode, determining that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and performing deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength may include:
[0012] When a size of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is equal to or larger than a predetermined size, and a prediction mode of the at least one block is a combined inter-intra prediction mode, a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is determined to be the predetermined value.
[0013] When a prediction mode of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-intra prediction mode, determining that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value and performing deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength may include:
[0014] When a size of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is equal to or smaller than a predetermined size, and a prediction mode of the at least one block is a combined inter-intra prediction mode, a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is determined to be the predetermined value.
[0015] The division shape mode may be a mode based on a division type, wherein the division type includes one of four divisions, two divisions, and three divisions.
[0016] An image decoding device according to an embodiment of the present disclosure includes at least one processor, wherein the at least one processor is configured to: determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of the current image, generate prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks, generate residual blocks of the plurality of blocks based on information about residuals of the plurality of blocks obtained from a bitstream, generate reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the residual blocks of the plurality of blocks, and reconstruct the current image by performing deblocking filtering on a boundary of at least one of the reconstructed blocks, wherein when the at least one processor reconstructs the current image by performing deblocking filtering on a boundary of the at least one reconstructed block, and a prediction mode of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-intra prediction mode, the at least one processor determines that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and performs deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength.
[0017] The predetermined value may be 1 or 2.
[0018] The predetermined value may be the same value as a value of the boundary filtering strength used when a prediction mode of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is an intra prediction mode.
[0019] The predetermined value may be the same value as a value of a boundary filtering strength used when a prediction mode of blocks located on both sides of a boundary of the at least one reconstructed block is an inter prediction mode.
[0020] When the at least one processor determines that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is the predetermined value, and when the prediction mode of at least one block among the blocks located on both sides of the boundary of the at least one reconstructed block is the combined inter-intra prediction mode, deblocking filtering is performed on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength,
[0021] When a size of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is equal to or greater than a predetermined size, and a prediction mode of the at least one block is a combined inter-intra prediction mode, the at least one processor may determine that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is the predetermined value.
[0022] When the at least one processor determines that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is the predetermined value, and when the prediction mode of at least one block among the blocks located on both sides of the boundary of the at least one reconstructed block is the combined inter-intra prediction mode, deblocking filtering is performed on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength,
[0023] When a size of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is equal to or smaller than a predetermined size, and a prediction mode of the at least one block is a combined inter-intra prediction mode, the at least one processor may determine that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is the predetermined value.
[0024] The image encoding method according to an embodiment of the present disclosure includes:
[0025] Determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of the current image; generate prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks; encode residual blocks of the plurality of blocks based on the prediction blocks of the plurality of blocks and original blocks;
[0026] generating a reconstructed block for the plurality of blocks by using the prediction blocks and the encoded residual blocks of the plurality of blocks; and performing deblocking filtering on a boundary of at least one reconstructed block among the reconstructed blocks,
[0027] Among them, the step of performing deblocking filtering on the boundary of the at least one reconstructed block includes: when the prediction mode of at least one block among the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-frame-intra-frame prediction mode, determining that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and performing deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength.
[0028] An image encoding device according to an embodiment of the present disclosure includes at least one processor, wherein the at least one processor is configured to: determine a plurality of blocks in a current image by hierarchically dividing the current image based on a division shape pattern of the current image, generate prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks, encode residual blocks of the plurality of blocks based on the prediction blocks of the plurality of blocks and original blocks, generate reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the encoded residual blocks, and perform deblocking filtering on a boundary of at least one reconstructed block among the reconstructed blocks,
[0029] Wherein, when the at least one processor performs deblocking filtering on the boundary of the at least one reconstructed block, when the prediction mode of at least one block among the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-frame-intra-frame prediction mode, the at least one processor determines that the value of the boundary filtering strength applied to the at least one reconstructed block is a predetermined value, and performs deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength.
[0030] The image decoding method according to an embodiment of the present disclosure includes:
[0031] Determine a plurality of blocks in a current image by hierarchically dividing the current image based on available division shape patterns of the plurality of blocks in the current image; generate prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks; generate residual blocks of the plurality of blocks based on information about residuals of the plurality of blocks obtained from a bitstream; generate reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the residual blocks of the plurality of blocks; and reconstruct the current image by performing deblocking filtering on a boundary of at least one of the reconstructed blocks based on a size or shape of at least one of the plurality of blocks determined by the available division shape patterns of the plurality of blocks in the current image.
[0032] According to an embodiment of the present disclosure, an image encoding method includes: determining a plurality of blocks in a current image by hierarchically dividing the current image based on an available division shape pattern of the plurality of blocks in the current image; generating prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks; encoding residual blocks of the plurality of blocks based on the prediction blocks of the plurality of blocks and original blocks; generating reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the encoded residual blocks; and performing deblocking filtering on a boundary of at least one reconstructed block in the reconstructed blocks based on a size or shape of at least one block in the plurality of blocks determined according to the available division shape pattern of the plurality of blocks in the current image.
[0033] A computer program for executing the 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
[0034] Figure 1a is a block diagram of an image decoding apparatus according to various embodiments.
[0035] Figure 1b is a flowchart of an image decoding method according to various embodiments.
[0036] Figure 1c is a flowchart of an image decoding method according to various embodiments.
[0037] Figure 1d is a block diagram of an image decoder according to various embodiments.
[0038] Figure 2a is a block diagram of an image encoding apparatus according to various embodiments.
[0039] Figure 2b is a flowchart of an image encoding method according to various embodiments.
[0040] Figure 2c is a flowchart of an image encoding method according to various embodiments.
[0041] Figure 2d is a block diagram of an image encoder according to various embodiments.
[0042] Figure 3 A process in which the image decoding apparatus according to an embodiment determines at least one coding unit by splitting a current coding unit is illustrated.
[0043] Figure 4 A process in which the image decoding apparatus according to an embodiment determines at least one coding unit by splitting a non-square coding unit is illustrated.
[0044] Figure 5A process in which the image decoding apparatus according to an embodiment divides a coding unit based on at least one of block shape information and information about a division shape mode is illustrated.
[0045] Figure 6 A method in which the image decoding apparatus according to an embodiment determines a specific coding unit from among odd-numbered coding units is illustrated.
[0046] 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.
[0047] Figure 8 A process in which an image decoding apparatus determines that a current coding unit is to be split into an odd number of coding units when coding units may not be processed in a specific order according to an embodiment is illustrated.
[0048] Fig. 9 A process in which the image decoding apparatus according to an embodiment determines at least one coding unit by splitting a first coding unit is illustrated.
[0049] 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 satisfies a specific condition, shapes into which the second coding unit may be split by the image decoding apparatus are limited.
[0050] Fig.11 A process of splitting a square coding unit by an image decoding apparatus when information about a division shape pattern indicates that the square coding unit is not to be split into four square coding units according to an embodiment is illustrated.
[0051] Fig.12 It is shown that a processing order among a plurality of coding units according to an embodiment may vary according to a process of dividing the coding units.
[0052] Fig.13 A process of determining a depth of a coding unit as a shape and a size of the coding unit change when the coding unit is recursively split to determine a plurality of coding units according to an embodiment is illustrated.
[0053] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0054] Fig.15 It is illustrated that a plurality of coding units are determined based on a plurality of specific data units included in a picture according to an embodiment.
[0055] Fig.16A processing block serving as a unit for determining an order of reference coding units included in a picture according to an embodiment is illustrated.
[0056] Figures 17a to 17d is a diagram for describing a process of performing deblocking filtering on a boundary of a reconstructed block according to various embodiments.
[0057] Fig.18 is a diagram for describing a process of limiting a division shape pattern of a block indicating three division types in consideration of a size of a unit for deblocking filtering.
[0058] Fig.19a and Fig.19b is a diagram for describing a process of limiting a division shape pattern of a two-division type block in consideration of a size of a unit for deblocking filtering.
[0059] Fig.20a and Fig.20b is a diagram for describing a process of determining the number of pixels whose pixel values are changed by deblocking filtering at a block boundary in consideration of a size of a block according to various embodiments.
[0060] Fig.21a and Figure 21b is a diagram for describing a process of determining the number of pixels whose pixel values are changed by deblocking filtering at a block boundary in consideration of sizes of blocks on both sides of a block boundary according to various embodiments.
[0061] Fig. 22 is a diagram for describing a process of determining the number of pixels whose pixel values are changed or the number of reference pixels in consideration of sizes of blocks on both sides of a block boundary according to various embodiments.
[0062] Fig.23a and Figure 23b is a diagram for describing a process in which an image decoding apparatus performs deblocking filtering on a boundary of a block of a transform unit according to various embodiments.
[0063] Fig.24a and Figure 24b 2 is a diagram for describing a process in which the image decoding apparatus 100 performs deblocking filtering on a block having a triangular partition shape according to various embodiments.
[0064] Fig.25 is a diagram for describing a process in which the image decoding apparatus 100 performs bidirectional inter prediction on a block having triangular partitions according to an embodiment.
[0065] Fig.26 : is a table showing the value of the boundary filter strength Bs and the conditions for determining the boundary filter strength Bs according to the embodiment.
[0066] Best Mode
[0067] According to an embodiment of the present disclosure, an image decoding method includes: determining a plurality of blocks in a current image by hierarchically dividing a current image based on a division shape pattern of the current image; generating prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks; generating residual blocks of the plurality of blocks based on residual information about the plurality of blocks obtained from a bitstream; generating reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the residual blocks of the plurality of blocks; and reconstructing the current image by performing deblocking filtering on a boundary of at least one reconstructed block among the plurality of reconstructed blocks, wherein the step of reconstructing the current image by performing deblocking filtering on a boundary of at least one reconstructed block among the plurality of reconstructed blocks includes: when a prediction mode of at least one reconstructed block among blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-intra prediction mode, determining that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and performing deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength.
[0068] An image decoding device according to an embodiment of the present disclosure includes at least one processor, wherein the at least one processor is configured to: determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of the current image, generate prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks, generate residual blocks of the plurality of blocks based on information about residuals of the plurality of blocks obtained from a bitstream, generate reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the residual blocks of the plurality of blocks, and reconstruct the current image by performing deblocking filtering on a boundary of at least one reconstructed block among the reconstructed blocks, wherein when the at least one processor reconstructs the current image by performing deblocking filtering on a boundary of the at least one reconstructed block, and a prediction mode of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-intra prediction mode, the at least one processor determines that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and performs deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength.
[0069] The image encoding method according to an embodiment of the present disclosure includes:
[0070] Determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of the current image; generate prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks; encode residual blocks of the plurality of blocks based on the prediction blocks of the plurality of blocks and original blocks;
[0071] generating a reconstructed block for the plurality of blocks by using the prediction blocks and the encoded residual blocks of the plurality of blocks; and performing deblocking filtering on a boundary of at least one reconstructed block among the reconstructed blocks,
[0072] Among them, the step of performing deblocking filtering on the boundary of the at least one reconstructed block includes: when the prediction mode of at least one block among the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-frame-intra-frame prediction mode, determining that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and performing deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength.
[0073] An image encoding device according to an embodiment of the present disclosure includes at least one processor, wherein the at least one processor is configured to: determine a plurality of blocks in a current image by hierarchically dividing the current image based on a division shape pattern of the current image, generate prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks, encode residual blocks of the plurality of blocks based on the prediction blocks of the plurality of blocks and original blocks, generate reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the encoded residual blocks, and perform deblocking filtering on a boundary of at least one reconstructed block among the reconstructed blocks,
[0074] Wherein, when the at least one processor performs deblocking filtering on the boundary of the at least one reconstructed block, when the prediction mode of at least one block among the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-frame-intra-frame prediction mode, the at least one processor determines that the value of the boundary filtering strength applied to the at least one reconstructed block is a predetermined value, and performs deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength.
[0075] The image decoding method according to an embodiment of the present disclosure includes:
[0076] Determine a plurality of blocks in a current image by hierarchically dividing the current image based on available division shape patterns of the plurality of blocks in the current image; generate prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks; generate residual blocks of the plurality of blocks based on information about residuals of the plurality of blocks obtained from a bitstream; generate reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the residual blocks of the plurality of blocks; and reconstruct the current image by performing deblocking filtering on a boundary of at least one of the reconstructed blocks based on a size or shape of at least one of the plurality of blocks determined by the available division shape patterns of the plurality of blocks in the current image.
[0077] According to an embodiment of the present disclosure, an image encoding method includes: determining a plurality of blocks in a current image by hierarchically dividing the current image based on an available division shape pattern of the plurality of blocks in the current image; generating prediction blocks of the plurality of blocks by performing prediction on the plurality of blocks; encoding residual blocks of the plurality of blocks based on the prediction blocks of the plurality of blocks and original blocks; generating reconstructed blocks for the plurality of blocks by using the prediction blocks of the plurality of blocks and the encoded residual blocks; and performing deblocking filtering on a boundary of at least one reconstructed block in the reconstructed blocks based on a size or shape of at least one block in the plurality of blocks determined according to the available division shape pattern of the plurality of blocks in the current image.
[0078] A computer program for executing the image decoding method according to an embodiment of the present disclosure may be recorded on a computer-readable recording medium. DETAILED DESCRIPTION
[0079] By referring to the embodiments described below in conjunction with the accompanying drawings, the advantages and features of the disclosed embodiments and the methods for achieving these advantages and features will be apparent. However, the present disclosure is not limited to these embodiments, but can be implemented in many different forms, and the present embodiments are provided to complete the present disclosure and enable those of ordinary skill in the art to understand the scope of the present disclosure.
[0080] Terms used in this specification will be briefly described, and the disclosed embodiments will be described in detail.
[0081] Although widely used general terms are selected as terms used in the present disclosure when considering the functions in the present disclosure, they may change according to the intention of ordinary technicians in the field, judicial precedents, the emergence of new technologies, etc. Terms arbitrarily selected by the applicant of the present disclosure may also be used in specific cases. In this case, their meanings will be described in detail in the detailed description of the present disclosure. Therefore, the terms must be defined based on the meaning of the terms and the content of the entire specification, rather than being defined only by stating the terms themselves.
[0082] It is to be understood that the singular forms "a," "an," and "the" include plural referents unless the context clearly dictates otherwise.
[0083] It should be understood that when a specific component “includes” a specific component, the component does not exclude additional components but may further include additional components unless the context clearly indicates otherwise.
[0084] As used herein, the term "part" or "unit" refers to a software or hardware component that performs a specific function. However, the term "part" or "unit" is not limited to software or hardware. A "part" or "unit" may be configured in an addressable storage medium, or may be configured to run on at least one processor. Therefore, as an example, a "part" or "unit" includes components, processes, functions, attributes, procedures, subroutines, program code fragments, drivers, firmware, microcodes, circuits, data, databases, data structures, tables, arrays, and variables such as software components, object-oriented software components, class components, and task components. The functions provided in components and "parts" or "units" may be combined into components and "parts" or "units" of a smaller number, or may be subdivided into additional components and "parts" or "units".
[0085] In an embodiment of the present disclosure, a "part" or "unit" may be implemented as a processor and a memory. The term "processor" should be interpreted in a broad sense 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, etc. In some embodiments, a "processor" may indicate an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), etc. The term "processor" may indicate a combination of processing devices, such as, for example, a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors coupled to a DSP core, or a combination of any other similar components.
[0086] 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 can read information from and / or write information to a memory, the memory may be considered to be in electronic communication with the processor. Memory that is integrated into a processor is in electronic communication with the processor.
[0087] Hereinafter, an “image” may mean a static image (such as a still image of a video) or a moving image (ie, a dynamic image such as a video itself).
[0088] Hereinafter, a "sample" which is data of a sampling position assigned to an image means data to be processed. For example, a pixel value in an image of a spatial region and a transform coefficient on a transform region may be a sample. A unit including at least one of such samples may be defined as a block.
[0089] Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings so that a person skilled in the art can easily implement the present disclosure. In addition, in the accompanying drawings, parts irrelevant to the description will be omitted for simplicity of description.
[0090] Will refer to Figures 1a to 26 The image encoding apparatus and the image decoding apparatus as well as the image encoding method and the image decoding method according to various embodiments are described in detail. Figures 3 to 16 Methods for determining data units of an image according to various embodiments are described and reference will be made to Figure 1a to Figure 1d , Figure 2a to Figure 2d as well as Figures 17a to 26 An image encoding device, an image decoding device, an image encoding method, and an image decoding method for performing deblocking filtering on a boundary of a reconstructed block of a data unit (e.g., a coding unit, a prediction unit, or a transform unit) determined in any of various shapes according to various embodiments are described.
[0091] In the following, reference will be made to Figures 1a to 2d An encoding / decoding method and apparatus for encoding or decoding an image based on data units (eg, coding units, prediction units, or transform units) of various shapes according to an embodiment are described in detail.
[0092] Figure 1a is a block diagram of an image decoding apparatus according to various embodiments.
[0093] The image decoding apparatus 100 according to various embodiments may include a deblocking filtering unit 105 and an image decoder 110. The deblocking filtering unit 105 and the image decoder 110 may include at least one processor. In addition, the deblocking filtering unit 105 and the image decoder 110 may include a memory storing instructions to be executed by at least one processor. The image decoder 110 may be implemented as hardware separate from the deblocking filtering unit 105, or may include the deblocking filtering unit 105.
[0094] The image decoder 110 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of the current image. That is, the image decoder 110 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of blocks in the current image. In this case, each block may be a coding unit. However, the present disclosure is not limited thereto, and the block may be a transform unit or a prediction unit. The division shape pattern may be a pattern based on at least one of a division direction and a division type. The division type may indicate at least one of two divisions, three divisions, and four divisions.
[0095] The image decoder 110 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on the available division shape modes of the blocks in the current image. The image decoder 110 may determine at least one second block based on one of the division shape modes available for the first block in the current image. For example, when the division shape mode indicates that the first block is not divided, the second block may be the same as the first block. When the division shape mode indicates that the first block is divided into a plurality of blocks, a plurality of second blocks may be determined from the first block. In this case, the available division shape mode may be a division shape mode limited by considering deblocking filtering among all the division shape modes.
[0096] The image decoder 110 may generate a prediction block of the block by performing prediction on the block. For example, the image decoder 110 may generate a prediction block of the at least one block by performing inter-frame prediction on the at least one block. The image decoder 110 may generate a prediction block of the at least one block by performing intra-frame prediction on the at least one block. The image decoder 110 may generate a prediction block of the at least one block by performing prediction based on a combined inter-frame-intra-frame prediction mode on the at least one block. For example, the combined inter-frame-intra-frame prediction mode may be a mode obtained by combining intra-frame prediction with inter-frame prediction (based on a merge index). That is, the sample value of the prediction block generated based on the combined inter-frame-intra-frame prediction mode may be determined according to a weighted sum of a first sample value of the prediction block generated based on the intra-frame prediction and a second sample value of the prediction block generated based on the inter-frame prediction (based on the merge index).
[0097] The image decoder 110 may generate a prediction block of at least one block by performing prediction on a partition of at least one block. In this case, the partition may be a plurality of units generated by dividing a block into various shapes, and may have any one of various shapes, such as a triangular shape or a quadrilateral shape.
[0098] The image decoder 110 may generate a residual block of a block based on information about a residual obtained from a bitstream.
[0099] The image decoder 110 may generate a reconstructed block for the block by using the prediction block of the block and the residual block of the block. The image decoder 110 may generate a reconstructed block of at least one block by adding the values of the samples of the prediction block to the values of the samples of the residual block of at least one block.
[0100] The deblocking filtering unit 105 may reconstruct the current image by performing deblocking filtering on a boundary of at least one reconstructed block in the reconstructed blocks. The boundary of the at least one reconstructed block is a boundary that divides two adjacent reconstructed blocks including the at least one reconstructed block, and the two adjacent reconstructed blocks may be divided vertically or horizontally by the boundary.
[0101] When the prediction mode of at least one reconstructed block in the reconstructed blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-frame-intra-frame prediction mode, the deblocking filtering unit 105 may determine that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value.
[0102] The deblocking filter unit 105 may perform deblocking filtering on the boundary of the at least one reconstructed block based on the determined value of the boundary filtering strength. The value of the boundary filtering strength may be calculated in units of four rows or four columns at the boundary, but is not limited thereto, and may be determined as one of 0, 1, and 2, but is not limited thereto.
[0103] That is, when filtering is performed on the vertical boundary of the reconstructed block in each 8×8 unit, the value of the boundary filter strength may be determined in units of four rows. When filtering is performed on the vertical boundary and the block located on the left side of the vertical boundary (when the value of the boundary filter strength is calculated in units of four rows or four columns, the block may be, but is not limited to, a block of size 4×4) is a P block and the block located on the right side of the vertical boundary is a Q block, the value of the boundary filter strength may be determined in units of four rows or four columns. Fig.26 The value of determining the boundary filter strength is shown in .
[0104] Fig.26 : is a table showing the value of the boundary filter strength Bs and the conditions for determining the boundary filter strength Bs according to the embodiment.
[0105] In detail, when a P block or a Q block (i.e., at least one of the P block and the Q block) is encoded in an intra prediction mode, the value of the boundary filtering strength may be determined to be 2. That is, deblocking filtering may be performed by using a larger boundary filtering value at a boundary of a block encoded in an intra prediction mode.
[0106] When the P block and the Q block are encoded in the inter-frame prediction mode, the value of the boundary filter strength may be determined to be 0 or 1. When discontinuity of pixel values does not occur in the P block and the Q block, the value of the boundary filter strength may be determined to be 0, and specifically, otherwise, the value of the boundary filter strength may be determined to be 1. The case where discontinuity of pixel values does not occur in the P block and the Q block may include the following cases: the case where both the P block and the Q block are encoded in the inter-frame prediction mode; and the case where there are no non-zero transform coefficients in both the P block and the Q block and the two blocks perform motion compensation at the same integer position. Therefore, the case where discontinuity occurs can be divided into the following multiple conditions, otherwise, it can be determined that discontinuity occurs.
[0107] Therefore, when a P block and a Q block are encoded in an inter prediction mode and a non-zero transform coefficient value exists in the P block or the Q block, the value of the boundary filtering strength may be determined to be 1.
[0108] When a P block and a Q block are encoded in an inter prediction mode and a non-zero transform coefficient value exists in the P block or the Q block, the value of the boundary filtering strength may be determined to be 1.
[0109] When the P block and the Q block are encoded in the inter prediction mode and there are no non-zero transform coefficients in the P block and the Q block, but the P block and the Q block have different motion vectors of integer units, the value of the boundary filtering strength may be determined to be 1.
[0110] When P blocks and Q blocks are encoded in inter-frame prediction mode, there are no non-zero transform coefficient values in the P blocks and Q blocks, and the P blocks and Q blocks have the same motion vector in integer units, but the P blocks and Q blocks perform motion compensation in different pictures or have different numbers of motion vectors, the value of the boundary filtering strength can be determined to be 1.
[0111] In other cases, that is, when a P block and a Q block are encoded in an inter prediction mode and discontinuity does not occur in pixel values of the P block or the Q block, the value of the boundary filtering strength may be determined to be 0.
[0112] When the value of the boundary filtering strength is greater than 0, the deblocking filtering unit 105 may perform deblocking filtering. However, the deblocking filtering unit 105 does not always perform filtering only because the value is greater than 0, and may re-determine whether to apply filtering by comparing a d value (which may refer to an amount of change in pixel values in two regions based on a boundary) determined based on pixel values in a block (e.g., based on pixel values located in the first and fourth columns in the case of a horizontal boundary, and based on pixel values located in the first and fourth rows in the case of a vertical boundary) with a β value determined based on quantization parameters of the P block and the Q block. The d value and the β value may be the same as the d value and the β value related to deblocking filtering defined in the High Efficiency Video Coding (HEVC) standard.
[0113] The deblocking filter unit 105 may determine whether to apply strong filtering or weak filtering to the boundary of the block. For example, in the case of a vertical boundary, the deblocking filter unit 105 may determine the strength of the filtering by using the pixel values of the first and fourth rows, the β value, and the tc value determined based on the value of the boundary filtering strength. That is, the deblocking filter unit 105 may determine whether the amount of change in the pixel values in the P block and the Q block is small but discontinuity occurs at the boundary by using the pixel values of the first and fourth rows, the β value, and the tc value, and may determine the strength of the filtering based on the determination result. The tc value determined based on the value of the boundary filtering strength may be the same as the tc value related to the deblocking filter defined in the HEVC standard.
[0114] In the case of a vertical boundary, the deblocking filtering unit 105 may perform deblocking filtering in units of rows. When the deblocking filtering unit 105 performs strong filtering on a vertical boundary, the deblocking filtering unit 105 may perform filtering in units of 3 pixels of a P block and 3 pixels of a Q block adjacent to the boundary of each row based on the pixel value of each row and the tc value. The pixels whose pixel values are changed by performing strong filtering may be 3 pixels of a P block and 3 pixels of a Q block adjacent to the boundary of each row, and the pixels referenced to perform strong filtering may be 4 pixels of a P block and 4 pixels of a Q block adjacent to the boundary of each row. That is, the number of pixels referenced to perform filtering and the number of pixels whose pixel values are changed may be different from each other, and preferably, the number of pixels referenced to perform filtering may be equal to or greater than the number of pixels whose pixel values are changed. Specifically, the pixel values in the P block may be changed by performing filtering with reference to the pixel values in the P block and the pixel values in the Q block, and the pixel values in the Q block may be changed by performing filtering with reference to the pixel values in the P block and the pixel values in the Q block.
[0115] When the deblocking filter unit 105 performs weak filtering on the vertical boundary, the deblocking filter unit 105 may perform filtering in units of 2 pixels of the P block and 2 pixels of the Q block adjacent to the boundary of each row based on the tc value. The pixels whose pixel values are changed by performing filtering may be 2 pixels of the P block and 2 pixels of the Q block adjacent to the boundary of each row, and the pixels referenced to perform filtering may be 4 pixels of the P block and 4 pixels of the Q block adjacent to the boundary of each row. That is, the number of pixels referenced to perform filtering and the number of pixels whose pixel values are changed may be different from each other, and preferably, the number of pixels referenced to perform filtering may be equal to or greater than the number of pixels whose pixel values are changed. The term "reference pixel" refers to a pixel used to determine a condition for determining whether to perform filtering on a pixel or to change a pixel value by performing filtering.
[0116] Therefore, when filtering (including strong filtering and weak filtering) is performed on the boundary of the reconstructed block in each 8×8 unit, the deblocking filtering unit 105 may refer to up to 4 pixels on either side of the boundary, and the values of up to 3 pixels on either side of the boundary may be changed.
[0117] However, it will be easily understood by those of ordinary skill in the art that the number of reference pixels and the number of pixels whose pixel values are changed are not limited thereto and may be any of various numbers.
[0118] The deblocking filtering unit 105 may determine that the value of the boundary filtering strength is a predetermined value of 1 or 2 when the prediction mode of one of the blocks located on both sides of the boundary of the at least one reconstructed block is the combined inter-intra prediction mode.
[0119] The predetermined value may be the same value as a value of the boundary filtering strength used when a prediction mode of one of blocks located on both sides of a boundary of the at least one reconstructed block is an intra prediction mode.
[0120] For example, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the intra-frame prediction mode can be 2, and therefore the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the combined inter-frame-intra-frame prediction mode can also be 2.
[0121] However, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the intra-frame prediction mode may be a value other than 2, and in this case, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the combined inter-frame-intra-frame prediction mode may be correspondingly determined to be a value other than 2.
[0122] The predetermined value may be the same value as the value of the boundary filter strength used when the prediction modes of the blocks located on both sides of the boundary of the at least one reconstructed block are both inter-frame prediction modes. For example, the value of the boundary filter strength used when the prediction mode of the blocks located on both sides of the boundary of the at least one reconstructed block is the inter-frame prediction mode may be 0 or 1, and therefore the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of the at least one reconstructed block is the combined inter-frame-intra-frame prediction mode may also be 0 or 1.
[0123] However, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the intra-frame prediction mode may be a value other than 0 or 1, and in this case, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the combined inter-frame-intra-frame prediction mode may also be determined to be a value other than 0 or 1 accordingly.
[0124] When a size of at least one of the blocks located on both sides of a boundary of at least one reconstructed block is equal to or greater than a predetermined size and a prediction mode of the at least one block is a combined inter-intra prediction mode, the deblocking filtering unit 105 may determine that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value (e.g., 1 or 2).
[0125] Optionally, when the size of at least one of the blocks located on both sides of the boundary of at least one reconstructed block is equal to or smaller than a predetermined size and the prediction mode of the at least one block is a combined inter-frame-intra-frame prediction mode, the deblocking filtering unit 105 may determine that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value (e.g., 1 or 2).
[0126] The deblocking filtering unit 105 may perform deblocking filtering based on a unit of a predetermined size. When a boundary of at least one reconstructed block is located at a boundary of the unit of the predetermined size, the deblocking filtering unit 105 may perform deblocking filtering on the boundary of the at least one reconstructed block. For example, the predetermined size may be N×N (N may be an integer or a power of 2, and in this case, n may be an integer), and may be 4×4 or 8×8.
[0127] The image decoder 110 may limit the available division shape mode of the first block according to the size or shape of the plurality of blocks divided from the first block based on the available division shape mode of the first block, and may determine the plurality of blocks based on the limited division shape mode. The deblocking filter unit 105 may perform deblocking filtering on the boundary of the reconstructed block of at least one of the plurality of blocks based on a unit of a predetermined size. That is, when the height or width of one of the plurality of blocks divided from the first block based on the available division shape mode of the first block is not a multiple of the height or width indicated by the predetermined size but a multiple of a smaller height or width, the division shape mode may be limited.
[0128] For example, when the predetermined size is 8×8, the height or width indicated by the predetermined size may be 8, and the division shape pattern of the first block having a size of 16×16 is a pattern based on three divisions, the size of one block among the plurality of blocks divided from the first block may be 8×4. In this case, since one of the height and the width is 4 (which is not a multiple of 8 and is a multiple of a value smaller than 8), the pattern based on three divisions for the first block may be limited.
[0129] Alternatively, for example, when the height or width indicated by the predetermined size is 8 and the division shape pattern of the first block of size 8×16 or 8×8 is a two-division based pattern, the sizes of the plurality of blocks divided from the first block may be 4×16 or 4×8.
[0130] In this case, since one of the height and the width is 4, which is not a multiple of 8 and is a multiple of a value smaller than 8, the mode based on two divisions for the first block may be limited.
[0131] Therefore, in this case, when the deblocking filtering unit 105 performs deblocking filtering based on 8×8 as a predetermined size, the deblocking filtering unit 105 may perform deblocking filtering on the boundary of at least one block among the divided blocks whose height and width are not multiples of 4 but multiples of 8.
[0132] When the deblocking filtering unit 105 performs deblocking filtering in units of rows or columns based on units of a predetermined size, the deblocking filtering unit 105 may determine the number of pixels to which deblocking filtering is applied (i.e., the number of pixels whose pixel values are changed by deblocking filtering) and the number of pixels referenced for deblocking filtering based on the sizes of two blocks located on both sides of the boundary of the block to which deblocking filtering is applied.
[0133] When the deblocking filtering unit 105 performs deblocking filtering in units of rows or columns based on a unit of size 4×4, and the height or width of one of the two blocks located on both sides of the boundary of the block to which the deblocking filtering is applied is 4, the deblocking filtering unit 105 may determine that the number of pixels to which the deblocking filtering is applied in each of the two blocks located on both sides is equal to or less than 2 (including 0), and the maximum number of pixels referenced for deblocking filtering in each of the two blocks located on both sides is equal to or less than 3 (for example, 2 or 1). For example, when the size of at least one of the blocks located on both sides of the boundary of the block to which the deblocking filtering is applied in units of rows or columns at the vertical block boundary or the horizontal block boundary is 4×N or N×4 (where N is an integer equal to or greater than 4), the deblocking filtering unit 105 may determine that the number of pixels to which the deblocking filtering is applied in each of the two blocks located on both sides is 1, and the maximum number of pixels referenced for deblocking filtering in each of the two blocks located on both sides is 3.
[0134] When the deblocking filtering unit 105 performs deblocking filtering in units of rows or columns based on a unit of size 4×4, and the height or width of one block (the first block) of the two blocks located on both sides of the boundary of the block to which deblocking filtering is applied is 4 and the height or width of the other block (the second block) is 8, the deblocking filtering unit 105 can determine that the maximum number of pixels referenced for deblocking filtering located in the first block is 2, the number of pixels applied to deblocking filtering located in the first block is 1, the maximum number of pixels referenced for deblocking filtering located in the second block is 4, and the number of pixels applied to deblocking filtering located in the second block is 3.
[0135] Optionally, the deblocking filtering unit 105 may determine that the maximum number of pixels located in the first block that are referenced for deblocking filtering is 2 and the number of pixels to which deblocking filtering is applied is 1, and may determine that the maximum number of pixels located in the second block that are referenced for deblocking filtering is 2 and the number of pixels to which deblocking filtering is applied is 0.
[0136] The deblocking filtering unit 105 may perform deblocking filtering at the boundary of the reconstructed block regardless of the unit of the predetermined size. That is, even when the boundary of the unit of the predetermined size does not match the boundary of the reconstructed block, the deblocking filtering unit 105 may perform deblocking filtering at the boundary of the reconstructed block. The reconstructed block may be one of a coding unit, a transform unit, and a prediction unit.
[0137] When residual information is not included in blocks located at both sides of the boundary of the reconstructed block, the deblocking filtering unit 105 may determine whether to perform deblocking filtering by using information about both blocks.
[0138] For example, when motion vectors of blocks on both sides of a boundary portion of the reconstructed block are different from each other, the deblocking filtering unit 105 may determine to perform deblocking filtering.
[0139] When the mode of at least one of the blocks located on both sides of the boundary of the reconstructed block is a specific mode, the deblocking filtering unit 105 may determine to perform deblocking filtering. In this case, the specific mode may be a motion compensation mode or a sub-block prediction mode based on an affine model. The motion compensation mode based on an affine model refers to a mode in which motion compensation is performed by using a motion model based on one of various affine motion models (such as a 4-parameter affine motion model or a 6-parameter affine motion model for motion compensation). When the intra-frame prediction modes of the blocks located on both sides of the boundary of the reconstructed block are different from each other, the deblocking filtering unit 105 may determine to perform deblocking filtering. When the illumination compensation parameters of the blocks located on both sides of the boundary of the reconstructed block are different from each other, the deblocking filtering unit 105 may determine to perform deblocking filtering. The sub-block prediction mode may refer to a mode in which prediction is performed based on a sub-block. The sub-block prediction mode may include a temporal merge mode based on a sub-block or a motion compensation mode based on an affine model.
[0140] When prediction modes of blocks located on both sides of a boundary of a reconstructed block are different from each other, the deblocking filtering unit 105 may determine to perform deblocking filtering.
[0141] For example, when the prediction modes of blocks located on both sides of the boundary of the reconstructed block are intra mode and inter mode, combined inter-intra prediction mode and inter mode, or combined inter-intra prediction mode and intra mode, the deblocking filtering unit 105 may determine to perform deblocking filtering.
[0142] When one of the blocks located on both sides of the boundary of the reconstructed block has a triangular partition shape, the deblocking filtering unit 105 may determine whether to perform deblocking filtering by considering the residuals of the two blocks. The deblocking filtering unit 105 may determine whether to perform deblocking filtering by considering the sizes of the height and width of the two blocks and the maximum and minimum values of the two values.
[0143] When blocks located on both sides have triangular partition shapes and a height or width of at least one of the two blocks is equal to or greater than or equal to or less than a specific size, the deblocking filtering unit 105 may perform deblocking filtering on a boundary between the triangular partitions.
[0144] When the block has a triangular partition shape, the image decoder 110 may perform bidirectional inter-frame prediction on the triangular partition. In this case, the image decoder 110 may variously determine the weights of the reference triangular partitions included in the two reference blocks in the two directions. For example, the weight of the first reference triangular partition of the first reference block may be 0, the weight of the second reference triangular partition of the first reference block may be 1, the weight of the first reference triangular partition of the second reference block may be 1, and the weight of the second reference triangular partition of the second reference block may be 0. Alternatively, the weight of the first reference triangular partition of the first reference block may be 1 / 4, the weight of the second reference triangular partition of the first reference block may be 3 / 4, the weight of the first reference triangular partition of the second reference block may be 3 / 4, and the weight of the second reference triangular partition of the second reference block may be 1 / 4. The weight of each reference triangular partition may be, but is not limited to, a predetermined value, and the image decoder 110 may obtain the weight of each reference triangular partition from the information about the weight included in the bitstream. In this case, the weight of the triangular partition may be determined as one of the one or more weight candidates. In this case, index information indicating one of the one or more weight candidates may be obtained from the bitstream. The weight candidate may be determined for each block, but the present disclosure is not limited thereto. The weight candidates may be determined for each reference block or for each reference triangle partition.
[0145] However, the block is not limited to having a triangular partition shape, and may have a partition mask shape including partitions having various shapes such as a quadrilateral shape. In this case, the shape of the partition mask of the block may be determined as one of one or more partition mask shape candidates. In this case, index information indicating one of the one or more mask shape candidates may be obtained from the bitstream.
[0146] Figure 1b is a flowchart of an image decoding method according to various embodiments.
[0147] In operation S105, the image decoding apparatus 100 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of the current image.
[0148] In operation S110, the image decoding apparatus 100 may generate a predicted block of a block by performing prediction on the block.
[0149] In operation S115, the image decoding apparatus 100 may generate a residual block of the block based on the information about the residual obtained from the bitstream.
[0150] In operation S120, the image decoding apparatus 100 may generate a reconstructed block with respect to the block by using a prediction block of the block and a residual block of the block.
[0151] In operation S125, the image decoding apparatus 100 may reconstruct the current image by performing deblocking filtering on a boundary of at least one block in the reconstructed block. In this case, when the prediction mode of the at least one reconstructed block in the blocks located on both sides of the boundary of the at least one reconstructed block is the combined inter-intra prediction mode, the image decoding apparatus 100 may determine that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and may perform deblocking filtering on the boundary of the at least one reconstructed block based on the value of the boundary filtering strength.
[0152] Figure 1c is a flowchart of an image decoding method according to various embodiments.
[0153] In operation S155, the image decoding apparatus 100 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on available division shape patterns of the blocks in the current image.
[0154] In operation S160, the image decoding apparatus 100 may generate a predicted block of the block by performing prediction on the plurality of blocks.
[0155] In operation S165, the image decoding apparatus 100 may generate a residual block of the block based on the information about the residual obtained from the bitstream.
[0156] In operation S170, the image decoding apparatus 100 may generate a reconstructed block with respect to the block by using a prediction block of the block and a residual block of the block.
[0157] In operation S175, the image decoding apparatus 100 may perform deblocking filtering on a boundary of at least one block in the reconstructed block according to a size or shape of at least one block among the plurality of blocks determined based on an available division shape mode of the blocks in the current image.
[0158] For example, the image decoding apparatus 100 may generate a plurality of blocks divided from the current block based on one of the available division shape modes of the current block, and when one of the height and width of one of the plurality of blocks is not a multiple of the height or width indicated by the predetermined size, the image decoding apparatus 100 may not allow the available division shape mode, and may determine a plurality of blocks from the current block based on another available division shape mode. The image decoding apparatus 100 may perform deblocking filtering on a boundary of at least one reconstructed block of the plurality of blocks determined based on the restricted division shape mode, based on a unit of a predetermined size.
[0159] Optionally, when at least one reconstructed block among the reconstructed blocks of multiple blocks determined based on the available partition shape pattern has a triangular partition shape, the image decoding device 100 may perform deblocking filtering on a boundary of the at least one reconstructed block or the boundary based on the height or width of the at least one reconstructed block or based on residual information on both sides of the boundary between the triangular partitions.
[0160] Figure 1d is a block diagram of an image decoder 6000 according to various embodiments.
[0161] The image decoder 6000 according to various embodiments performs a task performed by the image decoder 110 of the image decoding apparatus 100 to encode image data.
[0162] Reference Figure 1d , the entropy decoder 6150 parses the encoding information required for decoding and the encoded image data to be decoded 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.
[0163] The intra predictor 6400 performs intra prediction for each block. The inter predictor 6350 performs inter prediction for each block by using a reference image obtained from the reconstructed picture buffer 6300. The prediction data for each block generated by the intra predictor 6400 or the inter predictor 6350 may be added to the residual data to reconstruct the data of the spatial domain of the block of the current image included in the bitstream 6050, and the deblocker 6450 and the sample adaptive offset (SAO) performer 6500 may output the filtered reconstructed image 6600 by performing loop filtering on the reconstructed data in the spatial domain. In addition, the reconstructed image stored in the reconstructed picture buffer 6300 may be output as a reference image. The deblocking filtering unit 105 may include the deblocker 6450 of the decoder 6000.
[0164] In order for the image decoding apparatus 100 to decode image data, the tasks of the image decoder 6000 according to various embodiments may be performed according to blocks.
[0165] Figure 2a is a block diagram of an image encoding apparatus according to various embodiments.
[0166] The image encoding apparatus 200 according to various embodiments may include a deblocking filtering unit 205 and an image encoder 210 .
[0167] The deblocking filter unit 205 and the image encoder 210 may include at least one processor. In addition, the deblocking filter unit 205 and the image encoder 210 may include a memory storing instructions to be executed by at least one processor. The image encoder 210 may be implemented as hardware separate from the deblocking filter unit 205, or may include the deblocking filter unit 205.
[0168] The image encoder 210 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of the current image. That is, the image encoder 210 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on a division shape pattern of blocks in the current image. In this case, each block may be a coding unit. However, the present disclosure is not limited thereto, and the block may be a transform unit or a prediction unit. The division shape pattern may be a pattern based on at least one of a division direction and a division type. The division type may indicate at least one of two divisions, three divisions, and four divisions.
[0169] The image encoder 210 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on the available division shape modes of the blocks in the current image. The image encoder 210 may determine at least one second block based on one of the available division shape modes of the first block in the current image. For example, when the division shape mode indicates that the first block is not divided, the second block may be the same as the first block. When the division shape mode indicates that the first block is divided into a plurality of blocks, a plurality of second blocks may be determined. In this case, the available division shape mode may be a division shape mode that is limited by considering deblocking filtering among all the division shape modes.
[0170] The image encoder 210 may generate a prediction block of the block by performing prediction on the block. The image encoder 210 may generate a prediction block of the at least one block by performing inter-frame prediction on at least one block. The image encoder 210 may generate a prediction block of the at least one block by performing intra-frame prediction on at least one block. The image encoder 210 may generate a prediction block of the at least one block by performing prediction based on a combined inter-frame-intra-frame prediction mode on at least one block. The image encoder 210 may generate a prediction block of the at least one block by performing prediction on a partition of the at least one block. In this case, the partition may be a plurality of units generated by dividing one block into various shapes, and may have any one of various shapes, such as a triangular shape or a quadrilateral shape.
[0171] The image encoder 210 may encode a residual block of the block based on the prediction block and the original block of the block.
[0172] The image encoder 210 may generate a reconstructed block for the block by using the prediction block of the block and the residual block of the block. The image encoder 210 may generate the value of the sample of the reconstructed block of the at least one block by adding the value of the sample of the prediction block of the at least one block to the value of the sample of the residual block of the at least one block.
[0173] The deblocking filtering unit 205 may reconstruct the current image by performing deblocking filtering on a boundary of at least one reconstructed block in the reconstructed blocks. The boundary of the at least one reconstructed block is a boundary that divides two adjacent reconstructed blocks including the at least one reconstructed block, and the two adjacent reconstructed blocks may be divided vertically or horizontally by the boundary.
[0174] When the prediction mode of at least one reconstructed block in the reconstructed blocks located on both sides of the boundary of at least one reconstructed block is a combined inter-intra prediction mode, the deblocking filtering unit 205 may determine that the value of the boundary filter strength applied to the boundary of the at least one reconstructed block is a predetermined value. The deblocking filtering unit 205 may perform deblocking filtering on the boundary of at least one reconstructed block based on the value of the boundary filter strength. In detail, when a P block or a Q block is encoded in an intra prediction mode, the value of the boundary filter strength may be determined to be 2. . That is, deblocking filtering may be performed by using a larger boundary filter value at the boundary of a block encoded in an intra prediction mode. When the value of the boundary filter strength is greater than 0, the deblocking filtering unit 205 may perform filtering. However, the deblocking filtering unit 205 does not always perform filtering only because the value is greater than 0, and may re-determine whether to apply filtering by comparing the d value (which may refer to the amount of change in the pixel values in two regions based on the boundary) determined based on the pixel values in the block (for example, in the case of a horizontal boundary, based on the pixel values located in the first column and the fourth column) with the β value determined based on the quantization parameters of the P block and the Q block. The d value and the β value may be the same as the d value and the β value related to deblocking filtering defined in the High Efficiency Video Coding (HEVC) standard.
[0175] The deblocking filter unit 205 may determine whether to apply strong filtering or weak filtering to the boundary of the block. For example, in the case of a vertical boundary, the deblocking filter unit 205 may determine the strength of the filtering by using the pixel values of the first and fourth rows, the β value, and the tc value. That is, the deblocking filter unit 205 may determine whether the amount of change in the pixel values in the P block and the Q block is small but discontinuity occurs at the boundary by using the pixel values of the first and fourth rows, the β value, and the tc value, and may determine the strength of the filtering based on the determination result. The tc value may be the same as the tc value related to the deblocking filter defined in the HEVC standard.
[0176] In the case of a vertical boundary, the deblocking filtering unit 205 may perform deblocking filtering in units of rows. When the deblocking filtering unit 205 performs strong filtering on a vertical boundary, the deblocking filtering unit 205 may perform filtering in units of 3 pixels of a P block and 3 pixels of a Q block adjacent to the boundary of each row based on the pixel value of each row and the tc value. The pixels whose pixel values are changed by performing filtering may be 3 pixels of a P block and 3 pixels of a Q block adjacent to the boundary of each row, and the pixels referenced to perform filtering may be 4 pixels of a P block and 4 pixels of a Q block adjacent to the boundary of each row. That is, the number of pixels referenced to perform filtering and the number of pixels whose pixel values are changed may be different from each other, and preferably, the number of pixels referenced to perform filtering may be equal to or greater than the number of pixels whose pixel values are changed. Specifically, the pixel values in the P block may be changed by performing filtering with reference to the pixel values in the P block and the pixel values in the Q block, and the pixel values in the Q block may be changed by performing filtering with reference to the pixel values in the P block and the pixel values in the Q block.
[0177] When the deblocking filter unit 205 performs filtering on the vertical boundary, the deblocking filter unit 205 may perform filtering in units of 2 pixels of the P block and 2 pixels of the Q block adjacent to the boundary of each row based on the tc value. The pixels whose pixel values are changed by performing filtering may be 2 pixels of the P block and 2 pixels of the Q block adjacent to the boundary of each row, and the pixels referenced to perform filtering may be 4 pixels of the P block and 4 pixels of the Q block adjacent to the boundary of each row. That is, the number of pixels referenced to perform filtering and the number of pixels whose pixel values are changed may be different from each other, and preferably, the number of pixels referenced to perform filtering may be equal to or greater than the number of pixels whose pixel values are changed. The term "reference pixel" refers to a pixel used to determine a condition for determining whether to perform filtering on a pixel or to change a pixel value by performing filtering.
[0178] Therefore, when performing filtering in each 8×8 unit, the deblocking filtering unit 205 may refer to up to 4 pixels on either side of the boundary, and the values of up to 3 pixels on either side of the boundary may be changed. However, it will be readily understood by those skilled in the art that the number of reference pixels and the number of pixels whose pixel values are changed are not limited thereto, and may be any of a variety of numbers.
[0179] When the prediction mode of one of the blocks located on both sides of the boundary of the at least one reconstructed block is the combined inter-intra prediction mode, the deblocking filtering unit 205 may determine that the value of the boundary filtering strength is a predetermined value of 1 or 2. The predetermined value may be the same value as the value of the boundary filtering strength used when the prediction mode of one of the blocks located on both sides of the boundary of the at least one reconstructed block is the intra prediction mode.
[0180] For example, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the intra prediction mode may be 2, and thus the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the combined inter-intra prediction mode may also be 2. However, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the intra prediction mode may be a value other than 2, and in this case, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the combined inter-intra prediction mode may be determined to be a value other than 2 accordingly.
[0181] The predetermined value may be the same value as the value of the boundary filter strength used when the prediction modes of the blocks located on both sides of the boundary of at least one reconstructed block are both inter-frame prediction modes. For example, the value of the boundary filter strength used when the prediction mode of the blocks located on both sides of the boundary of at least one reconstructed block is the inter-frame prediction mode may be 0 or 1, and thus the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the combined inter-frame-intra-frame prediction mode may also be 0 or 1. However, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the intra-frame prediction mode may be a value other than 0 or 1, and in this case, the value of the boundary filter strength used when the prediction mode of one of the blocks located on both sides of the boundary of at least one reconstructed block is the combined inter-frame-intra-frame prediction mode may also be determined to be a value other than 0 or 1 accordingly.
[0182] When the size of at least one of the blocks located on both sides of the boundary of at least one reconstructed block is equal to or greater than a predetermined size, and the prediction mode of the at least one block is a combined inter-frame-intra-frame prediction mode, the deblocking filtering unit 205 may determine that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value.
[0183] Optionally, when the size of at least one of the blocks located on both sides of the boundary of at least one reconstructed block is equal to or smaller than a predetermined size, and the prediction mode of the at least one block is a combined inter-frame-intra-frame prediction mode, the deblocking filtering unit 205 may determine that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value.
[0184] Optionally, when the size of at least one of the blocks located on both sides of the boundary of at least one reconstructed block is equal to or greater than a predetermined size, and the prediction mode of the at least one block is a combined inter-frame-intra-frame prediction mode, the deblocking filtering unit 205 may determine that the value of the boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value.
[0185] The deblocking filtering unit 205 may perform deblocking filtering based on a unit of a predetermined size. When a boundary of at least one reconstructed block is located at a boundary of a unit of a predetermined size, the deblocking filtering unit 205 may perform deblocking filtering on the boundary of the at least one reconstructed block. For example, the predetermined size may be N×N (N may be an integer or a power of 2, and in this case, n may be an integer), and may be 4×4 or 8×8.
[0186] The image encoder 210 may limit the available division shape mode of the first block according to the size or shape of the plurality of blocks divided from the first block based on the available division shape mode of the first block, may determine the plurality of blocks based on the limited division shape mode, and may perform deblocking filtering on a boundary of a reconstructed block of at least one of the plurality of blocks based on a unit of a predetermined size. That is, when the height or width of one of the plurality of blocks divided from the first block based on the available division shape mode of the first block is not a multiple of the height or width indicated by the predetermined size but a multiple of a smaller height or width, the division shape mode may be limited.
[0187] Therefore, in this case, when the deblocking filtering unit 205 performs deblocking filtering based on 8×8 as a predetermined size, the deblocking filtering unit 205 may perform deblocking filtering on the boundary of at least one block among the divided blocks whose height and width are not multiples of 4 but multiples of 8.
[0188] When the deblocking filtering unit 205 performs deblocking filtering based on a unit of a predetermined size, the deblocking filtering unit 205 may determine the number of pixels to which deblocking filtering is applied and the number of pixels referenced for deblocking filtering based on the sizes of two blocks located on both sides of the boundary of the block to which deblocking filtering is applied.
[0189] When the deblocking filtering unit 205 performs deblocking filtering in units of rows or columns based on a unit of size 4×4, and the height or width of one of the two blocks located on both sides of the boundary of the block to which the deblocking filtering is applied is 4, the deblocking filtering unit 205 may determine that the number of pixels to which the deblocking filtering is applied in each of the two blocks located on both sides is equal to or less than 2 (including 0), and the maximum number of pixels referenced for deblocking filtering in each of the two blocks located on both sides is equal to or less than 3 (for example, 2 or 1). For example, when the size of at least one of the blocks located on both sides of the boundary of the block to which the deblocking filtering is applied in units of rows or columns at the vertical block boundary or the horizontal block boundary is 4×N or N×4 (where N is an integer equal to or greater than 4), the deblocking filtering unit 205 may determine that the number of pixels to which the deblocking filtering is applied in each of the two blocks located on both sides is 1, and the maximum number of pixels referenced for deblocking filtering in each of the two blocks located on both sides is 3.
[0190] When the deblocking filtering unit 205 performs deblocking filtering in units of rows or columns based on a unit of size 4×4, and the height or width of one block (the first block) of the two blocks located on both sides of the boundary of the block to which deblocking filtering is applied is 4 and the height or width of the other block (the second block) is 8, the deblocking filtering unit 205 can determine that the maximum number of pixels referenced for deblocking filtering located in the first block is 2, the number of pixels applied to deblocking filtering located in the first block is 1, the maximum number of pixels referenced for deblocking filtering located in the second block is 4, and the number of pixels applied to deblocking filtering located in the second block is 3.
[0191] Optionally, the deblocking filtering unit 205 may determine that the maximum number of pixels located in the first block that are referenced for deblocking filtering is 2 and the number of pixels to which deblocking filtering is applied is 1, and may determine that the maximum number of pixels located in the second block that are referenced for deblocking filtering is 2 and the number of pixels to which deblocking filtering is applied is 0.
[0192] The deblocking filtering unit 205 may perform deblocking filtering at the boundary of the reconstructed block regardless of the unit of the predetermined size. That is, even when the boundary of the unit of the predetermined size does not match the boundary of the reconstructed block, the deblocking filtering unit 205 may perform deblocking filtering at the boundary of the reconstructed block. The reconstructed block may be one of a coding unit, a transform unit, and a prediction unit.
[0193] When residual information is not included in blocks located at both sides of the boundary of the reconstructed block, the deblocking filtering unit 205 may determine whether to perform deblocking filtering by using information about both blocks.
[0194] For example, when motion vectors of blocks on both sides of a boundary portion of the reconstructed block are different from each other, the deblocking filtering unit 205 may determine to perform deblocking filtering.
[0195] When the mode of at least one of the blocks located on both sides of the boundary of the reconstructed block is a specific mode, the deblocking filtering unit 205 may determine to perform deblocking filtering. In this case, the specific mode may be a motion compensation mode or a subblock prediction mode based on an affine model.
[0196] When the intra prediction modes of the blocks located on both sides of the boundary of the reconstructed block are different from each other, the deblocking filtering unit 205 may determine to perform deblocking filtering. When the illumination compensation parameters of the blocks located on both sides of the boundary of the reconstructed block are different from each other, the deblocking filtering unit 205 may determine to perform deblocking filtering.
[0197] When prediction modes of blocks located on both sides of a boundary of a reconstructed block are different from each other, the deblocking filtering unit 205 may determine to perform deblocking filtering.
[0198] For example, when the prediction modes of blocks located on both sides of the boundary of the reconstructed block are intra mode and inter mode, combined inter-intra prediction mode and inter mode, or combined inter-intra prediction mode and intra mode, the deblocking filtering unit 205 may determine to perform deblocking filtering.
[0199] When one of the blocks located on both sides of the boundary of the reconstructed block has a triangular partition shape, the deblocking filtering unit 205 may determine whether to perform deblocking filtering by considering the residuals of the two blocks. The deblocking filtering unit 205 may determine whether to perform deblocking filtering by considering the sizes of the height and width of the two blocks and the maximum and minimum values of the two values.
[0200] When blocks located on both sides have triangular partition shapes and a height or width of at least one of the two blocks is equal to or greater than or equal to or less than a specific size, the deblocking filtering unit 205 may perform deblocking filtering on a boundary between triangular partitions.
[0201] When the block has a triangular partition shape, the image encoder 210 may perform bidirectional inter-frame prediction on the triangular partition. In this case, the image encoder 210 may variously determine the weights of the reference triangular partitions included in the two reference blocks in the two directions. For example, the weight of the first reference triangular partition of the first reference block may be 0, the weight of the second reference triangular partition of the first reference block may be 1, the weight of the first reference triangular partition of the second reference block may be 1, and the weight of the second reference triangular partition of the second reference block may be 0. Alternatively, the weight of the first reference triangular partition of the first reference block may be 1 / 4, the weight of the second reference triangular partition of the first reference block may be 3 / 4, the weight of the first reference triangular partition of the second reference block may be 3 / 4, and the weight of the second reference triangular partition of the second reference block may be 1 / 4. The weight of each reference triangular partition may be, but is not limited to, a predetermined value, and the image encoder 210 may generate a bitstream including information about the weight based on the weight of each reference triangular partition. In this case, the weight of the triangular partition may be determined as one of one or more weight candidates. In this case, index information indicating one of the one or more weight candidates may be obtained from the bitstream. The weight candidate may be determined for each block, but the present disclosure is not limited thereto. The weight candidate may be determined for each reference block or for each reference triangle partition.
[0202] However, the block is not limited to having a triangular partition shape, and may have a partition mask shape including partitions having various shapes such as a quadrilateral shape. In this case, the shape of the partition mask of the block may be determined as one of one or more partition mask shape candidates. In this case, index information indicating one of the one or more mask shape candidates may be obtained from the bitstream.
[0203] Figure 2b is a flowchart of an image encoding method according to various embodiments.
[0204] In operation S205, the image encoding apparatus 200 may determine a plurality of blocks in an image by hierarchically dividing the current image based on a division shape pattern of the current image.
[0205] In operation S210, the image encoding apparatus 200 may generate a predicted block of a block by performing prediction on the block.
[0206] In operation S215, the image encoding apparatus 200 may encode a residual block of the block based on the predicted block and the original block of the block.
[0207] In operation S220, the image encoding apparatus 200 may generate a reconstructed block with respect to the block by using a predicted block and an encoded residual block of the block.
[0208] In operation S225, the image encoding apparatus 200 may perform deblocking filtering on a boundary of at least one of the reconstructed blocks. In this case, when the prediction mode of at least one of the blocks located on both sides of the boundary of the at least one reconstructed block is a combined inter-intra prediction mode, the image encoding apparatus 200 may determine that a value of a boundary filtering strength applied to the boundary of the at least one reconstructed block is a predetermined value, and may perform deblocking filtering on the boundary of the at least one reconstructed block based on the value of the boundary filtering strength.
[0209] Figure 2c is a flowchart of an image encoding method according to various embodiments.
[0210] In operation S255, the image encoding apparatus 200 may determine a plurality of blocks in the current image by hierarchically dividing the current image based on available division shape patterns of the blocks in the current image.
[0211] In operation S260, the image encoding apparatus 200 may generate a predicted block of the block by performing prediction on the block.
[0212] In operation S265, the image encoding apparatus 200 may encode a residual block of the block based on the predicted block and the original block of the block.
[0213] In operation S270, the image encoding apparatus 200 may generate a reconstructed block with respect to the block by using the predicted block and the encoded residual block of the block.
[0214] In operation S275, the image encoding apparatus 200 may perform deblocking filtering on a boundary of at least one of the reconstructed blocks according to a size or shape of at least one of the plurality of blocks determined based on available division shape modes of blocks in the current image.
[0215] For example, the image encoding apparatus 200 may generate a plurality of blocks divided from the current block based on one of the available division shape modes of the current block, and when one of the height and width of one of the plurality of blocks is not a multiple of the height or width indicated by the predetermined size, the image encoding apparatus 200 may not allow the available division shape mode, and may determine a plurality of blocks from the current block based on another available division shape mode. The image encoding apparatus 200 may perform deblocking filtering on a boundary of at least one reconstructed block of the plurality of blocks determined based on the restricted division shape mode.
[0216] For example, the image encoding apparatus 200 may generate a plurality of blocks divided from the current block based on one of the available division shape modes of the current block, and when one of the height and width of one of the plurality of blocks is not a multiple of the height or width indicated by the predetermined size, the image encoding apparatus 200 may not allow the available division shape mode, and may determine a plurality of blocks from the current block based on another available division shape mode. The image encoding apparatus 200 may perform deblocking filtering on a boundary of at least one reconstructed block of the plurality of blocks determined based on the restricted division shape mode.
[0217] Optionally, when at least one reconstructed block among the reconstructed blocks of multiple blocks determined based on the available partition shape pattern has a triangular partition shape, the image encoding device 200 may perform deblocking filtering on the boundary based on the height or width of the at least one reconstructed block or based on residual information on both sides of the boundary between the triangular partitions.
[0218] Figure 2d is a block diagram of an image encoder according to various embodiments.
[0219] The image encoder 7000 according to various embodiments performs a task performed by the image encoder 210 of the image encoding apparatus 200 to encode image data.
[0220] That is, the intra predictor 7200 performs intra prediction for each block in the current image 7050 , and the inter predictor 7150 performs inter prediction for each block by using the current image 7050 and a reference image obtained by the reconstructed picture buffer 7100 .
[0221] The residual data may be generated by subtracting the prediction data for each block output from the intra predictor 7200 or the inter predictor 7150 from the data of the coding block for the current image 7050, and the transformer 7250 and the quantizer 7300 may output the quantized transform coefficient for each block by performing transform and quantization on the residual data. The dequantizer 7450 and the inverse transformer 7500 may reconstruct the residual data in the spatial domain by performing dequantization and inverse transform on the quantized transform coefficient. The reconstructed residual data in the spatial domain is added to the prediction data for each block output from the intra predictor 7200 or the inter predictor 7150 to reconstruct it into the data in the spatial domain for the block of the current image 7050. The deblocker 7550 and the SAO executor perform in-loop filtering on the reconstructed data in the spatial domain and generate a filtered reconstructed image. The deblocking filter unit 105 may include the deblocker 7550 of the image encoder 7000. 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-frame prediction of other images. The entropy encoder 7350 may entropy encode the quantized transform coefficients and may output the entropy-encoded coefficients as a bitstream 7400.
[0222] In order to apply the image encoder 7000 according to various embodiments to the image encoding apparatus 200 , the tasks of the image encoder 7000 according to various embodiments may be performed according to blocks.
[0223] The division of coding units according to an embodiment of the present disclosure will now be described in detail.
[0224] 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 present disclosure is not limited thereto. In addition, the maximum coding unit may be hierarchically divided into coding units based on information about a division shape pattern obtained from a bitstream. The information about the division shape pattern may include at least one of information indicating whether division is performed, division direction information, and division type information. The information indicating whether division is performed indicates whether the coding unit will be divided. The division direction information indicates that division is performed in one of the horizontal and vertical directions. The division type information indicates that division is performed in one of two divisions, three divisions (or ternary divisions), and four divisions.
[0225] Although for the sake of convenience of explanation, it is described that the information about the division shape mode includes information indicating whether to perform division, division direction information, and division type information, the present disclosure is not limited thereto. The image decoding apparatus 100 may obtain the information about the division shape mode from the bit stream by using a binary bit string. The image decoding apparatus 100 may determine whether the coding unit is to be divided, the division direction, and the division type based on a binary bit string.
[0226] The coding unit may be equal to or smaller than the maximum coding unit. For example, when the information about the division shape mode indicates that division is not performed, the coding unit has the same size as the maximum coding unit. When the information about the division shape mode indicates that division is performed, the maximum coding unit may be divided into coding units of a lower depth. In addition, when the information about the division shape mode for the coding unit of the lower depth indicates that division is performed, the coding unit of the lower depth may be divided into smaller coding units. However, division of an image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished from each other. Reference will be made to Figures 3 to 16 The division of coding units is described in more detail.
[0227] In addition, the coding unit may be divided into prediction units for prediction of an image. Each of the prediction units 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 of the transformation units may be equal to or smaller than the coding unit. The shapes and sizes of the transformation units and the prediction units 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 the same. The division of the prediction unit and the transformation unit may be performed in the same manner as the division of the coding unit. Referring to Figures 3 to 16 The division of the coding unit is described in more detail. Each of 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 or the current coding unit is a block that is currently performing decoding or encoding or is currently performing division. The neighboring block may be a block reconstructed earlier than 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 side, the left side, the upper left side, the upper side, the upper right side, the right side, and the lower right side of the current block.
[0228] Figure 3 A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by splitting a current coding unit is illustrated.
[0229] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, or N×4N. N may be a positive integer. The block shape information is information indicating at least one of a shape, a direction, an aspect ratio, and a size of a coding unit.
[0230] The shape of the coding unit may include a square shape and a non-square shape. When the width and height 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 shape. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square shape.
[0231] When the width and height 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 a non-square shape, 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, and 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 length of the width and the length of the height 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 length of the width, the length of the height, and the area of the coding unit.
[0232] 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 into which shape the coding unit is divided by using the information about the division shape mode. That is, the coding unit division method indicated by the information about the division shape mode may be determined according to which block shape is indicated by the block shape information used by the image decoding apparatus 100.
[0233] The image decoding device 100 may determine information about the division shape mode from the bitstream. However, the present disclosure is not limited thereto, and the image decoding device 100 and the image encoding device 200 may determine information about the pre-agreed division shape mode based on the block shape information. The image decoding device 100 may determine information about the pre-agreed division shape mode for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine that the information about the division shape mode for the maximum coding unit indicates four divisions. In addition, the image decoding device 100 may determine that the information about the division shape mode for the minimum coding unit indicates "no division is performed". For example, the image decoding device 100 may determine that the size of the maximum coding unit is 256×256. The image decoding device 100 may determine that the pre-agreed information about the division shape mode indicates four divisions. Four divisions are division shape modes in which the width and height of the coding unit are halved. The image decoding device 100 may obtain a coding unit of size 128×128 from a maximum coding unit of size 256×256 based on the information about the division shape mode. Also, the image decoding apparatus 100 may determine the size of the minimum coding unit to be 4 × 4. The image decoding apparatus 100 may obtain information about a division shape mode indicating that “division is not performed” with respect to the minimum coding unit.
[0234] 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 information about the division shape mode. Figure 3 , when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may determine not to divide the coding unit 310a having the same size as the current coding unit 300 based on the information about the division shape pattern indicating that division is not performed, or may determine the coding units 310b, 310c, and 310d divided based on the information about the division shape pattern indicating a specific division method.
[0235] Reference Figure 3According to an embodiment, the image decoding apparatus 100 may determine two coding units 310b obtained by vertically dividing the current coding unit 300 based on the information about the division shape pattern indicating that the division is performed vertically. The image decoding apparatus 100 may determine two coding units 310c obtained by horizontally dividing the current coding unit 300 based on the information about the division shape pattern indicating that the division is performed horizontally. The image decoding apparatus 100 may determine four coding units 310d obtained by vertically and horizontally dividing the current coding unit 300 based on the information about the division shape pattern indicating that the division is performed vertically and horizontally. However, the division method of the square coding unit is not limited to the above method, and the information about the division shape pattern may include various methods. A specific division method for dividing the square coding unit will be described in detail below through various embodiments.
[0236] Figure 4 A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by splitting a non-square coding unit is illustrated.
[0237] 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 specific method according to information about the split shape mode. 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 information about the division shape mode indicating that division is not performed, or may determine the coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c divided based on the information about the division shape mode indicating a specific division method. A specific division method for dividing a non-square coding unit will be described in detail below through various embodiments.
[0238] According to an embodiment, the image decoding apparatus 100 may determine a division method of a coding unit by using information about a division shape pattern, and in this case, the information about the division shape pattern may indicate the number of one or more coding units generated by dividing the coding unit. Figure 4When the information about the division shape pattern 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 information about the division shape pattern.
[0239] According to an embodiment, when the image decoding apparatus 100 splits the non-square current coding unit 400 or 450 based on the information about the split shape pattern, the position of the long side of the non-square current coding unit 400 or 450 may be considered. 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.
[0240] According to an embodiment, when the information about the division shape mode 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 information about the division shape mode 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.
[0241] 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, the length of the width is greater than the length of the height, and thus the block shape information may be horizontal. When the aspect ratio is 1:4, the length of the width is less than the length of the height, and thus the block shape information may be vertical. The image decoding apparatus 100 may determine to divide the current coding unit into an odd number of blocks based on information about the division shape mode. In addition, the image decoding apparatus 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 apparatus 100 may divide the current coding unit 400 horizontally, and may determine the coding units 430a, 430b, and 430c. In addition, when the current coding unit 450 is in the horizontal direction, the image decoding apparatus 100 may divide the current coding unit 450 vertically, and may determine the coding units 480a, 480b, and 480c.
[0242] According to an embodiment, the image decoding apparatus 100 may determine the odd number of coding units included in the current coding unit 400 or 450, and the sizes of all the determined coding units may be different. For example, a specific coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c 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 the odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have different sizes.
[0243] According to an embodiment, when the information about the division shape mode 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 may impose a specific restriction on 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 allow a decoding method of a coding unit 430b or 480b to be different from a decoding method of other coding units 430a and 430c or 480a and 480c, wherein the coding unit 430b or 480b is at a center position among three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated by dividing the current coding unit 400 or 450. 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 specific number of times.
[0244] Figure 5 A process in which the image decoding apparatus 100 according to an embodiment divides a coding unit based on at least one of block shape information and information about a division shape mode is illustrated.
[0245] According to an embodiment, the image decoding apparatus 100 may determine whether to divide the square first coding unit 500 into coding units or not to divide the square first coding unit 500 based on at least one of the block shape information and the information about the division shape mode. According to an embodiment, when the information about the division shape mode indicates that the first coding unit 500 is divided horizontally, the image decoding apparatus 100 may determine the second coding unit 510 by horizontally dividing the first coding unit 500. 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 dividing the coding unit. 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 relationship between the first coding unit, the second coding unit, and the third coding unit is applicable to the following description.
[0246] According to an embodiment, the image decoding apparatus 100 may determine whether to split the second coding unit 510 into coding units or not to split the determined second coding unit 510 based on at least one of the block shape information and the information about the division shape mode. 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, 520b, 520c, and 520d based on at least one of the block shape information and the information about the division shape mode, 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 information about the division shape mode, and may determine a plurality of second coding units (for example, 510) of various shapes by splitting the first coding unit 500 based on at least one of the block shape information and the information about the division shape mode, and may split the second coding unit 510 by using the splitting method of the first coding unit 500 based on at least one of the block shape information and the information about the division shape mode. 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 of the first coding unit 500 and the information about the division shape mode, 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 of the second coding unit 510 and the information about the division shape mode. That is, the coding unit may be recursively divided based on at least one of the block shape information of each coding unit and the information about the division shape mode. 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.
[0247] Reference Figure 5, a specific 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, the non-square third coding unit 520b 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 for recursively dividing coding units will be described below through various embodiments.
[0248] According to an embodiment, the image decoding apparatus 100 may divide each of the third coding units 520a, 520b, 520c, and 520d into coding units based on at least one of the block shape information and the information about the division shape mode. 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 information about the division shape mode. 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 specific restriction on a specific 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.
[0249] Reference Figure 5 , the image decoding device 100 may limit the third coding unit 520c at the center position among the odd 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 specific division method (for example, 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 specific number of times (for example, 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.
[0250] According to an embodiment, the image decoding apparatus 100 may obtain at least one of block shape information for splitting the current coding unit and information about a split shape mode from a specific position in the current coding unit.
[0251] Figure 6 A method in which the image decoding apparatus 100 according to an embodiment determines a specific coding unit from among odd-numbered coding units is illustrated.
[0252] Reference Figure 6 , at least one of the block shape information and the information on the division shape mode of the current coding unit 600 or 650 may be obtained from a sample at a specific position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the specific position in the current coding unit 600 where at least one of the block shape information and the information on the division shape mode can 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 block shape information and information about a division shape mode from a specific position, and may determine whether to divide the current coding unit into coding units of various shapes and sizes or not to divide the current coding unit.
[0253] According to an embodiment, when the current coding unit is split into a specific number of coding units, the image decoding apparatus 100 may select one of the coding units. Various methods that may be used to select one of a plurality of coding units will be described below through various embodiments.
[0254] 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 specific position.
[0255] 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 coding unit 620b at the center position or the coding unit 660b at the center position 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 at the center position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of specific 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.
[0256] 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.
[0257] 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. In addition, a method of determining a coding unit at a specific 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.
[0258] 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 specific 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.
[0259] According to an embodiment, the image decoding device 100 may determine the width or height of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya) indicating the position of the upper left sample point 630a of the upper coding unit 620a, the coordinates (xb, yb) indicating the position of the upper left sample point 630b of the middle coding unit 620b, and the coordinates (xc, yc) 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 620b as yb-ya. 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 widths and heights of the coding units 620a to 620c. Figure 6 , the image decoding apparatus 100 may determine the intermediate 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 a specific position. However, the above-described method in which the image decoding apparatus 100 determines a coding unit having a size different from the sizes of other coding units corresponds only to an example of determining a coding unit at a specific position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various methods of determining a coding unit at a specific position by comparing the size of the coding unit determined based on the coordinates of the specific sample points may be used.
[0260] The image decoding apparatus 100 may determine the width or height 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 sizes of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.
[0261] According to an embodiment, the image decoding apparatus 100 may determine the width of the left coding unit 660a as xe-xd. The image decoding apparatus 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 apparatus 100 may determine the width of the middle coding unit 660b as xf-xe. The image decoding apparatus 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 600. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 and the widths and heights of the left coding unit 660a and the middle coding unit 660b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined widths and heights of the coding units 660a, 660b, and 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 specific position. However, the above-mentioned method in which the image decoding apparatus 100 determines the coding unit having a size different from the sizes of other coding units corresponds only to an example of determining the coding unit at the specific 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 specific position by comparing the size of the coding unit determined based on the coordinates of the specific sample points may be used.
[0262] 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.
[0263] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a specific position from an odd number of coding units determined by dividing the current coding unit, taking into account 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 apparatus 100 may determine a coding unit at a specific position along the horizontal direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the horizontal direction and may 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 apparatus 100 may determine a coding unit at a specific position along the vertical direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the vertical direction and may impose restrictions on the coding unit.
[0264] 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 specific position among the even-numbered coding units. The image decoding apparatus 100 may determine the even-numbered coding units by dividing (dividing) the current coding unit, and may determine the coding unit at the specific 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 reference to Figure 6 The operation of determining a coding unit at a specific position (eg, a center position) among odd-numbered coding units described in detail corresponds, and thus a detailed description thereof is not provided here.
[0265] According to an embodiment, when a non-square current coding unit is split into a plurality of coding units, specific information about a coding unit at a specific position may be used in a split operation to determine a coding unit at a specific position among the plurality of coding units. For example, the image decoding apparatus 100 may determine a coding unit at a center position among the plurality of coding units determined by splitting the current coding unit using at least one of block shape information stored in samples included in a coding unit at a center position and information about a split shape mode in a split operation.
[0266] 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 information about the division shape mode, 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 at which at least one of the block shape information and the information about the division shape mode is obtained. That is, at least one of the block shape information and the information about the division shape mode of 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 information about the division shape mode, 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 information about the division shape mode, and the coding unit at the center position may be determined using various types of information.
[0267] According to an embodiment, specific information for identifying a coding unit at a specific position may be obtained from a specific sample point included in a coding unit to be determined. Figure 6, the image decoding apparatus 100 may determine a coding unit at a specific position (e.g., a coding unit at a center position among the divided coding units) among the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, using block shape information obtained from a sample at a specific position in the current coding unit 600 (e.g., a sample at a center position of the current coding unit) and at least one of information about a division shape mode. That is, the image decoding apparatus 100 may determine a sample at a specific position by considering the block shape of the current coding unit 600, determine a coding unit 620b including a sample for which specific information (e.g., at least one of block shape information and information about a division shape mode) may be obtained from among the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose specific restrictions 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 specific information may be obtained, and may impose a specific restriction on a coding unit 620b including the sample 640. However, the position of the sample from which specific information may be obtained is not limited to the above-mentioned position, and may include any position included in the coding unit 620b to be determined as a sample for restriction.
[0268] According to an embodiment, the position of the sample at which specific 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 specific 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 specific information can be obtained by using at least one of information about the width of the current coding unit and 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 for dividing the long side of the current coding unit in half as a sample at which specific information can be obtained.
[0269] 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 information about a division shape pattern to determine a coding unit at a specific 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 information about a division shape pattern from a sample at a specific 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 information about a division shape pattern, wherein the at least one of the information about the division shape pattern and the block shape information is obtained from a sample at a specific position in each of the plurality of coding units. That is, the coding unit may be recursively divided based on at least one of block shape information and information about a division shape pattern, wherein the at least one of the information about the division shape pattern and the block shape information is obtained from a sample at a specific position in each coding unit. Reference has been made to the above. Figure 4 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will be omitted here.
[0270] 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 specific block (for example, the current coding unit).
[0271] 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.
[0272] According to an embodiment, based on block shape information and information about a division shape pattern, 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 to 750d by dividing the first coding unit 700 in vertical and horizontal directions.
[0273] 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 and horizontal directions in a specific order (e.g., a raster scan order or a Z scan order 750e) according to which the coding units in one row are processed and then the coding units in the next row are processed.
[0274] 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 second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The division method of the plurality of second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d may correspond to the division method of the first coding unit 700. In this way, each of the plurality of second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 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.
[0275] 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.
[0276] 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 specific order using various methods.
[0277] Figure 8 A process in which the image decoding apparatus 100 determines that a current coding unit is to be split into an odd number of coding units when coding units may not be processed in a specific order according to an embodiment is illustrated.
[0278] According to an embodiment, the image decoding apparatus 100 may determine whether to split the current coding unit into an odd number of coding units based on the obtained block shape information and the information about the division shape mode. 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.
[0279] According to an embodiment, the image decoding apparatus 100 may determine whether an arbitrary 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 specific order. Figure 8, the image decoding apparatus 100 may determine the third coding units 820a, 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 is divided into an odd number of coding units based on at least one of the block shape information and the information about the division shape mode: 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. For example, the coding unit located on the right side 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 specific 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 a specific order.
[0280] According to an embodiment, the image decoding apparatus 100 may determine whether the third coding units 820a and 820b and 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition for processing in a specific order, and the condition is related to whether at least one of the width and height of the second coding units 810a and 810b will be divided in half along the boundary of the third coding units 820a and 820b and 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined by dividing the height of the non-square left second coding unit 810a in half may satisfy the condition. However, since the boundary of the third coding units 820c, 820d, and 820e determined by dividing the right second coding unit 810b into three coding units does not divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c, 820d, and 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 to be 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 specific restriction on the coding unit at a specific position in the divided coding units, and the restriction or the specific position has been described above through various embodiments, and therefore a detailed description thereof will be omitted.
[0281] Fig. 9 A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by splitting the first coding unit 900 is illustrated.
[0282] 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 obtained by a receiver (not shown) and information about a division shape mode. 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. For example, referring to Fig. 9 , when the block shape information indicates that the first coding unit 900 has a square shape and the information about the division shape mode 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 information about the division shape mode 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).
[0283] 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 satisfy a condition for processing in a specific order, and the condition is related to whether at least one of the width and height of the first coding unit 900 will be divided in half along the 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 specific 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 height 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 specific 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 will be 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 specific restriction on the coding unit at a specific position in the divided coding unit, and the restriction or the specific position has been described above through various embodiments, so its detailed description will be omitted.
[0284] According to an embodiment, the image decoding apparatus 100 may determine coding units of various shapes by splitting the first coding unit.
[0285] 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.
[0286] Fig.10 It is shown that shapes into which the image decoding apparatus 100 may split the second coding unit are limited when a second coding unit having a non-square shape determined by splitting the first coding unit 1000 satisfies a specific condition according to an embodiment.
[0287] 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, 1010b, 1020a, and 1020b based on at least one of block shape information and information about a division shape mode obtained by a receiver (not shown). The second coding units 1010a, 1010b, 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, 1010b, 1020a, and 1020b into a plurality of coding units or not to divide each of the second coding units 1010a, 1010b, 1020a, and 1020b based on at least one of block shape information and information about a division shape mode of each of the second coding units 1010a, 1010b, 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, 1012b, 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 block shape information and at least one of the information about the division shape pattern, and may be inefficient in terms of image decoding.
[0288] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1022a, 1022b, 1024a, and 1024b by vertically splitting the non-square second coding unit 1020a or 1020b determined by splitting the first coding unit 1000 in the horizontal direction. 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.
[0289] Fig.11 A process of splitting a square coding unit by the image decoding apparatus 100 when information about a division shape mode indicates that the square coding unit is not to be split into four square coding units according to an embodiment is illustrated.
[0290] According to an embodiment, the image decoding apparatus 100 may determine second coding units 1110a, 1110b, 1120a, 1120b, etc. by dividing the first coding unit 1100 based on at least one of block shape information and information about a division shape mode. The information about the division shape mode 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. According to such information about the division shape mode, the image decoding apparatus 100 may 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 non-square second coding units 1110a, 1110b, 1120a, 1120b, etc. based on the information about the division shape mode.
[0291] According to an embodiment, the image decoding apparatus 100 may independently divide the non-square second coding units 1110a, 1110b, 1120a, 1120b, etc. Each of the second coding units 1110a, 1110b, 1120a, 1120b, etc. may be recursively divided in a specific 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 information about a division shape mode.
[0292] 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.
[0293] 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.
[0294] Fig.12 It is shown that a processing order among a plurality of coding units according to an embodiment may vary according to a process of splitting a coding unit.
[0295] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1200 based on the block shape information and the information about the division shape mode. When the block shape information indicates a square shape and the information about the division shape mode 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, 1210b, 1220a, 1220b, etc. by dividing the first coding unit 1200. Fig.12 , the non-square second coding units 1210a, 1210b, 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 the block shape information of each coding unit and the information about the division shape pattern. 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 mentioned above, Fig.11 An operation of dividing the second coding units 1210a, 1210b, 1220a, and 1220b is described, and thus a detailed description thereof will be omitted.
[0296] According to an embodiment, the image decoding apparatus 100 may process the coding units in a specific order. Figure 7The operation of processing the coding units in a specific order is described, and thus a detailed description thereof will be omitted. Fig.12 , the image decoding apparatus 100 may determine four square third coding units 1216a, 1216b, 1216c, 1216d or 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 or 1226a, 1226b, 1226c, and 1226d based on a division shape in which the first coding unit 1200 is divided.
[0297] 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.
[0298] 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.
[0299] Reference Fig.12, square third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d can be determined by dividing the second coding units 1210a, 1210b, 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. In this way, by recursively splitting the coding units in different ways based on at least one of the block shape information and the information about the split shape mode, the image decoding apparatus 100 may process a plurality of coding units in different orders even if the coding units are ultimately determined to be the same shape.
[0300] Fig.13 A process of determining a depth of a coding unit as a shape and a size of the coding unit change when the coding unit is recursively split to determine a plurality of coding units according to an embodiment is illustrated.
[0301] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a specific criterion. For example, the specific criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before 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, the coding unit with the increased depth is represented as a coding unit of a deeper depth.
[0302] Reference Fig.12According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1302 and a third coding unit 1304 of a deeper depth, etc., 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.
[0303] According to an embodiment, the image decoding device 100 can determine a second coding unit 1312 or 1322, a third coding unit 1314 or 1324, and the like of a deeper depth 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).
[0304] 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.
[0305] 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.
[0306] 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.
[0307] 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.
[0308] 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.
[0309] 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 having a size of 2N×2N 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.
[0310] 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.
[0311] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0312] 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 information about the division shape pattern. 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 information about the division shape pattern of the first coding unit 1400.
[0313] 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 information about the division shape mode of the square first coding unit 1400 may be determined based on the length 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 information about the division shape pattern, 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.
[0314] 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 horizontally dividing the first coding unit 1410 whose height is longer than the width based on information about the division shape pattern. 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 vertically dividing the first coding unit 1420 whose width is longer than the height based on information about the division shape pattern.
[0315] According to an embodiment, the depths of the second coding units 1412a and 1412b, the second coding units 1414a, 1414b and 1414c, the second coding units 1422a and 1422b, and the second coding units 1424a, 1424b and 1424c determined based on the information about the division shape mode 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 of the non-square shape having a height longer than a 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.
[0316] 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 information about the division shape mode. 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 the 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 the coding units split from the first coding unit 1410 .
[0317] 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.
[0318] 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 having a height longer than a width. The image decoding apparatus 100 may identify each coding unit using a PID indicating each coding unit. According to an embodiment, the PID may be obtained from a sample point at a specific position of each coding unit (e.g., an upper left sample point).
[0319] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a specific position among the divided coding units by using a PID for distinguishing coding units. According to an embodiment, when information about a division shape mode of a first coding unit 1410 having a rectangular shape having a height longer than a 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 odd-numbered divided coding units. The image decoding apparatus 100 may determine a coding unit 1414b having a PID corresponding to an intermediate value among the PIDs of the coding units as a coding unit at a 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 information about the division shape mode 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 the coding unit at a specific position (e.g., the coding unit at the 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 and the size or position of the coding unit of a specific position to be determined are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the coding unit may be used.
[0320] According to an embodiment, the image decoding apparatus 100 may use a specific data unit in which recursive splitting of a coding unit starts.
[0321] Fig.15 It is illustrated that a plurality of coding units are determined based on a plurality of specific data units included in a picture according to an embodiment.
[0322] According to an embodiment, a specific 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 information about a division shape mode. That is, the specific 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 specific data unit is referred to as a reference data unit.
[0323] According to an embodiment, the reference data unit may have a specific size and a specific size shape. According to an embodiment, the reference coding unit may include M×N samples. Here, M and N may be the same 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.
[0324] 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 information about a division shape pattern of each reference data unit. The operation of dividing the reference data unit may correspond to a division operation using a quadtree structure.
[0325] 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 information about a division shape mode with reference to the determined reference data unit.
[0326] 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 can include one or more reference coding units.
[0327] 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 by describing the operation of determining one or more coding units included in the reference coding unit 1500 of the square, and the above has been described with respect to Figure 4 The operation of splitting the current coding unit 400 or 450 describes an operation of determining one or more coding units included in the non-square reference coding unit 1502, and thus a detailed description thereof will be omitted.
[0328] 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 specific 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, slice segment, or maximum coding unit from a bitstream, wherein the slice, slice segment, or 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 specific condition. The image decoding apparatus 100 may determine the size and shape of the reference coding unit for each data unit that satisfies the specific 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.
[0329] 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 image 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 may divide the reference coding unit based on at least one of block shape information and information about a division shape mode.
[0330] Fig.16 A processing block serving as a unit for determining an order of reference coding units included in the picture 1600 according to an embodiment is illustrated.
[0331] 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 an image, and 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 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, zigzag scanning, N-shaped scanning, upper right diagonal scanning, horizontal scanning, and vertical scanning), but is not limited to the scanning order mentioned above.
[0332] 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 image. 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 image. The size of the processing block may be a specific size of a data unit indicated by the processing block size information.
[0333] 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 a data unit such as an image, a sequence, a picture, a slice, or a slice segment. 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, and the size of the processing block may be an integer multiple of the size of the reference coding unit.
[0334] 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.
[0335] 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 included 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.
[0336] According to an embodiment, the image decoding apparatus 100 may obtain determination order information about one or more reference coding units included in one or more processing blocks from a bitstream, and may determine the determination order of the 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.
[0337] 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.
[0338] According to an embodiment, the image decoding apparatus 100 may determine one or more reference coding units based on the determined order.
[0339] 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. On the contrary, 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.
[0340] 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.
[0341] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or information about a division shape mode indicating a division method of the current coding unit from a bitstream, and may use the obtained information. The block shape information or the information about the division shape mode may be included in a bitstream associated with various data units. For example, the image decoding device 100 may use block shape information of information about the division shape mode included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a parallel block header, or a parallel block group header. In addition, the image decoding device 100 may obtain a syntax element corresponding to the block shape information or the information about the division shape mode from a bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax element.
[0342] Will refer to Figures 17a to 26 An image encoding device, an image decoding device, an image encoding method, and an image decoding method are described according to various embodiments, which encode or decode an image by performing deblocking filtering on a boundary of a reconstructed block of a block (e.g., a coding unit, a prediction unit, or a transform unit) determined in any of various shapes.
[0343] Figures 17a to 17d is a diagram for describing a process of performing deblocking filtering on a boundary of a reconstructed block according to various embodiments.
[0344] Reference Fig.17a, the image decoding apparatus 100 may perform deblocking filtering on three pixels 1715 on either side of a vertical block boundary 1710 in each 8×8 unit. When the image decoding apparatus 100 allows only four partitions among the partition types and determines a block of a coding unit, a prediction unit, or a transform unit based on the partition type, each block boundary is located only at a point corresponding to a multiple of 8 except for a block having a size of 4×4, and thus the image decoding apparatus 100 may perform deblocking filtering at most of the block boundaries.
[0345] Reference Fig.17b , the image decoding apparatus 100 may perform deblocking filtering on three pixels 1725 on either side of a block boundary 1720 in each 8×8 unit. When the image decoding apparatus 100 allows three-partitioning, two-partitioning, and four-partitioning as available partition types, blocks of sizes 8×4 and 16×4 may be determined, and in this case, deblocking filtering may not be performed at some block boundaries.
[0346] Reference Fig.17c , the image decoding apparatus 100 may perform deblocking filtering at each of the boundaries 1730 and 1735 of the 8×8 unit. The image decoding apparatus 100 may perform deblocking filtering on three pixels 1740 on either side of each of the boundaries 1730 and 1735 of the 8×8 unit. When the image decoding apparatus 100 allows three-partitioning and two-partitioning and four-partitioning as available partition types, blocks of sizes 8×4 and 16×4 may be determined, and in this case, deblocking filtering may not be performed at some block boundaries, and deblocking filtering may be performed at the boundary 1735 of the 8×8 unit other than the block boundary.
[0347] Reference Fig.17d , the image decoding apparatus 100 may perform deblocking filtering on three pixels 1750 on either side of the block boundary 1745 in each 4×4 unit. In this case, due to the deblocking filtering on the block boundary 1745 located on both sides, filtering may be performed twice on the pixel 1755. In this case, the deblocking filtering result value may vary according to the deblocking filtering order during the deblocking filtering of the block boundary 1745, and thus dependency on the deblocking filtering order occurs, making it difficult to perform deblocking filtering in parallel.
[0348] Fig.18 is a diagram for describing a process of limiting a division shape pattern of a block indicating three division types in consideration of a size of a unit for deblocking filtering.
[0349] Reference Fig.18, when the image decoding device 100 divides the reconstructed block 1800 having a size of 16×16 based on the three-division type, blocks of sizes of 4×16 and 8×16 may be determined, and in this case, when deblocking filtering is performed at the block boundary in each 8×8 unit, deblocking filtering is not performed at the boundary of the middle block. Therefore, the image decoding device 100 may limit the division shape pattern indicating the vertical three-division type among the available block division patterns of the reconstructed block 1800 so that the block boundary is not located at a point corresponding to a multiple of 4 other than a multiple of 8, and the reconstructed block 1800 may be divided by using one of the remaining available block division patterns. The image decoding device 100 may perform deblocking filtering at the boundary of the reconstructed block by limiting the division shape pattern so that the boundary of the reconstructed block is located at the boundary of the unit for performing deblocking filtering.
[0350] Fig.19a and 19b is a diagram for describing a process of limiting a division shape pattern of a two-division type block in consideration of a size of a unit for deblocking filtering.
[0351] Reference Fig.19a , when the image decoding apparatus 100 divides the reconstructed block 1900 having a size of 8×16 based on the two-division type, a block having a size of 4×16 may be determined, and in this case, when deblocking filtering is performed at a block boundary in each 8×8 unit, deblocking filtering is not performed at some block boundaries. Therefore, the image decoding apparatus 100 may limit a division shape pattern indicating a vertical two-division type among available division shape patterns of the reconstructed block 1900 so that the block boundary is not located at a point corresponding to a multiple of 4 other than a multiple of 8, and the reconstructed block 1900 may be divided by using one of the remaining available block division patterns. The image decoding apparatus 100 may perform deblocking filtering at a boundary of the reconstructed block by limiting the division shape pattern so that the boundary of the reconstructed block is located at a boundary of a unit for performing deblocking filtering.
[0352] Reference Fig.19b , when the image decoding apparatus 100 divides the reconstructed block 1950 having a size of 8×8 based on the two-division type, a block having a size of 4×8 may be determined, and in this case, when deblocking filtering is performed at a block boundary in each 8×8 unit, deblocking filtering is not performed at some block boundaries. Therefore, the image decoding apparatus 100 may limit a division shape pattern indicating a vertical two-division type among available division shape patterns of the reconstructed block 1950 so that the block boundary is not located at a point corresponding to a multiple of 4 other than a multiple of 8, and the reconstructed block 1950 may be divided by using one of the remaining available block division patterns. The image decoding apparatus 100 may perform deblocking filtering at a boundary of the reconstructed block by limiting the division shape pattern so that the boundary of the reconstructed block is located at a boundary of a unit for performing deblocking filtering.
[0353] As reference Fig.19a and Fig.19b As described above, the image decoding apparatus 100 may perform deblocking filtering at the boundary of the reconstructed block by limiting the division shape mode so that the boundary of the reconstructed block is located at the boundary of the unit for performing deblocking filtering. However, the restricted division shape mode is not limited thereto and may be modified. For example, when the size of the block determined based on the division shape mode is 8×4 or 16×4 and therefore at least one of the height and the width corresponds to a multiple of 4 other than a multiple of 8, the division shape mode may be limited.
[0354] Fig.20a and Fig.20b is a diagram for describing a process of determining the number of pixels whose pixel values are changed by deblocking filtering at a block boundary in consideration of a size of a block according to various embodiments.
[0355] Reference Fig.20a , when the image decoding device 100 performs deblocking filtering on the block boundary in each 4×4 unit in units of rows, and the width of a block in the reconstructed blocks located on both sides of the vertical block boundary 2010 is 4, the image decoding device 100 may perform deblocking filtering on two pixels 2020 located on either side of the vertical block boundary 2010 to change the pixel values of the two pixels 2020.
[0356] Reference Fig.20b , when the image decoding device 100 performs deblocking filtering on the block boundary in each 4×4 unit in units of rows, and the width of a block in the reconstructed blocks located on both sides of the vertical block boundary 2030 is 4, the image decoding device 100 may perform deblocking filtering on a pixel 2040 located on either side of the vertical block boundary 2030 to change the pixel value of the pixel 2040.
[0357] As reference Fig.20a and Fig.20b As described above, when the image decoding device 100 performs deblocking filtering in units of rows or columns in each 4×4 unit, the image decoding device 100 adaptively determines the number of pixels whose pixel values are changed according to deblocking filtering based on the vertical (horizontal) boundary of the reconstructed block based on the sizes of the blocks located on both sides of the boundary. Therefore, even when deblocking filtering is performed on adjacent boundaries in the same direction, the pixels whose pixel values are changed may not overlap with each other, and thus the dependence on the deblocking filtering order on adjacent boundaries in the same direction may be removed. As a result, the image decoding device 100 can perform deblocking filtering on adjacent boundaries in the same direction in parallel.
[0358] Fig.21a and Figure 21bis a diagram for describing a process of determining the number of pixels whose pixel values are changed by deblocking filtering at a block boundary in consideration of sizes of blocks on both sides of the block boundary according to various embodiments.
[0359] Reference Fig.21a , when the image decoding device 100 performs deblocking filtering on the block boundary in each 4×4 unit in units of rows, and the width of the block located on either side of the reconstructed blocks located on both sides of the vertical block boundary 2100 is 4, the image decoding device 100 may refer to two pixels 2120 on either side of the vertical block boundary 2100 to apply the deblocking filtering, and may change the pixel values of the two pixels 2120.
[0360] When the image decoding device 100 performs deblocking filtering on block boundaries in each 4×4 unit in units of rows, and the width of the block located on the left side in the reconstructed blocks located on both sides of the vertical block boundary 2110 is 4, the image decoding device 100 may apply deblocking filtering with reference to two pixels on the left side of the vertical block boundary 2110 and four pixels on the right side of the vertical block boundary 2110, and may perform deblocking filtering on two pixels on the left side of the vertical block boundary 2110 and three pixels 2130 on the right side of the vertical block boundary 2110 to change the pixel values of the pixels.
[0361] Reference Figure 21b , when the image decoding device 100 performs deblocking filtering on block boundaries in each 4×4 unit in units of rows, and the width of the blocks located on either side of the reconstructed blocks located on both sides of the vertical block boundary 2140 is 4, the image decoding device 100 may refer to a pixel 2160 located on either side of the vertical block boundary 2140 to apply deblocking filtering, and may change the pixel value of the pixel 2160.
[0362] When the image decoding device 100 performs deblocking filtering on block boundaries in each 4×4 unit in units of rows, and the width of the block located on the left side in the reconstructed blocks located on both sides of the vertical block boundary 2150 is 4, the image decoding device 100 may refer to one pixel on the left side of the vertical block boundary 2150 and four pixels on the right side of the vertical block boundary 2150 to apply deblocking filtering, and may perform deblocking filtering on one pixel on the left side of the vertical block boundary 2150 and three pixels 2170 on the right side of the vertical block boundary 2150 to change the pixel values of the pixels.
[0363] Fig. 22 is a diagram for describing a process of determining the number of pixels whose pixel values are changed by deblocking filtering at a block boundary or the number of reference pixels considering sizes of blocks on both sides of a block boundary according to various embodiments.
[0364] Reference Fig. 22, when the image decoding apparatus 100 performs deblocking filtering on the block boundary in each 4×4 unit in units of rows, and the width of the block located on the left side of the vertical block boundary 2210 is 4 and the width of the block located on the right side of the vertical block boundary 2210 is 8, the image decoding apparatus 100 may refer to two pixels 2220 on the left side of the vertical block boundary 2210 for the block located on the left side, and may not apply deblocking filtering to the block located on the left side. For the block located on the right side, the image decoding apparatus 100 may refer to four pixels 2240 on the right side of the vertical block boundary 2210, and may perform deblocking filtering on three pixels 2230 on the right side of the vertical block boundary 2210 to change the pixel value of the pixel 2230.
[0365] Fig.23a and Figure 23b is a diagram for describing a process in which an image decoding apparatus performs deblocking filtering on a boundary of a block of a transform unit according to various embodiments.
[0366] Fig.23a is a diagram for describing a process in which an image decoding apparatus according to an embodiment performs deblocking filtering on a boundary of a block of a transform unit.
[0367] 23 , when the size of the coding unit 2300 is 128×128 and the maximum size of the transformation unit is 64, four transformation units 2310 each having a size of 64×64 may be determined from the coding unit 2300 .
[0368] That is, when the size of the coding unit is larger than the maximum size of the transformation unit, the coding unit and the transformation unit may not have the same size, and the coding unit may include multiple transformation units. When the boundary of the coding unit does not match the boundary of the transformation unit, the image decoding apparatus 100 may perform deblocking filtering on the boundary of the block of the transformation unit.
[0369] Figure 23b is a diagram for describing a process in which an image decoding apparatus performs deblocking filtering on a boundary of a block of a transform unit according to another embodiment.
[0370] When the maximum size of the transformation unit is 64, and the size of the coding unit 2340 is equal to or smaller than the maximum size of the transformation unit, the size of the coding unit 2340 may be the same as the size of the transformation unit 2340. That is, the image decoding apparatus 100 may perform deblocking filtering on a boundary of the transformation unit 2340. Therefore, when compared with a case where the image decoding apparatus 100 performs deblocking filtering at a block boundary of an 8×8 unit, the image decoding apparatus 100 may perform deblocking filtering even at a block boundary that does not match an 8×8 unit.
[0371] As reference Fig.23a and Figure 23bAs described above, the image decoding apparatus 100 may perform deblocking filtering on the boundary of the transformation unit. However, the image decoding apparatus 100 may determine whether there is no residual information in the blocks located on both sides of the boundary of the transformation unit, and when it is determined that there is no residual information in the blocks located on both sides of the boundary of the transformation unit, the image decoding apparatus 100 may determine whether to perform deblocking filtering on the boundary of the transformation unit based on information about the blocks.
[0372] For example, when motion vectors on both sides of a boundary of a transformation unit are different from each other, the image decoding apparatus 100 may perform deblocking filtering on the boundary of the transformation unit. When a mode of at least one of blocks on both sides of the boundary of the transformation unit is a predetermined mode such as a motion compensation mode or a subblock prediction mode based on an affine model, the image decoding apparatus 100 may perform deblocking filtering on the boundary of the transformation unit. When intra prediction modes of blocks on both sides of the boundary of the transformation unit are different from each other, the image decoding apparatus 100 may perform deblocking filtering on the boundary of the transformation unit.
[0373] When illumination compensation parameters on both sides of a boundary of a transformation unit are different from each other, the image decoding apparatus 100 may perform deblocking filtering on the boundary of the transformation unit. When modes of blocks on both sides of a boundary of a transformation unit are different from each other, the image decoding apparatus 100 may perform deblocking filtering on the boundary of the transformation unit. For example, when modes of blocks on both sides of a boundary of a transformation unit are different from each other (e.g., inter mode and intra mode, combined inter-intra prediction mode and inter mode, or combined inter-intra prediction mode and intra mode), the image decoding apparatus 100 may perform deblocking filtering.
[0374] Fig.24a and Figure 24b 2 is a diagram for describing a process in which the image decoding apparatus 100 performs deblocking filtering on a block having a triangular partition shape according to various embodiments.
[0375] Reference Fig.24a , when at least one block adjacent to the boundary is a block 2400 having a triangular partition, the image decoding apparatus 100 may perform deblocking filtering on the block boundary 2410. The image decoding apparatus 100 may determine whether to perform deblocking filtering by considering residual information of blocks adjacent to both sides of the block boundary 2410. In addition, the image decoding apparatus 100 may determine whether to perform deblocking filtering by considering the size of the height or width of the blocks adjacent to both sides of the block boundary 2410 and the maximum value or minimum value of the two values.
[0376] Reference Figure 24b, when at least one block adjacent to the boundary is a block 2420 having triangular partitions, the image decoding apparatus 100 may perform deblocking filtering on a boundary 2425 between triangular partitions. When the height or width of the block 2420 is equal to or greater than or equal to or less than a specific height or width, the image decoding apparatus 100 may perform deblocking filtering on the boundary 2425 between triangular partitions.
[0377] Fig.25 is a diagram for describing a process in which the image decoding apparatus 100 performs bidirectional inter prediction on a block having triangular partitions according to an embodiment.
[0378] Reference Fig.25 , when the block has a triangular partition shape, the image decoding apparatus 100 may generate a prediction block of the block by performing bidirectional inter-frame prediction on the triangular partition. In this case, the image decoding apparatus 100 may variously determine the weights of the reference triangular partitions included in two reference blocks (e.g., the first reference block and the second reference block) in two directions. For example, Fig.25 , the weight of the first reference triangular partition (left partition) of the first reference block may be 0, the weight of the second reference triangular partition (right partition) of the first reference block may be 1, the weight of the first reference triangular partition (left partition) of the second reference block may be 1, and the weight of the second reference triangular partition (right partition) of the second reference block may be 0.
[0379] Alternatively, the weight of the first reference triangular partition of the first reference block may be 1 / 4, the weight of the second reference triangular partition of the first reference block may be 3 / 4, the weight of the first reference triangular partition of the second reference block may be 3 / 4, and the weight of the second reference triangular partition of the second reference block may be 1 / 4. Various other weights of the triangular partitions may be determined.
[0380] The weight of each reference triangle partition may be, but is not limited to, a predetermined value, and the image decoder 110 may obtain the weight of each reference triangle partition from information about the weight included in the bitstream. In this case, the weight of the triangle partition may be determined as one of the one or more weight candidates. In this case, index information indicating one of the one or more weight candidates may be obtained from the bitstream. The weight candidate may be determined for each block, but the present disclosure is not limited thereto. The weight candidate may be determined for each reference block or for each reference triangle partition.
[0381] However, the block is not limited to having a triangular partition shape, and may have a partition mask shape including partitions having various shapes such as a quadrilateral shape. In this case, the shape of the partition mask of the block may be determined as one of one or more partition mask shape candidates. In this case, index information indicating one of the one or more mask shape candidates may be obtained from the bitstream.
[0382] Various embodiments have been described. It will be appreciated by those skilled in the art that various changes in form and detail may be made in the present disclosure without departing from the spirit and scope of the present disclosure. The disclosed embodiments should be considered only in a descriptive sense and not for the purpose of limitation. Therefore, the scope of the present disclosure is not limited by the detailed description of the present disclosure, but by the appended claims, and all differences within the scope will be interpreted as being included in the present disclosure.
[0383] In addition, the embodiments of the present disclosure may be implemented as a computer executable program and may be executed by a general-purpose digital computer that uses a computer readable recording medium to run the program. Examples of computer readable recording media may include magnetic storage media (e.g., read-only memory (ROM), floppy disks, or hard disks) and optical read media (e.g., compact disk read-only memory (CD-ROM) or digital versatile disk (DVD)).
Claims
1. An image decoding method, include: When a prediction mode of a first coding unit is a combined inter-intra prediction mode, determining a first prediction block of the first coding unit by using a weighted sum of a first sample value according to intra prediction and a second sample value according to inter prediction; When the prediction mode of the first coding unit is the combined inter-intra prediction mode, determining a value of a boundary filtering strength applied to a boundary between a first reconstructed block and a second reconstructed block, wherein the value of the boundary filtering strength is equal to a value of the boundary filtering strength used when the prediction mode of the first coding unit is the intra prediction mode; and Based on the determined value of the boundary filtering strength, deblocking filtering is performed on samples adjacent to the boundary, wherein the inter-frame prediction mode includes a merge mode.
2. An image decoding device comprising at least one processor, in, The at least one processor is configured to: When a prediction mode of a first coding unit is a combined inter-intra prediction mode, determining a first prediction block of the first coding unit by using a weighted sum of a first sample value according to intra prediction and a second sample value according to inter prediction; When the prediction mode of the first coding unit is the combined inter-intra prediction mode, determining a value of a boundary filtering strength applied to a boundary between a first reconstructed block and a second reconstructed block, wherein the value of the boundary filtering strength is equal to a value of the boundary filtering strength used when the prediction mode of the first coding unit is the intra prediction mode; and Based on the determined value of the boundary filtering strength, deblocking filtering is performed on samples adjacent to the boundary, wherein the inter-frame prediction mode includes a merge mode.
3. An image encoding method, include: When a prediction mode of a first coding unit is a combined inter-intra prediction mode, determining a first prediction block of the first coding unit by using a weighted sum of a first sample value according to intra prediction and a second sample value according to inter prediction; When the prediction mode of the first coding unit is the combined inter-intra prediction mode, determining a value of a boundary filtering strength applied to a boundary between a first reconstructed block and a second reconstructed block, wherein the value of the boundary filtering strength is equal to a value of the boundary filtering strength used when the prediction mode of the first coding unit is the intra prediction mode; and Based on the determined value of the boundary filtering strength, deblocking filtering is performed on samples adjacent to the boundary, wherein the inter-frame prediction mode includes a merge mode.
4. An apparatus for transmitting a bit stream, in, The bit stream is generated by the image encoding method according to claim 3.
