Image encoding / decoding method and apparatus

The method addresses inefficiencies in encoding high-resolution and stereoscopic image contents by determining cross-component prediction modes for chroma blocks, improving coding efficiency through selective prediction techniques.

US20260380028A1Pending Publication Date: 2026-11-26DIGITALINSIGHTS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
US19/739155
Authority / Receiving Office
US · United States
Patent Type
Applications(United States)
Current Assignee / Owner
Priority Date
2025-05-21
Filing Date
2026-07-13
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Existing video compression technologies struggle to efficiently encode and decode high-resolution and stereoscopic image contents, particularly in handling chroma blocks, leading to suboptimal coding efficiency.

Method used

A method and apparatus for determining the cross-component prediction mode of a chroma block, utilizing flags and index information to perform cross-component prediction based on parameters signaled in the bitstream, including modes like explicit, implicit, and N-tap filter-based prediction, to enhance coding efficiency.

Benefits of technology

Improves coding efficiency of chroma signals by selectively using cross-component prediction modes, allowing for efficient signaling and parameter acquisition, thereby enhancing the overall image encoding and decoding process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US20260380028A1-D00000_ABST
    Figure US20260380028A1-D00000_ABST
Patent Text Reader

Abstract

An image decoding method and apparatus according to the present disclosure may acquire a flag indicating whether cross-component prediction is performed for a current chroma block from a bitstream, determine a cross-component prediction mode of the current chroma block based on the flag indicating that the cross-component prediction is performed for the current chroma block, and perform cross-component prediction for the current chroma block based on the cross-component prediction mode of the current chroma block. The flag may be signaled based on at least one of whether the current chroma block is a block coded in a lossless mode, whether the current chroma block is a block coded in a DPCM mode, or a size of the current chroma block.
Need to check novelty before this filing date? Find Prior Art

Description

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application is a continuation of International Application No. PCT / KR2026 / 006237, filed on May 21, 2026, which claims the benefit of earlier filing date and right of priority to KR Application No. 10-2025-0066356, filed on May 21, 2025, the contents of which are all incorporated by reference herein in their entireties.TECHNICAL FIELD

[0002] The present invention relates to an image encoding / decoding method and apparatus.BACKGROUND

[0003] As the market demand for high-resolution videos has increased, a technology which may effectively compress high-resolution images is necessary. According to this market demand, MPEG (Moving Picture Expert Group) of ISO / IEC and VCEG (Video Coding Expert Group) of ITU-T jointly formed JCT-VC (Joint Collaborative Team on Video Coding) to develop HEVC (High Efficiency Video Coding) video compression standards on January 2013 and has actively conducted research and development for next-generation compression standards.

[0004] The video compression is largely composed of intra prediction (or intra prediction), inter prediction (or inter prediction), transform, quantization, entropy coding and an in-loop filter. Meanwhile, as the demand for high-resolution images has increased, the demand for stereo-scopic image contents has increased together as a new image service. A video compression technology for effectively providing high-resolution and ultra high-resolution stereo-scopic image contents is being discussed.SUMMARY

[0005] The present disclosure provides a method and an apparatus for determining the cross-component prediction mode of a chroma block.

[0006] The present disclosure provides the cross-component prediction method and apparatus of a chroma block.

[0007] An image decoding method and apparatus according to the present disclosure may acquire a flag indicating whether cross-component prediction is performed for a current chroma block from a bitstream, determine a cross-component prediction mode of the current chroma block based on the flag indicating that the cross-component prediction is performed for the current chroma block, and perform cross-component prediction for the current chroma block based on the cross-component prediction mode of the current chroma block. The flag may be signaled based on at least one of whether the current chroma block is a block coded in a lossless mode, whether the current chroma block is a block coded in a Differential Pulse Code Modulation (DPCM) mode, or a size of the current chroma block.

[0008] In an image decoding method and apparatus according to the present disclosure, when the current chroma block is the block coded in the lossless mode, the flag may be signaled based on whether the current chroma block is the block coded in the DPCM mode.

[0009] In an image decoding method and apparatus according to the present disclosure, when the current chroma block is the block coded in the lossless mode, the flag may be signaled based on the size of the current chroma block.

[0010] In an image decoding method and apparatus according to the present disclosure, when the current chroma block is a block not coded in the lossless mode, the flag may be signaled based on the size of the current chroma block.

[0011] In an image decoding method and apparatus according to the present disclosure, the cross-component prediction mode of the current chroma block may be determined based on the first index information specifying one of a plurality of cross-component prediction modes.

[0012] In an image decoding method and apparatus according to the present disclosure, the plurality of cross-component prediction modes may include at least one of the first mode that performs the cross-component prediction based on a parameter to be explicitly signaled, the second mode that performs the cross-component prediction based on a parameter to be implicitly derived, or the third mode that performs the cross-component prediction based on an N-tap filter.

[0013] In an image decoding method and apparatus according to the present disclosure, based on the cross-component prediction mode of the current chroma block being the third mode, the cross-component prediction for the current chroma block may be performed based on the second index information for specifying a position of a luma sample to be used for the cross-component prediction.

[0014] In an image decoding method and apparatus according to the present disclosure, the second index information may specify one of a plurality of modes. The plurality of modes may include a base mode that performs the cross-component prediction by using the first luma sample, an above mode that performs the cross-component prediction by using an above luma sample of the first luma sample, and a left mode that performs the cross-component prediction by using a left luma sample of the first luma sample.

[0015] In an image decoding method and apparatus according to the present disclosure, the first luma sample may be a sample having coordinates corresponding to coordinates of a current sample within the current chroma block.

[0016] In an image decoding method and apparatus according to the present disclosure, a parameter for the cross-component prediction may be derived based on a pre-reconstructed sample within an above region adjacent to a corresponding luma block of the current chroma block.

[0017] In an image decoding method and apparatus according to the present disclosure, a range of the above region may be determined based on whether the corresponding luma block is located at an above boundary of a super block.

[0018] In an image decoding method and apparatus according to the present disclosure, based on the corresponding luma block being located at the above boundary of the super block, the range of the above region may be restricted to one sample line adjacent to an above boundary of the corresponding luma block.

[0019] An image encoding method and apparatus according to the present disclosure may encode a flag indicating whether cross-component prediction is performed for a current chroma block, and generate a bitstream including the flag. The flag may be encoded based on at least one of whether the current chroma block is a block coded in a lossless mode, whether the current chroma block is a block coded in a Differential Pulse Code Modulation (DPCM) mode, or a size of the current chroma block.

[0020] The present disclosure may provide a non-transitory computer-readable storage medium for storing a bitstream generated by an image encoding method.

[0021] The present disclosure may provide a transmission method and apparatus for transmitting a bitstream generated by an image encoding method.

[0022] According to the present disclosure, information for cross-component prediction may be efficiently signaled.

[0023] According to the present disclosure, the coding efficiency of a chroma signal may be improved by selectively using the cross-component prediction mode of a chroma block.

[0024] According to the present disclosure, a parameter for the cross-component prediction of a chroma component may be efficiently acquired or derived.

[0025] According to the present disclosure, the coding efficiency of a chroma signal may be improved through cross-component prediction for a chroma component.BRIEF DESCRIPTION OF THE DRAWINGS

[0026] FIG. 1 is a block diagram representing an image encoding apparatus according to the present disclosure.

[0027] FIG. 2 is a block diagram representing an image decoding apparatus according to the present disclosure.

[0028] FIG. 3 illustrates an image decoding method performed in a decoding apparatus according to the present disclosure.

[0029] FIGS. 4 and 5 illustrate an example of a downsampling filter according to the present disclosure.

[0030] FIG. 6 illustrates the downsampling method of a corresponding luma block as an embodiment according to the present disclosure.

[0031] FIG. 7 illustrates a filter for deriving the neighboring sample of a corresponding luma block as an embodiment according to the present disclosure.

[0032] FIG. 8 illustrates the downsampling method of a corresponding luma block as an embodiment according to the present disclosure.

[0033] FIG. 9 illustrates a filter for deriving the neighboring sample of a corresponding luma block as an embodiment according to the present disclosure.

[0034] FIG. 10 illustrates the downsampling method of a corresponding luma block as an embodiment according to the present disclosure.

[0035] FIG. 11 illustrates a neighboring region for deriving the DC value of a chroma block as an embodiment according to the present disclosure.

[0036] FIG. 12 illustrates a method for downsampling the neighboring region of a corresponding luma block as an embodiment according to the present disclosure.

[0037] FIG. 13 illustrates a neighboring region for deriving a parameter according to the present disclosure.

[0038] FIG. 14 illustrates the position of a luma sample that may be used to derive a parameter according to the present disclosure.DETAILED DESCRIPTION

[0039] Referring to drawings attached to this specification, the embodiment of the present invention will be described in detail so that those skilled in the art may easily implement it in the technical field to which the present invention belongs. However, the present invention may be implemented in different forms and is not limited to embodiments described herein. In addition, a part unrelated to the description is omitted to clearly explain the present invention in the drawings, and similar reference numerals are attached to similar parts throughout the specification.

[0040] Throughout this specification, when a part is referred to as being ‘connected to’ another part, it includes not only a case where it is directly connected, but also a case where it is electrically connected with other elements in between.

[0041] In addition, throughout this specification, when a part is referred to as ‘including’ a component, it means that instead of excluding other components, other components may be further included, unless otherwise specifically opposed.

[0042] In addition, although terms ‘first’, ‘second’, etc. may be used to describe various components, the components should not be limited by the terms. The terms are used only to distinguish one component from other components.

[0043] In addition, in an embodiment regarding a device and a method described in this specification, some configurations of the device or some steps of the method may be omitted. In addition, the order of some configurations of the device or some steps of the method may be changed. In addition, another configuration or another step may be inserted in some configurations of the device or some steps of the method.

[0044] In addition, some configurations or some steps in the first embodiment of the present disclosure may be added to the second embodiment of the present disclosure or may be replaced with some configurations or some steps in the second embodiment.

[0045] In addition, as construction units shown in an embodiment of the present disclosure are independently shown to represent different characteristic functions, it does not mean that each construction unit is composed in a construction unit of separate hardware or one software. In other words, as each construction unit is described 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 form one construction unit or one construction unit may be divided into a plurality of construction units to perform a function. The integrated embodiment and separate embodiment of each construction unit are also included in a scope of a right of the present disclosure unless they are beyond the essence of the present disclosure.

[0046] First, terms used herein are briefly described as follows.

[0047] A video decoding apparatus described below may be an apparatus included in a server terminal such as a civil security camera, a civil security system, a military security camera, a military security system, a personal computer (PC), a laptop computer, a portable multimedia player (PMP), a wireless communication terminal, a smart phone, a TV application server, a service server, etc., and may refer to various apparatus including a user terminal such as various devices, a communication apparatus such as a communication modem, etc. for communicating with a wired or wireless communication network, a memory for storing various programs and data for decoding an image or performing inter or intra prediction for decoding and a microprocessor for executing a program and calculating and controlling the program.

[0048] In addition, an image encoded into a bitstream by an encoder may be transmitted to an image decoding apparatus through a wired or wireless communication network, etc. such as the Internet, a wireless local area network, a wireless LAN network, a Wibro network, a mobile communication network, etc. or through various communication interfaces such as a cable, a universal serial bus (USB), etc. in real-time or non-real-time, decoded, reconstructed into an image and played. Alternatively, a bitstream generated by an encoder may be stored in a memory. The memory may include both a volatile memory and a nonvolatile memory. In this specification, a memory may be expressed as a recording medium storing a bitstream.

[0049] Typically, a video may be composed of a series of pictures, and each picture may be partitioned into coding units such as a block. In addition, those skilled in the art to which this embodiment belongs will understand that a term of ‘picture’ described below may be used by being substituted with other terms having the equivalent meaning such as ‘image’, ‘frame’, etc. And, those skilled in the art to which this embodiment belongs will understand that a term of ‘coding unit’ may be used by being substituted with other terms having the equivalent meaning such as ‘unit block’, ‘block’, etc.

[0050] Hereinafter, the embodiment of the present invention will be described in more detail by referring to attached drawings. In describing the present invention, an overlapping description for the same components is omitted.

[0051] FIG. 1 is a block diagram representing an image encoding apparatus according to the present invention.

[0052] Referring to FIG. 1, an image encoding apparatus 100 may include a picture partitioner 110, predictors 120 and 125, a transformer 130, a quantizer 135, a rearranger 160, an entropy encoder 165, an inverse quantizer 140, an inverse transformer 145, a filter 150 and a memory 155.

[0053] The picture partitioner 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). Hereinafter, in the embodiment of the present disclosure, a coding unit may be used as a unit performing encoding or may be used as a unit performing decoding.

[0054] A prediction unit may be partitioned in at least one square or rectangular shape, etc. with the same size within one coding unit, or may be partitioned so that any one prediction unit among the prediction units partitioned in one coding unit has a shape and / or a size different from another prediction unit. When it is not a minimum coding unit in generating a prediction unit which performs intra prediction based on a coding unit, intra prediction may be performed without being partitioned into a plurality of prediction units, N×N.

[0055] Predictors 120 and 125 may include an inter predictor 120 performing inter prediction or inter prediction and an intra predictor 125 performing intra prediction or intra prediction. Whether to use inter prediction or perform intra prediction for a prediction unit may be determined, and specific information according to each prediction method (e.g., an intra prediction mode, a motion vector, a reference picture, etc.) may be determined. A residual value (a residual block) between a generated prediction block and an original block may be input into the transformer 130. In addition, prediction mode information, motion vector information, etc. used for prediction may be encoded in the entropy encoder 165 along with a residual value and transmitted to a decoder.

[0056] In applying the block merge technology of the present invention described above, a method for using a merge estimation region (MER) by considering parallel processing when using a current block by merging the motion information of a spatially or temporally adjacent block may be applied to predictors 120 and 125. In other words, the present invention may utilize a parallel estimation region (PER) for configuring the spatially or temporally adjacent block of a current block by considering parallel processing in a prediction technology such as inter prediction, intra prediction, cross-component prediction, etc. among the video coding technologies.

[0057] The inter predictor 120 may predict a prediction unit based on the information of at least one of the previous picture or subsequent picture of a current picture, and in some cases, may predict a prediction unit based on the information of a partially encoded region within a current picture. The inter predictor 120 may include a reference picture interpolator, a motion predictor and a motion compensator.

[0058] The reference picture interpolator may receive reference picture information from the memory 155 and generate pixel information less than or equal to an integer pixel in a reference picture. For a luma pixel, a DCT-based 8-tap interpolation filter with 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 DCT-based 4-tap interpolation filter with a different filter coefficient may be used to generate pixel information equal to or less than an integer pixel in a ⅛-pixel unit.

[0059] The motion predictor may perform motion prediction based on a reference picture interpolated by the reference picture interpolator. 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. The motion predictor 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.

[0060] The intra predictor 125 may generate a prediction unit based on reference pixel information around a current block, which is pixel information within a current picture. When a reference pixel is a pixel which performed inter prediction because a neighboring block in a current prediction unit is a block which performed inter prediction, a reference pixel included in a block which performed inter prediction may be used by being substituted with reference pixel information of a neighboring block which performed intra prediction. In other words, when a reference pixel is unavailable, unavailable reference pixel information may be used by being substituted with at least one reference pixel of the available reference pixels.

[0061] In addition, a residual block including residual value information, which is a difference value between a prediction unit which performed prediction based on a prediction unit generated in predictors 120 and 125 and an original block in a prediction unit, may be generated. A generated residual block may be input into the transformer 130.

[0062] The transformer 130 may transform an original block and a residual block including residual value information in a prediction unit generated through predictors 120 and 125 by using a transform method such as Discrete Cosine Transform (DCT), Discrete Sine Transform (DST) and 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.

[0063] The quantizer 135 may quantize values which are transformed into a frequency domain in the transformer 130. A quantization coefficient may be changed according to a block or the importance of an image. A value calculated in the quantizer 135 may be provided to the inverse quantizer 140 and the rearranger 160.

[0064] The rearranger 160 may perform the reordering of a coefficient value for a quantized residual value.

[0065] The rearranger 160 may change a two-dimensional block-shaped coefficient into a one-dimensional vector shape through a coefficient scanning method. For example, in the rearranger 160, a DC coefficient to a coefficient in a high-frequency domain may be scanned by using a zig-zag scan method and changed into a one-dimensional vector shape. A vertical scan which scans a two-dimensional block-shaped coefficient in a column direction or a horizontal scan which scans a two-dimensional block-shaped coefficient in a row direction may be used instead of a zig-zag scan according to a size in a transform unit and an intra prediction mode. In other words, which scan method among a zig-zag scan, a vertical scan and a horizontal scan will be used according to a size in a transform unit and an intra prediction mode may be determined.

[0066] The entropy encoder 165 may perform entropy encoding based on values calculated by the rearranger 160. For example, entropy encoding may use various encoding methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding) and CABAC (Context-Adaptive Binary Arithmetic Coding). In this regard, the entropy encoder 165 may encode residual value coefficient information in a coding unit from the rearranger 160 and predictors 120 and 125. In addition, according to the present invention, it is possible to signal and transmit information indicating that motion information is derived and used on a decoder side and information on a technique used to derive motion information.

[0067] The inverse quantizer 140 and the inverse transformer 145 dequantize values quantized in the quantizer 135 and inversely transform values transformed in the transformer 130. A residual value generated in the inverse quantizer 140 and the inverse transformer 145 may generate a reconstructed block by being combined with a prediction unit which is predicted through a motion estimator, a motion compensator and an intra predictor included in predictors 120 and 125.

[0068] The filter 150 may include at least one of a deblocking filter, an offset modifier and an adaptive loop filter (ALF). A deblocking filter may remove block distortion generated due to a boundary between blocks in a reconstructed picture. The offset modifier may modify an offset with an original image in a pixel unit for an image where deblocking is performed. A method in which a pixel included in an image is divided into a certain number of regions, a region which will perform an offset is determined and 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 to perform offset modification for a specific picture. Adaptive Loop Filtering (ALF) may be performed based on a value obtained by comparing a filtered reconstructed image with an original image. A pixel included in an image may be divided into predetermined groups and one filter which will be applied to a corresponding group may be determined to perform filtering discriminately for each group.

[0069] The memory 155 may store a reconstructed block or picture calculated through the filter 150 and a stored reconstructed block or picture may be provided to predictors 120 and 125 when performing inter prediction.

[0070] FIG. 2 is a block diagram showing an image decoding apparatus according to the present invention.

[0071] Referring to FIG. 2, an image decoder 200 may include an entropy decoder 210, a rearranger 215, an inverse quantizer 220, an inverse transformer 225, predictors 230 and 235, a filter 240 and a memory 245.

[0072] When an image bitstream is input from an image encoder, an input bitstream may be decoded in a process opposite to that of an image encoder.

[0073] The entropy decoder 210 may perform entropy decoding in a process opposite to a process in which entropy encoding is performed in the entropy encoder of an image encoder. For example, in response to a method performed in an image encoder, various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding) and CABAC (Context-Adaptive Binary Arithmetic Coding) may be applied.

[0074] The entropy decoder 210 may decode information related to intra prediction and inter prediction performed in an encoder.

[0075] The rearranger 215 may perform reordering based on a method in which a bitstream entropy-decoded in the entropy decoder 210 is reordered in an encoder. Coefficients represented in a one-dimensional vector shape may be reconstructed and reordered into coefficients in a two-dimensional block shape.

[0076] The inverse quantizer 220 may perform dequantization based on a quantization parameter provided in an encoder and the coefficient value of a reordered block.

[0077] The inverse transformer 225 may perform transform performed in the transformer for a result of quantization performed in an image encoder, i.e., inverse transform for DCT, DST and KLT, i.e., inverse DCT, inverse DST and inverse KLT. Inverse transform may be performed based on a transmission unit determined in an image encoder. In the inverse transformer 225 of an image decoder, a transform technique (e.g., DCT, DST, KLT) may be selectively performed according to a plurality of information such as a prediction method, the size of a current block, a prediction direction, etc.

[0078] Predictors 230 and 235 may generate a prediction block based on prediction block generation-related information provided by the entropy decoder 210 and pre-decoded block or picture information provided by the memory 245.

[0079] As described above, when the size of a prediction unit is the same as that of a transform unit in performing intra prediction or intra prediction in the same manner as an operation in an image encoder, intra prediction for a prediction unit is performed based on a pixel at the left position of a prediction unit, a pixel at a top-left position and a pixel at a top position, but when the size of a prediction unit is different from that 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 partition may be used only for a minimum coding unit.

[0080] Predictors 230 and 235 may include a prediction unit determiner, an inter predictor and an intra predictor. The prediction unit determiner may receive as an input 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 the entropy decoder 210, distinguish a prediction unit in a current coding unit and determine whether a prediction unit performs inter prediction or intra prediction.

[0081] In addition, in applying the block merge technology of the present invention described above, a method for using a merge estimation region (MER) by considering parallel processing when using a current block by merging the motion information of a spatially or temporally adjacent block may be applied to predictors 230 and 235. In other words, the present invention may utilize a parallel estimation region (PER) for configuring the spatially or temporally adjacent block of a current block by considering parallel processing in a prediction technology such as inter prediction, intra prediction, cross-component prediction, etc. among the video coding technologies.

[0082] The inter predictor 230 may perform inter prediction on 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 encoder. 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.

[0083] The intra predictor 235 may generate a prediction block based on pixel information within a current picture. When a prediction unit is a prediction unit that performed intra prediction, intra prediction may be performed based on intra prediction mode information in a prediction unit provided by an image encoder. The intra predictor 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolator and a DC filter. An AIS filter is a part that performs filtering on the reference pixel of a current block, and may be applied by determining whether to apply a filter according to a prediction mode in a current prediction unit. AIS filtering may be performed on the reference pixel of a current block by using AIS filter information and a prediction mode in a prediction unit provided by an image encoder. When the prediction mode of a current block is a mode that does not perform AIS filtering, an AIS filter may not be applied.

[0084] When a prediction mode in a prediction unit is a prediction unit that performs intra prediction based on a pixel value interpolating a reference pixel, the reference pixel interpolator may interpolate a reference pixel to generate a reference pixel in a pixel unit less than or equal to an integer value. When a prediction mode in a current prediction unit is a prediction mode that 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 the prediction mode of a current block is a DC mode.

[0085] A reconstructed block or picture may be provided to the filter 240. The filter 240 may include a deblocking filter, an offset modifier and an ALF.

[0086] Information on whether a deblocking filter is applied to a corresponding block or picture and information on whether a strong filter or a weak filter is applied when a deblocking filter is applied may be provided from an image encoder. The deblocking filter of an image decoder may receive deblocking filter-related information provided by an image encoder and an image decoder may perform deblocking filtering for a corresponding block.

[0087] The offset modifier may perform offset modification on a reconstructed image based on the type of offset modification, offset value information, etc. applied to an image in encoding. An ALF may be applied to a coding unit based on information on whether to apply an ALF, ALF coefficient information, etc. provided from an encoder. Such ALF information may be provided by being included in a specific parameter set.

[0088] The memory 245 may store a reconstructed picture or block and use it as a reference picture or a reference block and also provide a reconstructed picture to an output unit.

[0089] FIG. 3 illustrates an image decoding method performed in a decoding apparatus according to the present disclosure.

[0090] Referring to FIG. 3, the cross-component prediction mode of a current chroma block may be determined (S300).

[0091] The cross-component prediction mode of a current chroma block may be determined as one of a plurality of cross-component prediction modes. Here, a plurality of cross-component prediction modes may include at least one of the first mode (cfl_explicit) that performs cross-component prediction based on a parameter to be explicitly signaled, the second mode (cfl_implicit) that performs cross-component prediction by implicitly deriving a parameter based on the neighboring reference sample of a current chroma block and the neighboring reference sample of a corresponding luma block, or the third mode (cfl_mh(multi hypothesis)) that performs cross-component prediction based on an N-tap filter. The filter coefficient of an N-tap filter may be derived based on the neighboring reference sample of a current chroma block and the neighboring reference sample of a corresponding luma block. The parameters of the first and second modes may be a linear parameter, and the filter coefficient of the third mode may be a non-linear parameter.

[0092] A method for determining the cross-component prediction mode of a current chroma block will be described in detail.

[0093] Based on a flag (cfl_flag) to be signaled from a bitstream, it may be determined whether cross-component prediction is performed for a current chroma block.

[0094] cfl_flag may indicate whether cross-component prediction is performed for a current chroma block. For example, when the value of cfl_flag is 1, cross-component prediction may be performed for a current chroma block, and otherwise, cross-component prediction may not be performed for a current chroma block.

[0095] cfl_flag may be signaled based on at least one of whether a current chroma block is a block coded in a lossless mode, whether a current chroma block is a block coded in a Differential Pulse Code Modulation (DPCM) mode, the size of a current chroma block, or a color space.

[0096] As an example, when a current chroma block is a block coded in a lossless mode, cfl_flag may be signaled based on whether a current chroma block is a block not coded in a DPCM mode. Specifically, when a current chroma block is a block coded in a DPCM mode, cfl_flag may not be signaled. Otherwise, cfl_flag may be signaled.

[0097] As an example, when a current chroma block is a block coded in a lossless mode, cfl_flag may be signaled based on the size of a current chroma block. Specifically, when a current chroma block is a 4×4-sized block, cfl_flag may be signaled. Otherwise, cfl_flag may not be signaled.

[0098] As an example, when a current chroma block is not a block coded in a lossless mode, cfl_flag may be signaled based on the size of a current chroma block. Specifically, when the width and height of a current chroma block are less than or equal to 64, cfl_flag may be signaled. Otherwise, cfl_flag may not be signaled.

[0099] When the value of cfl_flag is 1, index information (cfl_idx) specifying one of a plurality of cross-component prediction modes described above may be signaled, and based on this, the cross-component prediction mode of a current chroma block may be determined. When the value of cfl_flag is 0, information related to an intra prediction mode other than cross-component prediction may be signaled, and based on this, the intra prediction mode of a current chroma block may be determined.

[0100] cfl_idx may be signaled based on a distance between at least one of a current chroma block or a corresponding luma block and the boundary of a specific unit. Here, a specific unit may be at least one of a super block (or a coding tree unit (CTU)), a tile, a slice, or a frame.

[0101] For convenience of description, it is assumed that distances from a current chroma block (in particular, the above-left sample position of a current chroma block) to the above and left boundaries of a specific unit are A and B, respectively. It is assumed that distances from a corresponding luma block (in particular, the above-left sample position of a corresponding luma block) to the above and left boundaries of a specific unit are C and D, respectively.

[0102] In this case, A and B may be determined based on a current color space, C and D. As an example, when a current color space is in a 4:2:0 format, A may be determined as C / 2 and B may be determined as D / 2. When a current color space is in a 4:2:2 format, A may be determined as C and B may be determined as D / 2.

[0103] It is assumed that a distance from the above boundary of a corresponding luma block to the above boundary of a super block to which a current block belongs is E. In this case, C may be determined as E or (E+N). N may be an integer greater than or equal to 1.

[0104] When C is smaller than the first threshold value and D is smaller than the second threshold value, the signaling of cfl_idx may be omitted, and the cross-component prediction mode of a current chroma block may be derived as cfl_explicit.

[0105] When C is smaller than the third threshold value and D is smaller than the fourth threshold value, the cross-component prediction mode of a current chroma block may be determined as one of cfl_implicit or cfl_explicit. To this end, instead of signaling cfl_idx, a 1-bit flag specifying one of cfl_implicit or cfl_explicit may be signaled.

[0106] Referring to FIG. 3, cross-component prediction for a current chroma block may be performed based on the cross-component prediction mode of a current chroma block (S310).

[0107] A cross-component prediction process according to the present disclosure may include at least one of the downsampling process of a corresponding luma block, a DC calculation process for a current chroma block, an AC calculation process for a corresponding luma block, or a parameter acquisition process for cross-component prediction.1. Downsampling Process of a Corresponding Luma Block

[0108] Downsampling for the corresponding luma block of a current chroma block may be performed according to a color space. When a current color space is in a 4:2:2 format or a 4:2:0 format, downsampling may be performed based on a predetermined downsampling filter. When a current color space is in a 4:4:4 format, Step S320 may be omitted. A downsampling filter may be determined based on information to be signaled at a high level. A high level may include at least one of a sequence level, a picture (or frame) level, or a slice level.Downsampling for a 4:2:0 Format

[0109] A downsampling filter for a 4:2:0 format may be one of the first to third filters illustrated in FIG. 4. Alternatively, a downsampling filter for a 4:2:0 format may be selected as one of a plurality of pre-defined filters. Here, a plurality of pre-defined filters may include at least one of the first to third filters illustrated in FIG. 4.

[0110] For a 4:2:0 format, the width and height of a current chroma block may be half the width and height of a corresponding luma block, respectively. A downsampling filter may be applied to a corresponding luma block to generate a downsampled corresponding luma block having the same size as a current chroma block.

[0111] When a downsampling filter is determined as the first filter, filtering may be performed by using four samples within a corresponding luma block as an input to generate one downsampled sample.

[0112] When a downsampling filter is determined as the second filter, as illustrated in FIG. 6, downsampling may be performed based on the samples of a corresponding luma block.

[0113] In this case, when downsampling is performed for a sample located at the left boundary of a corresponding luma block (hereinafter, referred to as a base sample), the left neighboring sample of a base sample which is the input of a downsampling filter may not belong to a corresponding luma block. In this case, the value of a left neighboring sample may be padded as the value of a base sample. Alternatively, the value of a left neighboring sample may be derived by applying a 4-tap filter to samples belonging to a corresponding luma block. The input samples of a 4-tap filter may include a base sample and three samples adjacent to a base sample. A 4-tap filter may have the filter coefficient of FIG. 7. Alternatively, when a pre-reconstructed left neighboring sample is present in the left neighboring region of a corresponding luma block, a corresponding left neighboring sample may be used as the input of a downsampling filter.

[0114] When a downsampling filter is determined as the third filter, as illustrated in FIG. 8, downsampling may be performed based on the samples of a corresponding luma block.

[0115] In this case, when downsampling is performed for a sample located at the left and above boundaries of a corresponding luma block (hereinafter, referred to as a base sample), the left and above neighboring samples of a base sample which is the input of a downsampling filter may not belong to a corresponding luma block. In this case, the value of corresponding neighboring samples may be padded as the value of a base sample. Alternatively, the value of corresponding neighboring samples may be derived by applying a 3-tap filter to samples belonging to a corresponding luma block. The input samples of a 3-tap filter may include a base sample and two samples adjacent to a base sample. A 3-tap filter may have the filter coefficient of FIG. 9. Alternatively, when pre-reconstructed left and above neighboring samples are present in the neighboring region of a corresponding luma block, corresponding neighboring samples may be used as the input of a downsampling filter.Downsampling for a 4:2:2 Format

[0116] A downsampling filter for a 4:2:2 format may be one of the first to third filters illustrated in FIG. 5. Alternatively, a downsampling filter for a 4:2:2 format may be selected as one of a plurality of pre-defined filters. Here, a plurality of pre-defined filters may include at least one of the first to third filters illustrated in FIG. 5. For the third filter, downsampling may be performed by using one sample at a pre-defined position (e.g., left or right) among the two samples corresponding to a chroma sample as an input.

[0117] For a 4:2:0 format, the width of a current chroma block is half the width of a corresponding luma block, and the height of a current chroma block may be the same as the height of a corresponding luma block. A downsampling filter may be applied to a corresponding luma block to generate a downsampled corresponding luma block.

[0118] When a downsampling filter is determined as the second filter, as illustrated in FIG. 10, downsampling may be performed based on the samples of a corresponding luma block.

[0119] In this case, when downsampling is performed for a sample located at the left boundary of a corresponding luma block (hereinafter, referred to as a base sample), the left neighboring sample of a base sample which is the input of a downsampling filter may not belong to a corresponding luma block. In this case, the value of a left neighboring sample may be padded as the value of a base sample. Alternatively, the value of a left neighboring sample may be derived by applying a 2-tap filter to samples belonging to a corresponding luma block. The input samples of a 2-tap filter may include a base sample and one sample adjacent to a base sample. A 2-tap filter may have the filter coefficient of {6, 2}. Alternatively, when a pre-reconstructed left neighboring sample is present in the left neighboring region of a corresponding luma block, a corresponding left neighboring sample may be used as the input of a downsampling filter.2. A DC Calculation Process for a Current Chroma Block

[0120] A DC value (or, an average value) for a current chroma block may be calculated. For a DC calculation process, its performance order may be determined according to a promise between an encoding apparatus and a decoding apparatus, and it may also be performed in parallel with another process.

[0121] Whether a DC calculation process is performed may be determined based on the cross-component prediction mode of a current chroma block. As an example, a DC calculation process may be performed only when the cross-component prediction mode of a current chroma block is cfl_explicit. A DC calculation process may be performed only when the cross-component prediction mode of a current chroma block is cfl_explicit or cfl_implicit.

[0122] The DC value of a current chroma block may be derived as the average value of pre-reconstructed samples belonging to the neighboring region of a current chroma block. In this case, the range of a neighboring region for calculating a DC value may be determined according to a length parameter such as Ac, Bc, Cc, and Dc, as illustrated in FIG. 11. A neighboring region may include at least one of the left region, above region, above-left region, bottom-left region, or above-right region of a current chroma block.

[0123] A length parameter may be determined based on at least one of the cross-component prediction mode of a current chroma block, whether a pre-reconstructed sample is present within a neighboring region, whether a current block is located at the left and / or above boundary of a specific unit (e.g., a super block, a tile, a frame), the size of a current block, or the aspect ratio of a current block. Here, a current block may include at least one of a current chroma block or a corresponding luma block.

[0124] As an example, when a pre-reconstructed left neighboring sample is not present, Dc may be determined as 0. When a pre-reconstructed above neighboring sample is not present, Cc may be determined as 0.

[0125] As an example, when a current block is located at the left boundary of a super block, a tile, or a frame, Cc may be determined as 0. When a current block is located at the above boundary of a super block, a tile, or a frame, Dc may be determined as 0. When a current block is located at the above boundary of a super block (CTU), Cc may be determined as 1.

[0126] As an example, when the aspect ratio of a current block is greater than a specific threshold value, a DC value may be calculated based on a pre-reconstructed above neighboring sample. When the aspect ratio of a current block is less than a specific threshold value, a DC value may be calculated based on a pre-reconstructed left neighboring sample.

[0127] As an example, when pre-reconstructed left and above neighboring samples are not present or available (e.g., when a neighboring sample belongs to a different tile from a current block), the DC value of a current chroma block may be determined based on a bit depth. For example, a DC value may be determined as the median value, (median value+1), or (median value−1) of a bit depth.

[0128] In order to calculate a DC value without a division operation, a DC value may be calculated as shown in the following embodiment.

[0129] A final DC value may be calculated based on the average of above neighboring samples (DCA) determined according to the length parameter of Ac and Cc, and the average of left neighboring samples (DCL) determined according to the length parameter of Bc and Dc. In this case, Ac*Cc and Bc*De may be expressed as 2Ka and 2Kl (Ka and Kl are an integer greater than 1). A final DC value may be calculated as shown in Equation 1 below.DC=((DCA+DCL+1)>>1  [Equation 1]

[0130] N samples may be derived through subsampling for above neighboring samples belonging to an above region, and a DC value may be calculated based on N samples. M samples may be derived through subsampling for left neighboring samples belonging to a left region, and a DC value may be calculated based on M samples. The value of (N+M) may be expressed as 2K (K is an integer greater than 1). The values of N and M may be determined based on the size and / or aspect ratio of a current block.

[0131] The prediction sample of a current chroma block may be generated based on a DC mode. In this case, for a prediction sample located at the above and left boundaries of a current chroma block, offset-based refinement of intra prediction (ORIP) that modifies a prediction sample through filtering that uses a pre-reconstructed neighboring sample and the prediction sample as an input may be performed in the unit of a sub-block.

[0132] When a cross-component prediction mode is applied to a current chroma block, the ORIP may be restricted from being performed. Alternatively, when cross-component prediction is performed for a current chroma block, ORIP may be applied to a prediction sample located at the above and left boundaries of a current chroma block.3. An AC Calculation Process for a Corresponding Luma Block

[0133] This process may be a process of calculating the AC value of a corresponding luma block to be used for cross-component prediction.

[0134] An AC calculation process may be adaptively performed based on the cross-component prediction mode of a current chroma block. As an example, an AC calculation process may be performed only when the cross-component prediction mode of a current chroma block is cfl_explicit. Alternatively, an AC calculation process may be performed only when the cross-component prediction mode of a current chroma block is cfl_explicit or cfl_implicit.

[0135] An AC calculation process may consist of a process of calculating the DC value (or, DC block) of a corresponding luma block based on a sample to which downsampling is applied or is not applied according to a color space and a process of calculating an AC value by subtracting a DC value from the reconstructed sample value of a corresponding luma block. In this case, the DC value of a corresponding luma block may be calculated based on the pre-reconstructed neighboring sample of a corresponding luma block in the same manner as a method for calculating the DC value of a current chroma block.4. a Parameter Acquisition Process

[0136] A reference sample to be used to derive a parameter may be prepared. Here, a reference sample may be a pre-reconstructed sample belonging to the neighboring region of a corresponding luma block. A neighboring region may include at least one of the left region, above region, above-left region, bottom-left region, or above-right region of a corresponding luma block.

[0137] Based on the cross-component prediction mode of a current chroma block, whether the preparation process of a reference sample is performed and / or the preparation method of a reference sample may be determined. For example, the preparation process of a reference sample may be performed only when the cross-component prediction mode of a current chroma block is cfl_implicit or cfl_mh.

[0138] According to a current color space, downsampling may be performed based on reference samples belonging to the neighboring region of a corresponding luma block. When a current color space is in a 4:2:0 format, the downsampling filter of FIG. 4 may be used. When a current color space is in a 4:2:2 format, the downsampling filter of FIG. 5 may be used. When a corresponding luma block is located at the boundary of a super block, downsampling may be performed by using only an above L-sample line.

[0139] Downsampling for the above reference sample of a corresponding luma block may be performed as shown in FIG. 12. FIG. 12(a) relates to a case in which a corresponding luma block is not located at the above boundary of a super block. In this case, downsampling may be performed based on the third filter of FIG. 4 using a 3-sample line. FIG. 12(b) relates to a case in which a corresponding luma block is located at the above boundary of a super block. In this case, downsampling may be performed based on a filter using only a 1-sample line. Here, a 1-sample line may be a sample line adjacent to a corresponding luma block. The value of a reference sample on a 1-sample line may be padded based on a sample located at the above boundary of a corresponding luma block.

[0140] The range of a neighboring region for deriving a parameter may be determined according to a length parameter such as AL, BL, CL and DL, as illustrated in FIG. 13. A length parameter may be determined based on at least one of the cross-component prediction mode of a current chroma block, a distance between the boundary of a specific unit (e.g., a super block, a tile, a frame) and the above and left boundaries of a corresponding luma block, the size of a current block, or the aspect ratio of a current block. Here, a current block may include at least one of a current chroma block or a corresponding luma block.

[0141] As an example, when a corresponding luma block is located at the above boundary of a super block, CL may be derived as 1. In other words, when a corresponding luma block is located at the above boundary of a super block, the range of an above region to be used to derive a parameter may be restricted to one sample line adjacent to the above boundary of a corresponding luma block.

[0142] As an example, when a distance between the above and left boundaries of a corresponding luma block and the boundary of a specific unit (e.g., a tile, an independent slice, or a frame) is E and F, respectively, AL may be derived as E and BL may be derived as F.

[0143] Hereinafter, a method for determining a parameter for each cross-component prediction mode will be described.First Mode (cfl_explicit)

[0144] When the cross-component prediction mode of a current chroma block is cfl_implicit, a parameter (a) for cross-component prediction may be explicitly signaled.

[0145] In this case, index information (joint_sign_idx) representing the sign of a chroma component may be signaled.

[0146] As an example, among the combinations of no sign (N / A), positive (+) and negative (−), eight combinations excluding a case in which both a Cb component and a Cr component are unsigned may be defined. A decoding apparatus may determine a sign for a Cb component and a Cr component, respectively, by specifying one of the eight combinations based on joint_sign_idx. A sign for a Cb component and a Cr component according to joint_sign_idx may be defined as shown in Table 1 below.TABLE 1joint_sign_idxSign_cbSign_cr0N / A−1N / A+2−N / A3−−4−+5+N / A6+−7++

[0147] For a chroma component determined to be signed according to joint_sign_idx, index information representing the absolute value of a parameter may be additionally signaled. The absolute value of a parameter may be determined based on the signaled index information.

[0148] In the example of Table 1, when Condition 1 below is satisfied, the signaling of index information for a Cb component may be omitted, and a parameter for a Cb component may be derived as 0. Condition 1 corresponds to a case in which a quotient obtained by dividing (joint_sign_idx+1) by 3 is 0.(joint_sign_idx+1) / 3==0  [Condition 1]

[0149] In the example of Table 1, when Condition 2 below is satisfied, the signaling of index information for a Cr component may be omitted, and a parameter for a Cr component may be derived as 0. Condition 2 corresponds to a case in which a remainder obtained by dividing (joint_sign_idx+1) by 3 is 0.(joint_sign_idx+1)%3==0  [Condition 2]

[0150] A parameter for cross-component prediction may be determined based on the sign and absolute value of a previously determined parameter.Second Mode (cfl_implicit)

[0151] A parameter in cfl_implicit may include at least one of a scale factor or an offset. A parameter in cfl_implicit may be derived through the following process.

[0152] The position of a neighboring region for deriving a parameter may be determined. The position of a neighboring region may be determined based on at least one of whether the neighboring region of a current block is available, the size of a current block, or the aspect ratio of a current block. Here, a current block may include at least one of a current chroma block or a corresponding luma block.

[0153] As an example, when both the above and left regions are available, the position of a neighboring region to which a reference sample belongs may be determined based on the aspect ratio (width / height) of a current block. Specifically, when the aspect ratio of a current block is greater than a specific threshold value, only a sample within an above region may be used as a reference sample. When the aspect ratio of a current block is smaller than a specific threshold value, only a sample within a left region may be used as a reference sample. Otherwise, a sample within above and left regions may be used as a reference sample.

[0154] As an example, when only one of an above region or a left region is available, a parameter may be derived by using the sample of a corresponding region as a reference sample.

[0155] As an example, when both the above and left regions are unavailable, a parameter may be determined as a specific value defined according to a promise between an encoder and a decoder.

[0156] The number of reference sample pairs to be used to derive a parameter may be determined according to a promise between an encoder and a decoder or may be determined based on the size of a current block. A reference sample pair may be defined as a set of the reference sample of a chroma block and the reference sample of a luma block corresponding thereto.

[0157] As an example, the total number of reference sample pairs to be used to derive a parameter may be 2P (P is an integer greater than 1). When above and left regions are used, 2P-1 reference sample pairs may be used to derive a parameter in each region. When an above or left region is used, 2P reference sample pairs may be used to derive a parameter in a corresponding region.

[0158] When the size of a current block is greater than the number of reference sample pairs to be used to derive a parameter, a reference sample pair may be determined by subsampling samples belonging to the neighboring region of a current block.

[0159] As an example, a reference sample pair may be determined by performing subsampling in max (width / 2P-1, 1) or max (width / 2P, 1) sample units.

[0160] As an example, when the position of the above-left sample of a current block is (0, 0), the start position of subsampling in an above region may be determined as (0, −1), and the start position of subsampling in a left region may be determined as (−1, 0).

[0161] The start position of subsampling in above and left regions may be determined based on at least one of a subsampling interval, the size of a current block, or the aspect ratio of a current block.

[0162] As an example, when a subsampling interval (n_sub) is 1, the start position of subsampling in above and left regions may be (0, −1) and (−1, 0), respectively. Otherwise, the start position of subsampling in above and left regions may be (n_sub / 2, −1) and (−1, n_sub / 2), respectively. Here, n_sub / 2 may be a position corresponding to half of a subsampling interval.

[0163] A scale factor (α) may be calculated based on linear regression according to Equation 2 below. In Equation 2, N may refer to the number of reference sample pairs. As an example, a division operation may be performed through scaling and / or shift operations.α=∑ LR⁢CR-∑ LR⁢∑ CRN∑LR2-(∑LR)2N[Equation⁢ 2]

[0164] An offset (β) may be derived based on a reference sample. As an example, an offset may be derived through Equation 3 below.β=(∑CR-α⁢∑LR)N[Equation⁢ 3]Third Mode (cfl_mh)A parameter in cfl_mh may include a filter coefficient that minimizes a difference between the value of the neighboring sample of a corresponding luma block and the value of the neighboring sample of a current chroma block.

[0166] A filter to be used in cfl_mh may be defined as shown in Equation 4 below.f0C+f1A+f2B+f3P+f4M  [Equation 4]

[0167] In Equation 4, f may represent a filter coefficient, and A, B and C may represent a sample position within a (downsampled) corresponding luma block. M may represent a median value according to a bit depth, and P may be calculated as shown in Equation 5 below.P=(C2+M)>>bitdepth  [Equation 5]

[0168] Alternatively, P may be calculated as shown in Equation 6 below.P=((C+X2)2+M)≫bitdepth[Equation⁢ 6]

[0169] In Equation 6, C may represent a sample corresponding to the current sample of a current chroma block among the samples within a (downsampled) corresponding luma block. X is a sample belonging to a (downsampled) corresponding luma block, and may be a sample adjacent to C. For example, X may be one of the above sample (A), left sample (L), left sample (R), or bottom sample (B) of C.

[0170] FIG. 14 illustrates the position of a luma sample that may be used to derive a parameter according to cfl_mh.

[0171] Referring to FIG. 14, among the samples belonging to the (downsampled) neighboring region of a corresponding luma block, a parameter may be derived based on a sample (C) corresponding to a sample belonging to the neighboring region of a current chroma block. Here, a sample (C) may be a sample having coordinates corresponding to the coordinates of a sample belonging to the neighboring region of a current chroma block.

[0172] Alternatively, among the samples belonging to the (downsampled) neighboring region of a corresponding luma block, a parameter may be derived based on a sample other than a sample (C). Here, a sample other than a sample (C) may be adaptively determined as one of the neighboring samples adjacent to a sample (C). The neighboring samples may include at least one of an above sample (A), a left sample (L), a left sample (R), or a bottom sample (B). A sample other than a sample (C) may be a neighboring sample at a specific position adjacent to a sample (C). The specific position may be a fixed position which is pre-defined in an encoder / a decoder. For example, a specific position may be one of C, A, L, R, or B illustrated in FIG. 14.

[0173] For cfl_mh, one of the two modes may be determined based on a 1-bit flag to be signaled through a bitstream.

[0174] Here, two modes may be for specifying the position of a (downsampled) luma sample to be used to derive a parameter. For convenience of description, two modes are referred to as an above mode and a left mode, respectively. An above mode may be a mode that derives a parameter by using a sample (C) and an above sample (A) illustrated in FIG. 14. A left mode may be a mode that derives a parameter by using a sample (C) and a left sample (L) illustrated in FIG. 14.

[0175] In this case, a parameter per mode (i.e., a filter coefficient) may be derived based on the following Equation. Equation 7 relates to a method for deriving a filter coefficient according to an above mode, and a sample (C) and an above sample (A) may be used as the input of a filter. Equation 8 relates to a method for deriving a filter coefficient according to a left mode, and a sample (C) and a left sample (L) may be used as the input of a filter.f0C+f1A+f2P+f3M  [Equation 7]f0C+f1L+f2P+f3M  [Equation 8]For cfl_mh, one of the three modes may be determined based on index information to be signaled through a bitstream.

[0177] Here, three modes may be for specifying the position of a (downsampled) luma sample to be used to derive a parameter. For convenience of description, three modes are referred to as a base mode, an above mode and a left mode, respectively. A base mode may be a mode that derives a parameter by using a sample (C) illustrated in FIG. 14. An above mode may be a mode that derives a parameter by using an above sample (A) illustrated in FIG. 14. A left mode may be a mode that derives a parameter by using a left sample (L) illustrated in FIG. 14.

[0178] In this case, a parameter per mode (i.e., a filter coefficient) may be derived based on the following Equation. Equation 9 relates to a method for deriving a filter coefficient according to a base mode, and a sample (C) may be used as the input of a filter. Equation 10 relates to a method for deriving a filter coefficient according to an above mode, and an above sample (A) may be used as the input of a filter. Equation 11 relates to a method for deriving a filter coefficient according to a left mode, and a left sample (L) may be used as the input of a filter.f0C+f1P+f2M  [Equation 9]f0A+f1P+f2M  [Equation 10]f0L+f1P+f2M  [Equation 11]A filter coefficient may be derived through an integerized Gauss elimination method or an LDL decomposition method. In this case, when a neighboring sample is not present, a pre-defined filter coefficient may be used according to a promise between an encoder and a decoder.Based on a parameter acquired through the aforementioned method, cross-component prediction for a current chroma block may be performed. In other words, based on an acquired parameter, the prediction sample of a current chroma block may be generated from the sample of a (downsampled) corresponding luma block.

[0181] When the cross-component prediction mode of a current chroma block is cfl_implicit or cfl_explicit, the prediction sample of a current chroma block may be generated through linear prediction as shown in Equation 12 below.Cpred=α×LAC+CDC  [Equation 12]

[0182] In Equation 12, Cpred may represent the prediction sample of a current chroma block. LAC may represent an AC value calculated for a corresponding luma block. CDC may represent a DC value calculated for a current chroma block.

[0183] When the cross-component prediction mode of a current chroma block is cfl_mh, the prediction sample of a current chroma block may be generated based on a pre-derived parameter (i.e., a filter coefficient).

[0184] As an example, one of the two modes may be determined based on a 1-bit flag to be signaled through a bitstream.

[0185] Here, two modes may be for specifying the position of a (downsampled) luma sample to be used for cross-component prediction. For convenience of description, two modes are referred to as a vertical mode and a horizontal mode, respectively.

[0186] A vertical mode may be a mode that performs cross-component prediction by using a sample (C) and samples (A, B) adjacent to a sample (C) in a vertical direction. A sample (C) may be a sample corresponding to the current sample of a current chroma block among the samples belonging to a (downsampled) corresponding luma block. For example, a sample (C) may be a sample having coordinates corresponding to the coordinates of a current sample within a current chroma block within a (downsampled) corresponding luma block. A sample (A) may be a sample adjacent to the above of a sample (C). A sample (B) may be a sample adjacent to the bottom of a sample (C).

[0187] A horizontal mode may be a mode that performs cross-component prediction by using a sample (C) and samples (L, R) adjacent to a sample (C) in a horizontal direction. A sample (C) is the same as described above. A sample (L) may be a sample adjacent to the left of a sample (C). A sample (R) may be a sample adjacent to the right of a sample (C).

[0188] The aforementioned cross-component prediction per mode may be performed based on the following Equation.Cpred=f0C+f1A+f2B+f3P+f4M  [Equation 13]Cpred=f0C+f1L+f2R+f3P+f4M  [Equation 14]Equation 13 relates to cross-component prediction according to a vertical mode. According to Equation 13, the prediction sample (Cpred) of a current chroma block may be generated based on a filter that uses a sample (C) and samples (A, B) adjacent to a sample (C) in a vertical direction as an input. Equation 14 relates to cross-component prediction according to a horizontal mode. According to Equation 14, the prediction sample (Cpred) of a current chroma block may be generated based on a filter that uses a sample (C) and samples (L, R) adjacent to a sample (C) in a horizontal direction as an input.

[0190] As an example, one of the two modes may be determined based on a 1-bit flag to be signaled through a bitstream.

[0191] Here, two modes may be for specifying the position of a (downsampled) luma sample to be used for cross-component prediction. For convenience of description, two modes are referred to as an above mode and a left mode, respectively.

[0192] An above mode may be a mode that performs cross-component prediction by using a sample (C) and a sample (A). A sample (C) may be a sample corresponding to the current sample of a current chroma block among the samples belonging to a (downsampled) corresponding luma block. For example, a sample (C) may be a sample having coordinates corresponding to the coordinates of a current sample within a current chroma block within a (downsampled) corresponding luma block. A sample (A) may be a sample adjacent to the above of a sample (C).

[0193] A left mode may be a mode that performs cross-component prediction by using a sample (C) and a sample (L). A sample (C) is the same as described above, and a sample (L) may be a sample adjacent to the left of a sample (C).

[0194] The aforementioned cross-component prediction per mode may be performed based on the following Equation.Cpred=f0C+f1A+f2P+f3M  [Equation 15]Cpred=f0C+f1L+f2P+f3M  [Equation 16]Equation 15 relates to cross-component prediction according to an above mode. According to Equation 15, the prediction sample (Cpred) of a current chroma block may be generated based on a filter that uses a sample (C) and a sample (A) adjacent to a sample (C) in a vertical direction as an input. Equation 16 relates to cross-component prediction according to a left mode. According to Equation 16, the prediction sample (Cpred) of a current chroma block may be generated based on a filter that uses a sample (C) and a sample (L) adjacent to a sample (C) in a horizontal direction as an input.

[0196] As an example, one of the three modes may be determined based on index information to be signaled through a bitstream.

[0197] Here, three modes may be for specifying the position of a (downsampled) luma sample to be used for cross-component prediction. For convenience of description, three modes are referred to as a base mode, an above mode and a left mode, respectively.

[0198] A base mode may be a mode that performs cross-component prediction by using a sample (C). A sample (C) may be a sample corresponding to the current sample of a current chroma block among the samples belonging to a (downsampled) corresponding luma block. For example, a sample (C) may be a sample having coordinates corresponding to the coordinates of a current sample within a current chroma block within a (downsampled) corresponding luma block. In a base mode, a sample (A) and a sample (L) to be described below may not be used for the cross-component prediction of a current sample within a current chroma block.

[0199] An above mode may be a mode that performs cross-component prediction by using a sample (A). A sample (A) may be a sample adjacent to the above of a sample (C) described above. In an above mode, a sample (L) to be described below and a sample (C) may not be used for the cross-component prediction of a current sample within a current chroma block.

[0200] A left mode may be a mode that performs cross-component prediction by using a sample (L). A sample (L) may be a sample adjacent to the left of a sample (C). In a left mode, the above-described sample (C) and sample (A) may not be used for the cross-component prediction of a current sample within a current chroma block.

[0201] The aforementioned cross-component prediction per mode may be performed based on the following Equation.Cpred=f0C+f1P+f2M  [Equation 17]Cpred=f0A+f1P+f2M  [Equation 18]Cpred=f0L+f1P+f2M  [Equation 19]Equation 17 relates to cross-component prediction according to a base mode. According to Equation 17, the prediction sample (Cpred) of a current chroma block may be generated based on a filter that uses a sample (C) as an input. Equation 18 relates to cross-component prediction according to an above mode. According to Equation 18, the prediction sample (Cpred) of a current chroma block may be generated based on a filter that uses a sample (A) as an input. Equation 19 relates to cross-component prediction according to a left mode. According to Equation 19, the prediction sample (Cpred) of a current chroma block may be generated based on a filter that uses a sample (L) as an input.In predicting a sample located at the above boundary and / or left boundary of a current chroma block, when the aforementioned sample (A) or sample (L) is not present within a (downsampled) corresponding luma block, the value of a sample (A) or a sample (L) may be padded and used as the value of a sample within a (downsampled) corresponding luma block. In this case, a sample within a (downsampled) corresponding luma block to be used for padding may be a sample located at the boundary of a (downsampled) corresponding luma block.

[0204] An encoding apparatus according to the present disclosure may perform cross-component prediction for a current chroma block based on one of a plurality of cross-component prediction modes. A method for signaling the cross-component prediction mode of a current chroma block and a method for performing cross-component prediction for a current chroma block are the same as described by referring to FIG. 3.

[0205] The various embodiments of the present disclosure do not list all possible combinations, but are intended to describe the representative aspect of the present disclosure, and matters described in various embodiments may be applied independently or in a combination of at least two.

[0206] In addition, the various embodiments of the present disclosure may be implemented by hardware, firmware, software or a combination thereof. For implementation by hardware, they may be implemented by one or more ASICs (Application Specific Integrated Circuits), DSPs (Digital Signal Processors), DSPDs (Digital Signal Processing Devices), PLDs (Programmable Logic Devices), FPGAs (Field Programmable Gate Arrays), general processors, controllers, microcontrollers, microprocessors, etc.

[0207] The range of the present disclosure includes software or machine-executable instructions (i.e., an operating system, an application, firmware, a program, etc.) that enable operations according to the methods of various embodiments to be executed on a device or computer, and a non-transitory computer-readable medium in which such software or instructions are stored and executable on a device or computer.

Claims

1. An image decoding method, comprising:acquiring, from a bitstream, a flag indicating whether cross-component prediction is performed for a current chroma block;based on the flag indicating that the cross-component prediction is performed for the current chroma block, determining a cross-component prediction mode of the current chroma block; andperforming the cross-component prediction for the current chroma block based on the cross-component prediction mode of the current chroma block,wherein the flag is signaled based on at least one of whether the current chroma block is a block coded in a lossless mode, whether the current chroma block is a block coded in a Differential Pulse Code Modulation (DPCM) mode, or a size of the current chroma block.

2. The method of claim 1, wherein when the current chroma block is the block coded in the lossless mode, the flag is signaled based on whether the current chroma block is the block coded in the DPCM mode.

3. The method of claim 1, wherein when the current chroma block is the block coded in the lossless mode, the flag is signaled based on the size of the current chroma block.

4. The method of claim 1, wherein when the current chroma block is a block not coded in the lossless mode, the flag is signaled based on the size of the current chroma block.

5. The method of claim 1, wherein the cross-component prediction mode of the current chroma block is determined based on first index information specifying one of a plurality of cross-component prediction modes, andwherein the plurality of cross-component prediction modes includes at least one of a first mode that performs the cross-component prediction based on a parameter to be explicitly signaled, a second mode that performs the cross-component prediction based on a parameter to be implicitly derived, or a third mode that performs the cross-component prediction based on an N-tap filter.

6. The method of claim 5, wherein based on the cross-component prediction mode of the current chroma block being the third mode, the cross-component prediction for the current chroma block is performed based on second index information for specifying a position of a luma sample to be used for the cross-component prediction.

7. The method of claim 6, wherein the second index information specifies one of a plurality of modes, andwherein the plurality of modes includes a base mode that performs the cross-component prediction by using a first luma sample, an above mode that performs the cross-component prediction by using an above luma sample of the first luma sample, and a left mode that performs the cross-component prediction by using a left luma sample of the first luma sample.

8. The method of claim 7, wherein the first luma sample is a sample having coordinates corresponding to coordinates of a current sample within the current chroma block.

9. The method of claim 1, wherein a parameter for the cross-component prediction is derived based on a pre-reconstructed sample within an above region adjacent to a corresponding luma block of the current chroma block.

10. The method of claim 9, wherein a range of the above region is determined based on whether the corresponding luma block is located at an above boundary of a super block.

11. The method of claim 10, wherein based on the corresponding luma block being located at the above boundary of the super block, the range of the above region is restricted to one sample line adjacent to an above boundary of the corresponding luma block.

12. An image encoding method, comprising:encoding a flag indicating whether cross-component prediction is performed for a current chroma block; andgenerating a bitstream including the flag,wherein the flag is encoded based on at least one of whether the current chroma block is a block coded in a lossless mode, whether the current chroma block is a block coded in a Differential Pulse Code Modulation (DPCM) mode, or a size of the current chroma block.

13. A non-transitory computer-readable storage medium storing a bitstream generated by the image encoding method of claim 12.

14. A transmission method for transmitting a bitstream generated by the image encoding method of claim 12.