VIDEO ENCODING/DECODING METHOD AND RECORDING MEDIUM FOR STORING BITSTREAM

- KT CORPORATION

A video encoding/decoding method according to the present invention comprise the steps of: dividing a chroma block into a plurality of partitions; and performing intra-prediction for each of the partitions in the chroma block.

Skip to: Description  ·  Claims  · Patent History  ·  Patent History
Description
TECHNICAL FIELD

The present disclosure relates to a method and a device for processing an image signal.

BACKGROUND ART

Recently, demands for high-resolution and high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images have increased in a variety of application fields. As image data becomes high-resolution and high-quality, the volume of data relatively increases compared to the existing image data, so when image data is transmitted by using media such as the existing wire and wireless broadband circuit or is stored by using the existing storage medium, expenses for transmission and expenses for storage increase. High efficiency image compression technologies may be utilized to resolve these problems which are generated as image data becomes high-resolution and high-quality.

There are various technologies such as an inter prediction technology which predicts a pixel value included in a current picture from a previous or subsequent picture of a current picture with an image impression technology, an intra prediction technology which predicts a pixel value included in a current picture by using pixel information in a current picture, an entropy encoding technology which assigns a short sign to a value with high appearance frequency and assigns a long sign to a value with low appearance frequency and so on, and image data may be effectively compressed and transmitted or stored by using these image compression technologies.

On the other hand, as demands for a high-resolution image have increased, demands for stereo-scopic image contents have increased as a new image service. A video compression technology for effectively providing high-resolution and ultra high-resolution stereo-scopic image contents has been discussed.

DISCLOSURE Technical Problem

In encoding/decoding an image signal, the present disclosure is to provide a method and a device for predicting a chroma block by using a reconstructed luma block.

In encoding/decoding an image signal, the present disclosure is to provide a method and a device for predicting a chroma block based on the linearity of a luma component and a chroma component.

In encoding/decoding an image signal, the present disclosure is to provide a method and a device for deriving encoding/decoding information on a chroma block from a collocated luma block.

Technical effects of the present disclosure may be non-limited by the above-mentioned technical effects, and other unmentioned technical effects may be clearly understood from the following description by those having ordinary skill in the technical field to which the present disclosure pertains.

Technical Solution

An image encoding/decoding method according to the present disclosure may include partitioning a chroma block into a plurality of partitions; and performing intra prediction for each of the partitions in the chroma block. In this case, a partition type of the chroma block may be determined based on at least one of a partition type or a directionality of a collocated luma block of the chroma block.

In an image decoding/encoding method according to the present disclosure, the partition type of the chroma block may be set to be the same as the partition type of the collocated luma block.

In an image decoding/encoding method according to the present disclosure, the plurality of partitions may be generated by partitioning the chroma block in a horizontal direction or in a vertical direction, and a division direction of the chroma block may be determined based on the directionality of the collocated luma block.

In an image decoding/encoding method according to the present disclosure, decoding order for a plurality of partitions in the chroma block may be determined based on the directionality of the collocated luma block.

An image decoding/encoding method according to the present disclosure may further include determining whether to perform flipping on the chroma block. In this case, the flipping for the chroma block may be performed for at least one of a horizontal direction or a vertical direction.

In an image decoding/encoding method according to the present disclosure, whether to perform the flipping and a direction in which the flipping is performed may be determined based on the directionality of the collocated luma block.

In an image decoding/encoding method according to the present disclosure, the flipping may be allowed only when the collocated luma block is encoded by intra prediction.

In an image decoding/encoding method according to the present disclosure, an intra prediction mode of each of the plurality of partitions in the chroma block may be set to be the same as an intra prediction mode of each of a plurality of partitions included in the collocated luma block.

In an image decoding/encoding method according to the present disclosure, a predefined intra prediction mode may be applied to a partition corresponding to a region with a large prediction error in the collocated luma block among the plurality of partitions in the chroma block, and an intra prediction mode of the collocated luma block may be applied to a partition that does not.

In an image decoding/encoding method according to the present disclosure, whether a sub-region in the collocated luma block is a region with a large prediction error may be determined by comparing an average value of absolute values of residual samples in the sub-region with a threshold value.

In an image decoding/encoding method according to the present disclosure, the threshold value may be derived based on an average value of absolute values of residual samples in the collocated luma block.

In an image decoding/encoding method according to the present disclosure, the directionality of the collocated luma block may be determined based on an optimal intra prediction mode derived according to a result of performing intra prediction performed based on predefined intra prediction modes and reference samples around the collocated luma block.

In an image decoding/encoding method according to the present disclosure, the directionality of the collocated luma block may be set to be the same as a directionality of a reference block in which the collocated luma block is included.

A computer readable recording medium storing a bitstream encoded by an image encoding method according to the present disclosure may be provided.

Technical Effect

According to the present disclosure, encoding/decoding efficiency may be improved by predicting a chroma block by using a reconstructed luma block.

According to the present disclosure, the accuracy of intra prediction may be improved by predicting a chroma block based on the linearity of a luma component and a chroma component.

According to the present disclosure, compression efficiency for a chroma block may be improved by deriving encoding/decoding information of a chroma block by referring to a collocated luma block.

Effects obtainable from the present disclosure are not limited to the above-mentioned effects and other unmentioned effects may be clearly understood from the following description by those having ordinary skill in the technical field to which the present disclosure pertains.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing an image encoding device according to an embodiment of the present disclosure.

FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present disclosure.

FIG. 3 shows an image encoding/decoding method performed by an image encoding/decoding device according to the present disclosure.

FIGS. 4 and 5 show an example of a plurality of intra prediction modes according to the present disclosure.

FIG. 6 shows an intra prediction method based on a planar mode according to the present disclosure.

FIG. 7 shows an intra prediction method based on a DC mode according to the present disclosure.

FIG. 8 shows an intra prediction method based on a directional mode according to the present disclosure.

FIG. 9 shows a method for deriving a sample at a fractional position.

FIGS. 10 and 11 show that a tangent value for an angle is scaled 32 times per intra prediction mode.

FIG. 12 is a diagram illustrating an intra prediction aspect when a directional mode is one of mode no. 34 to mode no. 49.

FIG. 13 is a diagram for describing an example of generating a top reference sample by interpolating left reference samples.

FIG. 14 shows an example in which intra prediction is performed by using reference samples arranged in a 1D array.

FIG. 15 is a diagram for describing encoding/decoding order when a single tree structure is used.

FIG. 16 is a diagram for describing encoding/decoding order when a dual tree structure is used.

FIG. 17 is a flowchart showing a method for predicting a chroma block by using a reconstructed luma block/FIG. 18 to FIG. 20 show an example in which a luma block is downsampled.

FIG. 21 is a diagram for describing an example related to a position to which downsampling is applied.

FIG. 22 and FIG. 23 are a diagram for describing an example in which a partition structure of a chroma block is determined by referring to a collocated luma block in a dual tree structure.

FIG. 24 shows an example in which encoding/decoding information for a chroma block is determined based on a directionality for luma samples.

FIG. 25 represents an example in which reconstructed samples in a collocated luma block are used as reference samples.

FIG. 26 represents an example in which intra prediction modes are classified into a plurality of groups.

FIG. 27 and FIG. 28 represents scan order for each sub-block in a chroma block according to a directionality of a collocated luma block.

FIG. 29 represents an example in which flipping is performed for samples in a chroma block.

FIG. 30 represents an example in which whether it is a region with a large prediction error in a unit of a sub-block in a collocated luma block is determined.

MODE FOR INVENTION

As the present disclosure may make various changes and have several embodiments, specific embodiments will be illustrated in a drawing and described in detail. But, it is not intended to limit the present disclosure to a specific embodiment, and it should be understood that it includes all changes, equivalents or substitutes included in an idea and a technical scope for the present disclosure. A similar reference numeral was used for a similar component while describing each drawing.

A term such as first, second, etc. may be used to describe various components, but the components should not be limited by the terms. The terms are used only to distinguish one component from other components. For example, without going beyond a scope of a right of the present disclosure, a first component may be referred to as a second component and similarly, a second component may be also referred to as a first component. A term of and/or includes a combination of a plurality of relative entered items or any item of a plurality of relative entered items.

When a component is referred to as being “linked” or “connected” to other component, it should be understood that it may be directly linked or connected to that other component, but other component may exist in the middle. On the other hand, when a component is referred to as being “directly linked” or “directly connected” to other component, it should be understood that other component does not exist in the middle.

As terms used in this application are just used to describe a specific embodiment, they are not intended to limit the present disclosure. Expression of the singular includes expression of the plural unless it clearly has a different meaning contextually. In this application, it should be understood that a term such as “include” or “have”, etc. is to designate the existence of characteristics, numbers, steps, motions, components, parts or their combinations entered in the specification, but is not to exclude a possibility of addition or existence of one or more other characteristics, numbers, steps, motions, components, parts or their combinations in advance.

Hereinafter, referring to the attached drawings, a desirable embodiment of the present disclosure will be described in more detail. Hereinafter, the same reference numeral is used for the same component in a drawing and an overlapping description for the same component is omitted.

FIG. 1 is a block diagram showing an image encoding device according to an embodiment of the present disclosure.

Referring to FIG. 1, an image encoding device 100 may include a picture partitioning unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, a dequantization unit 140, an inverse-transform unit 145, a filter unit 150, and a memory 155.

As each construction unit shown in FIG. 1 is independently shown to represent different characteristic functions in an image encoding device, it does not mean that each construction unit is constituted by separated hardware or one software unit. That is, as each construction unit is included by being enumerated as each construction unit for convenience of a description, at least two construction units of each construction unit may be combined to constitute one construction unit or one construction unit may be partitioned into a plurality of construction units to perform a function, and even an integrated embodiment and a separated embodiment of each construction unit are also included in a scope of a right of the present disclosure unless they are departing from the essence of the present disclosure.

Further, some components may be just an optional component for improving performance, not a necessary component which perform an essential function in the present disclosure. The present disclosure may be implemented by including only a construction unit necessary for implementing the essence of the present disclosure excluding a component used to just improve performance, and a structure including only a necessary component excluding an optional component used to just improve performance is also included in a scope of a right of the present disclosure.

A picture partitioning unit 110 may partition an input picture into at least one processing unit. In this case, a processing unit may be a prediction unit (PU), a transform unit (TU) or a coding unit (CU). In a picture partitioning unit 110, one picture may be partitioned into a combination of a plurality of coding units, prediction units and transform units and a picture may be encoded by selecting a combination of one coding unit, prediction unit and transform unit according to a predetermined standard (e.g., a cost function).

For example, one picture may be partitioned into a plurality of coding units. In order to partition a coding unit in a picture, a recursive tree structure such as a quad tree may be used, and a coding unit which is partitioned into other coding units by using one image or the largest coding unit as a route may be partitioned with as many child nodes as the number of partitioned coding units. A coding unit which is no longer partitioned according to a certain restriction becomes a leaf node. In other words, when it is assumed that only square partitioning is possible for one coding unit, one coding unit may be partitioned into up to four other coding units.

Hereinafter, in an embodiment of the present disclosure, a coding unit may be used as a unit for encoding or may be used as a unit for decoding.

A prediction unit may be partitioned with at least one square or rectangular shape, etc. in the same size in one coding unit or may be partitioned so that any one prediction unit of prediction units partitioned in one coding unit can have a shape and/or a size different from another prediction unit.

When a prediction unit for which intra prediction is performed based on a coding unit is generated and it is not the minimum coding unit, intra prediction may be performed without being partitioned into a plurality of prediction units N×N.

Prediction units 120 and 125 may include an inter prediction unit 120 performing inter prediction and an intra prediction unit 125 performing intra prediction. Whether to perform inter prediction or intra prediction for a coding unit may be determined and detailed information according to each prediction method (e.g., an intra prediction mode, a motion vector, a reference picture, etc.) may be determined. In this case, a processing unit that prediction is performed may be different from a processing unit that a prediction method and details are determined. For example, a prediction method, a prediction mode, etc. may be determined in a prediction unit and prediction may be performed in a transform unit. A residual value (a residual block) between a generated prediction block and an original block may be input to a transform unit 130. In addition, prediction mode information, motion vector information, etc. used for prediction may be encoded with a residual value in an entropy encoding unit 165 and may be transmitted to a decoding device. When a specific encoding mode is used, an original block may be encoded as it is and transmitted to a decoding unit without generating a prediction block through prediction units 120 or 125.

An inter prediction unit 120 may predict a prediction unit based on information on at least one picture of a previous picture or a subsequent picture of a current picture, or in some cases, may predict a prediction unit based on information on some encoded regions in a current picture. An inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit and a motion compensation unit.

A reference picture interpolation unit may receive reference picture information from a memory 155 and generate pixel information equal to or less than an integer pixel in a reference picture. For a luma pixel, a 8-tap DCT-based interpolation filter having a different filter coefficient may be used to generate pixel information equal to or less than an integer pixel in a ¼ pixel unit. For a chroma signal, a 4-tap DCT-based interpolation filter having a different filter coefficient may be used to generate pixel information equal to or less than an integer pixel in a ⅛ pixel unit.

A motion prediction unit may perform motion prediction based on a reference picture interpolated by a reference picture interpolation unit. As a method for calculating a motion vector, various methods such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), NTS (New Three-Step Search Algorithm), etc. may be used. A motion vector may have a motion vector value in a ½ or ¼ pixel unit based on an interpolated pixel. A motion prediction unit may predict a current prediction unit by varying a motion prediction method. As a motion prediction method, various methods such as a skip method, a merge method, an advanced motion vector prediction (AMVP) method, an intra block copy method, etc. may be used.

An intra prediction unit 125 may generate a prediction unit based on reference pixel information around a current block which is pixel information in a current picture. When a neighboring block in a current prediction unit is a block which performed inter prediction and accordingly, a reference pixel is a pixel which performed inter prediction, a reference pixel included in a block which performed inter prediction may be used by being replaced with reference pixel information of a surrounding block which performed intra prediction. In other words, when a reference pixel is unavailable, unavailable reference pixel information may be used by being replaced with at least one reference pixel of available reference pixels.

A prediction mode in intra prediction may have a directional prediction mode using reference pixel information according to a prediction direction and a non-directional mode not using directional information when performing prediction. A mode for predicting luma information may be different from a mode for predicting chroma information and intra prediction mode information used for predicting luma information or predicted luma signal information may be utilized to predict chroma information.

When a size of a prediction unit is the same as that of a transform unit in performing intra prediction, intra prediction for a prediction unit may be performed based on a pixel at a left position of a prediction unit, a pixel at a top-left position and a pixel at a top position. However, if a size of a prediction unit is different from a size of a transform unit when intra prediction is performed, intra prediction may be performed by using a reference pixel based on a transform unit. In addition, intra prediction using N×N partition may be used only for the minimum coding unit.

An intra prediction method may generate a prediction block after applying an adaptive intra smoothing (AIS) filter to a reference pixel according to a prediction mode. A type of an AIS filter applied to a reference pixel may be different. In order to perform an intra prediction method, an intra prediction mode in a current prediction unit may be predicted from an intra prediction mode in a prediction unit around a current prediction unit. When a prediction mode in a current prediction unit is predicted by using mode information predicted from a surrounding prediction unit, information that a prediction mode in a current prediction unit is the same as a prediction mode in a surrounding prediction unit may be transmitted by using predetermined flag information if an intra prediction mode in a current prediction unit is the same as an intra prediction mode in a surrounding prediction unit, and prediction mode information of a current block may be encoded by performing entropy encoding if a prediction mode in a current prediction unit is different from a prediction mode in a surrounding prediction unit.

In addition, a residual block may be generated which includes information on a residual value that is a difference value between a prediction unit which performed prediction based on a prediction unit generated in prediction units 120 and 125 and an original block in a prediction unit. A generated residual block may be input to a transform unit 130.

A transform unit 130 may transform an original block and a residual block including residual value information in a prediction unit generated through prediction units 120 and 125 by using a transform method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), KLT. Whether to apply DCT, DST or KLT to transform a residual block may be determined based on intra prediction mode information in a prediction unit used to generate a residual block.

A quantization unit 135 may quantize values transformed into a frequency domain in a transform unit 130. A quantization coefficient may be changed according to a block or importance of an image. A value calculated in a quantization unit 135 may be provided to a dequantization unit 140 and a rearrangement unit 160.

A rearrangement unit 160 may perform rearrangement of a coefficient value for a quantized residual value.

A rearrangement unit 160 may change a coefficient in a shape of a two-dimensional block into a shape of a one-dimensional vector through a coefficient scan method. For example, a rearrangement unit 160 may scan a DC coefficient to a coefficient in a high-frequency domain by using a zig-zag scan method and change it into a shape of a one-dimensional vector. According to a size of a transform unit and an intra prediction mode, instead of zig-zag scan, vertical scan where a coefficient in a shape of a two-dimensional block is scanned in a column direction or horizontal scan where a coefficient in a shape of a two-dimensional block is scanned in a row direction may be used. In other words, which scan method among zig-zag scan, vertical directional scan and horizontal directional scan will be used may be determined according to a size of a transform unit and an intra prediction mode.

An entropy encoding unit 165 may perform entropy encoding based on values calculated by a rearrangement unit 160. Entropy encoding, for example, may use various encoding methods such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), CABAC (Context-Adaptive Binary Arithmetic Coding).

An entropy encoding unit 165 may encode a variety of information such as residual value coefficient information and block type information in a coding unit, prediction mode information, partitioning unit information, prediction unit information and transmission unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc. from a rearrangement unit 160 and prediction units 120 and 125.

An entropy encoding unit 165 may perform entropy encoding for a coefficient value in a coding unit which is input from a rearrangement unit 160.

A dequantization unit 140 and an inverse transform unit 145 dequantize values quantized in a quantization unit 135 and inversely transform values transformed in a transform unit 130. A residual value generated by a dequantization unit 140 and an inverse transform unit 145 may be combined with a prediction unit predicted by a motion prediction unit, a motion compensation unit and an intra prediction unit included in prediction units 120 and 125 to generate a reconstructed block.

A filter unit 150 may include at least one of a deblocking filter, an offset correction unit and an adaptive loop filter (ALF).

A deblocking filter may remove block distortion which is generated by a boundary between blocks in a reconstructed picture. In order to determine whether deblocking is performed, whether a deblocking filter will be applied to a current block may be determined based on a pixel included in several rows or columns included in a block. When a deblocking filter is applied to a block, a strong filter or a weak filter may be applied according to required deblocking filtering strength. In addition, in applying a deblocking filter, when horizontal filtering and vertical filtering are performed, horizontal directional filtering and vertical directional filtering may be set to be processed in parallel.

An offset correction unit may correct an offset with an original image in a unit of a pixel for an image that deblocking was performed. In order to perform offset correction for a specific picture, a region where an offset will be performed may be determined after dividing a pixel included in an image into the certain number of regions and a method in which an offset is applied to a corresponding region or a method in which an offset is applied by considering edge information of each pixel may be used.

Adaptive loop filtering (ALF) may be performed based on a value obtained by comparing a filtered reconstructed image with an original image. After a pixel included in an image is divided into predetermined groups, filtering may be discriminately performed per group by determining one filter which will be applied to a corresponding group. Information related to whether to apply ALF may be transmitted per coding unit (CU) for a luma signal and a shape and a filter coefficient of an ALF filter to be applied may vary according to each block. In addition, an ALF filter in the same shape (fixed shape) may be applied regardless of a characteristic of a block to be applied.

A memory 155 may store a reconstructed block or picture calculated through a filter unit 150 and a stored reconstructed block or picture may be provided to prediction units 120 and 125 when performing inter prediction.

FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present disclosure.

Referring to FIG. 2, an image decoding device 200 may include an entropy decoding unit 210, a rearrangement unit 215, a dequantization unit 220, an inverse transform unit 225, prediction units 230 and 235, a filter unit 240, and a memory 245.

When an image bitstream is input from an image encoding device, an input bitstream may be decoded according to a procedure opposite to that of an image encoding device.

An entropy decoding unit 210 may perform entropy decoding according to a procedure opposite to a procedure in which entropy encoding is performed in an entropy encoding unit of an image encoding device. For example, in response to a method performed in an image encoding device, various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), CABAC (Context-Adaptive Binary Arithmetic Coding) may be applied.

An entropy decoding unit 210 may decode information related to intra prediction and inter prediction performed in an encoding device.

A rearrangement unit 215 may perform rearrangement based on a method that a bitstream entropy-decoded in an entropy decoding unit 210 is rearranged in an encoding unit. Coefficients expressed in a form of a one-dimensional vector may be rearranged by being reconstructed into coefficients in a form of a two-dimensional block. A rearrangement unit 215 may receive information related to coefficient scanning performed in an encoding unit and perform rearrangement through a method in which scanning is inversely performed based on scanning order performed in a corresponding encoding unit.

A dequantization unit 220 may perform dequantization based on a quantization parameter provided from an encoding device and a coefficient value of a rearranged block.

An inverse transform unit 225 may perform transform performed in a transform unit, i.e., inverse transform for DCT, DST, and KLT, i.e., inverse DCT, inverse DST and inverse KLT for a result of quantization performed in an image encoding device. Inverse transform may be performed based on a transmission unit determined in an image encoding device. In an inverse transform unit 225 of an image decoding device, a transform technique (for example, DCT, DST, KLT) may be selectively performed according to a plurality of information such as a prediction method, a size of a current block, a prediction mode, etc.

Prediction units 230 and 235 may generate a prediction block based on information related to generation of a prediction block provided from an entropy decoding unit 210 and pre-decoded block or picture information provided from a memory 245.

As described above, when a size of a prediction unit is the same as a size of a transform unit in performing intra prediction in the same manner as an operation in an image encoding device, intra prediction for a prediction unit may be performed based on a pixel at a left position of a prediction unit, a pixel at a top-left position and a pixel at a top position, but when a size of a prediction unit is different from a size of a transform unit in performing intra prediction, intra prediction may be performed by using a reference pixel based on a transform unit. In addition, intra prediction using N×N partitioning may be used only for the smallest coding unit.

Prediction units 230 and 235 may include a prediction unit determination unit, an inter prediction unit and an intra prediction unit. A prediction unit determination unit may receive a variety of information such as prediction unit information, prediction mode information of an intra prediction method, motion prediction-related information of an inter prediction method, etc. which are input from an entropy decoding unit 210, divide a prediction unit in a current coding unit and determine whether a prediction unit performs inter prediction or intra prediction. An inter prediction unit 230 may perform inter prediction for a current prediction unit based on information included in at least one picture of a previous picture or a subsequent picture of a current picture including a current prediction unit by using information necessary for inter prediction in a current prediction unit provided from an image encoding device. Alternatively, inter prediction may be performed based on information on some regions which are pre-reconstructed in a current picture including a current prediction unit.

In order to perform inter prediction, whether a motion prediction method in a prediction unit included in a corresponding coding unit is a skip mode, a merge mode, an AMVP mode, or an intra block copy mode may be determined based on a coding unit.

An intra prediction unit 235 may generate a prediction block based on pixel information in a current picture. When a prediction unit is a prediction unit which performed intra prediction, intra prediction may be performed based on intra prediction mode information in a prediction unit provided from an image encoding device. An intra prediction unit 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation unit and a DC filter. As a part performing filtering on a reference pixel of a current block, an AIS filter may be applied by determining whether a filter is applied according to a prediction mode in a current prediction unit. AIS filtering may be performed for a reference pixel of a current block by using AIS filter information and a prediction mode in a prediction unit provided from an image encoding device. When a prediction mode of a current block is a mode which does not perform AIS filtering, an AIS filter may not be applied.

When a prediction mode in a prediction unit is a prediction unit which performs intra prediction based on a pixel value which interpolated a reference pixel, a reference pixel interpolation unit may interpolate a reference pixel to generate a reference pixel in a unit of a pixel equal to or less than an integer value. When a prediction mode in a current prediction unit is a prediction mode which generates a prediction block without interpolating a reference pixel, a reference pixel may not be interpolated. A DC filter may generate a prediction block through filtering when a prediction mode of a current block is a DC mode.

A reconstructed block or picture may be provided to a filter unit 240. A filter unit 240 may include a deblocking filter, an offset correction unit and an ALF.

Information on whether a deblocking filter was applied to a corresponding block or picture and information on whether a strong filter or a weak filter was applied when a deblocking filter was applied may be provided from an image encoding device. Information related to a deblocking filter provided from an image encoding device may be provided in a deblocking filter of an image decoding device and deblocking filtering for a corresponding block may be performed in an image decoding device.

An offset correction unit may perform offset correction on a reconstructed image based on offset value information, a type of offset correction, etc. applied to an image when performing encoding.

An ALF may be applied to a coding unit based on information on whether ALF is applied, ALF coefficient information, etc. provided from an encoding device. Such ALF information may be provided by being included in a specific parameter set.

A memory 245 may store a reconstructed picture or block for use as a reference picture or a reference block and provide a reconstructed picture to an output unit.

As described above, hereinafter, in an embodiment of the present disclosure, a coding unit is used as a term of a coding unit for convenience of a description, but it may be a unit which performs decoding as well as encoding.

In addition, as a current block represents a block to be encoded/decoded, it may represent a coding tree block (or a coding tree unit), a coding block (or a coding unit), a transform block (or a transform unit) or a prediction block (or a prediction unit), etc. according to an encoding/decoding step. In this specification, ‘unit’ may represent a base unit for performing a specific encoding/decoding process and ‘block’ may represent a pixel array in a predetermined size. Unless otherwise classified, ‘block’ and ‘unit’ may be used interchangeably. For example, in the after-described embodiment, it may be understood that a coding block (a coding block) and a coding unit (a coding unit) are used interchangeably.

FIG. 3 shows an image encoding/decoding method performed by an image encoding/decoding device according to the present disclosure.

Referring to FIG. 3, a reference line for intra prediction of a current block may be determined S300.

A current block may use one or more of a plurality of reference line candidates pre-defined in an image encoding/decoding device as a reference line for intra prediction. Here, a plurality of pre-defined reference line candidates may include a neighboring reference line adjacent to a current block to be decoded and N non-neighboring reference lines 1-sample to N-samples away from a boundary of a current block. N may be an integer of 1, 2, 3 or more. Hereinafter, for convenience of a description, it is assumed that a plurality of reference line candidates available for a current block consist of a neighboring reference line candidate and three non-neighboring reference line candidates, but it is not limited thereto. In other words, of course, a plurality of reference line candidates available for a current block may include four or more non-neighboring reference line candidates.

An image encoding device may determine an optimal reference line candidate among a plurality of reference line candidates and encode an index for specifying it. An image decoding device may determine a reference line of a current block based on an index signaled through a bitstream. The index may specify any one of a plurality of reference line candidates. A reference line candidate specified by the index may be used as a reference line of a current block.

The number of indexes signaled to determine a reference line of a current block may be 1, 2 or more. As an example, when the number of indexes signaled above is 1, a current block may perform intra prediction by using only a single reference line candidate specified by the signaled index among a plurality of reference line candidates. Alternatively, when the number of indexes signaled above is at least two, a current block may perform intra prediction by using a plurality of reference line candidates specified by a plurality of indexes among a plurality of reference line candidates.

Referring to FIG. 3, an intra prediction mode of a current block may be determined S310. An intra prediction mode of a current block may be determined among a plurality of intra prediction modes pre-defined in an image encoding/decoding device. The plurality of pre-defined intra prediction modes are described by referring to FIGS. 4 and 5.

FIG. 4 shows an example of a plurality of intra prediction modes according to the present disclosure.

Referring to FIG. 4, a plurality of intra prediction modes pre-defined in an image encoding/decoding device may be composed of a non-directional mode and a directional mode. A non-directional mode may include at least one of a planar mode or a DC mode. A directional mode may include directional mode 2 to 66.

A directional mode may be expanded more than shown in FIG. 4. FIG. 5 shows an example in which a directional mode is expanded.

In FIG. 5, it was illustrated that mode-1 to mode-14 and mode 67 to mode 80 are added. These directional modes may be referred to as a wide-angle intra prediction mode. Whether to use a wide-angle intra prediction mode may be determined according to a shape of a current block. As an example, if a current block is a non-square block whose width is greater than a height, some directional modes (e.g., No. 2 to No. 15) may be transformed to a wide-angle intra prediction mode between No. 67 and No. 80. On the other hand, if a current block is a non-square block whose height is greater than a width, some directional modes (e.g., No. 53 to No. 66) may be transformed to a wide-angle intra prediction mode between No. −1 and No. −14.

A scope of available wide-angle intra prediction modes may be adaptively determined according to a width-to-height ratio of a current block. Table 1 shows a scope of available wide-angle intra prediction modes according to a width-to-height ratio of a current block.

TABLE 1 Available wide-angle intra Width/Height prediction mode range W/H = 16 67~80 W/H = 8 67~78 W/H = 4 67~76 W/H = 2 67~74 W/H = 1 None W/H = ½ −1~−8 W/H = ¼  −1~−10 W/H = ⅛  −1~−12 W/H = 1/16  −1~−14

Among the plurality of intra prediction modes, K candidate modes (most probable mode, MPM) may be selected. A candidate list including a selected candidate mode may be generated. An index indicating any one of candidate modes belonging to a candidate list may be signaled. An intra prediction mode of a current block may be determined based on a candidate mode indicated by the index. As an example, a candidate mode indicated by the index may be configured as an intra prediction mode of a current block. Alternatively, an intra prediction mode of a current block may be determined based on a value of a candidate mode indicated by the index and a predetermined difference value. The difference value may be defined as a difference between a value of an intra prediction mode of the current block and a value of a candidate mode indicated by the index. The difference value may be signaled through a bitstream. Alternatively, the difference value may be a value pre-defined in an image encoding/decoding device. Alternatively, an intra prediction mode of a current block may be determined based on a flag showing whether a mode identical to an intra prediction mode of a current block exists in the candidate list. As an example, when the flag is a first value, an intra prediction mode of a current block may be determined from the candidate list. In this case, an index indicating any one of a plurality of candidate modes belonging to a candidate list may be signaled. A candidate mode indicated by the index may be configured as an intra prediction mode of a current block. On the other hand, when the flag is a second value, any one of the remaining intra prediction modes may be configured as an intra prediction mode of a current block. The remaining intra prediction modes may refer to a mode excluding a candidate mode belonging to the candidate list among a plurality of pre-defined intra prediction modes. When the flag is a second value, an index indicating any one of the remaining intra prediction modes may be signaled. An intra prediction mode indicated by the signaled index may be configured as an intra prediction mode of a current block. An intra prediction mode of a chroma block may be selected among intra prediction mode candidates of a plurality of chroma blocks. To this end, index information indicating one of intra prediction mode candidates of a chroma block may be explicitly encoded and signaled through a bitstream. Table 2 illustrates intra prediction mode candidates of a chroma block.

TABLE 2 Intra Prediction Mode Candidate for Chroma Block Luma Luma Luma Luma Index Mode: 0 Mode: 50 Mode: 18 Mode: 1 Others 0 66 0 0 0 0 1 50 66 50 50 50 2 18 18 66 18 18 3 1 1 1 66 1 4 DM

In an example of Table 2, a direct mode (DM) refers to setting an intra prediction mode of a luma block existing at the same position as a chroma block as an intra prediction mode of a chroma block. Meanwhile, a luma block existing at the same position as a chroma block may be determined based on a position of a top-left sample or a position of a center sample of a chroma block. As an example, if an intra prediction mode (a luma mode) of a luma block is No. 0 (a planar mode) and an index indicates No. 2, an intra prediction mode of a chroma block may be determined as a horizontal mode (No. 18). As an example, if an intra prediction mode (a luma mode) of a luma block is No. 1 (a DC mode) and an index indicates No. 0, an intra prediction mode of a chroma block may be determined as a planar mode (No. 0).

As a result, an intra prediction mode of a chroma block may be also set as one of intra prediction modes shown in FIG. 4 or FIG. 5. An intra prediction mode of a current block may be used to determine a reference line of a current block, and in this case, S310 may be performed before S300.

Referring to FIG. 3, intra prediction may be performed for a current block based on a reference line and an intra prediction mode of a current block S320.

Hereinafter, an intra prediction method per intra prediction mode is described in detail by referring to FIGS. 6 to 8. However, for convenience of a description, it is assumed that a single reference line is used for intra prediction of a current block, but even when a plurality of reference lines are used, an intra prediction method described later may be applied in the same/similar manner.

FIG. 6 shows an intra prediction method based on a planar mode according to the present disclosure.

Referring to FIG. 6, T represents a reference sample position at a top-right corner of a current block and L represents a reference sample positioned at a bottom-left corner of a current block. P1 may be generated through interpolation in a horizontal direction. As an example, P1 may be generated by interpolating T with a reference sample positioned on the same horizontal line as P1. P2 may be generated through interpolation in a vertical direction. As an example, P2 may be generated by interpolating L with a reference sample positioned on the same vertical line as P2. A current sample in a current block may be predicted through a weighted sum of P1 and P2 as in Equation 3 below.


(α×P1+β×P2)/(α+β)  [Equation 1]

In Equation 1, weight α and β may be determined by considering a width and a height of a current block. According to a width and a height of a current block, weight α and β may have the same value or a different value. If a width and a height of a current block are the same, weight α and β may be configured to be the same and a prediction sample of a current sample may be configured as an average value of P1 and P2. When a width and a height of a current block are not the same, weight α and β may have a different value. As an example, when a width is greater than a height, a smaller value may be configured to a weight corresponding to a width of a current block and a larger value may be configured to a weight corresponding to a height of a current block. Conversely, when a width is greater than a height, a larger value may be configured to a weight corresponding to a width of a current block and a smaller value may be configured to a weight corresponding to a height of a current block. Here, a weight corresponding to a width of a current block may refer to β and a weight corresponding to a height of a current block may refer to a.

FIG. 7 shows an intra prediction method based on a DC mode according to the present disclosure.

Referring to FIG. 7, an average value of a surrounding sample adjacent to a current block may be calculated, and a calculated average value may be configured as a prediction value of all samples in a current block. Here, a surrounding samples may include a top reference sample and a left reference sample of a current block. However, according to a shape of a current block, an average value may be calculated by using only a top reference sample or a left reference sample. As an example, when a width of a current block is greater than a height, an average value may be calculated by using only a top reference sample of a current block. Alternatively, when a ratio of a width and a height of a current block is greater than or equal to a predetermined threshold value, an average value may be calculated by using only a top reference sample of a current block. Alternatively, when a ratio of a width and a height of a current block is smaller than or equal to a predetermined threshold value, an average value may be calculated by using only a top reference sample of a current block. On the other hand, when a width of a current block is smaller than a height, an average value may be calculated by using only a left reference sample of a current block. Alternatively, when a ratio of a width and a height of a current block is smaller than or equal to a predetermined threshold value, an average value may be calculated by using only a left reference sample of a current block. Alternatively, when a ratio of a width and a height of a current block is greater than or equal to a predetermined threshold value, an average value may be calculated by using only a left reference sample of a current block.

FIG. 8 shows an intra prediction method based on a directional mode according to the present disclosure.

When an intra prediction mode of a current block is a directional mode, projection may be performed to a reference line according to an angle of a corresponding directional mode. When a reference sample exists at a projected position, a corresponding reference sample may be configured as a prediction sample of a current sample. If a reference sample does not exist at a projected position, a sample corresponding to a projected position may be generated by using one or more surrounding samples neighboring a projected position. As an example, interpolation may be performed based on two or more surrounding samples neighboring bidirectionally based on a projected position to generate a sample corresponding to a projected position. Alternatively, one surrounding sample neighboring a projected position may be configured as a sample corresponding to a projected position. In this case, among a plurality of surrounding samples neighboring a projected position, a surrounding sample closest to a projected position may be used. A sample corresponding to a projected position may be configured as a prediction sample of a current sample.

Referring to FIG. 8, for current sample B, when projection is performed to a reference line according to an angle of an intra prediction mode at a corresponding position, a reference sample exists at a projected position (i.e., a reference sample at an integer position, R3). In this case, a reference sample at a projected position may be configured as a prediction sample of current sample B. For current sample A, when projection is performed to a reference line according to an angle of an intra prediction mode at a corresponding position, a reference sample (i.e., a reference sample at an integer position) does not exists at a projected position. In this case, interpolation may be performed based on surrounding samples (e.g., R2 and R3) neighboring a projected position to generate a sample (r) at a fractional position. A generated sample (r) at a fractional position may be configured as a prediction sample of current sample A.

FIG. 9 shows a method for deriving a sample at a fractional position.

In an example of FIG. 9, variable h refers to a vertical distance (i.e., a vertical distance) from a position of prediction sample A to a reference sample line, and variable w refers to a horizontal distance (i.e., a horizontal distance) from a position of prediction sample A to a fractional position sample. In addition, variable θ refers to an angle which is predefined according to directivity of an intra prediction mode, and variable x refers to a fractional position.

Variable w may be derived as in Equation 2 below.


w=h tan θ  [Equation 2]

Then, if an integer position is removed from variable w, finally, a fractional position may be derived.

A fractional position sample may be generated by interpolating adjacent integer position reference samples. As an example, a fractional position reference sample at a x position may be generated by interpolating integer position reference sample R2 and integer position reference sample R3.

In deriving a fractional position sample, a scaling factor may be used to avoid a real number operation. As an example, when scaling factor f is set as 32, as in an example shown in FIG. 8(b), a distance between neighboring integer reference samples may be set as 32, not 1.

In addition, a tangent value for angle θ determined according to directivity of an intra prediction mode may be also scaled up by using the same scaling factor (e.g., 32).

FIGS. 10 and 11 show that a tangent value for an angle is scaled 32 times per intra prediction mode.

FIG. 10 shows a scaled result of a tangent value for a non-wide angle intra prediction mode, and FIG. 11 shows a scaled result of a tangent value for a wide angle intra prediction mode.

If a tangent value (tan θ) for an angle value of an intra prediction mode is positive, intra prediction may be performed by using only one of reference samples belonging to a top line of a current block (i.e., top reference samples) or reference samples belonging to a left line of a current block (i.e., left reference samples). Meanwhile, when a tangent value for an angle value of an intra prediction mode is negative, both reference samples at a top position and reference samples at a left position are used.

In this case, in order to simplify implementation, left reference samples may be projected to the top or may be projected to the left to arrange reference samples in a 1D array form, and reference samples in a 1D array form may be used to perform intra prediction.

FIG. 12 is a diagram illustrating an intra prediction aspect when a directional mode is one of mode no. 34 to mode no. 49.

When an intra prediction mode of a current block is one of mode no. 34 to mode no. 49, intra prediction is performed by using not only top reference samples of a current block, but also left reference samples. In this case, as in an example shown in FIG. 12, a reference sample of a top line may be generated by copying a reference sample at a left position of a current block to a position of a top line or by interpolating reference samples at a left position.

As an example, when a reference sample for position A on the top of a current block is obtained, considering directivity of an intra prediction mode of a current block, projection may be performed on a left line of a current block at position A on a top line. If a projected position is called a, a value corresponding to position a may be copied or a fractional position value corresponding to a may be generated and set as a value of position A. As an example, if position a is an integer position, a value of position A may be generated by copying an integer position reference sample. On the other hand, when position a is a fractional position, a reference sample at a top position of position a and a reference sample at a bottom position of position a may be interpolated and an interpolated value may be set as a value of position A. Meanwhile, at position A on the top of a current block, a direction projected to a left line of a current block may be parallel to and opposite to a direction of an intra prediction mode of a current block.

FIG. 13 is a diagram for describing an example of generating a top reference sample by interpolating left reference samples.

In FIG. 13, variable h represents a horizontal distance between position A on a top line and position a on a left line. Variable w represents a vertical distance between position A on a top line and position a on a left line. In addition, variable θ refers to an angle predefined according to directivity of an intra prediction mode, and variable x refers to a fractional position.

Variable h may be derived as in Equation 3 below.


h=w/tan θ  [Equation 3]

Afterwards, if an integer position is removed from variable h, a fractional position may be derived finally.

In deriving a fractional position sample, a scaling factor may be used to avoid a real number operation. As an example, a tangent value for variable θ may be scaled by using scaling factor f1. Here, since a direction projected to a left line is parallel and opposite to a directional prediction mode, a scaled tangent value shown in FIGS. 10 and 11 may be used.

When scaling factor f1 is applied, Equation 3 may be modified and used as in Equation 4 below.


h=(w*f1*f2)/(f1*tan θ)  [Equation 4]

In the same way as above, a 1D reference sample array may be configured only with reference samples belonging to a top line. As a result, intra prediction for a current block may be performed by using only top reference samples composed of 1D arrays.

FIG. 14 shows an example in which intra prediction is performed by using reference samples arranged in a 1D array.

As in an example shown in FIG. 14, left reference samples may be projected to generate top reference samples, and accordingly, prediction samples of a current block may be obtained by using only reference samples belonging to a top line.

Contrary to what is shown in FIGS. 12 and 14, top reference sample may be projected to a left line to configure a 1D reference sample array only with reference samples belonging to a left line. Specifically, for mode no. 19 to no. 33 of directional modes in which a tangent value (tan θ) for an angle of a directional mode is negative, reference samples belonging to a top line may be projected to a left line to generate a left reference sample.

As described above, a picture may be encoded/decoded in a unit of a block. As an example, a picture may be partitioned into blocks in a predetermined size. A block in a predetermined size may be referred to as a coding tree block (or a coding tree unit) or a reference block. Information showing a size of a reference block may be signaled through a bitstream. As an example, information showing a size of a coding tree block may be encoded through a sequence parameter set or a picture header.

Afterwards, a reference block may be added as blocks in various sizes based on at least one of tree structures predefined in a reference block. Then, encoding/decoding processing such as prediction, transform, quantization and/or entropy encoding, etc. may be performed for each partitioned block. Each partitioned block may be a coding block, a prediction block or a transform block.

Meanwhile, for a color picture, a luma picture and a chroma picture are encoded/decoded, respectively. In this case, a chroma picture usually has a characteristic similar to that of a luma picture. In other words, a characteristic of chroma samples in a chroma picture tends to be similar to a characteristic of collocated luma samples in a luma picture. This characteristic may be used to independently determine a partition structure for a reference block only for one reference component among the color components, and a tree structure determined in an existing component may be applied equally to other components. As such, a partition structure in which a tree partition structure of a reference component is applied to other components as it is may be referred to as a single tree structure.

Meanwhile, in embodiments described below, it is assumed that a reference component is a luma component. In other words, it is assumed that while a tree partition structure is independently applied to a luma component, a tree partition structure of a luma component is applied as it is to a chroma component.

Information about a tree partition structure in a reference component may be explicitly encoded and signaled. As an example, tree partition structure information about a luma reference block may be encoded and signaled. On the other hand, for a chroma reference block, encoding/decoding of tree partition structure information may be omitted and tree partition structure information in a luma reference block may be used in the same manner.

FIG. 15 is a diagram for describing encoding/decoding order when a single tree structure is used.

As in an example shown in FIG. 15, when a single tree structure is applied, a tree partition structure for a luma reference block may be applied as it is to a chroma reference block. Accordingly, a partition form for a chroma reference block is the same as a partition form for a luma reference block.

Meanwhile, encoding/decoding may be performed in the alternating order of a luma component and a chroma component. As an example, in FIG. 15, a number written in each leaf node block represents encoding/decoding order.

Meanwhile, a partition structure in which a tree structure for each color component is independently determined may be referred to as a dual tree structure. When a dual tree structure is applied, the information of a tree partition structure for a luma component and the information of a tree partition structure for a chroma component may be independently encoded and signaled.

FIG. 16 is a diagram for describing encoding/decoding order when a dual tree structure is used.

When a dual tree structure is applied, after encoding/decoding for any one component ends, encoding/decoding for a next component may strat.

As an example, after encoding/decoding for a luma component picture ends, encoding/decoding for a chroma component picture may be performed.

Alternatively, inter-component encoding/decoding order may be set in a unit of a reference block. As an example, after encoding/decoding for a luma component reference block ends, encoding/decoding for a chroma component reference block may be performed.

In an example shown in FIG. 16, a number written in a block represents encoding/decoding order. In an example of FIG. 16, it was illustrated that a reference block of a luma component is encoded/decoded before a reference block of a chroma component.

A reconstructed luma block may be used to perform prediction on a chroma block. As above, a prediction model using a different color component may be referred to as a cross-component linear model (CCLM). When a CCLM is applied, a process of deriving an intra prediction mode of a chroma block may be omitted based on an intra prediction mode of a luma block.

FIG. 17 is a flowchart showing a method for predicting a chroma block by using a reconstructed luma block.

Referring to FIG. 17, first, for prediction for a chroma block, a prediction parameter may be derived S1710. In this case, a prediction parameter may be derived in a different way according to an image format of a picture. As an image format represents a chroma subsampling rate, it may be determined as one of 4:4:4, 4:2:2 or 4:2:0.

When an image format is not 4:4:4, a luma block is downsampled and adjusted to have the same size as a chroma block.

FIG. 18 to FIG. 20 show an example in which a luma block is downsampled.

For convenience of a description, it is assumed that an image format is 4:2:0.

When an image format is 4:2:0, as in an example shown in FIG. 18, a size of a chroma block corresponding to a 4×4-sized luma block is 2×2. In this case, a downsampling filter may be applied to a luma block to reduce a 4×4-sized luma block to a size of 2×2. Equation 5 below shows an application aspect of a downsampling filter.


Downsampled_Luma[w][h]=(Luma[2*w][2*h−1]+Luma[2*w−1][2*h]+4*Luma[2*w][2*h]+Luma[2*w+1][2*h]+Luma[2*w][2*h+1]+4)>3  [Equation 5]

In Equation 5, Downsampled_Luma refers to a sample value in a downsampled luma block, and Luma refers to a value of a luma sample before downsampling. For example, Luma [0] [0] may represent a position of a top-left sample in a luma block before downsampling. Since a size of a downsampled luma block is 2×2, variables w and h representing a coordinate of a sample may have a value from 0 to 1, respectively.

When a downsampling filter according to Equation 5 is applied, a value of a downsampled luma sample may be obtained by applying a cross-shaped downsampling filter to luma samples. As an example, a value of a downsampled luma sample at a position of (0, 0) may be obtained by applying a downsampling filter to a luma sample at a position of (0, 0), a top luma sample at the position of (0, 0), a left luma sample at the position of (0, 0), a bottom luma sample at the position of (0, 0) and a right luma sample at the position of (0, 0).

A downsampling filter in a different shape from that shown in FIG. 19 may also be applied. As an example, a 1D filter, a rectangular filter or a square filter may be applied to obtain a downsampled luma sample. A 1D filter may have a size of 1×3 or 3×1, a rectangular filter may have a size of 2×3 or 3×2 and a square filter may have a size of 2×2 or 3×2.

A shape of a filter may be predefined in an encoder and a decoder.

Alternatively, a shape of a filter may be adaptively determined based on at least one of a size/a shape of a current block, an intra prediction mode applied to a luma block, whether a position of a chroma sample matches a position of a luma sample or an image format.

Alternatively, information indicating one of a plurality of filter candidates may be encoded and signaled.

Alternatively, a filter type may be different according to a downsampling position. As an example, a 1D filter or a rectangular filter may be applied to a luma sample positioned at a boundary of a luma block, while a cross-shaped filter may be applied to a luma sample not positioned at a boundary of a luma block.

As shown in FIG. 19, a downsampling filter may be applied to a position where both a x-axis coordinate and a y-axis coordinate are an even number.

An application position of a downsampling filter may be set differently from that shown in FIG. 19. FIG. 20 shows various examples for an application position of a downsampling filter.

After predefining a plurality of candidates related to a downsampling application position, one of a plurality of candidates may be selected. As an example, after defining examples of FIG. 20(a) to (d) as a plurality of candidates, index information indicating one of a plurality of examples may be encoded and signaled.

Alternatively, one of a plurality of candidates may be selected based on whether a position of a chroma sample matches a position of a luma sample.

A downsampling filter may also be applied to reference samples around a luma block. Here, a reference sample may represent a pre-reconstructed sample. Specifically, a downsampled luma reference sample may be obtained by applying a downsampling filter to at least one of a top reference region adjacent to the top of a luma block or a left reference region adjacent to the left.

The same number of downsampled luma reference samples as the number of reference samples included in a reference region of a chroma block may be obtained.

Meanwhile, a reference region of a luma block may be referred to as a luma reference region and a reference region of a chroma block may be referred to as a chroma reference region.

An inter-component prediction mode may be divided into a top inter-component prediction mode, a left inter-component prediction mode and a top and left inter-component prediction mode according to a configuration of a reference region. When a top inter-component prediction mode is selected, a reference region of each of a luma block and a chroma block is composed of only top reference regions. When a left inter-component prediction mode is selected, a reference region of each of a luma block and a chroma block is composed of only left reference regions. When a top and left inter-component prediction mode is selected, a reference region of each of a luma block and a chroma block may be composed of a top reference region and a left reference region.

Information indicating which of a top inter-component prediction mode, a left inter-component prediction mode and a top and left inter-component prediction mode is applied to a current block may be explicitly encoded and signaled. As an example, index information indicating a type of an inter-component prediction mode may be encoded and signaled.

Alternatively, one of a top inter-component prediction mode, a left inter-component prediction mode and a top and left inter-component prediction mode may be selected based on at least one of a size/a shape of a current block, whether a current block is adjacent to a CTU or a picture boundary or an intra prediction mode applied to a luma block.

For convenience of a description, in an embodiment described below, it is assumed that a reference region of each of a luma block and a chroma block includes a top reference region and a left reference region.

A shape of a downsampling filter applied to a reference region of a luma block may be the same as a downsampling filter applied to a luma block. Alternatively, a shape of a downsampling filter applied to a reference region of a luma block may be different from a downsampling filter applied to a luma block. Alternatively, a shape of a downsampling filter applied to a top reference region of a luma block may be different from a shape of a downsampling filter applied to a left reference region of a luma block.

Meanwhile, a position where downsampling is applied within a reference region may be predefined in an encoder and a decoder.

As another example, a decoder may determine by itself a position where downsampling is applied within a reference region in the same manner as an encoder.

FIG. 21 is a diagram for describing an example related to a position to which downsampling is applied.

When an image format is 4:2:0, a 1×1-sized chroma block corresponds to a 2×2-sized luma block. Accordingly, a downsampled luma reference sample corresponding to a chroma reference sample may be derived by applying a downsampling filter to a position of one of the four luma reference samples.

When four luma reference samples corresponding to one chroma reference sample are A to D, downsampling may be performed on each of the positions A to D in a reference region and a cost for each position may be calculated. Here, a cost for a specific position may be derived based on the sum of differences between a downsampled luma reference sample obtained by applying a downsampling filter centered on a corresponding position and a chroma reference sample corresponding to a corresponding position or the sum of absolute values of the differences. As such, a cost derived based on the sum of absolute values of a difference may also be called a SAD

(Sum of Difference).

Afterwards, a position with the lowest cost may be determined as an optimal position, and a process of deriving a prediction parameter described below may be performed by using downsampled luma samples at an optimal position.

Alternatively, information indicating one of a plurality of positions to which a downsampling filter may be applied may be encoded and signaled. As an example, in an example shown in FIG. 21, an index indicating one of the positions A to D may be encoded and signaled. To this end, an encoder may obtain a prediction parameter for each of a plurality of positions to which a downsampling filter may be applied and may encode and signal an index indicating a position used to derive an optimal prediction parameter among a plurality of prediction parameters. Here, an optimal prediction parameter may be derived by a cost of each prediction parameter or Rate Distortion Optimization (RDO).

Meanwhile, determining an optimal downsampling application position within a top reference region may be independent of determining an optimal downsampling application position within a left reference region. In this case, an optimal downsampling application position within a top reference region may be different from an optimal downsampling application position within a left reference region.

A prediction parameter for a chroma block may be derived by using downsampled luma reference samples and reference samples of a chroma block. A prediction parameter may include weight α and offset β. A prediction parameter may be derived by using a least square method, etc.

Alternatively, weight α and offset β may be derived based on the maximum value and the minimum value of downsampled luma reference samples and the linearity of the maximum value and the minimum value of chroma reference samples.

In this case, a prediction parameter may also be derived by using only chroma reference samples at a predefined position and downsampled luma reference samples corresponding thereto. In this case, a process of deriving a prediction parameter may be simplified to reduce complexity in an encoder and a decoder. As an example, a prediction parameter may be derived by using chroma reference samples at a position illustrated in Equation 6 below.


(−1,W/4),(−1,3W/4),(H/4,−1),(3H/4,−1)  [Equation 6]

In the example, W and H represent a width and a height of a chroma block, respectively. A prediction parameter may be derived by using four chroma reference samples according to the example and four downsampled luma reference samples corresponding thereto.

A prediction parameter may also be obtained by using reference samples at a position different from that in the example. As an example, a position of reference samples may be determined as in Equation 7 and Equation 8 below.


(−1,W/4),(−1,3W/4),(−1,5W/4),(−1,7W/4)  [Equation 7]


(H/4,−1),(3H/4,−1),(5H/4,−1),(7H/4,−1)  [Equation 8]

After predefining a plurality of candidates for a position of reference samples, one of a plurality of candidates may be selected. As an example, after each example in Equation 6 to Equation 8 listed above is set as a position candidate, reference samples may be selected according to one of a plurality of position candidates.

Information for selecting one of a plurality of position candidates may be encoded and signaled. As an example, an index indicating one of a plurality of position candidates may be encoded and signaled.

Alternatively, one of a plurality of position candidates may be adaptively selected based on at least one of a size/a shape of a current block, a color format or whether a position of a chroma sample matches a position of a luma sample.

As an example, when a current block is square, a prediction parameter may be derived by using a position candidate in Equation 6. On the other hand, when a current block is non-square, a prediction parameter may be derived by using a position candidate in Equation 7 or Equation 8. As an example, when a current block has a non-square shape that a width is greater than a height, a position candidate in Equation 7 may be used, and when a current block has a non-square shape that a height is greater than a width, a position candidate in Equation 8 may be used.

Once a prediction parameter is derived, a prediction sample of a chroma block may be obtained based on a downsampled luma sample S1720. As an example, a prediction sample of a chroma block may be obtained according to Equation 9 below.


PredChroma[w][h]=α×Downsampled_luma[w][h]+β, 0≤w<W,0≤h<H  [Equation 9]

In Equation 9, PredChroma represents a prediction sample of a chroma block and Downsampled_Luma represents a downsampled luma sample at a position corresponding to a chroma prediction sample.

Meanwhile, when an image format is 4:4:4, the above-described downsampling process may be omitted. In other words, when an image format is 4:4:4, a process of performing downsampling on reconstructed samples in a luma block and a process of performing downsampling on reference samples of a luma block may be omitted.

As another example, regardless of an image format, a downsampling filter may not be applied to a reference region of a luma block. In other words, in deriving a prediction parameter, instead of using the minimum value and the maximum value among the downsampled luma reference samples, the minimum value and the maximum value among the luma reference samples may be used.

Meanwhile, a picture may be encoded/decoded in a unit of a block. As an example, a picture may be partitioned into blocks in a predetermined size. A block in a predetermined size may be referred to as a coding tree block (or a coding tree unit) or a reference block. Information showing a size of a reference block may be signaled through a bitstream. As an example, information showing a size of a coding tree block may be encoded through a sequence parameter set or a picture header.

Afterwards, a reference block may be added as blocks in various sizes based on at least one of tree structures predefined in a reference block. Then, encoding/decoding processing such as prediction, transform, quantization and/or entropy encoding, etc. may be performed for each partitioned block. Each partitioned block may be a coding block, a prediction block or a transform block.

Meanwhile, for a color picture, a luma picture and a chroma picture are encoded/decoded, respectively. In this case, a chroma picture usually has a characteristic similar to that of a luma picture. In other words, a characteristic of chroma samples in a chroma picture tends to be similar to a characteristic of collocated luma samples in a luma picture. This characteristic may be used to independently determine a partition structure for a reference block only for one reference component among the color components, and a tree structure determined in an existing component may be applied equally to other components. As such, a partition structure in which a tree partition structure of a reference component is applied to other components as it is may be referred to as a single tree structure.

Meanwhile, in embodiments described below, it is assumed that a reference component is a luma component. In other words, it is assumed that while a tree partition structure is independently applied to a luma component, a tree partition structure of a luma component is applied as it is to a chroma component.

As another example, after deriving encoding/decoding information for a chroma block by referring to a collocated luma block, encoding/decoding for a chroma block may be performed based on derived encoding/decoding information. In this case, since a partition structure of a luma reference block and a partition structure of a chroma reference block are the same in a single tree structure, a luma block at the same position as a chroma block may be clearly specified.

On the other hand, a partition structure of a luma reference block and a partition structure of a chroma reference block are independent in a dual tree structure. Under a dual tree structure, a region in a luma picture corresponding to a region occupied by a chroma block or a higher node luma block including a region in the luma picture may be treated as a luma block at the same position as a chroma block.

Alternatively, a luma block including a region in a luma picture corresponding to a region occupied by a chroma block may be set as a collocated luma block. In this case, if a region within the luma picture is included in a plurality of luma blocks, a representative block among a plurality of luma blocks may be determined as a collocated luma block. Here, a representative block may be a luma block occupying the most of the region, the largest block among the luma blocks or a luma block including a reference position sample of a region within the luma picture. A reference position may be a top-left position, a center position, a top-right position, a bottom-left position or a bottom-right position within a region.

Alternatively, when a plurality of luma blocks are included in a region within a luma picture corresponding to a region occupied by a chroma block, a representative block among a plurality of luma blocks may be determined as a collocated luma block. Here, a representative block may be a luma block occupying the most of the region, the largest block among the luma blocks or a luma block including a reference position sample of a region within the luma picture.

Alternatively, when a plurality of luma blocks are included in a region within a luma picture corresponding to a region occupied by a chroma block, a higher node luma block including the plurality of luma blocks may be determined as a collocated luma block.

Alternatively, a reference position for determining a luma block at the same position as a chroma reference block may be defined, and a collocated luma block may be determined based on a reference position. A reference position may be a top-left position, a center position, a top-right position, a bottom-left position or a bottom-right position of a chroma block.

As an example, when a reference position is a center position of a chroma block, a luma block including a luma sample corresponding to a center position of a chroma block may be determined as a luma block at the same position as a chroma block.

In a dual tree structure, when determining a partition structure of a chroma block, a partition structure of a collocated luma block may be referred to. Whether to partition a chroma block into a plurality of partitions may be determined based on whether a collocated luma block is partitioned into a plurality of partitions.

FIG. 22 and FIG. 23 are a diagram for describing an example in which a partition structure of a chroma block is determined by referring to a collocated luma block in a dual tree structure.

As described through FIG. 16, when a dual tree structure is applied, encoding/decoding for a chroma component is performed after encoding/decoding for a luma component is completed. Accordingly, when encoding/decoding for a chroma block starts, decoding/encoding for a collocated luma block is completed.

Accordingly, encoding/decoding information for a chroma block may be derived by referring to encoding/decoding information of a collocated luma block. As a specific example, in encoding/decoding a chroma block, the partition information of a luma block may be applied to a chroma block as it is. Here, partition information may include at least one of whether to partition a block or a partition type of a block. Here, a partition type may relate to at least one of the number of partitions generated by partitioning a block, whether to perform asymmetrical partition or a partition direction of a block.

As an example, in an example shown in FIG. 22, a partition type of a first chroma block may be set to be the same as a partition type of a collocated luma block. Specifically, in an example shown in FIG. 22, a collocated luma block for a first chroma block is a higher node luma block partitioned into luma block B and luma block C. As in a shown example, it was shown that a collocated luma block is partitioned into two parts in a horizontal direction. Accordingly, a first chroma block may also be partitioned into two parts in a horizontal direction in the same way as a luma block.

Not only the partition information of a luma block, but also the prediction information of a luma block may be referenced when encoding/decoding a chroma block. In other words, the prediction information of each partition generated by partitioning a chroma block may be set to be the same as a collocated luma block for each partition.

As an example, in an example shown in FIG. 22, a prediction mode of each of the two partitions generated by partitioning a chroma block (i.e., b and c) may be set to be the same as a prediction mode of each of the two partitions generated by partitioning a luma block (i.e., B and C). Here, a prediction mode may indicate at least one of an encoding mode, an intra prediction mode or an inter prediction mode. An encoding mode represents whether intra prediction or inter prediction is applied to a block. An intra prediction mode may be information indicating one of non-directional intra prediction modes and directional prediction modes used when performing intra prediction. An inter prediction mode may be information indicating at least one of a motion information merge mode, a motion vector prediction mode and a template matching mode.

Similarly, a partition type for a second chroma block may be set to be the same as a partition type of a collocated luma block. In an example shown in FIG. 22, it was illustrated that quad type partition is applied to a collocated luma block of a second chroma block. Accordingly, quad type partition will also be applied to a second chroma block.

In addition, a prediction mode used in partitions generated by partitioning a chroma block (i.e., e, f, g, h) may be set to be the same as a prediction mode of each partition generated by partitioning a luma block (i.e., E, F, G, H), respectively.

Meanwhile, information showing whether encoding/decoding information of a chroma block will be set to be the same as that of a collocated luma block may be encoded and signaled. The information may be a 1-bit flag.

As an example, a first flag showing whether a partition type of a chroma block will be set to be the same as that of a collocated luma block may be encoded and signaled. When the first flag is true, encoding/decoding of partition information for a chroma block may be omitted, and a partition type of a chroma block may be set to be the same as that of a collocated luma block.

As an example, a second flag showing whether a prediction mode of a chroma block will be set to be the same as that of a collocated luma block may be encoded and signaled. When the second flag is true, encoding/decoding of a prediction mode for a chroma block may be omitted, and a prediction mode of a chroma block may be set to be the same as that of a collocated luma block.

Meanwhile, in an example shown in FIG. 22, it was illustrated that a chroma block and a collocated luma block have the same shape and a corresponding size. Here, having a corresponding size means that a size of a chroma block and a size of a collocated luma block correspond to each other when considering a chroma format. As an example, when a chroma format is 4:4:4, a size of a collocated luma block corresponding to a size of a chroma block may be the same as that of a chroma block. On the other hand, when a chroma format is 4:2:0, a size of a collocated luma block corresponding to a size of a chroma block may be twice a width and a height of a chroma block, respectively.

Meanwhile, for a chroma block, whether prediction and transform are performed sequentially may be adaptively determined. As an example, when at least one of partition information and/or prediction information of a collocated luma block is applied to a chroma block, prediction and transform for a next partition may be performed after prediction and transform for a partition with preceding encoding/decoding order within a chroma block are completed. As an example, in an example shown in FIG. 22, encoding/decoding order for each of the four partitions included in a second chroma block may be as follows.

Perform prediction for sub-block E→Perform transform and quantization (and reconstruction or entropy encoding) for sub-block E→Perform prediction for sub-block F→Perform transform and quantization (and reconstruction or entropy encoding) for sub-block F→Perform prediction for sub-block G→Perform transform and quantization (and reconstruction or entropy encoding) for sub-block G→Perform prediction for sub-block H→Perform transform and quantization (and reconstruction or entropy encoding) for sub-block H

Alternatively, after performing prediction for each sub-block first, transform for sub-blocks may be performed after prediction for sub-blocks is completed.

Unlike an example shown in FIG. 22, there may a case in which a shape between a chroma block and a collocated luma block is not the same or a size of a chroma block and a size of a collocated luma block do not correspond. Even in this case, the prediction information of a chroma block may be set to be the same as the prediction information of a collocated luma block.

As an example, a partition type of a chroma block may be determined by referring to a partition type of a collocated luma block. When a chroma block is partitioned into a plurality of partitions, a prediction mode of each partition may be set to be the same as a prediction mode of a partition in a luma block corresponding to each partition.

As an example, in FIG. 23, a luma block corresponding to a first chroma block is luma block B. In this case, an intra prediction mode of luma block B may be applied as it is to a first chroma block.

A second chroma block has a size corresponding to the sum of a plurality of luma blocks (i.e., E, F, G, H, J). In this case, chroma block 2 may be partitioned in the same shape as a plurality of luma blocks. In other words, a chroma block may be partitioned into two parts in a horizontal direction, and then quad partition may be applied to a top chroma block generated by two partitions. Then, a prediction mode of each partition generated by partitioning a chroma block (i.e., e, f, g, h, j) may be set to be the same as a prediction mode of each corresponding luma block (i.e., E, F, G, H, J).

Meanwhile, a size of a chroma block may be compared with a size of a collocated luma block to adaptively determine whether to apply the encoding/decoding information of a luma block to a chroma block. As an example, when a size of a chroma block does not correspond to a size of a collocated luma block, it may be set not to refer to the encoding/decoding information of a luma block in deriving the encoding/decoding information of a chroma block (e.g., at least one of a partition type or a prediction mode).

As an example, in an example shown in FIG. 22, a size of a collocated luma block of a first chroma block corresponds to a size of a first chroma block. In this case, it may be allowed to set the encoding/decoding information of a luma block as the encoding/decoding information of a chroma block.

On the other hand, in an example shown in FIG. 23, a size of a collocated luma block of a first chroma block does not correspond to a size of a first chroma block. In this case, it may not be allowed to set the encoding/decoding information of a luma block as the encoding/decoding information of a chroma block.

As another example, when encoding/decoding a chroma block, whether to partition a chroma block and/or encoding/decoding order may be determined based on a directionality for luma samples.

FIG. 24 shows an example in which encoding/decoding information for a chroma block is determined based on a directionality for luma samples.

In FIG. 24, a collocated luma block of a chroma block is indicated as block A.

If a collocated luma block is determined, a directionality for a collocated luma block is determined based on luma samples included in a collocated luma block. Specifically, after applying a plurality of intra prediction modes to a collocated luma block, an intra prediction mode with the lowest cost among a plurality of intra prediction modes may be selected. In this case, intra prediction may be performed by assuming that neighboring samples adjacent to a collocated luma block (i.e., block A) are reference samples. A cost for each intra prediction mode may be derived by adding up the absolute values of a difference at all positions in a collocated luma block after subtracting a prediction value generated through intra prediction from a reconstructed (or, original) sample included in a collocated luma block (i.e., block A). After that, an intra prediction mode with the lowest cost is set as a directionality of a collocated luma block (i.e., block A).

Specifically, for block A, when an intra prediction mode with an optimal cost is one of modes 2 to 33 in FIG. 4, a directionality of block A may be set as the left. Alternatively, for block A, when an intra prediction mode with an optimal cost is one of modes 34 to 66 in FIG. 4, a directionality of block A may be determined as the top.

Meanwhile, in encoding/decoding a chroma block, for a collocated luma block (i.e., block A), pre-reconstructed samples may exist not only in top and left regions, but also in right and bottom regions. Accordingly, other than predefined intra prediction modes (i.e., intra prediction modes shown in FIG. 4), a directionality of a collocated luma block may be determined by additionally checking intra prediction modes in an extended direction using right and bottom reference samples (i.e., intra prediction modes in a direction opposite to intra prediction modes shown in FIG. 4).

Meanwhile, in order to simplify implementation, block A and neighboring samples adjacent to block A may be rotated 180 degrees clockwise, and then a cost for each predefined intra prediction mode may be calculated. When block A and neighboring samples are rotated 180 degrees clockwise, top reference samples may be set as top reference samples, and right reference samples may be set as left reference samples. A mode with the smallest cost among the predefined intra prediction modes may be selected, and a selected intra prediction mode may be rotated 180 degrees in the opposite direction (i.e., counterclockwise) to determine an optimal intra prediction mode for a right/bottom direction.

Afterwards, a cost between an optimal intra prediction mode for a left/top direction selected when block A is not rotated and an optimal intra prediction mode for a right/bottom direction selected when block A is rotated may be compared to determine a directionality for block A.

As an example, when an optimal intra prediction mode for block A is derived when block A is rotated 180 degrees and the optimal intra prediction mode is one of modes 2 to 33 in FIG. 4, a directionality of block A may be determined as the right. Alternatively, when an optimal intra prediction mode for block A is derived when block A is rotated 180 degrees and the optimal intra prediction mode is one of modes 34 to 66 in FIG. 4, a directionality of block A may be determined as the bottom.

It is also possible to determine an optimal intra prediction mode for a collocated luma block by setting reconstructed samples positioned at a boundary within a collocated luma block as a reference sample.

FIG. 25 represents an example in which reconstructed samples in a collocated luma block are used as reference samples.

In an example shown in FIG. 25, each of w0, w1, h0 and h1 represents a region where reconstructed samples used as reference samples in a collocated luma block are included. Intra prediction may be performed for a residual region excluding a region where the reference samples are included to derive an optimal intra prediction mode for a collocated luma block.

As in the above-described example, an optimal intra prediction mode for a collocated luma block may be determined by calculating a cost for each of the predefined intra prediction modes and/or the intra prediction modes in an extended direction.

Alternatively, for simplicity, an intra prediction mode of a collocated luma block may be used when determining a directionality of a collocated luma block. In other words, a directionality of a collocated luma block may be determined based on an intra prediction mode used to encode/decode a collocated luma block.

Alternatively, intra prediction modes may be classified into a plurality of groups and a cost for each group may be calculated to determine a directionality of a collocated luma block.

FIG. 26 represents an example in which intra prediction modes are classified into a plurality of groups.

As in an example shown in FIG. 26, predefined intra prediction modes and extended intra prediction modes opposite to directional intra prediction modes among the predefined intra prediction modes may be partitioned into a plurality of groups.

Afterwards, for each group, a cost for each intra prediction mode belonging to a group may be calculated, and a calculated cost may be combined to derive a cost of a group.

Afterwards, a cost of groups corresponding to a left direction among a plurality of groups may be combined to calculate a cost for a left direction.

As an example, in an example shown in FIG. 26, a cost for a left direction may be calculated by combining a cost of group a and group h. In addition, a cost for a top direction may be derived by combining a cost of group b and group c, and a cost for a right direction may be derived by combining a cost of group d and group e. In addition, a cost for a bottom direction may be derived by combining a cost of group f and group g.

A cost for each of top, right, bottom and left directions may be compared to select a direction with the lowest cost as a direction of a collocated luma block.

Alternatively, in an example shown in FIG. 26, the sum of a cost of group a and group b may be set as a cost for a left direction, and the sum of a cost of group c and group d may be set as a cost for a top direction. In addition, the sum of a cost of group e and group f may be set as a cost for a right direction, and the sum of a cost of group g and group h may be set as a cost for a bottom direction.

Meanwhile, for a luma component, a directionality may be determined for each block in a predefined unit, and a directionality for a collocated luma block may be set to be the same as a directionality of a block in a predefined unit to which a collocated luma block belongs.

As an example, after determining a directionality in a unit of a coding tree unit, a directionality of a coding tree unit to which a collocated luma block belongs may be determined as a directionality of a collocated luma block. In this case, a method for deriving an optimal directionality for a coding tree unit may follow embodiments described above.

Meanwhile, according to a directionality of a collocated luma block, whether to partition a chroma block into a plurality of partitions may be determined. As an example, when an optimal intra prediction mode for a collocated luma block is a non-directional prediction mode, a chroma block may not be partitioned into a plurality of partitions. On the other hand, when an optimal intra prediction mode for a collocated luma block is a directional prediction mode, it may be determined to partition a chroma block into a plurality of partitions.

Alternatively, whether to partition a chroma block may be independently determined without considering a collocated luma block.

If a directionality of a collocated luma block (i.e., block A) is determined, the encoding/decoding order of a plurality of sub-blocks within a chroma block may be determined based on a directionality of a collocated luma block. As an example, when a chroma block is partitioned into four parts and encoded/decoded, scan order and an encoding/decoding start point for four sub-blocks may be determined according to a directionality of a collocated luma block.

FIG. 27 and FIG. 28 represents scan order for each sub-block in a chroma block according to a directionality of a collocated luma block.

In FIGS. 27 and 28, it was assumed that a chroma block is partitioned into four partitions and encoded/decoded. Here, each partition may be at least one of a coding unit (i.e., CU), a prediction unit (i.e., PU) or a transform unit (TU).

Unlike a shown example, this embodiment may be applied even when a chroma block is partitioned into a larger number of partitions or when a chroma block is partitioned into a smaller number of partitions.

In FIG. 27, it was illustrated that a chroma block is partitioned into four partitions whose height and width are ½ compared to a chroma block.

FIG. 27(a) shows the encoding/decoding order of sub-blocks within a chroma block when a directionality of a collocated luma block is top (i.e., when an optimal intra prediction mode is one of modes 34 to 66). An arrow refers to the encoding/decoding order of partitioned blocks. A start point of an arrow represents that it is encoded/decoded first, and an end point of an arrow represents that it is encoded/decoded later.

FIG. 27(b) shows the encoding/decoding order of sub-blocks within a chroma block when a directionality of a collocated luma block is left (i.e., when an optimal intra prediction mode is one of modes 2 to 33).

FIG. 27(c) shows the encoding/decoding order of sub-blocks within a chroma block when a directionality of a collocated luma block is right (i.e., when an optimal intra prediction mode is one of modes 2 to 33).

FIG. 27(d) shows the encoding/decoding order of sub-blocks within a chroma block when a directionality of a collocated luma block is bottom (i.e., when an optimal intra prediction mode is one of modes 34 to 66).

Unlike an example shown in FIG. 27, a chroma block may also be partitioned into partitions that one of a height or a width is ¼ compared to a chroma block.

In this case, a partition direction of a chroma block may be determined according to a directionality of a collocated luma block. As an example, when a directionality of a collocated luma block is top or bottom, a chroma block may be partitioned in a horizontal direction, as in an example shown in FIGS. 28(a) and (b). On the other hand, when a directionality of a collocated luma block is left or right, a chroma block may be partitioned in a vertical direction, as in an example shown in FIGS. 28(c) and (d).

Meanwhile, FIG. 28(a) shows the encoding/decoding order of sub-blocks within a chroma block when a directionality of a collocated luma block is top (i.e., when an optimal intra prediction mode is one of modes 34 to 66).

FIG. 28(b) shows the encoding/decoding order of sub-blocks within a chroma block when a directionality of a collocated luma block is bottom (i.e., when an optimal intra prediction mode is 180 degrees opposite to one of modes 34 to 66).

FIG. 28(c) shows the encoding/decoding order of sub-blocks within a chroma block when a directionality of a collocated luma block is left (i.e., when an optimal intra prediction mode is one of modes 2 to 33).

FIG. 28(d) shows the encoding/decoding order of sub-blocks within a chroma block when a directionality of a collocated luma block is right (i.e., when an optimal intra prediction mode is 180 degrees opposite to one of modes 2 to 33).

Meanwhile, when encoding/decoding a chroma block, a directionality of a collocated luma block may be determined, and rotation and/or flipping may be performed for a chroma block according to a directionality of a luma block. Here, rotation and/or flipping may be performed in a unit of a reference block, an encoding block, a prediction block or a transform block.

When rotation and/or flipping is performed, encoding/decoding may be performed for a rotated and/or flipped chroma block.

FIG. 29 represents an example in which flipping is performed for samples in a chroma block.

In FIG. 29, it was shown that a size of a chroma block is 4×4.

In an example shown in FIG. 29, p1 to p16 refer to samples within a chroma block.

FIG. 29(a) shows a chroma block in which flipping is not performed.

FIG. 29(b) shows a chroma block in which flipping is performed in a horizontal direction, and FIG. 29(c) shows a chroma block in which flipping is performed in a vertical direction.

FIG. 29(d) shows a chroma block in which flipping (i.e., horizontal flipping and vertical flipping) is performed 180 degrees.

When a directionality for a collocated luma block is left, as in an example shown in FIG. 29(a), flipping may not be applied. On the other hand, when a directionality for a collocated luma block is top, as in an example shown in FIG. 29(b), horizontal flipping may be applied. In addition, when a directionality for a collocated luma block is right, as in an example shown in FIG. 29(d), horizontal and vertical flipping may be applied at the same time. On the other hand, when a directionality for a collocated luma block is bottom, as in an example shown in FIG. 29(c), vertical flipping may be applied.

Alternatively, at least one of information indicating whether flipping is applied to a chroma block or information indicating a flipping direction may be encoded and signaled without being based on a directionality of a collocated luma block.

Meanwhile, flipping for a chroma block may be set to be applied only when a collocated luma block is encoded by intra prediction. As an example, when a collocated luma block is encoded by inter prediction, not intra prediction, the encoding/decoding of flipping-related information may be omitted for a chroma block, and flipping may not be performed for a chroma block.

As another example, an intra prediction mode of a chroma block may be determined based on a method for determining an optimal intra prediction mode for a collocated luma block described above. In other words, an optimal intra prediction mode for a collocated luma block may be set as an intra prediction mode of a chroma block.

Alternatively, intra prediction for a chroma block may be performed based on an intra prediction mode of a predetermined chroma block and an intra prediction mode of a collocated luma block. Here, an intra prediction mode of a determined chroma block may be at least one of a Direct Mode (DM), a Horizontal Mode, a Vertical Mode, a DC Mode, a planar mode or an inter-component cross prediction mode. Here, a DM mode may set an intra prediction mode used to encode/decode a collocated luma block as an intra prediction mode of a chroma block.

As an example, a first prediction block for a chroma block may be obtained based on an intra prediction mode of a determined chroma block, and a second prediction block for a chroma block may be obtained based on an optimal intra prediction mode of a collocated luma block. Afterwards, based on an average or a weighted sum operation of a first prediction block and a second prediction block, a final prediction block for a chroma block may be obtained.

As another example, a final prediction block for a chroma block may be obtained by combining an inter prediction mode and an intra prediction mode. As an example, a final prediction block for a chroma block may be generated through an average or a weighted sum operation between an intra prediction block obtained by intra prediction (or a first prediction block) and an inter prediction block obtained by inter prediction (or a second prediction block).

In this case, intra prediction may be performed based on an optimal intra prediction mode of a collocated luma block or may be performed based on a CCLM mode.

In addition, inter prediction may be performed by at least one of a motion information merge mode, a motion vector prediction mode or a template matching mode.

Meanwhile, when a final prediction block is obtained based on a weighted sum operation between a first prediction block and a second prediction block, a weight applied to each of a first prediction block and a second prediction block may always be set as the same value. Alternatively, a weight applied to each of a first prediction block and a second prediction block may be determined by using one of a plurality of weight candidates in a preset weight table. In this case, an index indicating one of a plurality of weight candidates may be encoded and signaled.

Alternatively, a weight applied to each of a first prediction block and a second prediction block may be determined by referring to an encoding mode of at least one neighboring block. As an example, when the number of neighboring blocks encoded/decoded by intra prediction is greater than the number of neighboring blocks encoded/decoded by inter prediction among a plurality of neighboring blocks, a weight applied to a first prediction block may have a larger value than a weight applied to a second prediction block. On the other hand, when the number of neighboring blocks encoded/decoded by inter prediction is greater than the number of neighboring blocks encoded/decoded by intra prediction among a plurality of neighboring blocks, a weight applied to a second prediction block may have a larger value than a weight applied to a first prediction block. When the number of neighboring blocks encoded/decoded by intra prediction is the same as the number of neighboring blocks encoded/decoded by inter prediction among a plurality of neighboring blocks, a weight applied to a first prediction block may be set as the same value as a weight applied to a second prediction block.

As another example, when a DM mode is used to derive an intra prediction mode of a chroma block, post-processing for derived prediction samples may be performed by performing intra prediction for a chroma block. The post-processing may correct prediction samples.

As an example, when an intra prediction mode of a chroma block is a DM mode, an intra prediction mode of a collocated luma block is set as an intra prediction mode of a chroma block.

Meanwhile, a collocated luma block may be reconstructed by combining a prediction sample obtained through intra prediction and a residual sample representing a difference between an original sample and a prediction sample. In this case, in a region within a chroma block corresponding to a region with a large prediction error within a collocated luma block, it may be set not to use a DM mode.

Here, whether it is a region with a large prediction error may be determined by comparing a value of residual samples with a threshold value. In addition, a judgment on a region with a large prediction error may be performed in a unit of a sample or in a unit of a sub-block in a predefined size. As an example, the judgment may be performed in a unit of a 2×2 or 4×4-sized sub-block.

FIG. 30 represents an example in which whether it is a region with a large prediction error in a unit of a sub-block in a collocated luma block is determined.

As in an example shown in FIG. 30, a chroma block and a luma block at the same position as the chroma block may be partitioned into sub-blocks in a preset size. In this case, a size and/or a shape of a sub-block may be predefined in an encoder and a decoder. Alternatively, a size and/or a shape of a sub-block may be adaptively determined according to a size and/or a shape of a chroma block to be encoded/decoded.

Afterwards, for each sub-block in a collocated luma block, whether it is a region with a large prediction error is determined. The determination may be performed by comparing an average of absolute values of residual samples in a sub-block with a threshold value. As an example, when an average value is greater than a threshold value, a corresponding sub-block may be determined as a region with a large prediction error, and otherwise, a corresponding sub-block may be determined as a region with a small prediction error.

Alternatively, whether a corresponding sub-block is a region with a large prediction error may be determined by comparing a threshold value with the minimum value, the maximum value or a median value of absolute values of residual samples in a sub-block.

Here, a threshold value may be a value predefined in an encoder and a decoder. Alternatively, information showing a threshold value may be explicitly encoded and signaled.

Alternatively, a threshold value may be derived based on an average of absolute values of residual samples in a collocated luma block. As an example, the threshold value may be an average of absolute values of residual samples in a luma block or a value obtained by adding or subtracting an offset to or from the average value.

Alternatively, a threshold value may be derived based on the minimum value, the maximum value or a median value of absolute values of residual samples in a collocated luma block. As an example, the threshold value may be set to be the same as the minimum value, the maximum value or a median value of absolute values of residual samples in a luma block or may be a value obtained by adding or subtracting an offset to or from the minimum value, the maximum value or a median value.

In an example shown in FIG. 30, it was illustrated that sub-block A and sub-block B in a collocated luma block are determined as a region with a large prediction error. In this case, a DM mode may not be used in sub-block a and sub-block b within a chroma block corresponding to sub-block A and sub-block B.

In a region where a DM mode is not used, intra prediction may be performed by using a predefined intra prediction mode. As an example, a predefined intra prediction mode may be a planar mode or a DC mode.

Alternatively, a decoder side may derive an intra prediction mode for a region where a DM mode is not used. As an example, an optimal intra prediction mode for a region with a large prediction error may be derived by using reconstructed samples around a region with a large prediction error within a luma block. As an example, in an example shown in FIG. 30, an optimal intra prediction mode may be derived for each of sub-block A and sub-block B within a collocated luma block. If an optimal intra prediction mode is derived for each of sub-block A and sub-block B, an optimal intra prediction mode derived for sub-block A may be set as an intra prediction mode of sub-block a within a chroma block and an optimal intra prediction mode derived for sub-block B may be set as an intra prediction mode of sub-block b within a chroma block.

Meanwhile, for a region with a large prediction error within a collocated luma block, information showing whether the application of a DM mode is limited may be explicitly encoded and signaled. The information may be a 1-bit flag.

A term of syntaxes used in the above-described embodiments is just named for convenience of a description.

When embodiments described based on a decoding process or an encoding process are applied to an encoding process or a decoding process, it is included in a scope of the present disclosure. When embodiments described in predetermined order are changed in order different from a description, it is also included in a scope of the present disclosure.

The above-described disclosure is described based on a series of steps or flow charts, but it does not limit a time series order of the present disclosure and if necessary, it may be performed at the same time or in different order. In addition, each component (e.g., a unit, a module, etc.) configuring a block diagram in the above-described disclosure may be implemented as a hardware device or software and a plurality of components may be combined and implemented as one hardware device or software. As an example, the hardware device may include at least one of a processor for performing an operation, a memory for storing data, a transmitter for transmitting data and a receiver for receiving data.

The above-described disclosure may be recorded in a computer readable recoding medium by being implemented in a form of a program instruction which may be performed by a variety of computer components. The computer readable recoding medium may include a program instruction, a data file, a data structure, etc. solely or in combination.

In addition, according to the present disclosure, a computer readable recording medium storing a bitstream generated by the above-described encoding method may be provided. The bitstream may be transmitted by an encoding device and a decoding device may receive the bitstream to decode an image.

A hardware device which is specially configured to store and perform magnetic media such as a hard disk, a floppy disk and a magnetic tape, optical recording media such as CD-ROM, DVD, magneto-optical media such as a floptical disk and a program instruction such as ROM, RAM, a flash memory, etc. is included in a computer readable recoding medium. The hardware device may be configured to operate as one or more software modules in order to perform processing according to the present disclosure and vice versa.

INDUSTRIAL AVAILABILITY

Embodiments through the present disclosure may be applied to an electronic device that encodes or decodes an image.

Claims

1. A method of decoding an image, the method comprising:

partitioning a chroma block into a plurality of partitions; and
performing an intra prediction for each of the partitions in the chroma block,
wherein a partition type of the chroma block is determined based on at least one of a partition type or a directionality of a collocated luma block of the chroma block.

2. The method of claim 1, wherein:

the partition type of the chroma block is set to be the same as the partition type of the collocated luma block.

3. The method of claim 1, wherein:

the plurality of partitions are generated by partitioning the chroma block in a horizontal direction or in a vertical direction, and
a partition direction of the chroma block is determined based on the directionality of the collocated luma block.

4. The method of claim 1, wherein a decoding order for a plurality of partitions in the chroma block is determined based on the directionality of the collocated luma block.

5. The method of claim 1, wherein the method further includes determining whether to perform a flipping on the chroma block, and

wherein the flipping for the chroma block is performed for at least one of a horizontal direction or a vertical direction.

6. The method of claim 5, wherein based on the directionality of the collocated luma block, whether to perform the flipping and a direction in which the flipping is performed are determined.

7. The method of claim 5, wherein the flipping is allowed only when the collocated luma block is encoded by the intra prediction.

8. The method of claim 1, wherein an intra prediction mode of each of the plurality of partitions in the chroma block is set to be the same as an intra prediction mode of each of a plurality of partitions included in the collocated luma block.

9. The method of claim 1, wherein:

a predefined intra prediction mode is applied to a partition corresponding to a region with a large prediction error in the collocated luma block among the plurality of partitions in the chroma block, and
an intra prediction mode of the collocated luma block is applied to a partition that does not.

10. The method of claim 9, wherein whether a sub-region in the collocated luma block is a region with a large prediction error is determined by comparing an average value of absolute values of residual samples in the sub-region with a threshold value.

11. The method of claim 10, wherein the threshold value is derived based on an average value of absolute values of residual samples in the collocated luma block.

12. The method of claim 1, wherein the directionality of the collocated luma block is determined based on an optimal intra prediction mode derived according to a result of performing an intra prediction performed based on predefined intra prediction modes and reference samples around the collocated luma block.

13. The method of claim 12, wherein the directionality of the collocated luma block is set to be the same as a directionality of a reference block in which the collocated luma block is included.

14. A method of encoding an image, the method comprising:

dividing a chroma block into a plurality of partitions; and
performing an intra prediction for each of the partitions in the chroma block,
wherein a partition type of the chroma block is determined based on at least one of a partition type or a directionality of a collocated luma block of the chroma block.

15. A computer readable recording medium storing a bitstream generated by an image encoding method, the computer readable recording medium comprising:

dividing a chroma block into a plurality of partitions; and
performing an intra prediction for each of the partitions in the chroma block,
wherein a partition type of the chroma block is determined based on at least one of a partition type or a directionality of a collocated luma block of the chroma block.
Patent History
Publication number: 20260379985
Type: Application
Filed: Oct 30, 2023
Publication Date: Nov 26, 2026
Applicant: KT CORPORATION (Gyeonggi-do)
Inventor: Sung Won LIM (Gyeonggi-do)
Application Number: 19/122,254
Classifications
International Classification: H04N 19/119 (20140101); H04N 19/159 (20140101); H04N 19/176 (20140101); H04N 19/186 (20140101);