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

By identifying and utilizing the availability of reference sample points of video blocks for intra prediction, the problem of low encoding and decoding efficiency of high-resolution or high-quality images is solved, and more efficient image compression and decoding is achieved.

CN120455716APending Publication Date: 2025-08-08SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510649169.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-06-21
Filing Date
2020-06-19
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing video encoding technology has low intra prediction efficiency when processing high-resolution or high-quality images, making it difficult to effectively compress and decode image content.

Method used

By identifying the availability of the upper left reference sample point of the current block, search the reference sample points on the left, upper and right reference lines, determine the availability of the remaining reference sample points, and perform intra prediction based on these sample point values, generate prediction blocks and residual blocks, and use the processor to perform inverse quantization and inverse transformation to reconstruct the image.

Benefits of technology

Improves the efficiency of intra prediction, improves the encoding and decoding performance of high-resolution or high-quality images, and enhances image compression effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455716A_ABST
    Figure CN120455716A_ABST
Patent Text Reader

Abstract

A video encoding method and apparatus, and a video decoding method and apparatus are provided. An image decoding method includes: determining a sample value of a left upper reference sample of a current block by identifying availability of the left upper reference sample of the current block when a prediction mode of the current block is an intra mode; except the left upper reference sampling point, sequentially searching a reference sampling point of at least one reference line of a left reference line, an upper reference line and a right reference line of the current block in a direction far away from the left upper reference sampling point, determining sample point values of other reference sample points except the upper left reference sample point of the current block by identifying the availability of the searched reference sample points; obtaining a prediction block of the current block by performing intra prediction on the current block based on the determined sample point value of the upper left reference sample point of the current block and the determined sample point values of the remaining reference sample points except the upper left reference sample point; and obtaining a reconstructed block of the current block based on the prediction block of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the patent application with the application date of June 19, 2020, application number 202080045559.X, and invention name “Video encoding method and device and video decoding method and device”. Technical Field

[0002] A method and apparatus according to an embodiment can encode or decode an image by using coding units of various shapes included in the image.A method and apparatus according to an embodiment include an intra prediction method and apparatus. Background Art

[0003] As hardware capable of reproducing and storing high-resolution or high-quality image content has been developed and become increasingly popular, there is a significant demand for codecs that can efficiently encode or decode high-resolution or high-quality image content. Encoded image content can then be decoded for reproduction. Currently, methods for efficiently compressing high-resolution or high-quality image content are being developed. For example, efficient image compression methods are implemented by processing the image to be encoded according to a predetermined method.

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

[0005] Technical issues

[0006] According to an embodiment of the present disclosure, an image decoding method includes: when a prediction mode of a current block is an intra mode, determining a sample value of an upper left reference sample of the current block by identifying the availability of an upper left reference sample of the current block; in addition to the upper left reference sample, sequentially searching for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determining sample values of the remaining reference samples of the current block except for the upper left reference sample by identifying the availability of the searched reference samples; obtaining a prediction block of the current block by performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except for the upper left reference sample; obtaining residual data of the current block from a bitstream, and obtaining a residual block of the current block by inverse quantizing and inverse transforming the residual data of the current block, wherein the residual block of the current block includes the current block. and obtaining a reconstructed block of the current block based on a prediction block of the current block and a residual block of the current block, wherein the step of determining a sample value of an upper-left reference sample of the current block comprises: when the upper-left reference sample is identified as available, determining a reconstructed sample value for the upper-left reference sample as the sample value of the upper-left reference sample; and when the upper-left reference sample is identified as unavailable, determining a value based on the bit depth of a sample as the sample value of the upper-left reference sample, and the step of determining sample values of remaining reference samples of the current block except the upper-left reference sample comprises: when the reference sample in the current search position is identified as unavailable, determining a value based on the bit depth of a sample or a sample value of a reference sample in a previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determining the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0007] According to an embodiment of the present disclosure, an image decoding device includes: at least one processor configured to: when a prediction mode of a current block is an intra mode, determine a sample value of an upper left reference sample of the current block by identifying availability of an upper left reference sample of the current block; search for reference samples of at least one reference line of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determine sample values of the remaining reference samples of the current block except the upper left reference sample by identifying availability of the searched reference samples; obtain a prediction block of the current block by performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except the upper left reference sample; obtain residual data of the current block from a bitstream, and obtain a residual block of the current block by dequantizing and inverse transforming the residual data of the current block, wherein the residual block of the current block includes coefficients of the current block; and The at least one processor is further configured to: when the upper left reference sample is identified as available, determine the reconstructed sample value for the upper left reference sample as the sample value of the upper left reference sample; and when the upper left reference sample is identified as unavailable, determine a value based on the bit depth of the sample as the sample value of the upper left reference sample; and when the at least one processor determines the sample value of the upper left reference sample, determine the reconstructed sample value for the upper left reference sample as the sample value of the upper left reference sample. When determining sample values of remaining reference samples other than the upper-left reference sample of the current block, the at least one processor is further configured to: when the reference sample in the current search position is identified as unavailable, determine a value based on the bit depth of the sample or a sample value of the reference sample in the previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determine a reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0008] According to an embodiment of the present disclosure, an image encoding method includes: when a prediction mode of a current block is an intra mode, determining a sample value of an upper left reference sample of the current block by identifying availability of an upper left reference sample of the current block; sequentially searching for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determining sample values of the remaining reference samples of the current block except for the upper left reference sample by identifying availability of the searched reference samples; performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except for the upper left reference sample to obtain a prediction block of the current block; generating a residual block including coefficients of the current block based on the prediction block of the current block, and generating transform coefficients of the current block by transforming and quantizing the residual block; and generating a bitstream including information about transform coefficients of the current block, wherein the step of determining a sample value of a top-left reference sample of the current block comprises: when the top-left reference sample is identified as available, determining a reconstructed sample value for the top-left reference sample as the sample value of the top-left reference sample; and when the top-left reference sample is identified as unavailable, determining a value based on the bit depth of a sample as the sample value of the top-left reference sample; and the step of determining sample values of remaining reference samples of the current block other than the top-left reference sample comprises: when the reference sample in the current search position is identified as unavailable, determining a value based on the bit depth of a sample or a sample value of a reference sample in a previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determining the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0009] A computer program for an image decoding method / image encoding method according to an embodiment of the present disclosure is recorded on a computer-readable recording medium.

[0010] Solution to the problem

[0011] According to an embodiment of the present disclosure, an image decoding method includes: when a prediction mode of a current block is an intra mode, determining a sample value of an upper left reference sample of the current block by identifying the availability of an upper left reference sample of the current block; in addition to the upper left reference sample, sequentially searching for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determining sample values of the remaining reference samples of the current block except for the upper left reference sample by identifying the availability of the searched reference samples; obtaining a prediction block of the current block by performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except for the upper left reference sample; obtaining residual data of the current block from a bitstream, and obtaining a residual block of the current block by inverse quantizing and inverse transforming the residual data of the current block, wherein the residual block of the current block includes the sample value of the current block. and obtaining a reconstructed block of the current block based on a prediction block of the current block and a residual block of the current block, wherein the step of determining a sample value of an upper-left reference sample of the current block comprises: when the upper-left reference sample is identified as available, determining a reconstructed sample value for the upper-left reference sample as the sample value of the upper-left reference sample; and when the upper-left reference sample is identified as unavailable, determining a value based on the bit depth of a sample as the sample value of the upper-left reference sample, and the step of determining sample values of remaining reference samples of the current block except the upper-left reference sample comprises: when the reference sample in the current search position is identified as unavailable, determining a value based on the bit depth of a sample or a sample value of a reference sample in a previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determining the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0012] According to an embodiment of the present disclosure, an image decoding device includes: at least one processor configured to: when a prediction mode of a current block is an intra mode, determine a sample value of an upper left reference sample of the current block by identifying availability of an upper left reference sample of the current block; search for reference samples of at least one reference line of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determine sample values of the remaining reference samples of the current block except the upper left reference sample by identifying availability of the searched reference samples; obtain a prediction block of the current block by performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except the upper left reference sample; obtain residual data of the current block from a bitstream, and obtain a residual block of the current block by dequantizing and inverse transforming the residual data of the current block, wherein the residual block of the current block includes coefficients of the current block; and The at least one processor is further configured to: when the upper left reference sample is identified as available, determine the reconstructed sample value for the upper left reference sample as the sample value of the upper left reference sample; and when the upper left reference sample is identified as unavailable, determine a value based on the bit depth of the sample as the sample value of the upper left reference sample; and when the at least one processor determines the sample value of the upper left reference sample, determine the reconstructed sample value for the upper left reference sample as the sample value of the upper left reference sample. When determining sample values of remaining reference samples other than the upper-left reference sample of the current block, the at least one processor is further configured to: when the reference sample in the current search position is identified as unavailable, determine a value based on the bit depth of the sample or a sample value of the reference sample in the previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determine a reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0013] According to an embodiment of the present disclosure, an image encoding method includes: when a prediction mode of a current block is an intra mode, determining a sample value of an upper left reference sample of the current block by identifying availability of an upper left reference sample of the current block; sequentially searching for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determining sample values of the remaining reference samples of the current block except for the upper left reference sample by identifying availability of the searched reference samples; performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except for the upper left reference sample to obtain a prediction block of the current block; generating a residual block including coefficients of the current block based on the prediction block of the current block, and generating transform coefficients of the current block by transforming and quantizing the residual block; and generating a bitstream including information about transform coefficients of the current block, wherein the step of determining a sample value of a top-left reference sample of the current block comprises: when the top-left reference sample is identified as available, determining a reconstructed sample value for the top-left reference sample as the sample value of the top-left reference sample; and when the top-left reference sample is identified as unavailable, determining a value based on the bit depth of a sample as the sample value of the top-left reference sample; and the step of determining sample values of remaining reference samples of the current block other than the top-left reference sample comprises: when the reference sample in the current search position is identified as unavailable, determining a value based on the bit depth of a sample or a sample value of a reference sample in a previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determining the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

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

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

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

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

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

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

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

[0021] Figure 3a is a diagram for describing a process in which the image decoding apparatus 100 determines sample values of reference samples to be stored in a reference buffer for intra prediction according to an embodiment.

[0022] Figure 3b is a diagram for describing a method of determining a sample value of a corresponding reference sample (and configuring a reference buffer) performed by the image decoding apparatus 100 when the image decoding apparatus 100 uses a reference sample spaced apart from a current block 200 for intra prediction according to an embodiment.

[0023] Figure 3c is a diagram for describing a method of configuring a single buffer that can determine sample values of corresponding reference samples, performed by the image decoding apparatus 100 when the image decoding apparatus 100 performs intra prediction using reference samples spaced apart from the current block 200 according to an embodiment.

[0024] Figure 3d Pseudo code for implementing an operation of configuring an upper reference line buffer performed by the image decoding apparatus 100 according to an embodiment is shown.

[0025] Figures 4a to 4g is a diagram for describing a process in which the image decoding apparatus 100 determines reference samples (pixels) around corners of a current block 200 when the image decoding apparatus 100 performs intra prediction on the current sample in an angular mode according to an embodiment.

[0026] Figure 5a This diagram is used to describe a split unit coding order (SUCO) method for determining a forward or backward coding (decoding) order between coding units based on a coding order flag according to an embodiment of the present disclosure, and to describe how a right reference line can be used for intra-frame prediction according to a coding (decoding) order based on the SUCO method.

[0027] Figure 5b is a diagram for describing a SUCO status determined based on the availability of a left neighboring area and a right neighboring area according to the SUCO method.

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

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

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

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

[0032] Figure 10 Illustrated is an order in which, when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit, the plurality of coding units are processed according to an embodiment.

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

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

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

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

[0037] Figure 15 It is shown that a processing order among a plurality of coding units may be changed according to a process of splitting the coding units according to an embodiment.

[0038] Figure 16 Illustrated is a process of determining a depth of a coding unit when a shape and size of a coding unit change when a coding unit is recursively split such that a plurality of coding units are determined, according to an embodiment.

[0039] Figure 17 Depths that may be determined based on shapes and sizes of coding units and partial indices (PIDs) for distinguishing coding units according to an embodiment are illustrated.

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

[0041] Figure 19 A processing block serving as a unit for determining an order of reference coding units included in a picture according to an embodiment is illustrated.

[0042] Best Mode

[0043] According to an embodiment of the present disclosure, an image decoding method includes: when a prediction mode of a current block is an intra mode, determining a sample value of an upper left reference sample of the current block by identifying the availability of an upper left reference sample of the current block; in addition to the upper left reference sample, sequentially searching for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determining sample values of the remaining reference samples of the current block except for the upper left reference sample by identifying the availability of the searched reference samples; obtaining a prediction block of the current block by performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except for the upper left reference sample; obtaining residual data of the current block from a bitstream, and obtaining a residual block of the current block by inverse quantizing and inverse transforming the residual data of the current block, wherein the residual block of the current block includes the sample value of the current block. and obtaining a reconstructed block of the current block based on a prediction block of the current block and a residual block of the current block, wherein the step of determining a sample value of an upper-left reference sample of the current block comprises: when the upper-left reference sample is identified as available, determining a reconstructed sample value for the upper-left reference sample as the sample value of the upper-left reference sample; and when the upper-left reference sample is identified as unavailable, determining a value based on the bit depth of a sample as the sample value of the upper-left reference sample, and the step of determining sample values of remaining reference samples of the current block except the upper-left reference sample comprises: when the reference sample in the current search position is identified as unavailable, determining a value based on the bit depth of a sample or a sample value of a reference sample in a previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determining the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0044] The determining of sample values of the remaining reference samples of the current block except the upper left reference sample may include: when availability of the reference sample in the current search position is identified from the remaining reference samples except the upper left reference sample, when it is identified that intra prediction is performed by not using reference samples reconstructed according to the inter mode and by using only reference samples reconstructed according to the intra mode, identifying the reference sample in the current search position as unavailable when a prediction mode of a reference block including the reference sample in the current search position is the inter mode.

[0045] The determining of sample values of the remaining reference samples of the current block except the top-left reference sample may include: when identifying availability of the reference sample in the current search position from the remaining reference samples except the top-left reference sample, identifying the reference sample in the current search position as unavailable when the reference sample in the current search position is located outside a picture, included in a different slice from the current block, or included in a different tile from the current block.

[0046] The step of obtaining the prediction block of the current block may include: when the intra prediction mode of the current block is the DC mode, identifying availability of a left neighboring area and a right neighboring area of the current block; and based on the identified availability of the left neighboring area and the right neighboring area of the current block, obtaining a prediction sample value of a sample in the current block by using samples of at least one reference line determined among a left reference line, an upper reference line, and a right reference line of the current block.

[0047] The step of obtaining the predicted sample value of the sample in the current block may include: when the left neighboring area is identified as available and the right neighboring area is identified as unavailable, obtaining the predicted sample value of the sample in the current block based on an average of the sample values of the reference samples of the determined left reference line and the sample values of the reference samples of the determined upper reference line.

[0048] The step of obtaining the predicted sample value of the sample in the current block may include: when the right neighboring area is identified as available and the left neighboring area is identified as unavailable, obtaining the predicted sample value of the sample in the current block based on an average of the sample values of the reference samples of the determined upper reference line and the sample values of the reference samples of the determined right reference line.

[0049] The step of obtaining the predicted sample value of the sample in the current block may include: when the right neighboring area and the left neighboring area are identified as available, obtaining the predicted sample value of the sample in the current block based on an average of the sample values of the reference samples of the determined upper reference line and the sample values of the reference samples of the determined right reference line.

[0050] When the coordinate value of the sample point at the upper left corner of the current block is (0, 0), the coordinate value of the upper left reference sample point of the current block may be (-1, -1).

[0051] The step of obtaining a prediction block for the current block may include: when an intra prediction mode of the current block is an angular mode, performing filtering using an N-tap interpolation filter (N is a natural number greater than 1) by using a first reference sample of the at least one reference line and sample values of neighboring samples adjacent to the first reference sample, and obtaining a prediction sample value of the current sample based on a result of the filtering, wherein the first reference sample is connected to a line extended from the current sample in the current block in an intra prediction direction indicated by the angular mode or in a direction opposite to the intra prediction direction, the sample values of the neighboring samples may be sample values of coordinates modified by clipping coordinates of the neighboring samples, and when a coordinate value of a sample at the upper left corner of the current block is (0, 0), a lower limit of a clipped range may be -1, and an upper limit of the clipped range may be a value based on at least one of a height and a width of the current block.

[0052] The search direction of the upper reference line may be a right direction from the upper left reference sample point, the search direction of the left reference line may be a downward direction from the upper left reference sample point, and the search direction of the right reference line may be a downward direction from the upper right reference sample point of the current block, and when the coordinate value of the sample point at the upper left corner of the current block is (0, 0), the x-coordinate value of the upper right reference sample point of the current block may be the width of the current block, and the y-coordinate value may be -1.

[0053] The image decoding method may further include: obtaining one or more coding units by hierarchically dividing the current image based on a division shape pattern, wherein one of the one or more coding units may be the current block, and the division shape pattern may be based on a division type including one of quadruple division, binary division and ternary division.

[0054] When the division direction of the first coding unit is a vertical direction, the decoding order of the left second coding unit and the right second coding unit divided according to the division direction can be determined in the order of the left second coding unit and then the right second coding unit, or in the order of the right second coding unit and then the left second coding unit.

[0055] The value based on the bit depth of the sample may be a median value within a range of sample values indicated by the bit depth of the sample.

[0056] According to an embodiment of the present disclosure, an image decoding device includes: at least one processor configured to: when a prediction mode of a current block is an intra mode, determine a sample value of an upper left reference sample of the current block by identifying availability of an upper left reference sample of the current block; search for reference samples of at least one reference line of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determine sample values of the remaining reference samples of the current block except the upper left reference sample by identifying availability of the searched reference samples; obtain a prediction block of the current block by performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except the upper left reference sample; obtain residual data of the current block from a bitstream, and obtain a residual block of the current block by dequantizing and inverse transforming the residual data of the current block, wherein the residual block of the current block includes coefficients of the current block; and The at least one processor is further configured to: when the upper left reference sample is identified as available, determine the reconstructed sample value for the upper left reference sample as the sample value of the upper left reference sample; and when the upper left reference sample is identified as unavailable, determine a value based on the bit depth of the sample as the sample value of the upper left reference sample; and when the at least one processor determines the sample value of the upper left reference sample, determine the reconstructed sample value for the upper left reference sample as the sample value of the upper left reference sample. When determining sample values of remaining reference samples other than the upper-left reference sample of the current block, the at least one processor is further configured to: when the reference sample in the current search position is identified as unavailable, determine a value based on the bit depth of the sample or a sample value of the reference sample in the previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determine a reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0057] According to an embodiment of the present disclosure, an image encoding method includes: when a prediction mode of a current block is an intra mode, determining a sample value of an upper left reference sample of the current block by identifying availability of an upper left reference sample of the current block; sequentially searching for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, and determining sample values of the remaining reference samples of the current block except for the upper left reference sample by identifying availability of the searched reference samples; performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except for the upper left reference sample to obtain a prediction block of the current block; generating a residual block including coefficients of the current block based on the prediction block of the current block, and generating transform coefficients of the current block by transforming and quantizing the residual block; and generating a bitstream including information about transform coefficients of the current block, wherein the step of determining a sample value of a top-left reference sample of the current block comprises: when the top-left reference sample is identified as available, determining a reconstructed sample value for the top-left reference sample as the sample value of the top-left reference sample; and when the top-left reference sample is identified as unavailable, determining a value based on the bit depth of a sample as the sample value of the top-left reference sample; and the step of determining sample values of remaining reference samples of the current block other than the top-left reference sample comprises: when the reference sample in the current search position is identified as unavailable, determining a value based on the bit depth of a sample or a sample value of a reference sample in a previous search position as the sample value of the reference sample in the current search position; and when the reference sample in the current search position is identified as available, determining the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

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

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

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

[0061] In this specification, where possible, common terms that are currently widely used are selected in consideration of the functions of the present disclosure, but non-common terms may be selected based on the intentions of those skilled in the art, precedents, or new technologies. Some terms may be arbitrarily selected by the applicant. In such cases, the meanings of these terms will be explained in detail in the corresponding parts of this disclosure. Therefore, the terms used herein should not be defined based on their names but on their meanings and the entire context of this disclosure.

[0062] As used herein, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

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

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

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

[0066] The term "memory" should be broadly interpreted 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, and the like. When a processor is able to read information from and / or write information to the memory, the memory is said to be in electronic communication with the processor. Memory that is integrated into a processor is in electronic communication with the processor.

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

[0068] The term "sample," as used herein, refers to data assigned to a sampling location of an image, i.e., data to be processed. For example, a sample can be a pixel value in the spatial domain and a transform coefficient in the transform domain. A unit comprising at least one such sample can be defined as a block. Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement the embodiments of the present disclosure. Furthermore, portions not relevant to the description will be omitted from the drawings to clarify the present disclosure.

[0069] In the following, referring to FIG. Figure 19 An image encoding apparatus and an image decoding apparatus as well as an image encoding method and an image decoding method according to embodiments are described in detail.

[0070] Will refer to Figures 6 to 19 A method for determining a data unit of an image according to an embodiment will be described with reference to Figures 1a to 5b An encoding method and apparatus or an image decoding method and apparatus for efficiently performing intra prediction in consideration of availability of identifying neighboring reference samples according to an embodiment is described.

[0071] In the following, reference is made to Figures 1a to 5b An image encoding method and apparatus or an image decoding method and apparatus for efficiently performing intra prediction in consideration of availability of identifying neighboring reference samples according to an embodiment of the present disclosure will be described in detail.

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

[0073] The image decoding apparatus 100 according to various embodiments may include an obtainer 105 and an image decoder 110 .

[0074] The obtainer 105 and the image decoder 110 may include at least one processor. In addition, the obtainer 105 and the image decoder 110 may include a memory storing instructions to be executed by the at least one processor.

[0075] The image decoder 110 may be implemented as hardware separate from the obtainer 105 , or may include the obtainer 105 .

[0076] The image decoder 110 may include an intra predictor 115. In this case, the image decoder 110 may be implemented as hardware separate from the intra predictor 115.

[0077] The intra predictor 115 may obtain a predicted block of the current block by performing intra prediction on the current block using reference samples included in a neighboring region of the current block.

[0078] The image decoder 110 may obtain a reconstructed block of the current block based on the prediction block of the current block obtained by the intra predictor 115 .

[0079] When the prediction mode of the current block is intra mode, the intra predictor 115 may identify the availability of the upper left reference sample of the current block and may determine the sample value of the upper left reference sample of the current block. The reason for performing this operation is to determine the sample value of the reference sample used for intra prediction of the current block. Here, the sample value of the reference sample determined for intra prediction of the current block may be stored in a reference buffer. The reference buffer may have a one-dimensional arrangement shape. That is, the intra predictor 115 may determine the sample value of the reference sample and may configure the reference buffer based on the determined sample value of the reference sample. The intra predictor 115 may determine the sample value of the reference sample and may store the determined sample value of the reference sample in a corresponding position in the reference buffer.

[0080] In addition, the reference samples stored in the reference buffer may be marked. For example, the first reference sample stored in the reference buffer may be marked as "usable for intra prediction" or "unusable for intra prediction." The intra predictor 115 may perform intra prediction on the current block using the reference samples stored in the reference buffer that are marked as "usable for intra prediction."

[0081] Hereinafter, according to an embodiment, a method is described in detail, according to which the intra-frame predictor 115 can determine a sample value of a reference sample, store the determined sample value in a reference buffer, perform marking on the stored sample, and perform intra-frame prediction based on the stored sample.

[0082] When it is recognized that the upper left reference sample is available, the intra predictor 115 may determine the sample value reconstructed for the upper left reference sample as the sample value of the upper left reference sample. Here, when the coordinate value of the upper left corner sample of the current block is (0, 0), the coordinate value of the upper left reference sample may be (-1, -1). That is, the upper left reference sample may represent a pixel directly adjacent to the upper left side of the upper left corner sample of the current block.

[0083] When it is recognized that the top left reference sample is not available, the intra predictor 115 may determine a default value (such as 0 or a value based on the bit depth of the sample) as the sample value of the top left reference sample. For example, the value based on the bit depth of the sample may be a median value or a maximum value within the range of sample values indicated by the bit depth of the sample. That is, when the bit depth is 8, within the range of sample values (0-255) indicated by the bit depth of the sample, the value based on the bit depth of the sample may be 128 (or 127) (as a median value) or 255 (as a maximum value). Alternatively, when it is recognized that the top left reference sample is not available, the intra predictor 115 may determine a default value (such as the median value, maximum value, or minimum value of the bit depth of the sample indicated for each of luma and chroma when a tool such as adaptive bit depth is applied) as the sample value of the top left reference sample. For example, when the bit depth of samples indicated for each of luma and chroma is N, the median of the bit depth may be indicated as (1<<(N-1)), and when N is 10 bits, the median may be 512.

[0084] The intra-frame predictor 115 may identify whether the reference sample in the current position is available as follows. That is, when the current position is outside the picture, the intra-frame predictor 115 may identify that the reference sample in the corresponding position is unavailable, and when the current position is inside the picture, the intra-frame predictor 115 may identify that the reference sample in the corresponding position is available. When the current position is included in a different slice from the current block, the intra-frame predictor 115 may identify that the reference sample in the corresponding position is unavailable, and when the current position is included in the same slice as the current block, the intra-frame predictor 115 may identify that the reference sample in the corresponding position is available.

[0085] When the current position is included in a different tile from the current block, the intra predictor 115 may recognize that the reference sample in the corresponding position is unavailable. When the current position is included in the same tile as the current block, the intra predictor 115 may recognize that the reference sample in the corresponding position is available.

[0086] When the current position is located on a different side from the current block based on a virtual boundary (for example, when the current position is located on a different side from the current block based on a boundary of a window in a 360-degree image, or when the current position is located in a different flexible tile from the current block based on a boundary of a flexible tile having a boundary within a coding tree unit (CTU) or a maximum coding unit), the intra predictor 115 may recognize that the reference sample in the corresponding position is unavailable, and when this is not the case, the intra predictor 115 may recognize that the reference sample in the corresponding position is available. That is, the flexible tile may be a plurality of tiles divided from an image and having different sizes from each other, and when the flexible tile is used, the boundary between the flexible tiles may be within the CTU.

[0087] When it is identified that constrained intra prediction (CIP) is used, the intra predictor 115 may identify that the reference samples in the corresponding position are unavailable when the corresponding position is encoded in inter mode. In addition, when the corresponding position is encoded in intra mode, the reference samples in the corresponding position may be identified as available. Here, CIP may mean that for intra prediction of the current block, when the neighboring block is encoded in inter mode, intra prediction is performed by not using the samples of the corresponding neighboring block encoded in inter mode and by using only the samples of the neighboring block encoded in intra mode, so as to prevent error propagation. Here, a CIP activation flag may be obtained from the bitstream, and whether CIP is used may be identified based on the corresponding CIP activation flag. In addition, the prediction mode of the neighboring block may be identified based on the prediction mode information of the neighboring block (e.g., the neighboring coding unit including the reference sample in the corresponding position) obtained from the bitstream.

[0088] When there is a reconstructed sample for the current position, the intra predictor 115 may recognize that a reference sample in the corresponding position is available.

[0089] The intra predictor 115 may identify the availability of reference samples in the corresponding position by combining the above-mentioned various situations.

[0090] In addition to the top-left reference sample, the intra predictor 115 may sequentially search for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the top-left reference sample. The intra predictor 115 may determine sample values of the remaining reference samples of the current block except for the top-left reference sample by identifying the availability of the searched reference samples.

[0091] Here, a reference line may represent a row or column including multiple reference samples, and may be a row or column directly adjacent to a corner row or column of the current block, a column directly adjacent to the left of the left corner column of the current block, a row directly adjacent to the top of the top corner row, or a column directly adjacent to the right of the right corner column. Here, the length of the reference line may be greater than the height or width of the current block. Samples that are not directly adjacent to the current block may be referenced depending on the prediction direction. Therefore, the length of the reference line may be greater than the height or width of the current block.

[0092] For example, the length of the reference line may be a value obtained by summing the height and width of the current block, but is not limited thereto and may have various values.

[0093] For example, when the coordinate value of the upper left corner of the current block is (0, 0), the x coordinate of the reference sample included in the left reference line of the current block may be -1, and the y coordinate may be a value within a range from -1 (or 0) to a value obtained by subtracting 1 from a value obtained by summing the height and width of the current block, the y coordinate of the reference sample included in the upper reference line of the current block may be -1, and the x coordinate may be a value within a range from -1 (or 0) to a value obtained by subtracting 1 from a value obtained by summing the height and width of the current block. The x coordinate of the reference sample included in the right reference line of the current block may be the width of the current block, and the y coordinate may be a value within a range from -1 (or 0) to a value obtained by subtracting 1 from a value obtained by summing the height and width of the current block.

[0094] Here, the search direction of the upper reference line may be the right direction from the upper left reference sample point, the search direction of the left reference line may be the downward direction from the upper left reference sample point, and the search direction of the right reference line may be the downward direction from the upper right reference sample point of the current block. When the coordinate value of the sample point at the upper left corner of the current block is (0, 0), the x coordinate of the upper right reference sample point of the current block may be the width of the current block, and the y coordinate may be -1.

[0095] When the reference sample in the current search position is identified as unavailable, the intra predictor 115 may determine a default value or a sample value of the reference sample in the previous search position as the sample value of the reference sample in the current search position. Here, the default value may be the same as the default value described above. For example, the default value may be a value based on the bit depth of the sample, and may be a median or maximum value of a range of sample values indicated by the bit depth of the sample.

[0096] When the reference sample in the current search position is identified as available, the intra predictor 115 may determine the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0097] As described above, when the intra predictor 115 identifies the availability of the reference sample in the current search position from reference samples other than the upper left reference sample, and when it is identified that intra prediction is performed by not using the reference samples reconstructed in the inter mode but by using only the reference samples reconstructed in the intra mode (i.e., CIP), when the prediction mode of the reference block including the reference sample in the current search position corresponds to the inter mode, the intra predictor 115 may identify that the reference sample in the current search position is unavailable. Alternatively, when the intra predictor 115 identifies the availability of the reference sample in the current search position from reference samples other than the upper left reference sample, when the reference sample in the current search position is outside the picture, included in a different slice from the current block, included in a different tile from the current block, or located on a different side from the current block based on a virtual boundary, the intra predictor 115 may determine that the reference sample in the current search position is unavailable.

[0098] When the intra predictor 115 identifies the availability of a reference sample in the current search position from reference samples other than the upper left reference sample, the intra predictor 115 may identify that the reference sample in the current search position is unavailable when there is a reconstructed sample value for the reference sample in the current search position.

[0099] The intra predictor 115 may identify the availability of reference samples in the current search position by combining the above-mentioned various conditions.

[0100] The intra predictor 115 may obtain a prediction block of the current block by performing intra prediction on the current block based on the sample value of the upper left reference sample of the current block and the sample value of the reference sample other than the upper left reference sample. Here, the sample value of the upper left reference sample of the current block and the sample value of the reference sample other than the upper left reference sample may be stored in a reference buffer, and all reference samples stored in the reference buffer may be marked as "usable for intra prediction".

[0101] Therefore, when the intra-frame predictor 115 performs intra-frame prediction using reference samples stored in the reference buffer, the intra-frame predictor 115 does not need to separately identify the availability of the reference samples stored in the reference buffer and can freely use all reference samples stored in the reference buffer to perform intra-frame prediction. That is, after determining the sample value of the top-left reference sample stored in the reference buffer as a reliable value according to the above series of methods, the intra-frame predictor 115 can sequentially search for the remaining reference samples other than the top-left reference sample based on the availability of the reference samples and determine the sample values of the remaining reference samples as reliable values regardless of the availability of the reference samples in the current search position. Therefore, all reference samples stored in the reference buffer can be determined to be available for intra-frame prediction, and therefore, intra-frame prediction can be performed by freely using all reference samples stored in the reference buffer.

[0102] However, the present disclosure is not limited thereto. Even when all reference samples stored in the reference buffer are marked as available, the reference samples in the predetermined positions may have a possibility that their sample values may not be properly derived for intra prediction, and therefore, whether the reference samples stored in the reference buffer can be used for intra prediction may be additionally identified as needed.

[0103] The image decoder 110 may determine at least one coding unit by hierarchically dividing the current image. For example, the image decoder 110 may determine at least one coding unit by hierarchically dividing the current image based on a division shape pattern of the current image. Here, the division shape pattern may indicate at least one of whether division is performed, a division direction, and a division type. The division type may indicate one of binary division, ternary division, and quadruple division. The obtainer 105 may obtain information about the division shape pattern of the current image, and the image decoder 110 may determine at least one coding unit by hierarchically dividing the current image based on the obtained information about the division shape pattern of the current image. Here, the current block on which the intra predictor 115 performs intra prediction may be one of the at least one determined coding units.

[0104] When the division direction of the first coding unit is a vertical direction, the image decoder 110 may determine the decoding order of the left second coding unit and the right second coding unit divided according to the division direction as the order of the left second coding unit and then the right second coding unit, or as the order of the right second coding unit and then the left second coding unit. Here, the method of determining whether the encoding order and decoding order of the divided right and left coding units are determined to be forward or backward is referred to as a division unit coding order (SUCO) method.

[0105] When the SUCO method is not applied, the image decoder 110 may determine the decoding order of the second coding unit as the order of the second coding unit on the left and then the second coding unit on the right (forward). However, when the SUCO method is applied, the image decoder 110 may determine the decoding order of the second coding unit as the order of the second coding unit on the left and then the second coding unit on the right (forward) or the order of the second coding unit on the right and then the second coding unit on the left (backward). Figure 5a Describes detailed aspects of the SUCO method.

[0106] By considering the decoding order of the coding units when the SUCO method is applied, reference samples available for intra prediction may not be limited to the left neighboring area and the upper neighboring area, and may also include the right neighboring area. However, the left neighboring area and the right neighboring area may not always be available, and therefore, the intra predictor 115 may recognize the availability of the left neighboring area and the right neighboring area by considering the decoding order, and may perform intra prediction on the current block by considering the availability of the left neighboring area and the right neighboring area.

[0107] For example, when the intra prediction mode of the current block is the direct current (DC) mode and the reference buffer is configured as described above, the sample values of the reference samples of all left reference lines, upper reference lines, and right reference lines of the current block stored in the reference buffer may be defined. Therefore, the intra predictor 115 can perform intra prediction on the current block without additionally identifying availability. That is, when the intra prediction mode of the current block is the DC mode, the intra predictor 115 can determine the predicted sample value of the sample in the current block by using the average value of the reference samples in all directions (left, upper, and right directions).

[0108] When the SUCO method is applied, the intra predictor 115 may recognize a condition according to the SUCO method. Figure 5b The situation according to the SUCO method is described in detail. Here, the identification of the situation according to the SUCO method may correspond to the identification of the availability of the left neighboring area and the upper neighboring area of the current block.

[0109] The intra-frame predictor 115 may obtain predicted sample values of samples in the current block by using samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block based on the availability of the left neighboring area and the right neighboring area of the current block. For example, the intra-frame predictor 115 may identify one of various conditions LR_00, LR_01, LR_10, and LR_11 according to the SUCO method, and based on the identified condition according to the SUCO method, obtain predicted sample values of samples in the current block by using samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block.

[0110] When the left neighboring area is identified as available and the right neighboring area is identified as unavailable, the intra-frame predictor 115 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the left reference line and the average value of the sample value of the reference sample of the upper reference line. For example, when the condition according to the SUCO method is LR_10, the intra-frame predictor 115 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the left reference line and the average value of the sample value of the reference sample of the upper reference line.

[0111] Alternatively, when the left neighboring area of the current block is identified as unavailable and the right neighboring area is identified as available, the intra-frame predictor 115 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the right reference line and the average value of the sample value of the reference sample of the upper reference line. For example, when the condition according to the SUCO method is LR_01, the intra-frame predictor 115 may obtain the predicted sample value of the sample in the current block based on the average value of the sample value of the reference sample of the right reference line and the average value of the sample value of the reference sample of the upper reference line.

[0112] Alternatively, when the left neighboring area of the current block is identified as available and the right neighboring area is identified as available, the intra-frame predictor 115 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the left reference line, the sample value of the reference sample of the right reference line, and the average value of the sample value of the reference sample of the upper reference line. For example, when the condition according to the SUCO method is LR_11, the intra-frame predictor 115 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the left reference line, the sample value of the reference sample of the right reference line, and the average value of the sample value of the reference sample of the upper reference line.

[0113] Alternatively, when the left neighboring area of the current block is identified as unavailable and the right neighboring area is identified as unavailable, the intra-frame predictor 115 may obtain the predicted sample values of the samples in the current block based on the average of the sample values of the reference samples of the upper reference line. For example, when the condition according to the SUCO method is LR_00, the intra-frame predictor 115 may obtain the predicted sample values of the samples in the current block based on the average of the sample values of the reference samples of the upper reference line. However, this is not limiting. When the condition according to the SUCO method is LR_00, the intra-frame predictor 115 may obtain the predicted sample values of the samples in the current block based on the average of the sample values of the reference samples of the left reference line and the sample values of the reference samples of the upper reference line.

[0114] As described above, when the intra prediction mode is the DC mode, the intra predictor 115 may obtain the predicted sample value of the sample in the current block by using samples of at least one of the left reference line, the upper reference line, and the right reference line of the current block based on the availability of the left and right neighboring areas of the current block. However, the present disclosure is not limited thereto. Regardless of the availability of the neighboring area of the current block, the predicted sample value of the sample in the current block may be obtained by using samples of at least one of the determined reference lines of the left reference line, the upper reference line, and the right reference line of the block.

[0115] In addition, when the intra-frame prediction mode is the DC mode, the intra-frame predictor 115 can obtain the predicted sample value of the sample in the current block by using the sample of at least one reference line among the left reference line, the upper reference line and the right reference line of the current block based not only on the availability of the left neighboring area and the availability of the right neighboring area, but also on the availability of the upper neighboring area.

[0116] Hereinafter, according to an embodiment, a method of efficiently signaling a chroma intra prediction mode performed by the image decoding apparatus 100 is described.

[0117] The chroma intra prediction mode may include a total of five modes, namely, direct mode (DM), DC mode, vertical mode and horizontal mode. Here, direct mode (referred to as DM or DM mode) means an intra prediction mode that uses the luma intra prediction mode as the chroma intra prediction mode intact. When the intra prediction mode indicated by DM overlaps with the remaining four modes, one of the four modes (the mode overlapping with the intra prediction mode indicated by DM) may be replaced by another mode, or one bit may be saved via truncated binarization. However, in this case, dependency on DM may occur, and an additional context model may be required. Therefore, hereinafter, a simple method of signaling a chroma intra prediction mode is described.

[0118] When the number of chroma intra prediction mode candidates remains at five, DM is selected as the same intra prediction mode as the remaining intra prediction mode candidates, and overlap may be allowed. Here, information about whether the chroma intra prediction mode is DM may be encoded as a 1-bit flag using binary arithmetic encoding based on the context. When the chroma intra prediction mode is not DM, the remaining four intra prediction mode candidates may be encoded as 2 bits using fixed-length coding (FLC).

[0119] Therefore, the obtainer 105 may obtain a 1-bit flag indicating whether the chroma intra prediction mode is DM from the bitstream, and may identify whether the chroma intra prediction mode is DM based on the value of the information on whether the chroma intra prediction mode is DM, wherein the information is obtained by performing binary arithmetic decoding based on a context model. Here, when performing binary arithmetic decoding based on a context model, one context model may be used.

[0120] When it is determined that the chroma intra prediction mode of the current block is not DM, the obtainer 105 can obtain 2 bits of information about the chroma intra prediction mode from the bitstream, determine the value of the 2 bits of information by debinarizing it according to the FLC, and obtain the chroma intra prediction mode corresponding to the value. Therefore, the dependence on DM can be eliminated, various comparison operations can be reduced, and the chroma intra prediction mode can be signaled in a simple manner without using an additional context model.

[0121] The intra-frame predictor 115 may perform intra-frame prediction using reference samples that are spaced apart from the current block and do not directly contact the current block. For example, when the coordinate value of the upper left corner of the current block is (0, 0), reference samples with coordinate values of (-2, -1), (-1, -2), (the width of the current block, -2), etc. may be used. Here, the length of the left reference line buffer and the upper reference line buffer may be extended according to the intra-frame prediction method or intra-frame prediction mode. The intra-frame predictor 115 may increase the length of the reference line buffer, identify the availability of the reference sample, and determine the reconstructed sample value for the corresponding reference sample as the sample value of the reference sample based on the availability of the reference sample. When the reference sample is unavailable, the sample value of the reference sample may be determined as a default value or the sample value of another available reference sample. Here, the determined sample value of the reference sample may be stored in the reference line buffer.

[0122] The following will refer to Figure 3b and 3C describe a method of using sample values of a reference line buffer in another direction closer to the current block or determining corresponding reference samples without changing the length of the reference line buffer.

[0123] When the intra prediction mode is the angular mode, the intra predictor 115 may perform intra prediction on the current sample in the current block by using an N-tap interpolation filter and the sample values of a plurality of reference samples required for filtering. That is, the intra predictor 115 may obtain the predicted sample value of the current sample in the current block by filtering the reference samples intersecting the extended line from the current sample in the intra prediction direction (or the opposite direction) and the reference samples adjacent to the aforementioned reference samples using the N-tap interpolation filter. Here, the following will refer to Figures 4a to 4gDescribed is a method of determining sample values of reference samples to be used for intra prediction, performed by the intra predictor 115, when reference samples intersecting a line extended from the current sample in the intra prediction direction (or the opposite direction) are located around the corners of the current block.

[0124] The obtainer 105 may obtain residual data of the current block from the bitstream. Here, the residual data may include information about a transform coefficient of the current block.

[0125] The image decoder 110 may inversely quantize and inversely transform the residual data of the current block to obtain a residual block of the current block, wherein the residual block of the current block includes coefficients of the current block.

[0126] The image decoder 110 may obtain a reconstructed block of the current block based on the prediction block of the current block and the residual block of the current block. For example, the image decoder 110 may obtain a reconstructed sample value of the current sample in the reconstructed block by summing the predicted sample value of the current sample in the prediction block with the residual sample value of the current sample in the residual block, and may obtain the reconstructed block of the current block based on the reconstructed sample value.

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

[0128] In operation S105, when the prediction mode of the current block is the intra mode, the image decoding apparatus 100 may determine the sample value of the upper left reference sample of the current block by identifying the availability of the upper left reference sample of the current block. For example, when the upper left reference sample is identified as available, the image decoding apparatus 100 may determine the reconstructed sample value for the upper left reference sample as the sample value of the upper left reference sample. When the upper left reference sample is identified as unavailable, the image decoding apparatus 100 may determine the sample value of the upper left reference sample as a value based on the bit depth of the sample.

[0129] In operation S110, the image decoding apparatus 100 may sequentially search for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the upper left reference sample, in addition to the upper left reference sample of the current block, and determine sample values of the remaining reference samples of the current block, in addition to the upper left reference sample, by identifying the availability of the searched reference samples. For example, when the reference sample in the current search position is identified as unavailable, the image decoding apparatus 100 may determine a value based on the bit depth of the sample or a sample value of a reference sample in a previous search position as the sample value of the reference sample in the current search position.

[0130] When the reference sample in the current search position is identified as available, the image decoding apparatus 100 may determine the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0131] In operation S115 , the image decoding apparatus 100 may obtain a predicted block of the current block by performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except the upper left reference sample.

[0132] In operation S120, the image decoding apparatus 100 may obtain residual data of the current block from a bitstream, and may obtain a residual block of the current block including coefficients of the current block by inverse-quantizing and inverse-transforming the residual data of the current block.

[0133] In operation S125 , the image decoding apparatus 100 may obtain a reconstructed block of the current block based on the prediction block of the current block and the residual block of the current block.

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

[0135] The image decoder 6000 according to various embodiments may perform operations performed by the obtainer 105 and the image decoder 110 of the image decoding apparatus 100 to decode image data.

[0136] Reference Figure 1c , the entropy decoder 6150 parses the coded image data to be decoded and the coding information required for decoding from the bitstream 6050. The coded 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.

[0137] The intra-frame predictor 6400 performs intra-frame prediction on each block in the block. The inter-frame predictor 6350 performs inter-frame prediction on each block by using the reference image obtained from the reconstructed picture buffer 6300. The prediction data for each block generated by the intra-frame predictor 6400 or the inter-frame predictor 6350 can be added to the residual data to reconstruct the spatial domain data of the block of the current image, and the deblocker 6450 and the sample adaptive offset (SAO) performer 6500 can perform loop filtering on the reconstructed data in the spatial domain so that the filtered reconstructed image 6600 can be output. In addition, the reconstructed image stored in the reconstructed picture buffer 6300 can be output as a reference image.

[0138] In order for the obtainer 105 and the image decoder 110 of the image decoding apparatus 100 to decode image data, operations of the image decoder 6000 according to various embodiments may be performed on each block.

[0139] For example, the operation of the intra predictor 6400 may correspond to the operation of the intra predictor 115 .

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

[0141] The image encoding apparatus 150 according to various embodiments may include an image encoder 155 and a bitstream generator 170 .

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

[0143] The image encoder 155 may determine at least one coding unit by hierarchically dividing the current image. For example, the image encoder 155 may determine at least one coding unit by hierarchically dividing the current image based on a division shape pattern of the current image. The current block on which the intra predictor 160 performs intra prediction may be one of the determined at least one coding unit.

[0144] Here, the division shape mode may indicate at least one of whether to divide, a division direction, and a division type. The division type may indicate one of binary division, ternary division, and quaternary division.

[0145] The image encoder 155 may encode information about the division shape pattern of the current image, and the bitstream generator 170 may generate a bitstream including the encoded information about the division shape pattern of the current image.

[0146] The image encoder 155 may include an intra predictor 160. Here, the image encoder 155 and the intra predictor 160 may be implemented as hardware separate from each other.

[0147] The intra predictor 160 may obtain a predicted block of the current block by performing intra prediction on the current block using reference samples included in a neighboring region of the current block.

[0148] When the prediction mode of the current block is intra mode, the intra predictor 160 can determine the sample value of the upper left reference sample of the current block by identifying the availability of the upper left reference sample of the current block. This operation is performed to determine the sample value of the reference sample used for intra prediction of the current block. Here, the sample values of the reference samples determined for intra prediction of the current block can be stored in a reference buffer. The reference buffer can have a one-dimensional arrangement. That is, the intra predictor 160 can determine the sample values of the reference samples and configure the reference buffer based on the determined sample values of the reference samples. In addition, the reference samples stored in the reference buffer can be marked. For example, the first reference sample stored in the reference buffer can be marked as "available for intra prediction" or "unavailable for intra prediction." The intra predictor 160 can perform intra prediction on the current block by using the reference samples marked as "available for intra prediction" among the reference samples stored in the reference buffer.

[0149] When it is recognized that the top-left reference sample is available, the intra predictor 160 may determine the sample value reconstructed for the top-left reference sample as the sample value of the top-left reference sample. Here, when the coordinate value of the top-left corner sample of the current block is (0, 0), the coordinate value of the top-left reference sample may be (-1, -1). That is, the top-left reference sample may represent a pixel directly adjacent to the top-left side of the top-left corner sample of the current block.

[0150] When it is recognized that the top left reference sample is unavailable, the intra predictor 160 may determine a default value (such as 0 or a value based on the bit depth of the sample) as the sample value of the top left reference sample. For example, the value based on the bit depth of the sample may be a median or maximum value within the range of sample values indicated by the bit depth of the sample. That is, when the bit depth is 8, within the range of sample values (0-255) indicated by the bit depth of the sample, the value based on the bit depth of the sample may be 128 (or 127) (as a median value) or 255 (as a maximum value).

[0151] Alternatively, when the top-left reference sample is identified as unavailable, the intra predictor 160 may determine a default value (such as a median value of a color scale) as the sample value of the top-left reference sample.

[0152] The intra-frame predictor 160 may identify whether the reference sample in the current position is available as follows. That is, when the current position is outside the picture, the intra-frame predictor 160 may identify that the reference sample in the corresponding position is unavailable, and when the current position is inside the picture, the intra-frame predictor 160 may identify that the reference sample in the corresponding position is available. When the current position is included in a different slice from the current block, the intra-frame predictor 160 may identify that the reference sample in the corresponding position is unavailable, and when the current position is included in the same slice as the current block, the intra-frame predictor 160 may identify that the reference sample in the corresponding position is available.

[0153] When the current position is included in a different tile from the current block, the intra predictor 160 may recognize that the reference sample in the corresponding position is unavailable. When the current position is included in the same tile as the current block, the intra predictor 160 may recognize that the reference sample in the corresponding position is available.

[0154] When the predetermined position is located on a different side from the current block based on a virtual boundary (for example, when the predetermined position belongs to a different window from the current block based on a boundary of a window in a 360-degree image, or is located in a different flexible tile from the current block based on a boundary of a flexible tile having a boundary within a CTU or a maximum coding unit), the intra-frame predictor 160 may recognize that the reference sample in the corresponding position is unavailable, and when the situation is not as described above, the intra-frame predictor 160 may recognize that the reference sample in the corresponding position is available.

[0155] When it is recognized that CIP is used, the intra predictor 160 may recognize that the reference samples in the corresponding position are unavailable when the corresponding position is encoded in inter mode. In addition, when the corresponding position is encoded in intra mode, the reference samples in the corresponding position may be recognized as available. Here, CIP may mean that for intra prediction of the current block, when the neighboring block is encoded in inter mode, intra prediction is performed by not using the samples of the corresponding neighboring block encoded in inter mode and by using only the samples of the neighboring block encoded in intra mode, so as to prevent error propagation. Whether CIP is used may be recognized, and a CIP activation flag may be generated based on whether CIP is used and the CIP activation flag may be stored in the bitstream.

[0156] After identifying the prediction mode of a neighboring block (e.g., a neighboring coding unit including a reference sample in a corresponding position), information about the prediction mode of the neighboring block may be generated based on the identified prediction mode and included in a bitstream.

[0157] When the intra predictor 160 identifies the availability of a reference sample in the current search position from reference samples other than the upper left reference sample, when there is a reconstructed sample value for the reference sample in the current search position, the intra predictor 160 may identify that the reference sample in the current search position is unavailable.

[0158] The intra predictor 160 may identify the availability of reference samples in the current search position by combining the above-described various conditions.

[0159] In addition to the top-left reference sample, the intra predictor 160 may sequentially search for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the top-left reference sample. The intra predictor 160 may determine sample values of the remaining reference samples of the current block except for the top-left reference sample by identifying the availability of the searched reference samples.

[0160] For example, when the coordinate value of the upper left corner of the current block is (0, 0), the x coordinate of the reference sample included in the left reference line of the current block may be -1, and the y coordinate may be a value within a range from -1 to a value obtained by subtracting 1 from a value obtained by summing the height and width of the current block. The y coordinate of the reference sample included in the upper reference line of the current block may be -1, and the x coordinate may be a value within a range from -1 to a value obtained by subtracting 1 from a value obtained by summing the height and width of the current block. The x coordinate of the reference sample included in the right reference line of the current block may be the width of the current block, and the y coordinate may be a value within a range from -1 to a value obtained by subtracting 1 from a value obtained by summing the height and width of the current block.

[0161] Here, the search direction of the upper reference line may be the right direction from the upper left reference sample point, the search direction of the left reference line may be the downward direction from the upper left reference sample point, and the search direction of the right reference line may be the downward direction from the upper right reference sample point of the current block. When the coordinate value of the sample point at the upper left corner of the current block is (0, 0), the x coordinate of the upper right reference sample point of the current block may be the width of the current block, and the y coordinate may be -1.

[0162] When the reference sample in the current search position is identified as unavailable, the intra predictor 160 may determine a default value or a sample value of the reference sample in the previous search position as the sample value of the reference sample in the current search position. Here, the default value may be the same as the default value described above. For example, the default value may be a value based on the bit depth of the sample, and may be a median or maximum value in the range of sample values indicated by the bit depth of the sample.

[0163] When the reference sample in the current search position is identified as available, the intra predictor 160 may determine the reconstructed sample value for the reference sample in the current search position as the sample value of the reference sample in the current search position.

[0164] As described above, when the intra predictor 160 identifies the availability of the reference sample in the current search position from reference samples other than the upper left reference sample, and when it is identified that intra prediction is performed by not using the reference samples reconstructed in the inter mode and by using only the reference samples reconstructed in the intra mode, when the prediction mode of the reference block including the reference sample in the current search position corresponds to the inter mode, the intra predictor 115 may identify that the reference sample in the current search position is unavailable. Alternatively, when the intra predictor 160 identifies the availability of the reference sample in the current search position from reference samples other than the upper left reference sample, the intra predictor 160 may determine that the reference sample in the current search position is unavailable when the reference sample in the current search position is outside the picture, included in a different slice from the current block, included in a different tile from the current block, or located on a different side from the current block based on a virtual boundary.

[0165] When the intra predictor 160 identifies the availability of a reference sample in the current search position from reference samples other than the upper left reference sample, when there is a reconstructed sample value for the reference sample in the current search position, the intra predictor 160 may identify that the reference sample in the current search position is unavailable.

[0166] The intra predictor 160 may identify the availability of reference samples in the current search position by combining the above-mentioned various situations.

[0167] The intra predictor 160 may obtain a predicted block for the current block by performing intra prediction on the current block based on the sample value of the determined upper-left reference sample of the current block and the sample values of the determined reference samples other than the upper-left reference sample. Here, the determined sample value of the upper-left reference sample of the current block and the determined sample values of the reference samples other than the upper-left reference sample may be stored in a reference buffer, and all reference samples stored in the reference buffer may be marked as "available for intra prediction." Therefore, when the intra predictor 160 performs intra prediction using the reference samples stored in the reference buffer, the intra predictor 160 may not separately identify the availability of the reference samples stored in the reference buffer and may freely use all reference samples stored in the reference buffer to perform intra prediction. That is, after determining the sample value of the upper-left reference sample to be stored in the reference buffer, the intra predictor 160 may sequentially search for the remaining reference samples other than the upper-left reference sample and may always determine the sample values of the remaining reference samples, regardless of the availability of the reference samples in the current search position. Therefore, all reference samples stored in the reference buffer can be determined to be available for intra prediction, and therefore, intra prediction can be performed by freely using all reference samples stored in the reference buffer. However, the present disclosure is not limited thereto. Even when all reference samples stored in the reference buffer are marked as available, there is a possibility that the sample values of the reference samples in the predetermined positions may not be properly derived for intra prediction, and therefore, whether the reference samples stored in the reference buffer can be used for intra prediction can be additionally identified as needed.

[0168] When the division direction of the first coding unit is a vertical direction, the image encoder 155 may determine the encoding order of the left second coding unit and the right second coding unit divided according to the division direction as the order of the left second coding unit and then the right second coding unit or the order of the right second coding unit and then the left second coding unit. When the SUCO method is not applied, the image encoder 155 may determine the encoding order of the second coding unit as the order of the left second coding unit and then the right second coding unit. However, when the SUCO method is applied, the image encoder 155 may determine the encoding order of the second coding unit as the order of the left second coding unit and then the right second coding unit or the order of the right second coding unit and then the left second coding unit. Figure 5b Describes detailed aspects of the SUCO method.

[0169] By considering the coding order of the coding units when the SUCO method is applied, reference samples available for intra prediction may not be limited to the left neighboring area and the upper neighboring area, and may also include the right neighboring area. However, the left neighboring area and the right neighboring area may not always be available, and the intra predictor 160 may recognize the availability of the left neighboring area and the right neighboring area by considering the decoding order, and may perform intra prediction on the current block by considering the availability of the neighboring areas.

[0170] For example, when the intra prediction mode of the current block is the DC mode and the reference buffer is configured as described above, the sample values of the reference samples of all left reference lines, upper reference lines, and right reference lines of the current block stored in the reference buffer can be defined. Therefore, the intra predictor 115 can perform intra prediction on the current block without additionally identifying the availability. That is, when the intra prediction mode of the current block is the DC mode, the intra predictor 160 can determine the predicted sample value of the sample in the current block by using the average value of the reference samples in all directions (left, upper, and right directions).

[0171] However, when the SUCO method is applied, the intra predictor 160 may recognize a condition according to the SUCO method and refer to Figure 5b The situation according to the SUCO method is described in detail. Here, the identification of the situation according to the SUCO method may correspond to the identification of the availability of the left neighboring area and the upper neighboring area of the current block.

[0172] The intra-frame predictor 160 may obtain predicted sample values of samples in the current block by using samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block based on the availability of the left neighboring area and the right neighboring area of the current block. For example, the intra-frame predictor 160 may identify one of various conditions LR_00, LR_01, LR_10, and LR_11 according to the SUCO method, and based on the identified condition according to the SUCO method, may obtain predicted sample values of samples in the current block by using samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block.

[0173] When the left neighboring area is identified as available and the right neighboring area is identified as unavailable, the intra-frame predictor 160 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the left reference line and the average value of the sample value of the reference sample of the upper reference line. For example, when the condition according to the SUCO method is LR_10, the intra-frame predictor 160 may obtain the predicted sample value of the sample in the current block based on the average value of the sample value of the reference sample of the left reference line and the average value of the sample value of the reference sample of the upper reference line.

[0174] Alternatively, when the left neighboring area of the current block is identified as unavailable and the right neighboring area is identified as available, the intra-frame predictor 160 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the right reference line and the average value of the sample value of the reference sample of the upper reference line. For example, when the condition according to the SUCO method is LR_01, the intra-frame predictor 160 may obtain the predicted sample value of the sample in the current block based on the average value of the sample value of the reference sample of the right reference line and the average value of the sample value of the reference sample of the upper reference line.

[0175] Alternatively, when the left neighboring area of the current block is identified as available and the right neighboring area is identified as available, the intra-frame predictor 160 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the left reference line, the sample value of the reference sample of the right reference line, and the sample value of the reference sample of the upper reference line. For example, when the condition according to the SUCO method is LR_11, the intra-frame predictor 160 may obtain the predicted sample value of the sample in the current block based on the sample value of the reference sample of the left reference line, the sample value of the reference sample of the right reference line, and the sample value of the reference sample of the upper reference line.

[0176] Alternatively, when the left neighboring area of the current block is identified as unavailable and the right neighboring area is identified as unavailable, the intra-frame predictor 160 may obtain the predicted sample values of the samples in the current block based on the average of the sample values of the reference samples of the upper reference line. For example, when the condition according to the SUCO method is LR_00, the intra-frame predictor 160 may obtain the predicted sample values of the samples in the current block based on the average of the sample values of the reference samples of the upper reference line. However, this is not limiting. When the condition according to the SUCO method is LR_00, the intra-frame predictor 160 may obtain the predicted sample values of the samples in the current block based on the average of the sample values of the reference samples of the left reference line and the sample values of the reference samples of the upper reference line.

[0177] As described above, when the intra prediction mode is the DC mode, the intra predictor 160 can obtain the predicted sample value of the sample in the current block by using the sample of at least one reference line from the left, upper, and right reference lines of the current block based on the availability of the left and right neighboring areas of the current block. However, the present disclosure is not limited thereto. Regardless of the availability of the neighboring area of the current block, the predicted sample value of the sample in the current block can be obtained by using the sample of at least one reference line from the left, upper, and right reference lines of the block.

[0178] In addition, when the intra-frame prediction mode is the DC mode, the intra-frame predictor 160 can obtain the predicted sample value of the sample in the current block by using the sample of at least one reference line among the left reference line, the upper reference line, and the right reference line of the current block based not only on the availability of the left neighboring area and the availability of the upper neighboring area, but also on the availability of the right neighboring area.

[0179] Hereinafter, according to an embodiment, a method of efficiently signaling a chroma intra prediction mode, performed by the image encoding apparatus 150 , is described.

[0180] The chroma intra prediction mode may include a total of five modes, namely, DM, DC mode, vertical mode, and horizontal mode. Here, DM represents an intra prediction mode that uses the luma intra prediction mode as the chroma intra prediction mode intact. When the intra prediction mode indicated by DM overlaps with the remaining four modes, one of the four modes (the mode overlapping with the intra prediction mode indicated by DM) may be replaced by another mode, or one bit may be saved via truncated binarization. However, in this case, dependency on DM may occur, and an additional context model may be required. Therefore, hereinafter, a simple method of signaling a chroma intra prediction mode is described.

[0181] When the number of chroma intra prediction mode candidates remains at five, overlap is allowed when DM is selected as the same intra prediction mode as the remaining intra prediction mode candidates. Here, information about whether the chroma intra prediction mode is DM can be encoded as a 1-bit flag using binary arithmetic encoding based on the context. When the chroma intra prediction mode is not DM, the remaining four intra prediction mode candidates can be encoded as 2 bits using FLC.

[0182] Therefore, the image encoder 155 may perform binary arithmetic coding based on a context model on a 1-bit flag indicating whether the chroma intra prediction mode is DM. When the chroma intra prediction mode of the current block is not DM, the image encoder 155 may binarize the 2-bit information about the chroma intra prediction mode according to the FLC. The bitstream generator 170 may generate a bitstream including at least one of a 1-bit flag indicating whether the chroma intra prediction mode is binary arithmetic coded DM and 2-bit information about the chroma intra prediction mode.

[0183] Therefore, the dependence on DM can be eliminated, various comparison operations can be reduced, and the chroma intra prediction mode can be signaled in a simple manner without using an additional context model.

[0184] The image encoding apparatus 150 may generate binary bits for signaling a chroma intra prediction mode according to the following pseudo code.

[0185] [pseudocode]

[0186]

[0187] The intra-frame predictor 160 can perform intra-frame prediction by using reference samples that are spaced apart from the current block and do not directly contact the current block. For example, when the coordinate value of the upper left corner of the current block is (0, 0), reference samples with coordinate values of (-2, -1), (-1, -2), (the width of the current block, -2), etc. can be used. Here, the length of the left reference line buffer and the upper reference line buffer can be extended according to the intra-frame prediction method or intra-frame prediction mode. The intra-frame predictor 160 can increase the length of the reference line buffer, identify the availability of the reference sample, and determine the reconstructed sample value for the corresponding reference sample as the sample value of the reference sample based on the availability of the reference sample. When the reference sample is unavailable, the sample value of the reference sample can be determined as a default value or the sample value of another available reference sample. Here, the determined sample value of the reference sample can be stored in the reference line buffer.

[0188] The following will refer to Figure 3b and 3C describe a method of using sample values of a reference line buffer in another direction closer to the current block or determining corresponding reference samples without changing the length of the reference line buffer.

[0189] When the intra prediction mode is the angular mode, the intra predictor 160 may perform intra prediction on the current sample in the current block by using an N-tap interpolation filter and the sample values of a plurality of reference samples required for filtering. That is, the intra predictor 160 may obtain the predicted sample value of the current sample in the current block by filtering the reference samples intersecting the extended line from the current sample in the intra prediction direction (or the opposite direction) and the reference samples adjacent to the aforementioned reference samples using the N-tap interpolation filter. Here, the following will refer to Figures 4a to 4g A method of determining sample values of reference samples to be used for intra prediction, performed by the intra predictor 160, is described when reference samples intersecting a line extended from a current sample in an intra prediction direction (or opposite direction) are located around a corner of the current block.

[0190] The image encoder 155 may generate a residual block including coefficients of the current block based on the prediction block of the current block. The image encoder 155 may obtain residual sample values (coefficient values) of current samples in the residual block of the current block by subtracting the original sample values of the current samples in the original block of the current block from the predicted sample values of the current samples in the prediction block of the current block, and may generate the residual block of the current block based on the residual sample values of the current samples.

[0191] The image encoder 155 may generate at least one transform coefficient of the current block by transforming and quantizing the residual block of the current block.

[0192] The bitstream generator 170 may generate a bitstream including information about a transform coefficient of a current block.

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

[0194] In operation S155, when the prediction mode of the current block is the intra mode, the image encoding apparatus 150 may determine the sample value of the upper left reference sample of the current block by identifying the availability of the upper left reference sample of the current block. For example, when the upper left reference sample is identified as available, the image encoding apparatus 150 may determine the reconstructed sample value for the upper left reference sample as the sample value of the upper left reference sample. When the upper left reference sample is identified as unavailable, the image encoding apparatus 150 may determine the sample value of the upper left reference sample as a value based on the bit depth of the sample.

[0195] In operation S160, the image encoding apparatus 150 may sequentially search for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block, excluding the upper left reference sample, in a direction away from the upper left reference sample, and may determine sample values of the remaining reference samples of the current block excluding the upper left reference sample by identifying the availability of the searched reference samples. For example, when the reference sample at the current search position is identified as unavailable, the image encoding apparatus 150 may determine a value based on the bit depth of the sample or a sample value of a reference sample at a previous search position as the sample value of the reference sample at the current search position. When the reference sample at the current search position is identified as available, the image encoding apparatus 150 may determine a reconstructed sample value for the reference sample at the current search position as the sample value of the reference sample at the current search position.

[0196] In operation S165, the image encoding apparatus 150 may obtain a predicted block of the current block by performing intra prediction on the current block based on the determined sample value of the upper left reference sample of the current block and the determined sample values of the remaining reference samples except the upper left reference sample.

[0197] In operation S170, the image encoding apparatus 150 may generate a residual block including coefficients of the current block based on the prediction block of the current block, and may generate a transform coefficient of the current block by transforming and quantizing the residual block.

[0198] In operation S175 , the image encoding apparatus 150 may generate a bitstream including information about a transformation coefficient of the current block.

[0199] Figure 2cis a block diagram of an image encoder according to various embodiments.

[0200] The image encoder 7000 according to various embodiments may perform operations performed by the image encoder 155 and the bitstream generator 170 of the image encoding apparatus 150 to encode image data.

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

[0202] Residual data can be generated by subtracting prediction data for each block from data for the block to be encoded in the current image 7050, where the prediction data is output from the intra predictor 7200 or the inter predictor 7150. Furthermore, the transformer 7250 and the quantizer 7300 can transform and quantize the residual data to output quantized transform coefficients for each block. The inverse quantizer 7450 and the inverse transformer 7500 can reconstruct spatial residual data by performing inverse quantization and inverse transform on the quantized transform coefficients. The reconstructed spatial residual data can be added to the prediction data output from the intra predictor 7200 or the inter predictor 7150 for each block, thereby reconstructing spatial data for the block in the current image 7050. The deblocker 7550 and the SAO performer perform in-loop filtering on the spatial reconstructed data to generate a filtered reconstructed image. 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 for another image. The entropy encoder 7350 may entropy encode the quantized transform coefficients and may output the entropy-encoded coefficients as a bitstream 7400.

[0203] To implement the image encoder 7000 according to various embodiments in the image encoding apparatus 150 , operations of the image encoder 7000 according to various embodiments may be performed on each of the blocks. For example, operations of the intra predictor 7200 may correspond to operations of the intra predictor 160 .

[0204] Figure 3a is a diagram for describing a process in which the image decoding apparatus 100 determines sample values of reference samples to be stored in a reference buffer for intra prediction according to an embodiment.

[0205] When the image decoding device 100 generates a reference buffer, it may define an initial value for a predetermined position and, based on a predetermined data unit based on the predetermined position, store sample values of reference samples in the buffer by identifying the availability of the reference samples. Here, the predetermined data unit may be defined as a pixel unit, a unit based on a minimum coding unit, or the like. For example, depending on the direction of the search for the data unit, the size (height and width) of the minimum coding unit may be 4, and the size of the unit based on the minimum coding unit may be 1×4 or 4×1. When it is determined that a reference sample in the search position next to the position where the initial value is defined is available, the image decoding device 100 may store the reconstructed sample value in the position corresponding to the reference sample in the reference buffer. When it is determined that a reference sample in the search position next to the position where the initial value is defined is unavailable, the image decoding device 100 may store the defined initial value in the position corresponding to the reference sample in the reference buffer. Similarly, the reference sample value of the reference sample in the search position next to the next search position may be stored in the corresponding position of the reference sample.

[0206] Reference Figure 3a , when the coordinates of the upper left corner of the current block are (0, 0), and R(x, y) represents a reference sample located at the coordinates (x, y), the upper left reference sample 205 of the current block may be defined as R(-1, -1).

[0207] The image decoding apparatus 100 may identify the availability of the top-left reference sample 205. When the image decoding apparatus 100 identifies that the top-left reference sample 205 is available, the image decoding apparatus 100 may determine an available value (reconstructed value) as the sample value of the top-left reference sample 205 and may store the corresponding sample value in the reference buffer. When the image decoding apparatus 100 identifies that the top-left reference sample 205 is unavailable, a default value may be filled in the reference buffer. Here, the default value may be 0, the median value of the color scale, or the median or maximum value within the range of sample values indicated by the sample bit depth, but is not limited thereto.

[0208] After determining the sample value of the top-left reference sample 205 (and storing it in the reference buffer), the image decoding apparatus 100 may sequentially identify the availability of each predetermined data unit of the reference buffer for the left reference line 210, the upper reference line 215, and the right reference line 220. When a predetermined data unit of the reference buffer for the left reference line 210, the upper reference line 215, and the right reference line 220 is identified as available, the reconstructed sample value of the data unit may be stored in the reference buffer. When the predetermined data unit is identified as unavailable (for example, when the data unit is not encoded, CIP is performed, or the data unit is encoded in inter-frame prediction mode), the image decoding apparatus 100 may fill the pixels of the current data unit with default values, fill the pixels of the current data by filling the last value stored in the buffer, or store the sample value of the previous data unit in the reference buffer.

[0209] The image decoding apparatus 100 may identify availability of reference samples before determining sample values of reference samples to be stored in a reference buffer, and may identify the availability according to the following conditions.

[0210] For example, the image decoding apparatus 100 may identify the availability of reference samples by identifying whether CIP is applied and by identifying the prediction mode. When CIP is applied and the prediction mode of the neighboring block including the reference sample is an inter-frame prediction mode, the image decoding apparatus 100 may identify that the reference sample is unavailable. When CIP is not applied, the image decoding apparatus 100 may not identify the prediction mode of the neighboring block including the reference sample. In other words, the image decoding apparatus 100 may not identify the availability based on the prediction mode.

[0211] When the position of the reference sample is outside the picture, the image decoding apparatus 100 may recognize that the corresponding reference sample is unavailable, and when the position of the reference sample is inside the picture, the image decoding apparatus 100 may recognize that the corresponding reference sample is available.

[0212] When the position of the reference sample is included in a different slice from the current block 200, the image decoding apparatus 100 may recognize the corresponding reference sample as unavailable, and when the position of the reference sample is included in the same slice as the current block 200, the image decoding apparatus 100 may recognize the corresponding reference sample as available.

[0213] When the position of the reference sample is included in a tile different from the current block 200, the image decoding apparatus 100 may identify the corresponding reference sample as unavailable, and when the position of the reference sample is included in the same tile as the current block 200, the image decoding apparatus 100 may identify the corresponding reference sample as available.

[0214] When the position of the reference sample is included in a tile different from the current block 200, the image decoding apparatus 100 may identify the corresponding reference sample as unavailable, and when the position of the reference sample is included in the same tile as the current block 200, the image decoding apparatus 100 may identify the corresponding reference sample as available.

[0215] When the position of the reference sample is located on a different side from the current block 200 based on a virtual boundary, the image decoding apparatus 100 may identify the corresponding reference sample as unavailable. For example, the virtual boundary may be a boundary of a window area in a 360-degree image or a boundary of a flexible tile (a boundary located within a maximum coding unit). When the reference sample is located on the same side as the current block based on the virtual boundary, the image decoding apparatus 100 may identify the corresponding reference sample as available.

[0216] When CIP is to be used, the image decoding apparatus 100 may identify the corresponding reference sample as unavailable when the position of the reference sample is encoded in the intra mode, and may identify the corresponding reference sample as available when the position of the reference sample is encoded in the inter mode.

[0217] The image decoding apparatus 100 may identify whether a reference sample is reconstructed according to a decoding order, and may identify whether a corresponding reference sample is available based on whether the reference sample is reconstructed.

[0218] The image decoding apparatus 100 may recognize the availability of reference samples by using various combinations of the above-described conditions.

[0219] Above, by reference Figure 3a , describes a method in which the image decoding apparatus 100 may determine a sample value of the top-left reference sample 205 of the current block 200 by identifying the availability of the top-left reference sample 205, may sequentially search for reference samples of at least one of a left reference line, an upper reference line, and a right reference line of the current block in a direction away from the top-left reference sample 205, and may determine sample values of the remaining reference samples of the current block other than the top-left reference sample by identifying the availability of the searched reference sample. However, the present invention is not limited to this. Those skilled in the art will appreciate that reference samples at different predetermined locations other than the top-left reference sample 205 may be determined, reference samples may be sequentially searched for in a direction away from the corresponding reference sample, and sample values of the remaining reference samples other than the reference sample at the predetermined location may be determined by identifying the availability of the searched reference sample.

[0220] Previously, image decoding devices could identify the availability of reference samples at predetermined locations and, when the reference samples were available, store the information for the upper and left reference lines corresponding to the height and width of the current block intact in a reference buffer. However, in this case, when the availability of the stored reference samples was identified, there was a possibility that unavailable areas existed. Consequently, the corresponding image decoding device might have difficulty supporting the use of CIP. Therefore, a new method for storing sample values in a reference buffer was needed.

[0221] When there is no available reference sample at the current position, the image decoding device may fill the reference buffer with a default value, or may fill the reference buffer with a sample value of the nearest position (the first or last value of the block with information) by searching for a sample with an available sample value from a position where there is no available reference sample. However, in this case, there is a problem that the sample with the sample value may not be used appropriately, or the current position must be stored until a sample with an available sample value is searched. Therefore, in order to solve these problems, as described above with reference to Figure 3a As described above, the image decoding device 100 can identify the availability of the upper left reference sample 205 and determine the sample value of the upper left reference sample 205 of the current block. In addition, the image decoding device 100 can sequentially search for reference samples of at least one of the left reference line, the upper reference line, and the right reference line of the current block in a direction away from the upper left reference sample 205, and can determine the sample values of the remaining reference samples of the current block except the upper left reference sample by identifying the availability of the searched reference samples. Therefore, the image decoding device 100 can efficiently store the sample values in the reference buffer, and all the reference samples stored in the reference buffer can be marked as available for intra prediction, and therefore, the image decoding device can efficiently perform intra prediction without additionally marking the availability. In addition, the above reference can be performed Figure 3a The operation of the image decoding apparatus 100 is described, and based on the sample values stored in the reference buffer according to the performed operation, the image decoding apparatus 100 may support the use of CIP.

[0222] Figure 3b is a diagram for describing a method of determining a sample value of a corresponding reference sample (and configuring a reference buffer) performed by the image decoding apparatus 100 when the image decoding apparatus 100 uses a reference sample spaced apart from a current block 200 for intra prediction according to an embodiment.

[0223] The image decoding device 100 may separately include reference buffers for an upper reference line, a left reference line, and a right reference line. In this case, the length of each buffer may be the sum of the height and width of the current block. Furthermore, the image decoding device 100 may increase the length of the reference buffer to determine sample values of previously unused reference samples and store these sample values in the reference buffers. For example, the reference buffers for the upper reference line, the left reference line, and the right reference line may store sample values such as R(-2, -1), R(-1, -2), R(width, -2), etc. When a reference sample at a corresponding position is available, a reconstructed value may be determined as the sample value of the reference sample at the corresponding position, and the determined sample value of the reference sample at the corresponding position may be stored in the reference buffer. When a reference sample at a corresponding position is unavailable, a default value may be determined as the sample value of the reference sample at the corresponding position, and the determined sample value of the reference sample at the corresponding position may be stored in the reference buffer. Depending on the embodiment, the length of the reference buffer for a reference line may not always be extended, and may be extended based on intra-frame prediction.

[0224] Reference Figure 3b , the image decoding apparatus 100 may replace the reference samples spaced apart from the current block 200 with sample values stored in a reference buffer of another reference line.

[0225] The image decoding apparatus 100 may replace the sample value of reference sample 230 with the sample value of reference sample 225. For example, when determining the sample value of reference sample 230, the image decoding apparatus 100 may access the sample value of reference sample 225 stored in the reference buffer for the left reference line, determine the sample value of reference sample 230 as the sample value of reference sample 225, and store the sample value of reference sample 225 in the reference buffer for the upper reference line. The sample value of each sample may be determined (and stored in the reference buffer) by performing a one-to-one matching method, but is not limited thereto. The sample value calculated for sub-pixel units according to the intra prediction direction may be determined (and stored in the reference buffer) via N-tap interpolation (N is a natural number equal to or greater than 2).

[0226] Figure 3c 2 is a diagram for describing a method of configuring a single reference buffer performed by the image decoding apparatus 100 when the image decoding apparatus 100 uses reference samples spaced apart from the current block 200 for intra prediction according to an embodiment, wherein the single reference buffer is configured to determine a sample value of a corresponding reference sample.

[0227] Optionally, refer to Figure 3c, the image decoding apparatus 100 may store the sample values of the reference samples in a single line buffer 235. In this case, when a line is extended to determine the sample values of reference samples spaced apart from the current block 200, the sample values stored in the line buffer 235 can be accessed by successively increasing or decreasing the sample index. For example, the image decoding apparatus 100 may increment the index R(-1, -1) of the line buffer 235 by 1 and determine the sample value of R(0, -1) indicated by the corresponding index to be the sample value of R(-2, -1). Similarly, the image decoding apparatus 100 may increment the index R(width, -1) of the line buffer 235 by 1 and determine the sample value of R(width, 0) indicated by the corresponding index to be the sample value of R(width+1, -1).

[0228] By configuring a single line buffer 235, the image decoding device 100 can obtain an effect similar to that obtained by storing the sample values of the reference samples separately in the reference buffer in each direction, and when the sample values of the reference samples spaced apart from the current block 200 are to be used, the image decoding device 100 can access the sample values of the reference samples stored in the line buffer 235 at positions close to the current block 200, and therefore, can efficiently perform intra-frame prediction.

[0229] Figure 3d A pseudo code for implementing an operation of configuring an upper reference line buffer performed by the image decoding apparatus 100 according to an embodiment is shown.

[0230] Reference Figure 3d , the image decoding apparatus 100 may identify the availability of the upper left reference pixel of the current block, and when the upper left reference pixel of the current block is available (if (IS_AVAIL…), the value of the upper left reference pixel may be stored in the reference buffer (copy (up-1,…).

[0231] When unavailable (else), the image decoding apparatus 100 may store a default value in the reference buffer.

[0232] Thereafter, the image decoding apparatus 100 may perform an operation of filling the reference buffer in the upper direction (the reference buffer of the upper reference line) as follows.

[0233] The image decoding apparatus 100 may determine the pixel value of the reference pixel in the search position by performing a search operation from the upper left reference pixel in the right direction. Here, the image decoding apparatus 100 may check the availability of each predetermined unit, and when the predetermined unit is available, the pixel value of the pixel of the corresponding unit may be stored in the buffer, and when the predetermined unit is not available, the reference buffer may be filled by directly filling the previously stored pixel value into the current search position. Here, the predetermined unit may be defined as a single pixel unit, a plurality of pixel units, the size of the minimum coding unit, etc.

[0234] In addition, the image decoding device 100 may replace the pixel value up[-2] of R(-2,-1) in the reference buffer in the upper direction relative to the current block with the pixel value LEFT[0] of R(-1,0) stored in the reference buffer in the left direction, and may store the replaced value in the reference buffer in the upper direction. However, this is not limited to this. When the pixel of R(-2,-1) is available, the pixel value of the pixel of R(-2,-1) may be stored intact in the reference buffer in the upper direction. Alternatively, the pixel value of the pixel of R(-2,-1) may be determined as the pixel value up[-1] of the pixel of R(-1,-1), and the determined pixel value may be stored in the reference buffer in the upper direction. (That is, the pixel value up[-1] of the pixel of R(1,-1) may be filled and stored).

[0235] Figures 4a to 4g is a diagram for describing a process of determining reference samples (pixels) around the corners of the current block 200 performed by the image decoding apparatus 100 when the image decoding apparatus 100 performs intra prediction on the current sample in an angular mode according to an embodiment.

[0236] Reference Figures 4a to 4g When the image decoding apparatus 100 performs intra prediction on a current sample in the angular mode, the image decoding apparatus 100 may obtain a predicted sample value of the current sample by using N-tap interpolation (N is a natural number equal to or greater than 2) for at least two reference samples 250, wherein the at least two reference samples 250 include a reference sample intersecting a line extending from the current sample in the prediction direction 245 and adjacent reference samples. In this case, the image decoding apparatus 100 may use reference samples around the corners of the current block 200, and hereinafter, a method of determining the reference samples to be used therein is described.

[0237] Reference Figure 4a, the image decoding device 100 can obtain a predicted sample value obtained by interpolating the value using four reference samples 250 as the predicted sample value of the current sample 240, wherein the four reference samples 250 include a reference sample that intersects with an extension line from the current sample in the prediction direction 245.

[0238] like Figure 4b As shown in , when the reference sample is located at the upper left corner of the current block 200, the image decoding apparatus 100 may pad the sample value of the reference sample 255 at position (-1, -1) based on the position of the upper left corner of the current block, and may store the sample value of the reference sample 260 at position (-2, -1) in the reference buffer. Here, the sample values may not be stored separately in the reference buffer, and the coordinates may be clipped to achieve the same effect as padding. That is, when the lower limit of the clipping range of the x-coordinate is set to -1, and when the reference sample at the position with the x-coordinate of -2 is to be accessed, the reference sample at the position with the x-coordinate of -1 may be accessed via coordinate clipping, and thus, the sample value of the reference sample 260 at position (-2, -1) may be obtained, similar to when the sample value of the reference sample 255 at position (-1, -1) is padded.

[0239] Reference Figure 4c When the image decoding apparatus 100 performs intra prediction on the current sample 240 in the prediction direction 245, the image decoding apparatus 100 may use the sample value of the reference sample 265 at the position (-1, 0) instead of the sample value of the reference sample 260 at the position (-2, -1). For example, when the reference sample 260 is not available, the sample value of the reference sample 265 may be used. However, this is not limiting, and the sample value of the reference sample 265 may be used regardless of the availability of the reference sample 260.

[0240] Hereinafter, a process of determining reference samples around the upper right corner of the current block 200 performed by the image decoding apparatus 100 when the image decoding apparatus 100 can use sample values of reference samples in a right neighboring area is described.

[0241] Reference Figure 4d , the image decoding apparatus 100 may use the sample value of the reference sample at the position (width+1,-1). Here, when the reference sample 268 at the position (width+1,-1) is available, the sample value of the reference sample at the corresponding position may be stored in the pixel buffer and may be used for intra prediction of the current sample 240. Alternatively, similar to the reference sample 268, Figure 4bAs described, the sample value of the reference sample 268 at the position (width + 1, -1) may be stored by padding the sample value of the reference sample at the position (width, -1), or the sample value of the sample at the position (width, -1) stored in the reference buffer may be accessed via coordinate clipping.

[0242] Reference Figure 4e When reference sample 268 is unavailable in the process of performing intra prediction on current sample 240 according to prediction direction 245, image decoding apparatus 100 may use the sample value of reference sample 270. Here, the sample value of reference sample 268 may be replaced by the sample value of reference sample 270 and may be stored in the reference buffer. However, regardless of the availability of reference sample 268, image decoding apparatus 100 may use the sample value of reference sample 270.

[0243] Reference Figure 4f , when the image decoding device 100 uses a large number of reference samples in the right direction of the upper right corner of the current block 200 when performing intra-frame prediction on the current sample 240 according to the prediction direction 245, the image decoding device 100 can use the sample value of the reference sample 275 in the position (width-1,-1).

[0244] Reference Figure 4g , similar to the reference above Figure 4b As described, the image decoding device 100 can store the pixel value of the reference pixel 285 in the position (width, -2) by filling the pixel value of the reference pixel 280 in the position (width, -1), or can access the pixel value of the pixel in the position (width, -1) stored in the reference buffer through coordinate clipping.

[0245] Figure 5a This diagram describes a SUCO method for determining a forward or backward encoding (decoding) order between coding units based on a coding order flag and describes how a right reference line can be used for intra prediction according to the encoding (decoding) order based on the SUCO method.

[0246] Reference Figure 5a, the maximum coding unit 1950 may be divided into a plurality of coding units 1956, 1958, 1960, 1962, 1968, 1970, 1972, 1974, 1980, 1982, 1984, and 1986. The maximum coding unit 1950 may correspond to the topmost node 1900 of the tree structure. In addition, the plurality of coding units 1956, 1958, 1960, 1962, 1968, 1970, 1972, 1974, 1980, 1982, 1984, and 1986 may correspond to a plurality of nodes 1906, 1908, 1910, 1912, 1918, 1920, 1922, 1924, 1930, 1932, 1934, and 1936, respectively. The upper coding order flags 1902 , 1914 , and 1926 and the lower coding order flags 1904 , 1916 , and 1928 indicating the coding order in the tree structure may correspond to arrows 1952 , 1964 , and 1976 and arrows 1954 , 1966 , and 1978 , respectively.

[0247] The upper coding order flag may indicate the coding order of two upper coding units among four coding units having the same depth. When the upper coding order flag is 0, encoding may be performed in a forward direction. Conversely, when the upper coding order flag is 1, encoding may be performed in a backward direction.

[0248] Similarly, the lower coding order flag may indicate the coding order of two lower coding units among four coding units having the same depth. When the lower coding order flag is 0, encoding may be performed in a forward direction. Conversely, when the lower coding order flag is 1, encoding may be performed in a backward direction.

[0249] For example, since the upper coding order flag 1914 is 0, the coding order between coding units 1968 and 1970 can be determined as forward left to right. In addition, since the lower coding order flag 1916 is 1, the coding order between coding units 1972 and 1974 can be determined as backward right to left.

[0250] According to an embodiment, the upper coding order flag and the lower coding order flag may be configured to have the same value. For example, when the upper coding order flag 1902 is determined to be 1, the lower coding order flag 1904 corresponding to the upper coding order flag 1902 may also be determined to be 1. Since the values of the upper coding order flag and the lower coding order flag are determined to be one bit, the amount of coding order information can be reduced.

[0251] According to an embodiment, the upper coding order flag and the lower coding order flag of the current coding unit may be determined with reference to at least one of the upper coding order flag and the lower coding order flag applied to a coding unit with a lower depth than the current coding unit. For example, the upper coding order flag 1926 and the lower coding order flag 1928 applied to coding units 1980, 1982, 1984, and 1986 may be determined based on the lower coding order flag 1916 applied to coding units 1972 and 1974. Therefore, the upper coding order flag 1926 and the lower coding order flag 1928 may be determined to have the same value as the lower coding order flag 1916. Because the values of the upper coding order flag and the lower coding order flag are determined from the coding unit above the current coding unit, coding order information may not be obtained from the bitstream. Therefore, the amount of coding order information may be reduced.

[0252] Here, data of samples included in the right adjacent coding unit 1958 decoded before the current coding unit 1986 is available, and therefore, the image decoding device 100 can perform intra-frame prediction according to an embodiment of the present disclosure by using data of samples (right reference line) included in the right adjacent coding unit 1958.

[0253] Figure 5b is a diagram for describing a SUCO status determined based on the availability of a left neighboring area and a right neighboring area according to the SUCO method.

[0254] Reference Figure 5b , as mentioned above Figure 5a As described above, according to the encoding / decoding order (forward or backward) of the coding unit determined based on the SUCO method, the position of the available reference sample for the current block 200 may be changed. Therefore, the image decoding apparatus 100 may determine the SUCO status by considering the decoding order recognition availability. Figure 5b , the SUCO state may be one of LR_10, LR_01, LR_11, and LR_00. Here, L / R represents left / right, and 0 / 1 indicates whether a reference sample is available. The SUCO state may be determined by identifying the availability of a sample at a predetermined position (e.g., a sample immediately to the left of the upper left corner sample / a sample immediately to the right of the upper right corner sample in the case of a left area) from the neighboring samples of the current block 200 (e.g., whether a neighboring block including the corresponding sample is reconstructed), but is not limited thereto.

[0255] When the image decoding apparatus 100 does not use the SUCO method, LR_01 and LR_11 may not appear. However, when the image decoding apparatus 100 uses the SUCO method, LR_01 and LR_11 may appear, and during intra-frame prediction, it may be necessary to consider reference samples different from those available when the SUCO method is not used. Therefore, the image decoding apparatus 100 can appropriately determine the reference samples used for intra-frame prediction by considering the SUCO situation, and thus can perform intra-frame prediction efficiently. This aspect has been described above, and therefore will not be described in detail.

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

[0257] An 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 of the same size. However, embodiments are not limited thereto. Furthermore, the maximum coding unit may be hierarchically divided into a plurality of coding units based on division shape pattern information obtained from the bitstream. The division shape pattern information may include at least one of information indicating whether division is to be performed, division direction information, and division type information. The information indicating whether division is to be performed indicates whether the coding unit is to be divided. The division direction information indicates whether the division is to be performed horizontally or vertically. The division type information indicates whether the coding unit is to be divided using one of binary division, ternary division, and quadruple division.

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

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

[0260] Furthermore, the coding unit may be divided into prediction units for prediction of an image. The prediction units may all be equal to or smaller than the coding unit. Furthermore, the coding unit may be divided into transformation units for transformation of an image. The transformation units may all 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, but the coding unit, the prediction unit, and the transformation unit may be equivalent to each other. The division of the prediction unit and the transformation unit may be performed in the same manner as the division of the coding unit. Figures 6 to 19 The division of coding units is described in detail. The current block and neighboring blocks of the present disclosure may indicate one of a maximum coding unit, a coding unit, a prediction unit, and a transform unit. In addition, the current block or the current coding unit is a block to be decoded or encoded or a block to be divided. The neighboring block may be a block reconstructed before the current block. The neighboring block may be spatially or temporally adjacent to the current block. The neighboring block may be located at one of the lower left, left, upper left, upper side, upper right, right, and lower right side of the current block.

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

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

[0263] The shape of the coding unit may include a square and a non-square. 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. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square.

[0264] When the width and height of a coding unit are different (i.e., when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, or N×4N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is non-square, the image decoding apparatus 100 may determine the aspect ratio in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, or 8:1. In addition, the image decoding apparatus 100 may determine whether the coding unit is in the horizontal direction or in the vertical direction based on the width and 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 width, height, or area of the coding unit.

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

[0266] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, the embodiment is not limited thereto, and the image decoding device 100 and the image encoding device 150 may obtain the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may obtain the pre-agreed division shape pattern information for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information for the maximum coding unit as quadruple division. In addition, the image decoding device 100 may determine the division shape pattern information for the minimum coding unit as "no division". Specifically, the image decoding device 100 may determine the size of the maximum coding unit to be 256×256. The image decoding device 100 may determine the pre-agreed division shape pattern information as quadruple division. Quaternary division is a division shape pattern in which the width and height of the coding unit are both divided into two equal parts. The image decoding device 100 may obtain a coding unit of 128×128 size from a maximum coding unit of 256×256 size based on the division shape pattern information. 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 division shape pattern information indicating “do not perform division” with respect to the minimum coding unit.

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

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

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

[0270] 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 using a predetermined splitting method based on the splitting shape pattern information. Referring to FIG. 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 splitting shape pattern information indicating that splitting is not performed, or may determine coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c that are split based on the splitting shape pattern information indicating the predetermined splitting method. The predetermined splitting method for splitting the non-square coding unit will be described in detail below with respect to various embodiments.

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

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

[0273] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (ternary division) 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. For example, when the division shape pattern information indicates that the current coding unit 400 or 450 is divided into three coding units, the image decoding apparatus 100 may divide the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.

[0274] According to an embodiment, the ratio of the width to the height of the current coding unit 400 or 450 may be 4:1 or 1:4. When the ratio of the width to the height is 4:1, the block shape information may be horizontal because the width length is greater than the height length. When the ratio of the width to the height is 1:4, the block shape information may be vertical because the width length is less than the height length. The image decoding device 100 may determine whether to split the current coding unit into an odd number of blocks based on the division shape pattern information. Furthermore, the image decoding device 100 may determine the direction in which to split 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 vertical, the image decoding device 100 may determine coding units 430a to 430c by splitting the current coding unit 400 horizontally. Furthermore, when the current coding unit 450 is horizontal, the image decoding device 100 may determine coding units 480a to 480c by splitting the current coding unit 450 vertically.

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

[0276] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and further, may apply a predetermined restriction to at least one coding unit among the odd number of coding units generated by dividing the current coding unit 400 or 450. Referring to FIG4 , the image decoding apparatus 100 may set a decoding process for a coding unit 430 b or 480 b located at the center of the three coding units 430 a, 430 b, and 430 c, or 480 a, 480 b, and 480 c, generated by dividing the current coding unit 400 or 450, to be different from decoding processes for other coding units 430 a and 430 c, or 480 a and 480 c. 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 split or from being split only a predetermined number of times.

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

[0278] According to an embodiment, the image decoding device 100 may determine whether to split the square first coding unit 500 into multiple coding units or not to split the square first coding unit 500 based on at least one of the block shape information and the division shape pattern information. According to an embodiment, when the division shape pattern information indicates that the first coding unit 500 is to be split horizontally, the image decoding device 100 may determine the second coding unit 510 by splitting the first coding unit 500 horizontally. The terms "first coding unit," "second coding unit," and "third coding unit" used in the embodiment are terms used to help understand the relationship between a coding unit before and after the coding unit is split. For example, the second coding unit may be determined by splitting the first coding unit, and the third coding unit may be determined by splitting 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 follows the above description.

[0279] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 510 into multiple coding units or not to split the determined second coding unit 510 based on at least one of block shape information and division shape pattern information. Referring to FIG. 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, or 520d based on at least one of the block shape information and the division shape pattern information, or may not split the second coding unit 510. The image decoding apparatus 100 may obtain at least one of the block shape information and the division shape pattern information, and may split the first coding unit 500 into multiple second coding units (e.g., 510) of various shapes based on the obtained at least one of the block shape information and the division shape pattern information. The second coding unit 510 may be obtained according to a method of splitting the first coding unit 500 based on at least one of the block shape information and the division shape pattern information. According to an embodiment, when the first coding unit 500 is divided into the second coding unit 510 based on at least one of the block shape information and the division shape mode information for the first coding unit 500, the second coding unit 510 may also be divided into third coding units (e.g., 520a, 520b, 520c, and 520d) based on at least one of the block shape information and the division shape mode information for the second coding unit 510. That is, the coding units may be recursively divided based on at least one of the block shape information and the division shape mode information for each coding unit. Therefore, square coding units may be determined by dividing non-square coding units, and non-square coding units may be determined by recursively dividing square coding units.

[0280] Reference Figure 8, a predetermined coding unit (e.g., a coding unit located 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. The non-square fourth coding unit 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d may be further divided into a plurality of coding units. For example, the non-square fourth coding unit 530b or 530d may be further divided into an odd-numbered coding unit. A method for recursively dividing coding units will be described below with respect to various embodiments.

[0281] According to an embodiment, the image decoding apparatus 100 may divide each of the third coding unit 520a, or 520b, 520c, and 520d into coding units based on at least one of the block shape information and the division shape pattern information. Furthermore, the image decoding apparatus 100 may determine not to divide the second coding unit 510 based on at least one of the block shape information and the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding apparatus 100 may impose a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding apparatus 100 may restrict the third coding unit 520c at the center of the odd number of third coding units 520b, 520c, and 520d from being further divided or from being divided a configurable number of times.

[0282] Reference Figure 8 , the image decoding apparatus 100 may limit the third coding unit 520c at the center position among the odd-numbered third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to no longer be divided, limited to being divided by using a predetermined division method (for example, divided only into four coding units or divided by using the division method of the second coding unit 510), or limited to being divided only a predetermined number of times (for example, divided only n times (where n>0)). However, the limitation on the third coding unit 520c at the center position is merely according to the embodiment, and therefore, should not be interpreted as being limited to the above-described embodiment, but should be interpreted as including various limitations for decoding the third coding unit 520c at the center position differently from the other third coding units 520b and 520d.

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

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

[0285] Reference Figure 9 , at least one of the block shape information and the division shape mode information about the current coding unit 600 or 650 may be obtained from a sample at a predetermined position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the predetermined position in the current coding unit 600 where at least one of the block shape information and the division shape mode information may be obtained should not be construed as being limited to Figure 6 , and should be interpreted as including various positions (e.g., above, below, 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 division shape pattern information from a predetermined 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.

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

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

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

[0289] According to an embodiment, the information indicating the positions of the upper left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, 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 samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, 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 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 can 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 information about the width or height of the coding units corresponding to the difference between the coordinates.

[0290] According to an embodiment, the information indicating the position of the upper left sample point 630a of the upper coding unit 620a may include coordinates (xa, ya), the information indicating the position of the upper left sample point 630b of the middle coding unit 620b may include coordinates (xb, yb), and the 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 can determine the middle coding unit 620b by using the coordinates of the upper left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the upper left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the sample point 630b at the center position can be determined as the coding unit at the center position among the coding units 620a, 620b, and 620c determined by splitting the current coding unit 600. However, the coordinates indicating the positions of the upper left sample points 630a, 630b, and 630c may include coordinates indicating absolute positions in the picture, or coordinates (dxb, dyb) indicating the relative position of the upper left sample point 630b of the middle coding unit 620b relative to the position of the upper left sample point 630a of the upper coding unit 620a and coordinates (dxc, dyc) indicating the relative position of the upper left sample point 630c of the lower coding unit 620c relative to the position of the upper left sample point 630a of the upper coding unit 620a may be used. The method of determining the coding unit at a predetermined position by using the coordinates of the sample points included in the coding unit as information indicating the positions of the sample points should not be interpreted as being limited to the above method, but should be interpreted as including various arithmetic methods capable of using the coordinates of the sample points.

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

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

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

[0294] 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 650. 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 or the width or height 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 width and height of the coding units 660a to 660c. With reference to Figure 9 , the image decoding apparatus 100 may determine the middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as the coding unit at the predetermined position. However, the above-described method of determining a coding unit having a size different from the sizes of other coding units, performed by the image decoding apparatus 100, corresponds only to an example of determining the coding unit at the predetermined position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various methods of determining the coding unit at the predetermined position by comparing the sizes of the coding units determined based on the coordinates of the predetermined sample points may be used.

[0295] However, the positions of samples considered for determining the position of a coding unit are not limited to the above-mentioned upper left position, and information on predetermined positions of samples included in the coding unit may be used.

[0296] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a predetermined position from an odd number of coding units determined by dividing the current coding unit based on the shape of the current coding unit. For example, when the current coding unit has a non-square shape in which the width is greater than the height, the image decoding apparatus 100 may determine a coding unit at a predetermined 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 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 predetermined 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.

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

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

[0299] Reference Figure 9The image decoding apparatus 100 may split the current coding unit 600 into multiple coding units 620a, 620b, and 620c based on at least one of the block shape information and the division shape pattern information, and may determine the coding unit 620b at the center position among the multiple coding units 620a, 620b, and 620c. Furthermore, the image decoding apparatus 100 may determine the coding unit 620b at the center position by considering the position at which at least one of the block shape information and the division shape pattern information is obtained. That is, at least one of the block shape information and the division shape pattern information regarding the current coding unit 600 may be obtained from a sample 640 at the center position of the current coding unit 600, and when the current coding unit 600 is split into the multiple coding units 620a, 620b, and 620c based on at least one of the block shape information and the division shape pattern information, the coding unit 620b including the sample 640 may be determined as the coding unit at the center position. However, information used to determine the coding unit at the center position is not limited to at least one of the block shape information and the division shape pattern information, and the coding unit at the center position may be determined using various types of information.

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

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

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

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

[0304] Figure 10 Illustrated is 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.

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

[0306] Reference Figure 10 , 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 predetermined order (for example, in a raster scan order or a zigzag scan order 750e), wherein the coding units in one row are processed and then the coding units in the next row are processed in the predetermined order.

[0307] According to an embodiment, the image decoding apparatus 100 may recursively divide the coding unit. Figure 10 , the image decoding apparatus 100 may determine a plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d. A division method of the plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d may correspond to a division method of the first coding unit 700. In this manner, each of the plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d may be independently divided into a plurality of coding units. Referring to Figure 10 , 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.

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

[0309] According to an embodiment, the processing order of coding units may be determined based on the operation of splitting the coding units. In other words, the processing order of the split coding units may be determined based on the processing order of the coding units immediately before the split. The image decoding device 100 may determine the processing order of the third coding units 720a and 720b determined by splitting the left second coding unit 710a independently of the right second coding unit 710b. Because the third coding units 720a and 720b are determined by splitting the left second coding unit 710a horizontally, the third coding units 720a and 720b may be processed in a vertical order 720c. Because the left second coding unit 710a and the right second coding unit 710b are processed in a horizontal 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 order 720c. Determining the processing order of coding units based on coding units before splitting is not limited to the above example, and coding units split and determined into various shapes may be independently processed in a predetermined order using various methods.

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

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

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

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

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

[0315] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 900 based on at least one of the block shape information and the division shape mode information obtained by the obtainer 105. 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 Figure 12 When the block shape information indicates that the first coding unit 900 is a square and the division shape pattern information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. In detail, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 900 in a horizontal direction or a vertical direction, the image decoding apparatus 100 may divide the square first coding unit 900 into an odd number of coding units (for example, second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in a vertical direction, or second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in a horizontal direction).

[0316] According to an embodiment, the image decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for processing in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Figure 12 Because the boundaries of the second coding units 910a, 910b, and 910c determined by vertically dividing the first coding unit 900 into a square 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 meet the conditions for processing in a predetermined order. Furthermore, because the boundaries of the second coding units 920a, 920b, and 920c determined by horizontally dividing the first coding unit 900 into a square 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 meet the conditions for processing in a predetermined order. When the conditions are not met as described above, the image decoding apparatus 100 may determine that the scanning order is discontinuous and, based on the determination result, determine that the first coding unit 900 is divided into an odd number of coding units. According to an embodiment, when a coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose predetermined restrictions on coding units at predetermined positions within the divided coding units. These restrictions or predetermined positions have been described above with respect to various embodiments, and therefore a detailed description thereof will not be provided here.

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

[0318] Reference Figure 12 , 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.

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

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

[0321] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1022a and 1022b, or 1024a and 1024b, by vertically splitting the non-square second coding unit 1020a or 1020b determined by horizontally splitting the first coding unit 1000. However, when the second coding unit (e.g., the upper second coding unit 1020a) is split in the vertical direction, for the above-mentioned reason, 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.

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

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

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

[0325] For example, the image decoding apparatus 100 may determine square third coding units 1112a and 1112b by horizontally splitting the left second coding unit 1110a, and square third coding units 1114a and 1114b by horizontally splitting the right second coding unit 1110b. Furthermore, the image decoding apparatus 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by horizontally splitting both the left second coding unit 1110a and the right second coding unit 1110b. In this case, coding units having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d split from the first coding unit 1100 may be determined.

[0326] As another example, the image decoding apparatus 100 may determine square third coding units 1122a and 1122b by vertically dividing the upper second coding unit 1120a, and may determine square third coding units 1124a and 1124b by vertically dividing the lower second coding unit 1120b. Furthermore, the image decoding apparatus 100 may determine square third coding units 1126a, 1126b, 1126c, and 1126d by vertically dividing both the upper second coding unit 1120a and the lower second coding unit 1120b. 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.

[0327] Figure 15 It is shown that a processing order among a plurality of coding units according to an embodiment may be changed according to a process of splitting the coding units.

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

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

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

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

[0332] Reference Figure 15, square third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d can be determined by dividing the second coding units 1210a and 1210b, and 1220a and 1220b, respectively. Although the second coding units 1210a and 1210b 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 shaped coding units split from the first coding unit 1200. Therefore, by recursively splitting the coding units in different ways based on at least one of the block shape information and the division shape pattern information, the image decoding apparatus 100 can process a plurality of coding units in different orders even if the coding units are ultimately determined to have the same shape.

[0333] Figure 16 A process of determining a depth of a coding unit when a shape and size of a coding unit change when a coding unit is recursively split to determine a plurality of coding units, according to an embodiment, is illustrated.

[0334] According to an embodiment, the image decoding apparatus 100 may determine the depth of a coding unit based on a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being split is 2n (n>0) times the length of the long side of the current coding unit after being split, the image decoding apparatus 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 split. In the following description, a coding unit with an increased depth is referred to as a coding unit of a lower depth.

[0335] Reference Figure 16According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1302 and a third coding unit 1304 of a lower depth by dividing the 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.

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

[0337] 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 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 dividing 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 dividing the first coding unit 1310 in horizontal and vertical directions.

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

[0339] 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 vertical and horizontal directions.

[0340] 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 vertical and horizontal directions.

[0341] 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 vertical and horizontal directions.

[0342] 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 a 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 a first coding unit 1320 having a size of 2N×N by splitting the first coding unit 1300 in a horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1300 having a size of 2N×2N in a horizontal direction or a vertical direction may be the same as the depth of the first coding unit 1300.

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

[0344] Figure 17 Depths that may be determined based on shapes and sizes of coding units and partial indices (PIDs) for distinguishing coding units according to an embodiment are illustrated.

[0345] 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. Figure 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 and horizontal directions based on the division shape pattern information. That is, the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first coding unit 1400.

[0346] According to an embodiment, the depths of the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information of the square first coding unit 1400 may be determined based on the 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 division shape pattern information, because the length of the side of the square second coding units 1406a, 1406b, 1406c and 1406d is 1 / 2 of the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1, which is 1 lower than the depth D of the first coding unit 1400.

[0347] 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 having a height greater than its width based on the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1422a and 1422b and 1424a, 1424b, and 1424c by vertically dividing the first coding unit 1420 having a width greater than its height based on the division shape pattern information.

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

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

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

[0351] 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. Figure 14, the image decoding apparatus 100 may determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 into a rectangular shape having a height greater than a width. The image decoding apparatus 100 may use a PID to identify the corresponding coding unit. According to an embodiment, the PID may be obtained from a sample at a predetermined position (e.g., an upper left sample) of each coding unit.

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

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

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

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

[0356] Depending on the embodiment, the reference data unit may have a predetermined size and a predetermined size shape. Depending on the embodiment, the reference data unit may include M×N samples. Here, M and N may be equal to each other and may be integers expressed as powers 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.

[0357] According to an embodiment, the image decoding apparatus 100 may divide a 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 division shape pattern information of each reference data unit. The operation of dividing the reference data units may correspond to a division operation using a quadtree structure.

[0358] According to an embodiment, the image decoding apparatus 100 may predetermine a minimum size allowed for a reference data unit included in a 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 partition shape mode information with reference to the determined reference data units.

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

[0360] According to an embodiment, the obtainer 105 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 6 The operation of dividing the current coding unit 300 describes the operation of dividing the square reference coding unit 1500 into one or more coding units, and the above has been described about Figure 7 The operation of splitting the current coding unit 400 or 450 describes an operation of splitting the non-square reference coding unit 1502 into one or more coding units. Therefore, a detailed description thereof will not be provided here.

[0361] According to an embodiment, the image decoding apparatus 100 may determine the size and shape of a reference coding unit using a PID for identifying the size and shape of a reference coding unit based on some data units predetermined based on predetermined conditions. That is, the obtainer 105 may obtain from the bitstream only the PID for identifying the size and shape of the reference coding unit for each slice, each slice segment, or each maximum coding unit, where each slice, each slice segment, or each maximum coding unit is a data unit (e.g., a data unit with 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 meets the predetermined condition. The image decoding apparatus 100 may determine the size and shape of the reference coding unit for each data unit that meets the predetermined condition using the PID. When obtaining and using reference coding unit shape information and reference coding unit size information from the bitstream based on each relatively small data unit, using the bitstream may be inefficient. Therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and reference coding unit size information. In this case, at least one of the sizes and shapes of the reference coding units corresponding to the PID for identifying the sizes and shapes of the reference coding units may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the sizes and shapes of the reference coding units included in the data unit serving as the unit for obtaining the PID by selecting at least one of the sizes and shapes of the reference coding units predetermined based on the PID.

[0362] According to an embodiment, the image decoding apparatus 100 may use one or more reference coding units included in a maximum coding unit. That is, the maximum coding unit divided from the picture may include one or more reference coding units, and the coding unit may be determined by recursively dividing each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding apparatus 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 division shape pattern information.

[0363] Figure 19 Processing blocks serving as a criterion for determining an order of reference coding units included in the picture 1600 according to an embodiment are illustrated.

[0364] According to an embodiment, the image decoding apparatus 100 may determine one or more processing blocks divided from a picture. A processing block is a data unit including one or more reference coding units divided from a picture, and the one or more reference coding units included in the processing block may be determined according to a specific order. That is, the determination order of the one or more reference coding units determined in each of the processing blocks may correspond to one of various types of orders for determining the 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, for example, a raster scan order, a zigzag scan, an N-shaped scan, an upper right diagonal scan, a horizontal scan, and a vertical scan, but is not limited to the aforementioned scan order.

[0365] 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 a picture. The image decoding apparatus 100 may obtain processing block size information from a bitstream and may determine the size of one or more processing blocks included in a picture. The size of the processing block may be a predetermined size of a data unit indicated by the processing block size information.

[0366] According to an embodiment, the obtainer 105 of the image decoding device 100 may obtain processing block size information from the bitstream based on each specific data unit. For example, the processing block size information may be obtained from the bitstream based on data units such as an image, a sequence, a picture, a slice, or a slice segment. That is, the obtainer 105 may obtain processing block size information from the bitstream based on each of the various data units, and the image decoding device 100 may determine the size of one or more processing blocks divided from the picture by using the obtained processing block size information. The size of the processing block may be an integer multiple of the size of the reference coding unit.

[0367] According to an embodiment, the image decoding apparatus 100 may determine the sizes of the processing blocks 1602 and 1612 included in the picture 1600. For example, the image decoding apparatus 100 may determine the sizes of the processing blocks based on processing block size information obtained from a bitstream. Figure 19 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 order in which one or more reference coding units in one or more processing blocks are determined.

[0368] 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 the determination order of one or more reference coding units in the processing blocks 1602 and 1612. According to an embodiment, the determination of the reference coding unit may include determination of the size of the reference coding unit.

[0369] According to an embodiment, the image decoding apparatus 100 may obtain determination order information of one or more reference coding units included in one or more processing blocks from a bitstream, and may determine a determination order for 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.

[0370] According to an embodiment, the image decoding apparatus 100 may obtain the determination order information of the reference coding units from the bitstream for each specific data unit. For example, the obtainer 105 may obtain the determination order information of the reference coding units from the bitstream for each data unit (such as an image, sequence, picture, slice, slice segment, or processing block). Because the determination order information of the reference coding units indicates the order used to determine the reference coding units in the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.

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

[0372] According to an embodiment, the obtainer 105 may obtain determination order information of reference coding units from a bitstream as information related to the 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 the processing blocks 1602 and 1612, and may determine one or more reference coding units included in the picture 1600 based on the determination order. Figure 19, the image decoding apparatus 100 may determine determination orders 1604 and 1614 of one or more reference coding units in processing blocks 1602 and 1612, respectively. For example, when obtaining determination order information of reference coding units for each processing block, different types of determination order information of reference coding units may be obtained for processing blocks 1602 and 1612. When the determination order 1604 of the reference coding units in processing block 1602 is a raster scan order, the reference coding units included in processing block 1602 may be determined according to the raster scan order. Conversely, when the determination order 1614 of the reference coding units in another processing block 1612 is a reverse raster scan order, the reference coding units included in processing block 1612 may be determined according to the reverse raster scan order.

[0373] 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. Methods for decoding the reference coding units may include various image decoding methods.

[0374] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating the division method of the current coding unit from the bitstream, and may use the obtained information. The block shape information or division shape pattern information may be included in the bitstream associated with various data units. For example, the image decoding device 100 may use the block shape information or division shape pattern information 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 division shape pattern information from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax element.

[0375] Various embodiments have been described above. Those skilled in the art will appreciate that the present disclosure may be implemented in many different forms without departing from the essential features of the present disclosure. Therefore, the embodiments of the present disclosure set forth herein should be considered solely in a descriptive sense, and not for purposes of limitation. The scope of the present disclosure is set forth in the claims rather than in the foregoing description, and all differences that fall within the scope of equivalence with the claims should be interpreted as being included in the present disclosure.

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

Claims

1. An image decoding method, comprising: obtaining at least one coding unit including the current block by hierarchically splitting the current image based on the split type information, When the current prediction mode of the current block is an intra mode, determining a first sample value of the upper left reference sample of the current block by identifying a first availability of the upper left reference sample of the current block; Searching, in sequence, for remaining reference sample points of at least one reference line from a plurality of reference lines, except for the upper left reference sample point, wherein the plurality of reference lines include a left reference line of the current block, an upper reference line of the current block, and a right reference line of the current block; determining second sample values of the remaining reference samples of the current block except the upper left reference sample by identifying second availability of the remaining reference samples found; Performing intra prediction on the current block based on a first sample value of an upper left reference sample of the current block and second sample values of the remaining reference samples of the current block except the upper left reference sample to obtain a prediction block of the current block; and Obtaining a reconstructed block of the current block based on the predicted block of the current block, The step of determining the first sample value of the upper left reference sample of the current block includes: When the upper left reference sample is unavailable, determining a first value obtained based on the sample bit depth as the first sample value of the upper left reference sample, The step of determining the second sample point values of the remaining reference samples of the current block except the upper left reference sample point includes: When the current reference sample in the current search position is unavailable, determining a second value obtained based on a sample value of a previous reference sample in a previous search position as the current sample value of the current reference sample in the current search position, The first search direction of the upper reference line is the right direction relative to the upper left reference sample point. The second search direction of the left reference line is the first downward direction relative to the upper left reference sample point. The third search direction of the right reference line is the second downward direction relative to the upper right reference sample point of the current block. When the coordinate value of the upper left corner sample point of the current block is (0, 0), the x-axis coordinate value of the upper right reference sample point of the current block is the width of the current block, and the y-axis coordinate value of the upper right reference sample point of the current block is -1. The partition type information indicates one of a plurality of partition types including quaternary partition, binary partition and ternary partition.

2. An image decoding device, comprising: The intra predictor is configured to: when a current prediction mode of a current block is an intra mode, determine a first sample value of an upper left reference sample of the current block by identifying a first availability of an upper left reference sample of the current block, sequentially search for remaining reference samples of at least one reference line from a plurality of reference lines excluding the upper left reference sample, wherein the plurality of reference lines include a left reference line of the current block, an upper reference line of the current block, and a right reference line of the current block, determine second sample values of remaining reference samples of the current block excluding the upper left reference sample by identifying a second availability of the searched remaining reference samples, perform intra prediction on the current block based on the first sample value of the upper left reference sample of the current block and the second sample values of the remaining reference samples of the current block excluding the upper left reference sample to obtain a predicted block of the current block, and obtain a reconstructed block of the current block based on the predicted block of the current block. wherein at least one coding unit including the current block is obtained by hierarchically dividing the current image based on the division type information, When the intra predictor determines the first sample value of the upper left reference sample of the current block, the intra predictor is further configured to: When the upper left reference sample is unavailable, determining a first value obtained based on the sample bit depth as the first sample value of the upper left reference sample, When the intra predictor determines the second sample values of the remaining reference samples of the current block except the upper left reference sample, the intra predictor is further configured to: When the current reference sample in the current search position is unavailable, determining a second value obtained based on a sample value of a previous reference sample in a previous search position as the current sample value of the current reference sample in the current search position, The first search direction of the upper reference line is the right direction relative to the upper left reference sample point. The second search direction of the left reference line is the first downward direction relative to the upper left reference sample point. The third search direction of the right reference line is the second downward direction relative to the upper right reference sample point of the current block. Wherein, when the coordinate value of the upper left corner sample point of the current block is (0, 0), the x-axis coordinate value of the upper right reference sample point of the current block is the width of the current block, and the y-axis coordinate value of the upper right reference sample point of the current block is -1, and The partition type information indicates one of a plurality of partition types including quaternary partition, binary partition and ternary partition.

3. An image encoding method, comprising: determining at least one coding unit including the current block by hierarchically splitting the current image based on a plurality of partition types, When the prediction mode of the current block is an intra mode, determining a first sample value of the upper left reference sample of the current block by identifying a first availability of the upper left reference sample of the current block; Searching, in sequence, for remaining reference sample points of at least one reference line from a plurality of reference lines, except for the upper left reference sample point, wherein the plurality of reference lines include a left reference line of the current block, an upper reference line of the current block, and a right reference line of the current block; determining second sample values of the remaining reference samples of the current block except the upper left reference sample by identifying second availability of the remaining reference samples found; Performing intra prediction on the current block based on a first sample value of an upper left reference sample of the current block and second sample values of remaining reference samples except the upper left reference sample to obtain a prediction block of the current block; and generating a bitstream based on a predicted block of the current block, The step of determining the first sample value of the upper left reference sample of the current block includes: When the upper left reference sample is unavailable, determining a first value obtained based on the sample bit depth as the first sample value of the upper left reference sample, The step of determining the second sample point values of the remaining reference samples of the current block except the upper left reference sample point includes: When the current reference sample in the current search position is unavailable, determining a second value obtained based on a sample value of a previous reference sample in a previous search position as the current sample value of the current reference sample in the current search position, The first search direction of the upper reference line is the right direction relative to the upper left reference sample point. The second search direction of the left reference line is the first downward direction relative to the upper left reference sample point. The third search direction of the right reference line is the second downward direction relative to the upper right reference sample point of the current block. Wherein, when the coordinate value of the upper left corner sample point of the current block is (0, 0), the x-axis coordinate value of the upper right reference sample point of the current block is the width of the current block, and the y-axis coordinate value of the upper right reference sample point of the current block is -1, and The bitstream includes partition type information, and the partition type information indicates one of the multiple partition types including quadruple partition, binary partition and ternary partition.

4. A method for transmitting a bitstream generated by an image encoding method, the method comprising: Send bitstream, The image encoding method includes: determining at least one coding unit including the current block by hierarchically splitting the current image based on a plurality of partition types, When the prediction mode of the current block is an intra mode, determining a first sample value of the upper left reference sample of the current block by identifying a first availability of the upper left reference sample of the current block; Searching, in sequence, for remaining reference sample points of at least one reference line from a plurality of reference lines, except for the upper left reference sample point, wherein the plurality of reference lines include a left reference line of the current block, an upper reference line of the current block, and a right reference line of the current block; determining second sample values of the remaining reference samples of the current block except the upper left reference sample by identifying second availability of the remaining reference samples found; Performing intra prediction on the current block based on a first sample value of an upper left reference sample of the current block and second sample values of remaining reference samples except the upper left reference sample to obtain a prediction block of the current block; and generating a bitstream based on a predicted block of the current block, The step of determining the first sample value of the upper left reference sample of the current block includes: When the upper left reference sample is unavailable, determining a first value obtained based on the sample bit depth as the first sample value of the upper left reference sample, The step of determining the second sample point values of the remaining reference samples of the current block except the upper left reference sample point includes: When the current reference sample in the current search position is unavailable, determining a second value obtained based on a sample value of a previous reference sample in a previous search position as the current sample value of the current reference sample in the current search position, The first search direction of the upper reference line is the right direction relative to the upper left reference sample point. The second search direction of the left reference line is the first downward direction relative to the upper left reference sample point. The third search direction of the right reference line is the second downward direction relative to the upper right reference sample point of the current block. Wherein, when the coordinate value of the upper left corner sample point of the current block is (0, 0), the x-axis coordinate value of the upper right reference sample point of the current block is the width of the current block, and the y-axis coordinate value of the upper right reference sample point of the current block is -1, and The bitstream includes partition type information, and the partition type information indicates one of the multiple partition types including quadruple partition, binary partition and ternary partition.