Method for encoding / decoding image and recording medium storing bitstream
The method predicts chroma blocks using restored luma blocks and derived filter coefficients, addressing inefficiencies in high-resolution video compression by improving prediction accuracy and reducing data management costs.
Patent Information
- Application Number
- PCT/KR2024/005262
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-18
- Filing Date
- 2024-04-18
- Publication Date
- 2024-10-24
AI Technical Summary
High-resolution and ultra-high-definition video data requires efficient compression methods to manage increasing data volumes, and existing technologies struggle to effectively predict chroma blocks during encoding and decoding, leading to inefficiencies in storage and transmission.
A method and device for predicting chroma blocks using restored luma blocks, where filter coefficients are derived based on the similarity between sub-blocks, and the type of filter applied is determined by the color format and size of the block, improving prediction accuracy on a sub-block basis.
This approach enhances encoding and decoding efficiency by improving intra prediction accuracy and reducing data storage and transmission costs for high-resolution video content.
Smart Images

Figure KR2024005262_24102024_PF_FP_ABST
Abstract
Description
Video encoding / decoding method and recording medium for storing bitstream
[0001] The present disclosure relates to a video signal processing method and device.
[0002] Recently, the demand for high-resolution, high-quality images, such as HD (High Definition) and UHD (Ultra High Definition) images, is increasing across various application fields. As image data becomes higher in resolution and quality, the relative amount of data increases compared to conventional image data. Therefore, transmitting image data using existing media such as wired and wireless broadband lines or storing it using existing storage media leads to increased transmission and storage costs. To address these issues arising from the increasing resolution and quality of image data, high-efficiency image compression technologies can be utilized.
[0003] There are various technologies for image compression, such as inter-picture prediction technology that predicts pixel values included in the current picture from pictures before or after the current picture, intra-picture prediction technology that predicts pixel values included in the current picture using pixel information in the current picture, and entropy encoding technology that assigns short codes to values with high frequency of appearance and long codes to values with low frequency of appearance. Using these image compression technologies, image data can be effectively compressed and transmitted or stored.
[0004] Meanwhile, as demand for high-resolution video grows, so does the demand for stereoscopic video content as a new video service. Discussions are underway on video compression technologies to effectively deliver high-resolution and ultra-high-resolution stereoscopic video content.
[0005] The present disclosure aims to provide a method and device for predicting a chroma block using a restored luma block in encoding / decoding a video signal.
[0006] The present disclosure aims to provide a method and device for predicting a chroma block based on the linearity of a luma component and a chroma component in encoding / decoding a video signal.
[0007] The present disclosure aims to provide a method and device for predicting a chroma block in units of sub-blocks when encoding / decoding a video signal.
[0008] The present disclosure aims to provide a method and device for deriving filter parameters for chroma block prediction by utilizing similarity between sub-blocks in encoding / decoding a video signal.
[0009] The technical problems to be achieved in the present disclosure are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by a person having ordinary skill in the technical field to which the present invention pertains from the description below.
[0010] A video encoding / decoding method according to the present disclosure includes a step of deriving filter coefficients for chroma block prediction; and a step of filtering a plurality of luma restoration samples in a luma block corresponding to the chroma block based on the filter coefficients, thereby deriving a prediction sample for the chroma block.
[0011] In the image decoding / encoding method according to the present disclosure, the form of the filter applied to the luma restoration samples is determined based on at least one of a color format, a size or a shape of a current block, and the current block may be the chroma block or the luma block.
[0012] In the image decoding / encoding method according to the present disclosure, the filter is determined as one of a plurality of filter candidates, and the plurality of filter candidates may include a first filter candidate having a square shape and a second filter candidate having a non-square shape.
[0013] In the image decoding / encoding method according to the present disclosure, the filter coefficients can be derived based on the restored samples included in the luma reference area around the luma block and the restored samples included in the chroma reference area around the chroma block.
[0014] In the image decoding / encoding method according to the present disclosure, the filter coefficients can be derived based on feature values of restored samples included in the luma reference area.
[0015] In the image decoding / encoding method according to the present disclosure, the feature value may be a gradient value derived by applying a mask to restored samples included in the luma reference area.
[0016] In the image decoding / encoding method according to the present disclosure, the mask is one of a plurality of mask candidates, and selection of the mask among the plurality of mask candidates can be determined based on at least one of a color format or a filter shape.
[0017] In the image decoding / encoding method according to the present disclosure, prediction for the chroma block can be performed in units of sub blocks.
[0018] In the image decoding / encoding method according to the present disclosure, a class index may be assigned to a luma sub-block corresponding to a chroma sub-block within the chroma block, and the filter coefficient may be derived based on a reference sub-block within a reference area surrounding the luma block to which the same class index as that assigned to the luma sub-block is assigned.
[0019] In the image decoding / encoding method according to the present disclosure, the class index assigned to the luma sub-block can be derived based on at least one of the first cross-directional gradients or the second cross-directional gradients for the restored samples within the luma sub-block.
[0020] In the image decoding / encoding method according to the present disclosure, if there is no reference sub-block assigned the same class index as that assigned to the luma sub-block within the reference area around the luma block, the filter coefficient may be set to a default value.
[0021] In the image decoding / encoding method according to the present disclosure, if there is no reference sub-block assigned the same class index as that assigned to the luma sub-block within the reference area around the luma block, the filter coefficients can be derived using a reference sub-block assigned the class index having the smallest difference value from the class index assigned to the luma sub-block.
[0022] In the image decoding / encoding method according to the present disclosure, it can be determined whether the prediction is performed in units of sub-blocks based on a flag parsed from a bitstream.
[0023] A computer-readable recording medium storing a bitstream encoded by an image encoding method according to the present disclosure may be provided.
[0024] According to the present disclosure, encoding / decoding efficiency can be improved by predicting a chroma block using a restored luma block.
[0025] According to the present disclosure, the accuracy of intra prediction can be improved by predicting a chroma block based on the linearity of a luma component and a chroma component.
[0026] According to the present disclosure, intra prediction accuracy can be improved by predicting chroma blocks in sub-block units.
[0027] According to the present disclosure, intra prediction can improve accuracy by deriving filter parameters for chroma block prediction by utilizing similarity between sub-blocks.
[0028] The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects that are not mentioned will be clearly understood by a person having ordinary skill in the art to which the present disclosure pertains from the description below.
[0029] FIG. 1 is a block diagram illustrating an image encoding device according to an embodiment of the present disclosure.
[0030] FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present disclosure.
[0031] FIG. 3 illustrates an image encoding / decoding method performed by an image encoding / decoding device according to the present disclosure.
[0032] FIG. 4 and FIG. 5 illustrate examples of multiple intra prediction modes according to the present disclosure.
[0033] FIG. 6 illustrates an intra prediction method based on a planar mode according to the present disclosure.
[0034] FIG. 7 illustrates an intra prediction method based on DC mode according to the present disclosure.
[0035] FIG. 8 illustrates an intra prediction method based on a directional mode according to the present disclosure.
[0036] Figure 9 illustrates a method for deriving samples of fractional positions.
[0037] Figures 10 and 11 illustrate that the tangent value for the angle is scaled by a factor of 32 for each intra prediction mode.
[0038] Figure 12 is a diagram illustrating an intra prediction aspect when the directional mode is one of modes 34 to 49.
[0039] Figure 13 is a drawing for explaining an example of generating an upper reference sample by interpolating left reference samples.
[0040] Figure 14 shows an example in which intra prediction is performed using reference samples arranged in a 1D array.
[0041] Figure 15 is a flowchart illustrating a method for predicting a chroma block using a restored luma block.
[0042] Figures 16 to 18 illustrate examples of downsampling a luma block.
[0043] Figure 19 is a drawing for explaining an example related to the location where down sampling is applied.
[0044] Figure 20 illustrates templates for each chroma block and its corresponding luma block.
[0045] Figure 21 shows the filter form applied to reference samples of the luma component.
[0046] Figure 22 is a drawing for explaining an example of deriving the size of a reference area in a decoder.
[0047] Figure 23 illustrates template candidates for the current block.
[0048] Figure 24 illustrates template candidates for the current block.
[0049] The present invention is susceptible to various modifications and embodiments. Specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, but rather to encompass all modifications, equivalents, and alternatives falling within the spirit and technical scope of the present invention. Throughout the description of each drawing, similar reference numerals have been used to designate similar components.
[0050] While terms such as "first" and "second" may be used to describe various components, these components should not be limited by these terms. These terms are used solely to distinguish one component from another. For example, without departing from the scope of the present invention, a first component may be referred to as a "second component," and similarly, a second component may also be referred to as a "first component." The term "and / or" includes a combination of multiple related items described herein or any of multiple related items described herein.
[0051] When a component is referred to as being "connected" or "connected" to another component, it should be understood that it may be directly connected or connected to that other component, but that there may be other components intervening. Conversely, when a component is referred to as being "directly connected" or "connected" to another component, it should be understood that there are no other components intervening.
[0052] The terminology used in this application is only used to describe specific embodiments and is not intended to limit the present invention. The singular expression includes the plural expression unless the context clearly indicates otherwise. In this application, it should be understood that the terms "comprise" or "have" indicate the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0053] Hereinafter, with reference to the attached drawings, preferred embodiments of the present invention will be described in more detail. Hereinafter, identical components in the drawings will be designated by the same reference numerals, and redundant descriptions of identical components will be omitted.
[0054] FIG. 1 is a block diagram showing an image encoding device according to an embodiment of the present invention.
[0055] Referring to FIG. 1, a video encoding device (100) may include a picture segmentation unit (110), a prediction unit (120, 125), a transformation unit (130), a quantization unit (135), a reordering unit (160), an entropy encoding unit (165), an inverse quantization unit (140), an inverse transformation unit (145), a filter unit (150), and a memory (155).
[0056] Each component shown in Fig. 1 is independently depicted to indicate different characteristic functions in the video encoding device, and does not mean that each component is composed of separate hardware or a single software component. That is, each component is listed and included as a separate component for convenience of explanation, and at least two components among each component may be combined to form a single component, or one component may be divided into multiple components to perform a function, and such integrated and separate embodiments of each component are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.
[0057] Additionally, some components may not be essential components that perform essential functions of the present invention, but may be optional components merely used to enhance performance. The present invention may be implemented by including only components essential to implementing the essence of the present invention, excluding components used solely for performance enhancement. A structure that includes only essential components, excluding optional components used solely for performance enhancement, is also within the scope of the present invention.
[0058] The picture splitting unit (110) can split the input picture into at least one processing unit. At this time, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture splitting unit (110) can split one picture into a combination of multiple coding units, prediction units, and transform units, and select one combination of coding units, prediction units, and transform units based on a predetermined criterion (e.g., a cost function) to encode the picture.
[0059] For example, a picture can be split into multiple coding units. A recursive tree structure, such as a quad tree structure, can be used to split a coding unit in a picture. A coding unit that is split into other coding units starting from an image or the largest coding unit as the root can be split into as many child nodes as the number of split coding units. A coding unit that cannot be split any further according to a certain restriction becomes a leaf node. That is, assuming that only a square split is possible for a coding unit, a coding unit can be split into at most four different coding units.
[0060] Hereinafter, in the embodiments of the present invention, the encoding unit may be used to mean a unit that performs encoding or may be used to mean a unit that performs decoding.
[0061] A prediction unit may be divided into at least one square or rectangular shape of the same size within a single coding unit, or may be divided such that one prediction unit among the divided prediction units within a single coding unit has a different shape and / or size from another prediction unit.
[0062] When generating a prediction unit that performs intra prediction based on a coding unit, if it is not the minimum coding unit, intra prediction can be performed without dividing it into multiple prediction units NxN.
[0063] The prediction unit (120, 125) may include an inter prediction unit (120) that performs inter prediction and an intra prediction unit (125) that performs intra prediction. It may be determined whether to use inter prediction or intra prediction for a prediction unit, and specific information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. At this time, the processing unit where prediction is performed and the processing unit where the prediction method and specific contents are determined may be different. For example, the prediction method and prediction mode may be determined in the prediction unit, and the prediction may be performed in the transformation unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transformation unit (130). In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value in the entropy encoding unit (165) and transmitted to the decoding device. When using a specific encoding mode, it is also possible to encode the original block as is and transmit it to the decoding unit without generating a prediction block through the prediction unit (120, 125).
[0064] The inter prediction unit (120) may predict a prediction unit based on information of at least one picture among the previous or subsequent pictures of the current picture, and in some cases, may predict a prediction unit based on information of a portion of an encoded region within the current picture. The inter prediction unit (120) may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
[0065] The reference picture interpolation unit can receive reference picture information from the memory (155) and generate pixel information less than an integer pixel from the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter with different filter coefficients can be used to generate pixel information less than an integer pixel in units of 1 / 4 pixels. In the case of a chrominance signal, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information less than an integer pixel in units of 1 / 8 pixels.
[0066] The motion prediction unit can perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods can be used to derive a motion vector, such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm). The motion vector can have a motion vector value in units of 1 / 2 or 1 / 4 pixels based on the interpolated pixel. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various methods can be used as motion prediction methods, such as the Skip method, the Merge method, the AMVP (Advanced Motion Vector Prediction) method, and the Intra Block Copy method.
[0067] The intra prediction unit (125) can generate a prediction unit based on reference pixel information surrounding the current block, which is pixel information within the current picture. If the surrounding block of the current prediction unit is a block on which inter prediction has been performed and the reference pixel is a pixel on which inter prediction has been performed, the reference pixel included in the block on which inter prediction has been performed can be replaced and used with reference pixel information of the surrounding block on which intra prediction has been performed. That is, if the reference pixel is not available, the unavailable reference pixel information can be replaced and used with at least one reference pixel among the available reference pixels.
[0068] In intra prediction, the prediction mode can have a directional prediction mode that uses reference pixel information according to the prediction direction, and a non-directional mode that does not use directional information when performing prediction. The mode for predicting luminance information and the mode for predicting chrominance information can be different, and the intra prediction mode information used to predict luminance information or the predicted luminance signal information can be utilized to predict chrominance information.
[0069] When performing intra prediction, if the size of the prediction unit and the size of the transformation unit are the same, intra prediction for the prediction unit can be performed based on the pixels located to the left of the prediction unit, the pixels located at the upper left, and the pixels located at the upper. However, when performing intra prediction, if the sizes of the prediction unit and the transformation unit are different, intra prediction can be performed using reference pixels based on the transformation unit. In addition, intra prediction using NxN division can be used only for the minimum coding unit.
[0070] The intra prediction method can generate a prediction block after applying an Adaptive Intra Smoothing (AIS) filter to a reference pixel according to a prediction mode. The type of AIS filter applied to the reference pixel may be different. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit can be predicted from the intra prediction modes of prediction units existing around the current prediction unit. When the prediction mode of the current prediction unit is predicted using the mode information predicted from the surrounding prediction units, if the intra prediction modes of the current prediction unit and the surrounding prediction units are the same, information indicating that the prediction modes of the current prediction unit and the surrounding prediction units are the same can be transmitted using predetermined flag information, and if the prediction modes of the current prediction unit and the surrounding prediction units are different, entropy encoding can be performed to encode the prediction mode information of the current block.
[0071] Additionally, a residual block containing residual value information, which is the difference between the prediction unit that performed the prediction based on the prediction unit generated in the prediction unit (120, 125) and the original block of the prediction unit, can be generated. The generated residual block can be input to the transformation unit (130).
[0072] In the transformation unit (130), the residual block including the residual value information of the prediction unit generated through the original block and the prediction unit (120, 125) can be transformed using a transformation method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), or KLT. Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on the intra prediction mode information of the prediction unit used to generate the residual block.
[0073] The quantization unit (135) can quantize values converted to the frequency domain by the transformation unit (130). The quantization coefficients can vary depending on the block or the importance of the image. The values produced by the quantization unit (135) can be provided to the dequantization unit (140) and the reordering unit (160).
[0074] The rearrangement unit (160) can perform rearrangement of coefficient values for quantized residual values.
[0075] The rearrangement unit (160) can change a two-dimensional block-shaped coefficient into a one-dimensional vector form through a coefficient scanning method. For example, the rearrangement unit (160) can change the two-dimensional block-shaped coefficient into a one-dimensional vector form by scanning from the DC coefficient to the coefficient of the high-frequency region using a zig-zag scan method. Depending on the size of the transformation unit and the intra prediction mode, a vertical scan that scans the two-dimensional block-shaped coefficient in the column direction or a horizontal scan that scans the two-dimensional block-shaped coefficient in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra prediction mode, it is possible to determine which scan method among the zig-zag scan, the vertical scan, and the horizontal scan is to be used.
[0076] The entropy encoding unit (165) can perform entropy encoding based on the values produced by the rearrangement unit (160). Entropy encoding can use various encoding methods such as, for example, Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC).
[0077] The entropy encoding unit (165) can encode various information such as residual value coefficient information of an encoding unit, block type information, prediction mode information, division unit information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information from the rearrangement unit (160) and the prediction unit (120, 125).
[0078] The entropy encoding unit (165) can entropy encode the coefficient values of the encoding unit input from the rearrangement unit (160).
[0079] The inverse quantization unit (140) and the inverse transformation unit (145) inversely quantize the values quantized in the quantization unit (135) and inversely transform the values transformed in the transformation unit (130). The residual values generated in the inverse quantization unit (140) and the inverse transformation unit (145) can be combined with the predicted prediction units predicted through the motion estimation unit, motion compensation unit, and intra prediction unit included in the prediction unit (120, 125) to generate a reconstructed block.
[0080] The filter unit (150) may include at least one of a deblocking filter, an offset correction unit, and an ALF (Adaptive Loop Filter).
[0081] A deblocking filter can remove block distortion caused by boundaries between blocks in a reconstructed picture. To determine whether to perform deblocking, a deblocking filter can be applied to the current block based on the pixels contained in several columns or rows within the block. When applying a deblocking filter to a block, a strong filter or a weak filter can be applied depending on the required deblocking filtering strength. Furthermore, when applying a deblocking filter, horizontal and vertical filtering can be processed in parallel when performing vertical and horizontal filtering.
[0082] The offset correction unit can correct the offset from the original image on a pixel-by-pixel basis for an image that has undergone deblocking. To perform offset correction for a specific picture, the pixels contained in the image can be divided into a certain number of regions, the regions to be offset can be determined, and the offset can be applied to those regions. Alternatively, the offset can be applied by considering the edge information of each pixel.
[0083] Adaptive Loop Filtering (ALF) can be performed based on the comparison of the filtered restored image with the original image. After dividing the pixels included in the image into predetermined groups, a filter to be applied to each group can be determined, and filtering can be performed differentially for each group. Information regarding whether to apply ALF can be transmitted by luminance signal for each coding unit (CU), and the shape and filter coefficients of the ALF filter to be applied can vary depending on each block. Furthermore, an ALF filter of the same form (fixed form) can be applied regardless of the characteristics of the target block.
[0084] The memory (155) can store a restored block or picture produced through the filter unit (150), and the stored restored block or picture can be provided to the prediction unit (120, 125) when performing inter prediction.
[0085] FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present invention.
[0086] Referring to FIG. 2, the image decoding device (200) may include an entropy decoding unit (210), a rearrangement unit (215), an inverse quantization unit (220), an inverse transformation unit (225), a prediction unit (230, 235), a filter unit (240), and a memory (245).
[0087] When a video bitstream is input to a video encoding device, the input bitstream can be decoded in the opposite procedure to that of the video encoding device.
[0088] The entropy decoding unit (210) can perform entropy decoding in a procedure opposite to that of the entropy encoding unit of the video encoding device. For example, various methods such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) can be applied in response to the method performed in the video encoding device.
[0089] The entropy decoding unit (210) can decode information related to intra prediction and inter prediction performed in the encoding device.
[0090] The reordering unit (215) can perform reordering based on the method in which the bitstream entropy-decoded by the entropy decoding unit (210) is reordered by the encoding unit. The coefficients expressed in the form of a one-dimensional vector can be reordered by restoring them back to coefficients in the form of a two-dimensional block. The reordering unit (215) can perform reordering by receiving information related to the coefficient scanning performed by the encoding unit and performing reverse scanning based on the scanning order performed by the corresponding encoding unit.
[0091] The inverse quantization unit (220) can perform inverse quantization based on the quantization parameters provided from the encoding device and the coefficient values of the rearranged block.
[0092] The inverse transform unit (225) can perform inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, on the transforms performed by the transform unit, i.e., DCT, DST, and KLT, on the quantization result performed by the image encoding device. The inverse transform can be performed based on the transmission unit determined by the image encoding device. In the inverse transform unit (225) of the image decoding device, a transform technique (e.g., DCT, DST, KLT) can be selectively performed according to a plurality of pieces of information, such as a prediction method, the size of the current block, and the prediction direction.
[0093] The prediction unit (230, 235) can generate a prediction block based on the prediction block generation related information provided by the entropy decoding unit (210) and the previously decoded block or picture information provided by the memory (245).
[0094] As described above, when performing intra prediction in the same manner as the operation in the video encoding device, if the size of the prediction unit and the size of the transformation unit are the same, intra prediction for the prediction unit is performed based on the pixels on the left side of the prediction unit, the pixels on the upper left side, and the pixels on the upper side. However, when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction can be performed using a reference pixel based on the transformation unit. In addition, intra prediction using NxN division only for the minimum coding unit can be used.
[0095] The prediction unit (230, 235) may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit may receive various information such as prediction unit information input from the entropy decoding unit (210), prediction mode information of an intra prediction method, and motion prediction-related information of an inter prediction method, and may distinguish a prediction unit from a current encoding unit and determine whether the prediction unit performs inter prediction or intra prediction. The inter prediction unit (230) may perform inter prediction on the current prediction unit based on information included in at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit, using information necessary for inter prediction of the current prediction unit provided from the video encoding device. Alternatively, inter prediction may be performed based on information on a pre-restored portion of the current picture including the current prediction unit.
[0096] In order to perform inter prediction, it is possible to determine whether the motion prediction method of the prediction unit included in the encoding unit is Skip Mode, Merge Mode, AMVP Mode, or Intra Block Copy Mode based on the encoding unit.
[0097] The intra prediction unit (235) can generate a prediction block based on pixel information in the current picture. If the prediction unit is a prediction unit that has performed intra prediction, intra prediction can be performed based on intra prediction mode information of the prediction unit provided by the image encoding device. The intra prediction unit (235) can include an AIS (Adaptive Intra Smoothing) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a part that performs filtering on the reference pixels of the current block, and can determine and apply whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block using the prediction mode and AIS filter information of the prediction unit provided by the image encoding device. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.
[0098] The reference pixel interpolation unit can interpolate the reference pixel to generate a reference pixel of a pixel unit less than an integer value when the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on the pixel value interpolated from the reference pixel. When the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is the DC mode.
[0099] The restored block or picture may be provided to a filter unit (240). The filter unit (240) may include a deblocking filter, an offset correction unit, and an ALF.
[0100] Information regarding whether a deblocking filter has been applied to a corresponding block or picture may be received from a video encoding device, and if a deblocking filter has been applied, information regarding whether a strong or weak filter has been applied. The deblocking filter of the video decoding device may receive information related to the deblocking filter provided by the video encoding device, and the video decoding device may perform deblocking filtering on the corresponding block.
[0101] The offset correction unit can perform offset correction on the restored image based on the type of offset correction applied to the image during encoding and offset value information.
[0102] ALF can be applied to an encoding unit based on information such as whether ALF is applied and ALF coefficient information provided from an encoding device. This ALF information can be provided by being included in a specific parameter set.
[0103] The memory (245) can store a restored picture or block so that it can be used as a reference picture or reference block, and can also provide the restored picture to an output unit.
[0104] As described above, in the following embodiments of the present invention, for convenience of explanation, the term “coding unit” is used as an encoding unit, but it may also be a unit that performs not only encoding but also decoding.
[0105] In addition, the current block represents a block to be encoded / decoded, and may represent a coding tree block (or coding tree unit), an encoding block (or encoding unit), a transform block (or transform unit), or a prediction block (or prediction unit), depending on the encoding / decoding step. In this specification, a 'unit' represents a basic unit for performing a specific encoding / decoding process, and a 'block' may represent a pixel array of a predetermined size. Unless otherwise specified, 'block' and 'unit' may be used with the same meaning. For example, in the embodiment described below, an encoding block (coding block) and an encoding unit (coding unit) may be understood to have the same meaning.
[0106] FIG. 3 illustrates an image encoding / decoding method performed by an image encoding / decoding device according to the present disclosure.
[0107] Referring to FIG. 3, a reference line for intra prediction of the current block can be determined (S300).
[0108] The current block can use one or more of a plurality of pre-defined reference line candidates in the video encoding / decoding device as reference lines for intra prediction. Here, the plurality of pre-defined reference line candidates can include neighboring reference lines adjacent to the current block to be decoded and N non-neighboring reference lines that are 1 to N samples away from the boundary of the current block. N can be 1, 2, 3, or an integer greater than or equal to 1. For convenience of explanation, it is assumed hereafter that the plurality of reference line candidates available to the current block are composed of neighboring reference line candidates and three non-neighboring reference line candidates, but the present invention is not limited thereto. That is, it goes without saying that the plurality of reference line candidates available to the current block can include four or more non-neighboring reference line candidates.
[0109] An image encoding device can determine an optimal reference line candidate from among a plurality of reference line candidates and encode an index for specifying the optimal reference line candidate. An image decoding device can determine a reference line of a current block based on an index signaled through a bitstream. The index can specify any one of the plurality of reference line candidates. The reference line candidate specified by the index can be used as a reference line of the current block.
[0110] The number of indexes signaled to determine the reference line of the current block may be 1, 2, or more. For example, when the number of indexes signaled is 1, the current block can perform intra prediction 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 is 2 or more, the current block can perform intra prediction using a plurality of reference line candidates specified by a plurality of indexes among a plurality of reference line candidates.
[0111] Referring to FIG. 3, the intra prediction mode of the current block can be determined (S310).
[0112] The intra prediction mode of the current block can be determined from among multiple intra prediction modes pre-defined in the video encoding / decoding device. The multiple pre-defined intra prediction modes will be described with reference to FIGS. 4 and 5.
[0113] FIG. 4 illustrates an example of multiple intra prediction modes according to the present disclosure.
[0114] Referring to FIG. 4, the multiple intra prediction modes pre-defined in the video encoding / decoding device may be configured as a non-directional mode and a directional mode. The non-directional mode may include at least one of a planar mode or a DC mode. The directional mode may include directional modes 2 to 66.
[0115] The directional mode can be further expanded than that shown in Fig. 4. Fig. 5 shows an example in which the directional mode is expanded.
[0116] In Fig. 5, modes -1 to -14 and modes 67 to 80 are exemplified as being added. These directional modes may be referred to as wide-angle intra prediction modes. Whether to use the wide-angle intra prediction mode may be determined depending on the shape of the current block. For example, if the current block is a non-square block whose width is greater than its height, some directional modes (e.g., 2 to 15) may be converted to wide-angle intra prediction modes between 67 and 80. On the other hand, if the current block is a non-square block whose height is greater than its width, some directional modes (e.g., 53 to 66) may be converted to wide-angle intra prediction modes between -1 and -14.
[0117] The range of available wide-angle intra prediction modes can be adaptively determined based on the width-to-height ratio of the current block. Table 1 shows the range of available wide-angle intra prediction modes based on the width-to-height ratio of the current block.
[0118] Available Wide Angle Intra Prediction Mode Ranges W / H = 1667~80 W / H = 867~78 W / H = 467~76 W / H = 267~74 W / H = 1 None W / H = 1 / 2-1~-8 W / H = 1 / 4-1~-10 W / H = 1 / 8-1~-12 W / H = 1 / 16-1~-14
[0119] Among the above multiple intra prediction modes, K candidate modes (most probable modes, MPMs) can be selected. A candidate list including the selected candidate modes can be generated. An index indicating one of the candidate modes in the candidate list can be signaled. The intra prediction mode of the current block can be determined based on the candidate mode indicated by the index. For example, the candidate mode indicated by the index can be set as the intra prediction mode of the current block. Alternatively, the intra prediction mode of the current block can be determined based on a value of the candidate mode indicated by the index and a predetermined difference value. The difference value can be defined as a difference between a value of the intra prediction mode of the current block and a value of the candidate mode indicated by the index. The difference value can be signaled through a bitstream. Alternatively, the difference value may be a pre-defined value in the video encoding / decoding device. Alternatively, the intra prediction mode of the current block may be determined based on a flag indicating whether a mode identical to the intra prediction mode of the current block exists in the candidate list. For example, when the flag has a first value, the intra prediction mode of the 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 the candidate list may be signaled. The candidate mode indicated by the index may be set as the intra prediction mode of the current block. On the other hand, when the flag has a second value, any one of the remaining intra prediction modes may be set as the intra prediction mode of the current block. The remaining intra prediction mode may mean a mode excluding a candidate mode belonging to the candidate list among the plurality of pre-defined intra prediction modes. When the flag has a second value, an index indicating any one of the remaining intra prediction modes may be signaled.An intra prediction mode indicated by a signaled index may be set as the intra prediction mode of the current block. The intra prediction mode of a chroma block may be selected from intra prediction mode candidates of multiple chroma blocks. To this end, index information indicating one of the intra prediction mode candidates of the chroma block may be explicitly encoded and signaled through the bitstream. Table 2 illustrates examples of intra prediction mode candidates of chroma blocks.
[0120] Intra prediction mode candidates for indexed chroma blocks Luma mode: 0 Luma mode: 50 Luma mode: 18 Luma mode: 1 Other 0 6 6 0 0 0 1 5 0 6 6 5 0 5 0 5 0 2 1 8 1 8 6 6 1 8 1 8 3 1 1 6 6 1 4 DM
[0121] In the example of Table 2, DM (Direct Mode) means setting the intra prediction mode of the luma block co-located with the chroma block to the intra prediction mode of the chroma block. Meanwhile, the luma block co-located with the chroma block can be determined based on the position of the upper left sample or the position of the center sample of the chroma block.
[0122] For example, if the intra prediction mode (luma mode) of the luma block is 0 (planar mode) and the index points to 2, the intra prediction mode of the chroma block can be determined as horizontal mode (18). For example, if the intra prediction mode (luma mode) of the luma block is 1 (DC mode) and the index points to 0, the intra prediction mode of the chroma block can be determined as planar mode (0).
[0123] Consequently, the intra prediction mode of the chroma block may also be set to one of the intra prediction modes illustrated in FIG. 4 or FIG. 5. The intra prediction mode of the current block may also be used to determine a reference line of the current block, in which case step S310 may be performed before step S300.
[0124] Referring to FIG. 3, intra prediction can be performed for the current block based on the reference line and intra prediction mode of the current block (S320).
[0125] Hereinafter, with reference to FIGS. 6 through 8, we will examine in detail the intra prediction method for each intra prediction mode. However, for convenience of explanation, it is assumed that a single reference line is used for intra prediction of the current block. However, even when multiple reference lines are used, the intra prediction method described below can be applied in the same / similar manner.
[0126] FIG. 6 illustrates an intra prediction method based on a planar mode according to the present disclosure.
[0127] Referring to Fig. 6, T represents a reference sample located at the upper right corner of the current block, and L represents a reference sample located at the lower left corner of the current block. P1 can be generated through horizontal interpolation. For example, P1 can be generated by interpolating T with a reference sample located on the same horizontal line as P1. P2 can be generated through vertical interpolation. For example, P2 can be generated by interpolating L with a reference sample located on the same vertical line as P2. The current sample within the current block can be predicted through a weighted sum of P1 and P2, as in the following mathematical expression 1.
[0128]
[0129] In Equation 1, weights α and β can be determined by considering the width and height of the current block. Depending on the width and height of the current block, weights α and β may have the same value or different values. If the width and height of the current block are the same, weights α and β can be set to the same value, and the prediction sample of the current sample can be set to the average value of P1 and P2. If the width and height of the current block are not the same, weights α and β can have different values. For example, if the width is greater than the height, a smaller value can be set for the weight corresponding to the width of the current block, and a larger value can be set for the weight corresponding to the height of the current block. Conversely, if the width is greater than the height, a larger value can be set for the weight corresponding to the width of the current block, and a smaller value can be set for the weight corresponding to the height of the current block. Here, the weight corresponding to the width of the current block can mean β, and the weight corresponding to the height of the current block can mean α.
[0130] FIG. 7 illustrates an intra prediction method based on DC mode according to the present disclosure.
[0131] Referring to FIG. 7, the average value of neighboring samples adjacent to the current block can be calculated, and the calculated average value can be set as the predicted value of all samples in the current block. Here, the neighboring samples can include the upper reference sample and the left reference sample of the current block. However, depending on the shape of the current block, the average value can be calculated using only the upper reference sample or the left reference sample. For example, if the width of the current block is greater than the height, the average value can be calculated using only the upper reference sample of the current block. Alternatively, if the ratio of the width to the height of the current block is greater than or equal to a predetermined threshold, the average value can be calculated using only the upper reference sample of the current block. Alternatively, if the ratio of the width to the height of the current block is less than or equal to a predetermined threshold, the average value can be calculated using only the upper reference sample of the current block. On the other hand, if the width of the current block is less than the height, the average value can be calculated using only the left reference sample of the current block. Alternatively, if the ratio of the width to the height of the current block is less than or equal to a predetermined threshold, the average value can be calculated using only the left reference sample of the current block. Alternatively, if the ratio of the width and height of the current block is greater than or equal to a predetermined threshold, the average value can be calculated using only the left reference sample of the current block.
[0132] FIG. 8 illustrates an intra prediction method based on a directional mode according to the present disclosure.
[0133] If the intra prediction mode of the current block is a directional mode, projection can be performed to a reference line according to the angle of the directional mode. If a reference sample exists at the projected position, the reference sample can be set as a prediction sample of the current sample. If a reference sample does not exist at the projected position, a sample corresponding to the projected position can be generated using one or more neighboring samples neighboring the projected position. For example, a sample corresponding to the projected position can be generated by performing interpolation based on two or more neighboring samples neighboring in both directions with respect to the projected position. Alternatively, one neighboring sample neighboring the projected position can be set as the sample corresponding to the projected position. In this case, among the plurality of neighboring samples neighboring the projected position, the neighboring sample closest to the projected position can be used. The sample corresponding to the projected position can be set as a prediction sample of the current sample.
[0134] Referring to FIG. 8, for the current sample B, when projection is performed with a reference line according to the angle of the intra prediction mode at the corresponding position, a reference sample exists at the projected position (i.e., a reference sample at an integer position, R3). In this case, the reference sample at the projected position can be set as a prediction sample of the current sample B. For the current sample A, when projection is performed with a reference line according to the angle of the intra prediction mode at the corresponding position, a reference sample (i.e., a reference sample at an integer position) does not exist at the projected position. In this case, a sample (r) at a fractional position can be generated by performing interpolation based on neighboring samples (e.g., R2 and R3) adjacent to the projected position. The generated sample (r) at the fractional position can be set as a prediction sample of the current sample A.
[0135] Figure 9 illustrates a method for deriving samples of fractional positions.
[0136] In the example of Fig. 9, the variable h represents the vertical distance (i.e., vertical distance) between the position of the predicted sample A and the reference sample line, and the variable w represents the horizontal distance (i.e., horizontal distance) between the position of the predicted sample A and the fractional position sample. In addition, the variable θ represents a predefined angle according to the directionality of the intra prediction mode, and the variable x represents the fractional position.
[0137] The variable w can be derived as shown in the following mathematical expression 2.
[0138]
[0139] Afterwards, by removing the integer position from the variable w, the fractional position can be finally derived.
[0140] Fractional position samples can be generated by interpolating adjacent integer position reference samples. For example, integer position reference sample R2 and integer position reference sample R3 can be interpolated to generate fractional position reference samples at the x position.
[0141] To avoid floating-point operations when deriving fractional position samples, a scaling factor can be used. For example, if the scaling factor f is set to 32, the distance between neighboring integer reference samples can be set to 32 instead of 1, as in the example illustrated in (b) of Fig. 8.
[0142] Additionally, the tangent value for the angle θ determined by the directionality of the intra prediction mode can also be scaled up using the same scaling factor (e.g., 32).
[0143] Figures 10 and 11 illustrate that the tangent value for the angle is scaled by a factor of 32 for each intra prediction mode.
[0144] Figure 10 shows the scaled results of tangent values for the non-wide angle intra prediction mode, and Figure 11 shows the scaled results of tangent values for the wide angle intra prediction mode.
[0145] If the tangent value (tanθ) for the angle value of the intra prediction mode is positive, intra prediction can be performed using only one of the reference samples belonging to the upper line of the current block (i.e., upper reference samples) or the reference samples belonging to the left line of the current block (i.e., left reference samples). On the other hand, if the tangent value for the angle value of the intra prediction mode is negative, both the reference samples located at the upper side and the reference samples located at the left side are used.
[0146] At this time, to simplify the implementation, the reference samples may be arranged in a 1D array form by projecting the left reference samples upward or the top reference samples to the left, and intra prediction may be performed using the reference samples in the 1D array form.
[0147] Figure 12 is a diagram illustrating an intra prediction aspect when the directional mode is one of modes 34 to 49.
[0148] If the intra prediction mode of the current block is one of modes 34 to 49, intra prediction is performed using not only the upper reference samples of the current block but also the left reference samples. At this time, as in the example illustrated in Fig. 12, the reference sample located on the left side of the current block can be copied to the position of the upper line, or the reference samples located on the left can be interpolated to generate the reference sample of the upper line.
[0149] For example, in case of obtaining a reference sample for position A at the top of the current block, projection can be performed from position A of the top line to the left line of the current block, considering the directionality of the intra prediction mode of the current block. If the projected position is a, the value corresponding to position a can be copied, or a fractional position value corresponding to a can be generated and set as the value of position A. For example, if position a is an integer position, the value of position A can be generated by copying the integer position reference sample. On the other hand, if position a is a fractional position, the reference sample located above position a and the reference sample located below position a can be interpolated, and the interpolated value can be set as the value of position A. Meanwhile, the direction of projection from position A at the top of the current block to the left line of the current block can be parallel to and opposite to the direction of the intra prediction mode of the current block.
[0150] Figure 13 is a drawing for explaining an example of generating an upper reference sample by interpolating left reference samples.
[0151] In Fig. 13, the variable h represents the horizontal distance between position A of the upper line and position a of the left line. The variable w represents the vertical distance between position A of the upper line and position a of the left line. In addition, the variable θ represents a predefined angle according to the directionality of the intra prediction mode, and the variable x represents a fractional position.
[0152] The variable h can be derived as shown in the following mathematical expression 3.
[0153]
[0154] Afterwards, by removing the integer position from the variable h, the fractional position can be finally derived.
[0155] To avoid real-valued operations when deriving fractional position samples, a scaling factor can be used. For example, the tangent value for variable θ can be scaled using the scaling factor f1. Here, since the direction projected to the left line is parallel and opposite to the directional prediction model, the scaled tangent value illustrated in FIGS. 10 and 11 can also be used.
[0156] When the scaling factor f1 is applied, Equation 3 can be transformed into Equation 4 below.
[0157]
[0158] In this manner, a 1D reference sample array can be constructed using only the reference samples belonging to the upper line. As a result, intra prediction for the current block can be performed using only the upper reference samples formed in the 1D array.
[0159] Figure 14 shows an example in which intra prediction is performed using reference samples arranged in a 1D array.
[0160] As in the example illustrated in Fig. 14, by projecting the left reference samples to generate the upper reference samples, prediction samples of the current block can be obtained using only the reference samples belonging to the upper line.
[0161] Contrary to what is shown in FIGS. 12 and 14, a 1D reference sample array can also be constructed using only the reference samples belonging to the left line by projecting the upper reference sample onto the left line. Specifically, for modes 19 to 33 among the directional modes in which the tangent value (tanθ) for the angle of the directional mode is negative, the reference samples belonging to the upper line can be projected onto the left line to generate the left reference sample.
[0162] Meanwhile, for color pictures, encoding / decoding can be performed for each of the luminance component and chroma component. For example, encoding / decoding can be performed for the luminance component of the current block (i.e., luminance block), and then encoding / decoding can be performed for the chroma component of the current block (i.e., chroma block).
[0163] Meanwhile, the size of the chroma block corresponding to the luminance block may vary depending on the chrominance format. For example, in the 4:4:4 format, the size of the luminance block and the size of the chroma block may be the same. On the other hand, in the 4:2:0 format, the width and height of the chroma block may be half the size of the width and height of the corresponding luminance block, respectively.
[0164] Meanwhile, predictions can be performed on chroma blocks using the restored luma block. A prediction model utilizing different color components, such as the above, can be called a Cross-Component Linear Model (CCLM). When CCLM is applied, the process of deriving the intra-prediction mode of the chroma block based on the intra-prediction mode of the luma block can be omitted.
[0165] Figure 15 is a flowchart illustrating a method for predicting a chroma block using a restored luma block.
[0166] In the embodiments described below, the chroma component of the current block will be referred to as a chroma block. In addition, the luminance component block of the current component or the luma component block corresponding to the chroma block will be referred to as a luma block. Meanwhile, the current block represents the current encoding / decoding target block and may be at least one of a coding unit, a prediction unit, or a transformation unit for the luminance component or the chroma component.
[0167] Additionally, unless explicitly stated otherwise, embodiments in the present disclosure that apply to the current block may be applicable to at least one of a luma block or a chroma block. That is, the current block may mean at least one of a luma block or a chroma block. For example, embodiments relating to configuring a template for the current block may be applicable to at least one of configuring a template for a luma block or a template for a chroma block.
[0168] Referring to Figure 15, first, prediction parameters can be derived for prediction of chroma blocks (S1510). At this time, the prediction parameters can be derived in different ways depending on the video format of the picture. The video format indicates the chroma subsampling rate and can be determined as one of 4:4:4, 4:2:2, or 4:2:0.
[0169] If the video format is not 4:4:4, the luma block is downsampled to the same size as the chroma block.
[0170] Figures 16 to 18 illustrate examples of downsampling a luma block.
[0171] For convenience of explanation, the video format is assumed to be 4:2:0.
[0172] When the video format is 4:2:0, the size of the chroma block corresponding to the 4x4 luma block is 2x2, as in the example illustrated in Fig. 16. In this case, a down-sampling filter can be applied to the luma block to reduce the 4x4 luma block to 2x2. The following mathematical expression 5 shows how the down-sampling filter is applied.
[0173]
[0174] In mathematical expression 5, Downsampled_Luma refers to a sample value within a downsampled luma block, and Luma refers to the value of a luma sample before downsampling. For example, Luma[0][0] may indicate the position of the upper left sample within a luma block before downsampling. Since the size of the downsampled luma block is 2x2, the variables x and y, which indicate the coordinates of the sample, may each have values ranging from 0 to 1.
[0175] When applying the down-sampling filter according to mathematical expression 5, the value of the down-sampled luma sample can be obtained by applying a cross-shaped down-sampling filter to the luma samples. For example, the value of the down-sampled luma sample at the (0, 0) position can be obtained by applying the down-sampling filter to the luma sample at the (0, 0) position, the upper luma sample at the (0, 0) position, the left luma sample at the (0, 0) position, the lower luma sample at the (0, 0) position, and the right luma sample at the (0, 0) position.
[0176] Downsampling filters of different shapes than those illustrated in Fig. 17 may also be applied. For example, a 1D filter, a rectangular or square filter may be applied to obtain downsampled luma samples. The 1D filter may have a size of 1x3 or 3x1, the rectangular filter may have a size of 2x3 or 3x2, and the square filter may have a size of 2x2 or 3x2.
[0177] The shape of the filter may be predefined in the encoder and decoder.
[0178] Alternatively, the shape of the filter may be adaptively determined based on at least one of the size / shape of the current block, the intra prediction mode applied to the luma block, whether the positions of the chroma samples match the positions of the luma samples, or the image format.
[0179] Alternatively, information indicating one of multiple filter candidates may be encoded and signaled.
[0180] Alternatively, depending on the downsampling location, the filter type may differ. For example, a 1D filter or a rectangular filter may be applied to luma samples located at the boundary of a luma block, while a cross-shaped filter may be applied to luma samples not located at the boundary of a luma block.
[0181] As illustrated in Fig. 17, a downsampling filter can be applied to positions where both the x-axis coordinate and the y-axis coordinate are even numbers.
[0182] The application position of the downsampling filter can also be set differently from that shown in Fig. 17.
[0183] Figure 18 shows various examples of application locations of the downsampling filter.
[0184] After defining multiple candidates for the downsampling application location, one of the multiple candidates can be selected. For example, after defining the examples in (a) to (d) of FIG. 18 as multiple candidates, index information indicating one of the multiple examples can be encoded and signaled.
[0185] Alternatively, one of the multiple candidates may be selected based on whether the location of the chroma sample matches the location of the luma sample.
[0186] A downsampling filter can also be applied to reference samples surrounding a luma block. Here, the reference samples may represent previously restored samples. Specifically, a downsampling filter can be applied to at least one of an upper reference region adjacent to the upper side of the luma block or a left reference region adjacent to the left side to obtain a downsampled luma reference sample.
[0187] A number of downsampled luma reference samples equal to the number of reference samples included in the reference area of the chroma block can be obtained.
[0188] Meanwhile, the reference area of a luma block can be called a luma reference area, and the reference area of a chroma block can be called a chroma reference area. The reference area can also be called a template.
[0189] The inter-component prediction mode can be divided into an upper inter-component prediction mode, a left inter-component prediction mode, and an upper and left inter-component prediction mode, depending on the configuration of the reference region. When the upper inter-component prediction mode is selected, the reference region of each of the luma block and the chroma block consists of only the upper reconstruction region. When the left inter-component prediction mode is selected, the reference region of each of the luma block and the chroma block consists of only the left reconstruction region. When the upper and left inter-component prediction modes are selected, the reference region of each of the luma block and the chroma block can consist of an upper reconstruction region and a left reconstruction region.
[0190] Information indicating which of the top inter-component prediction mode, the left inter-component prediction mode, and the top and left inter-component prediction modes is applied to the current block can be explicitly encoded and signaled. For example, index information indicating the type of inter-component prediction mode can be encoded and signaled.
[0191] Alternatively, one of the top inter-component prediction mode, the left inter-component prediction mode, and the top and left inter-component prediction mode may be selected based on at least one of the size / shape of the current block, whether the current block touches a CTU or picture boundary, or an intra prediction mode applied to the luma block.
[0192] For convenience of explanation, in the embodiments described below, it is assumed that the reference areas of each of the luma block and the chroma block include an upper reference area and a left reference area.
[0193] The shape of the down-sampling filter applied to the reference area of the luma block may be the same as the down-sampling filter applied to the luma block. Alternatively, the shape of the down-sampling filter applied to the reference area of the luma block may be different from the down-sampling filter applied to the luma block. Alternatively, the shape of the down-sampling filter applied to the upper reference area of the luma block may be different from the shape of the down-sampling filter applied to the left reference area of the luma block.
[0194] Meanwhile, the location where downsampling is applied within the reference region may be predefined in the encoder and decoder.
[0195] In other words, in a decoder, you can also decide for yourself where in the reference region downsampling should be applied, in the same way as the encoder.
[0196] Figure 19 is a drawing for explaining an example related to the location where down sampling is applied.
[0197] When the video format is 4:2:0, a 1x1 chroma block corresponds to a 2x2 luma block. Accordingly, a downsampling filter can be applied to one of the four luma reference samples to derive a downsampled luma reference sample corresponding to the chroma reference sample.
[0198] When four luma reference samples corresponding to one chroma reference sample are represented as A to D, downsampling can be performed on each of positions A to D within the reference area, and then the cost for each position can be calculated. Here, the cost for a specific position can be derived based on the sum of the differences between the downsampled luma reference sample obtained by applying a downsampling filter centered on the position and the chroma reference sample corresponding to the position, or the sum of the absolute values of the differences. In this way, the cost derived based on the sum of the absolute values of the differences can be referred to as SAD (Sum of Difference).
[0199] Afterwards, the location with the lowest cost is determined as the optimal location, and the prediction parameter derivation process described below can be performed using the downsampled luma samples at the optimal location.
[0200] Alternatively, information indicating one of the multiple positions to which the downsampling filter can be applied can be encoded and signaled. For example, in the example illustrated in FIG. 19, an index indicating one of positions A to D can be encoded and signaled. To this end, the encoder can obtain prediction parameters for each of the multiple positions to which the downsampling filter can be applied, and can encode and signal an index indicating a position used to derive an optimal prediction parameter among the multiple prediction parameters. Here, the optimal prediction parameter can be derived by the cost of each of the prediction parameters or by Rate Distortion Optimization (RDO).
[0201] Meanwhile, determining the optimal downsampling position within the upper reference area may be independent of determining the optimal downsampling position within the left reference area. In this case, the optimal downsampling position within the upper reference area and the optimal downsampling position within the left reference area may differ.
[0202] Prediction parameters for a chroma block can be derived using downsampled luma reference samples and chroma block reference samples. The prediction parameters may include weights α and offsets β. The prediction parameters can be derived using the least squares method, for example.
[0203] Alternatively, the weight α offset β can be derived based on the linearity of the maximum and minimum values of the downsampled luma reference samples and the maximum and minimum values of the chroma reference samples.
[0204] At this time, prediction parameters can be derived using only chroma reference samples at predefined locations and corresponding downsampled luma reference samples. In this case, the process of deriving prediction parameters can be simplified, thereby reducing the complexity of the encoder and decoder. For example, prediction parameters can be derived using chroma reference samples at locations exemplified in the following mathematical expression 6.
[0205]
[0206] In the above example, W and H represent the width and height of the chroma block, respectively. According to the above example, prediction parameters can be derived using four chroma reference samples and four corresponding downsampled luma reference samples.
[0207] Prediction parameters can also be obtained using reference samples at different locations than in the example above. For example, the locations of the reference samples can be determined as in Equations 7 and 8 below.
[0208]
[0209]
[0210] After defining multiple candidates for the locations of reference samples, one of the multiple candidates can be selected. For example, each of the examples in Equations 6 to 8 listed above can be set as a location candidate, and then reference samples can be selected based on one of the multiple location candidates.
[0211] Information for selecting one of multiple location candidates may be encoded and signaled. For example, an index pointing to one of the multiple location candidates may be encoded and signaled.
[0212] Alternatively, one of the plurality of location candidates may be adaptively selected based on at least one of the size / shape of the current block, the color format, or whether the location of the chroma sample matches the location of the luma sample.
[0213] For example, if the current block is square, the prediction parameter can be derived using the location candidate of Equation 6. On the other hand, if the current block is non-square, the prediction parameter can be derived using the location candidate of Equation 7 or Equation 8. For example, if the current block is non-square in which the width is greater than the height, the location candidate of Equation 7 can be used, and if the current block is non-square in which the height is greater than the width, the location candidate of Equation 8 can be used.
[0214] Once the prediction parameters are derived, a prediction sample of a chroma block can be obtained based on the downsampled luma sample (S1520). For example, a prediction sample of a chroma block can be obtained according to the following mathematical expression 9.
[0215]
[0216] In mathematical expression 9, PredChroma represents a prediction sample of a chroma block, and Downsampled_Luma represents a downsampled luma sample at a position corresponding to the chroma prediction sample.
[0217] Meanwhile, if the video format is 4:4:4, the above-described downsampling process may be omitted. That is, if the video format is 4:4:4, the process of performing downsampling on the restored samples within the luma block and the process of performing downsampling on the reference samples of the luma block may be omitted.
[0218] As another example, regardless of the image format, the reference region of the luma block may not be subjected to a downsampling filter. That is, when deriving prediction parameters, instead of using the minimum and maximum values of the downsampled luma reference samples, the minimum and maximum values of the luma reference samples may be used.
[0219] Prediction samples for chroma prediction blocks can also be derived using filters (or convolutions) composed of more filter coefficients than those in Equation 9. Specifically, templates can be set around each of the luma block and chroma block, and prediction parameters can be derived based on the samples included in the templates. For convenience of explanation, the template for the chroma block will be referred to as the chroma template, and the template for the luma block will be referred to as the luma template.
[0220] Figure 20 illustrates templates for each chroma block and its corresponding luma block.
[0221] The previously restored region surrounding the chroma block can be set as a template for the chroma block. Furthermore, the previously restored region surrounding the luma block corresponding to the chroma block can be set as a template for the luma block. That is, each template may be composed of restored samples. Meanwhile, the samples within each template may be referred to as reference samples.
[0222] In the example illustrated in Fig. 20, the region including the upper four lines and the left four lines of each of the luma block and the chroma block is exemplified as being set as a template. Meanwhile, the template of the luma block and the template of the chroma block may have the same shape. Depending on the color format, the template of the chroma block may have the same size as the template of the luma block (e.g., 4:4:4 format), or the template of the chroma block may have a smaller size than the template of the luma block (e.g., 4:2:2 or 4:2:0 format).
[0223] Filter coefficients can be derived based on reference samples within a luma template and reference samples within a chroma template. Specifically, the filter coefficients can be derived so that the output values when a filter is applied to reference samples within a luma template are close to the values of the reference samples within the chroma template.
[0224] At this time, the filter applied to the reference samples in the luma template may be a convolution filter using a mask.
[0225] Figure 21 shows the filter form applied to reference samples of the luma component.
[0226] As in the example illustrated in Fig. 21, when a cross-shaped filter is applied, a value E obtained by filtering luma reference samples can be obtained according to the following mathematical expression 10.
[0227]
[0228] In Equation 10, [i, j] represents the coordinates (e.g., [x, y]) of the reference sample within the template. T represents the template. That is, '[i, j] ∈ T' means that the reference sample is included in the template (i.e., luma template or chroma template).
[0229] Y can represent a reference sample within a chroma template.
[0230] C represents the position of a reference sample to which a filter is applied within the luma template. Specifically, C may be a reference sample within the luma template, and may be located at a position corresponding to the reference sample Y within the chroma template. N, S, E, and W represent samples adjacent to the top, bottom, right, and left of the reference sample C within the luma template, respectively.
[0231] Variable B can be derived by bit depth. For example, variable B can be derived according to the following mathematical expression (11).
[0232]
[0233] In the above mathematical expression 11, D may represent the bit depth of the sample. For example, if the bit depth is 10 bits, the variable B may be derived as the median value 512. Alternatively, if the bit depth is 8 bits, the variable B may be derived as the median value 128.
[0234] In the above mathematical expression 10, filter coefficients (i.e., filter parameters) w0 to w5 that minimize the filtered value E can be derived. Meanwhile, regression analysis can be used to derive the filter coefficients.
[0235] Once the filter coefficients are derived, a filter can be applied to luma samples within a luma block to obtain a prediction sample within a chroma block. For example, assuming that the cross filter illustrated in FIG. 21 is applied, a prediction sample Y' within a chroma block can be derived according to the following mathematical expression 12.
[0236]
[0237] In mathematical expression 12, M denotes a luma block corresponding to a chroma block. That is, '[i, j]∈M' may mean that the sample at the position [i, j] belongs to the luma block. C' may represent a sample within the luma block that is at the same position as the prediction sample Y' of the chroma block. N', S', E', and W' represent samples adjacent to the top, bottom, right, and left of the sample C' within the luma block, respectively.
[0238] Meanwhile, the shape or type of the filter is not limited to the example illustrated in FIG. 21. For example, a horizontal 1D filter (e.g., a 1xN-shaped filter), a vertical 1D filter (e.g., an Nx1-shaped filter), or a square-shaped filter (e.g., an NxN-shaped filter) may be used to derive prediction samples within a chroma block using filter coefficients or derived filter coefficients. In the above example, N is a natural number greater than or equal to 1, and may be 3, 4, or 5.
[0239] The filter type can be adaptively determined based on at least one of the size or shape of the current block. For example, if the current block is a non-square shape with a width greater than its height, a horizontal 1D filter can be used to derive filter coefficients or prediction samples within the chroma block. Conversely, if the current block is a non-square shape with a height greater than its width, a vertical 1D filter can be used to derive filter coefficients or prediction samples within the chroma block.
[0240] Alternatively, information indicating one of multiple filter type candidates may be encoded and signaled.
[0241] Filter coefficients are derived using the previously restored regions around the luma and chroma blocks. Accordingly, filter coefficients can be derived in the decoder using the same method as in the encoder.
[0242] As another example, information about a filter coefficient set, including filter coefficients, may be encoded and signaled to a decoder. For example, an index indicating one of multiple filter coefficient set candidates may be encoded and signaled. Each filter coefficient set candidate may be composed of multiple filter coefficients.
[0243] Alternatively, the values of the filter coefficients that make up the filter coefficient set may be explicitly encoded and signaled.
[0244] As in the example described above, filter coefficients can be derived and prediction blocks can be generated using convolution. The convolution-based inter-component prediction mode can also be referred to as the Cross-Component Convolution Model (CCCM).
[0245] In the above-described mathematical expressions 9 and 12, it is exemplified that a prediction block of a chroma block is obtained based on a type of parameter derived using reconstructed samples surrounding the luma block and chroma block. Here, the use of a type of parameter indicates that a single prediction parameter or a single filter is used across the entire region of the current block.
[0246] In this way, a method of predicting a chroma block using one type of prediction parameter or a single type filter can be called a single-model method.
[0247] Extending the above-described embodiments, it is also possible to obtain a prediction block of a chroma block from a luma block using multiple parameters or multiple filters (or multiple convolutions).
[0248] In this way, a prediction method of a chroma block using multiple parameters or multiple filters can be called a multi-mode method.
[0249] When a multi-model approach is applied, multiple parameters can be derived. Specifically, the reference samples of the luma block and the reference samples of the chroma block can be classified into multiple groups. Then, parameters can be derived from each of the multiple groups.
[0250] For example, the average Ym of reference samples of a luma block is derived. At this time, luma reference samples around a luma block that are smaller than the average Ym can be classified into a first group. Furthermore, chroma reference samples at the same position as the luma reference samples classified into the first group can also be classified into the first group. On the other hand, luma reference samples around a luma block that are equal to or larger than the average Ym can be classified into a second group. Furthermore, chroma reference samples at the same position as the luma reference samples classified into the second group can also be classified into the second group.
[0251] Thereafter, prediction parameters can be derived for each group. For example, a first parameter can be derived using luma reference samples and chroma reference samples belonging to group 1. For example, the first parameter may include a first weight α1 and a first offset β1 for linear prediction.
[0252] Additionally, a second time parameter can be derived based on the luma reference samples and chroma reference samples belonging to group 2. For example, the second parameter may include a second weight α2 and a second offset β2 for linear prediction.
[0253] Depending on the group to which the luma sample in the luma block belongs, one of multiple parameters may be selected. Here, the luma sample represents a sample in the luma block at the same location as the location to be predicted (i.e., the prediction target location) in the chroma block.
[0254] For example, if a luma sample in a luma block belongs to the first group (e.g., if the value of the luma sample is smaller than the average Ym), a prediction sample of a chroma block can be obtained using a first parameter derived based on reference samples of the first group. For example, if a luma sample belongs to the first group, a prediction sample of a chroma block can be obtained according to the following mathematical expression 13.
[0255]
[0256] On the other hand, if the luma sample in the luma block belongs to the second group (e.g., if the value of the luma sample is equal to or greater than the average Ym), the prediction sample of the chroma block can be obtained using the second parameter derived based on the reference samples of the second group. For example, if the luma sample belongs to the second group, the prediction sample of the chroma block can be obtained according to the following mathematical expression 14.
[0257]
[0258] In the above mathematical expressions 13 and 14, (x, y) may indicate a sample location to be predicted within a chroma block.
[0259] Meanwhile, in the above-described example, the first parameter and the second parameter may be filter coefficients for convolution-based prediction. For example, the first parameter derived based on reference samples belonging to the first group may include first filter coefficients (w0_1 to w5_1). In addition, the second parameter derived based on reference samples belonging to the second group may include second filter coefficients (w0_2 to w5_2).
[0260] If the luma sample in the luma block belongs to the first group, the prediction sample of the chroma block can be derived using the first filter coefficients according to Equation 12. On the other hand, if the luma sample in the luma block belongs to the second group, the prediction sample of the chroma block can be derived using the second filter coefficients according to Equation 12.
[0261] Alternatively, one of the first parameter and the second parameter may be a prediction parameter for performing inter-component prediction based on linearity (e.g., CCLM), and the other may be filter coefficients for performing inter-component prediction based on convolution (e.g., CCCM).
[0262] Meanwhile, when classifying the first and second groups, instead of the average value Ym of the luma reference samples, the average value of the luma samples within the luma block or the average value of the luma reference samples and the luma samples may be used.
[0263] Alternatively, the first group and the second group may be classified based on the sample value at the middle position, taking into account the distribution of the mean luma reference samples and / or luma samples.
[0264] Meanwhile, multiple parameters can be derived based on the first template and the second template, which are spatially separated.
[0265] For example, a base restoration region located at the top of a luma block can be set as a first luma template, and a base restoration region located at the top of a chroma block can be set as a first chroma template. Thereafter, a first parameter can be derived based on the first luma template and the first chroma template.
[0266] Furthermore, the restoration region located on the left side of the luma block can be set as a second luma template, and the restoration region located on the left side of the chroma block can be set as a second chroma template. Thereafter, the second parameter can be derived based on the second luma template and the second chroma template.
[0267] For luma samples belonging to the first region within the luma block, the first parameter can be applied, while for luma samples belonging to the second region within the luma block, the second parameter can be applied.
[0268] For example, the first region and the second region may be triangular shaped partitions.
[0269] Alternatively, the first region and the second region may be sub-blocks divided along the horizontal direction or sub-blocks divided along the vertical direction.
[0270] Alternatively, a first parameter may be applied to a luma block to derive a first prediction block for a chroma block, and a second parameter may be applied to the luma block to derive a second prediction block for the chroma block. Thereafter, a final prediction block for the chroma block may be derived based on an average or weighted sum operation of the first and second prediction blocks.
[0271] Meanwhile, information indicating whether linearity-based inter-component prediction is applied to the current block may be encoded and signaled. For example, the information may be a flag of the first bit.
[0272] Additionally, information indicating whether convolution-based inter-component prediction is applied to the current block may be encoded and signaled. For example, the information may be a flag of the first bit.
[0273] Information indicating whether a single-model approach or a multi-model approach is applied to the current block may be encoded and signaled. If the information indicates a single-model approach, it may be determined whether linearity-based inter-component prediction or convolution-based inter-component prediction is applied to the current block.
[0274] As another example, information for inter-component prediction can be determined at the decoder side based on the reference region around the luma block and the reference region of the chroma block. Here, the information for inter-component prediction can indicate whether the first inter-component prediction mode or the second inter-component prediction mode is applied to the current block. As an example, one of the first inter-component prediction mode and the second inter-component prediction mode can be a linearity-based inter-component prediction mode (e.g., CCLM), and the other can be a convolution-based inter-component prediction mode (e.g., CCCM).
[0275] Meanwhile, at least one of the size, shape, or configuration of the reference region may be predefined in the encoder and decoder. For example, as illustrated in FIG. 20, a template around a luma block and a template around a chroma block may be configured.
[0276] Alternatively, at least one of the size / shape or configuration of the reference block may be adaptively determined based on at least one of the size / shape of the current block, the encoding mode of the luma block, or the intra prediction mode of the luma block. Here, the encoding mode may indicate whether the luma block is encoded / decoded with intra prediction or inter prediction.
[0277] Alternatively, information related to the configuration of the reference region may be encoded and signaled. The information may indicate one of a plurality of reference region configuration candidates. For example, the configuration candidates may include at least one of a first candidate indicating that the reference region is composed only of an upper restoration region located at the top of the current block, a second candidate indicating that the reference region is composed only of a left restoration region located at the left of the current block, and a third candidate indicating that the reference region is composed of both the upper restoration region and the left region.
[0278] Based on the reference region of the luma block and the reference region of the chroma block, a first parameter for the first inter-component prediction mode and a second parameter for the second inter-component prediction mode can be derived.
[0279] Thereafter, based on the first parameter, a first inter-component prediction mode can be applied to the reference region of the luma block. By applying the first inter-component prediction mode to the reference region of the luma block, prediction values (i.e., prediction samples) for the reference region of the chroma block can be derived. The reference region of the chroma block composed of prediction values can be referred to as a prediction reference region.
[0280] Additionally, based on the second parameter, a second inter-component prediction mode can be applied to the reference region of the luma block. By applying the second inter-component prediction mode to the reference region of the luma block, prediction samples for the reference region of the chroma block can be derived.
[0281] Thereafter, the cost for each inter-component prediction mode can be calculated. For example, the cost for the first inter-component prediction mode can be calculated based on the reconstructed samples within the reference region of the chroma block and the predicted samples within the reference region of the chroma block derived based on the first inter-component prediction mode. In addition, the cost for the second inter-component prediction mode can be calculated based on the reconstructed samples within the reference region of the chroma block and the predicted samples within the reference region of the chroma block derived based on the second inter-component prediction mode.
[0282] Here, the cost may be calculated based on the Sum of Absolute Difference (SAD). For example, the cost for the inter-component prediction mode can be derived by summing the absolute values of the differences between the restored and predicted samples.
[0283] Meanwhile, the size / shape of the reference region for deriving prediction parameters and the size / shape of the reference region that is the prediction target can be set differently. In this case, to distinguish between the reference region for deriving prediction parameters and the reference region that is the prediction target, the reference region for deriving prediction parameters can be called a template.
[0284] Among the first inter-component prediction mode and the second inter-component prediction mode, the one with a lower cost can be applied to the current block. For example, if the cost of the first inter-component prediction mode is lower than the cost of the second inter-component prediction mode, a prediction block of a chroma block can be obtained based on the first inter-component prediction mode. That is, a prediction sample of a chroma block can be derived by applying a first parameter to a luma sample in a luma block. For example, if the first inter-component prediction mode is a linearity-based inter-component prediction mode, a prediction block of a chroma block can be derived based on the first prediction parameters (i.e., α and β) according to Equation 9.
[0285] For example, if the cost of the second inter-component prediction mode is lower than the cost of the first inter-component prediction mode, a prediction block of a chroma block can be obtained based on the second inter-component prediction mode. That is, a prediction sample of a chroma block can be derived by applying a second parameter to a luma sample in a luma block. For example, if the second inter-component prediction mode is a convolution-based inter-component prediction mode, a prediction block of a chroma block can be derived based on the second prediction parameters (i.e., w0 to w5) according to Equation 12.
[0286] For a chroma block, multiple prediction blocks can be derived, and a final prediction block of the chroma block can be derived based on an average or weighted sum operation of the multiple prediction blocks. For example, a first prediction block for the chroma block can be derived based on a first inter-component prediction mode, and a second prediction block for the chroma block can be derived based on a second inter-component prediction mode. Thereafter, a final prediction block of the chroma block can be derived based on a weighted sum operation of the first and second prediction blocks.
[0287] Meanwhile, when performing a weighted sum operation on the first prediction block and the second prediction block, the weights for each of the first prediction block and the second prediction block can be determined by considering the cost for the first inter-component prediction mode and the cost for the second inter-component prediction mode. For example, if the cost for the first inter-component prediction mode is cost1 and the cost for the second inter-component prediction mode is cost2, the final prediction block for the chroma block can be derived according to the following mathematical expression 15.
[0288]
[0289] In the above mathematical expression 15, P_1 represents a first prediction block derived based on the first inter-component prediction mode. P_2 represents a second prediction block derived based on the second inter-component prediction mode.
[0290] The size of the reference region can also be derived in the decoder in the same way as in the encoder.
[0291] Figure 22 is a drawing for explaining an example of deriving the size of a reference area in a decoder.
[0292] In the example illustrated in Figure 22, h0 represents the number of lines included in the upper reference area of the luma block, and w0 represents the number of lines included in the left reference area of the luma block. In addition, h1 represents the number of lines included in the upper reference area of the chroma block, and w1 represents the number of lines included in the left reference area of the chroma block.
[0293] w0 and w1 may be referred to as the horizontal thickness (or width) of the reference region (or template), and h0 and h1 may be referred to as the vertical thickness (or height) of the reference region (or template). Meanwhile, the horizontal thickness may be the same as the vertical thickness.
[0294] For convenience of explanation, it is assumed that the size of the reference region of the chroma block is the same as the size of the reference region of the luma block. However, depending on the chroma format, the size of the reference region of the chroma block may be set to be smaller than the size of the reference region of the luma block, unlike in the illustrated example.
[0295] After setting the reference region to a first size, a first parameter can be derived from the reference region. For example, at least one of a prediction parameter for linearity-based chroma prediction or a filter parameter for convolution-based chroma prediction can be derived from the reference region of the first size. Then, by applying the first parameter to the reference region of the first size, prediction values for the reference region are obtained. Then, a cost for the reference region of the first size can be calculated based on the difference between the reconstructed samples within the reference region of the chroma block and the prediction samples within the reference region.
[0296] In addition, after setting the reference area to a second size, the second parameter can be derived from the reference area. Here, the reference area of the second size can be different from the reference area of the first size in at least one of the width or the height. For example, w0 and h0 for the reference area of the first size can each be 3. Since the size of the chroma reference area is the same as the size of the luma reference area, w1 and h1 can also each be 3. On the other hand, for the second size, w0 and h0 for the reference area of the second size can each be 4. Since the size of the chroma reference area is the same as the size of the luma reference area, w1 and h1 can also each be 4.
[0297] Thereafter, the second parameter is applied to the second-sized reference region to obtain prediction values for the reference region. Thereafter, the cost for the second-sized reference region can be calculated based on the difference between the reconstructed samples within the reference region of the chroma block and the prediction samples within the reference region.
[0298] The size of the reference region can be determined by comparing the cost for the reference region of the first size with the cost for the reference region of the second size. For example, if the cost of the reference region of the first size is smaller than the cost of the reference region of the second size, the size of the reference region can be determined as the first size. Accordingly, a prediction block for a chroma block can be obtained based on a first parameter derived based on the reference region of the first size. On the other hand, if the cost of the reference region of the second size is smaller than the cost of the reference region of the first size, the size of the reference region can be determined as the second size. Accordingly, a prediction block for a chroma block can be obtained based on a second parameter derived based on the reference region of the second size.
[0299] Meanwhile, the number of samples included in the reference area of the first size may differ from the number of samples included in the reference area of the second size. Accordingly, the cost for the reference area of the first size and the cost for the reference area of the second size may be normalized, and the normalized costs may be compared to select either the first size or the second size. For example, the normalized cost may be derived by dividing the result of SAD by the number of samples included in the reference area.
[0300] In a similar manner to the above, the decoder side can also determine the configuration of the reference region in the same manner as the encoder.
[0301] Figure 23 illustrates template candidates for the current block.
[0302] As in the example illustrated in Fig. 23, when there are multiple template (or reference region) candidates applicable to the current block, parameters, predicted reference regions, and costs can be derived for each of the multiple template candidates.
[0303] For example, by applying the Nth template candidate among the template candidates illustrated in Fig. 23, the Nth parameter for inter-component prediction can be derived. Here, the Nth parameter can be for inter-component prediction based on linearity or inter-component prediction based on convolution.
[0304] Thereafter, by applying the Nth parameter to the luma reference region, a prediction reference region can be obtained, and the cost for the template candidate can be calculated based on the restored samples in the chroma reference region of the chroma block and the predicted values in the prediction reference region. Meanwhile, the configuration of the reference region to which inter-component prediction based on the Nth parameter is applied may be the same as the template candidate, or may have a different size and / or shape from the template candidate.
[0305] Thereafter, the template candidate with the lowest cost can be determined to be applied to the current block. That is, a prediction block for the chroma block can be obtained based on parameters derived based on the template candidate with the lowest cost.
[0306] Alternatively, template candidates can be reordered based on cost. This reordering may involve arranging template candidates in ascending order of cost. As a result of the reordering, the template candidate with the lowest cost may be assigned the smallest index, and the template candidate with the highest cost may be assigned the largest index.
[0307] Information indicating one of the rearranged template candidates can be encoded and signaled. Based on parameters derived from the template candidate indicated by the information, a prediction block of the chroma block can be obtained.
[0308] Meanwhile, at least one of the number or types of template candidates is not limited to the example illustrated in FIG. 23. For example, a template candidate consisting only of an upper reference area located at the top of the current block or a template candidate consisting only of a left reference area located at the top of the current block may be set as available for the current block.
[0309] Additionally, at least one of the number or types of template candidates may be determined based on at least one of the size / shape of the current block, the encoding mode of the luma block, or the inter-component prediction mode. For example, at least one of the number or types of template candidates available for the current block may be different between a case where the current block is a non-square shape with a height greater than its width and a case where the current block is a non-square shape with a width greater than its height. Alternatively, at least one of the number or types of template candidates available for the current block may be different between a case where a linearity-based inter-component prediction mode is applied to the current block and a case where a convolution-based inter-component prediction mode is applied to the current block.
[0310] Alternatively, the luma block can determine the configuration of the reference region based on the intra prediction mode. For example, if the intra prediction mode of the current block is equal to or greater than 34 (the upper left diagonal mode in Figure 4), only the upper reconstructed region located above the current block can be included in the template. Conversely, if the intra prediction mode of the current block is less than 34, only the left reconstructed region located to the left of the current block can be included in the template.
[0311] Meanwhile, if the intra prediction mode of the current block is a non-radial mode (e.g., DC or planar), the template may include both the top restoration area and the left restoration area.
[0312] Meanwhile, in the above-described examples, it was assumed that the area for deriving parameters for inter-component prediction and the area to which the derived parameters are applied, i.e., the area subject to cost calculation, are the same.
[0313] Unlike the example described above, the region for deriving parameters for inter-component prediction and the region for applying the derived parameters can be set differently.
[0314] For example, the template candidates illustrated in FIG. 23 may be regions for deriving parameters for inter-component prediction. Once parameters for inter-component prediction are derived based on each template candidate, the parameters can be applied to a reference region of the form illustrated in FIG. 20 to establish a prediction reference region.
[0315] That is, regardless of the template candidate, the reference region to which the parameters for inter-component prediction are applied can have a fixed shape and / or size.
[0316] When a multiple model approach is applied, reference samples belonging to the reference region of a luma block are classified into multiple groups. For example, by comparing the value of a reference sample with a threshold value, if the value of the reference sample is equal to or greater than the threshold value, the reference sample can be classified into the first group. Conversely, if the value of the reference sample is less than the threshold value, the reference sample can be classified into the second group.
[0317] As described above, the threshold can be derived based on reference samples within a luma reference region or luma samples within a luma block.
[0318] By further expanding the above embodiment, a plurality of threshold values can be set, and inter-component prediction can be performed based on each of the plurality of threshold values, thereby performing prediction for each of the plurality of threshold values.
[0319] For example, for the first threshold, reference samples within the luma reference region are classified into the first group and the second group based on the first threshold. With reference to the classification results of the reference samples within the luma reference region, reference samples within the chroma reference region are also classified into the first group and the second group.
[0320] Thereafter, a first parameter is derived based on reference samples belonging to the first group, and a second parameter is derived based on reference samples belonging to the second group.
[0321] Thereafter, predictions are performed based on the first and second parameters within the luma reference region to obtain prediction values for the crowbar reference region. For example, the first parameter is applied to reference samples classified as the first group within the luma reference region to obtain prediction values, and the second parameter is applied to reference samples classified as the second group within the luma reference region to obtain prediction values.
[0322] Thereafter, a cost for the first threshold can be calculated based on the restored samples within the reference region of the chroma block and the predicted samples within the reference region of the chroma block.
[0323] For each of the multiple thresholds, a cost can be calculated according to the example described above. Thereafter, a prediction block of the chroma block can be derived based on the threshold with the lowest cost among the multiple thresholds.
[0324] For example, if an Nth threshold value is selected from among a plurality of threshold values, a prediction sample of a chroma block can be obtained by applying a first parameter derived based on reference samples belonging to a first group to samples that are equal to or greater than the Nth threshold value within a luma block. Here, the first group may be composed of reference samples that are equal to or greater than the Nth threshold value. In addition, a prediction sample of a chroma block can be obtained by applying a second parameter derived based on reference samples belonging to a second group to samples that are less than the Nth threshold value within a luma block. Here, the second group may be composed of samples that are less than the Nth threshold value.
[0325] Meanwhile, the plurality of threshold candidates may include at least one of an average value of reference samples within a luma reference region, an average value of reference samples within a luma block, or an average value of restored samples included in the luma reference region and the luma block.
[0326] Meanwhile, in Fig. 23, template candidates applicable to the current block are illustrated as consisting of restoration areas surrounding the current block. Unlike the illustrated example, areas not adjacent to the current block can also be set as templates or template candidates.
[0327] Figure 24 illustrates template candidates for the current block.
[0328] For convenience of explanation, it is assumed that the template candidate illustrated in Fig. 24 is used to derive prediction parameters, and that the parameters derived from the template candidate are applied to a reference area around the current block.
[0329] As in the example illustrated in Figure 24, there may be at least one template candidate consisting of restoration areas that are not adjacent to the current block.
[0330] In Figure 24, 19 template candidates that are not adjacent to the current block are illustrated. Furthermore, the template candidates are illustrated as not overlapping each other. However, the number and configuration of the template candidates are not limited to the illustrated example.
[0331] When there are multiple template candidates, the template candidates may be spaced apart by a predefined interval. For example, multiple template candidates positioned on the same horizontal line may be spaced apart by x_interval in the horizontal direction. Specifically, when the upper left sample of the first template candidate is (x, y), the coordinate of the upper left sample of the second template candidate located to the left of the first template candidate may be (x-x_interval, y), and the coordinate of the upper left sample of the third template candidate located to the right of the first template candidate may be (x+x_interval, y).
[0332] In addition, multiple template candidates placed on the same vertical line may be spaced apart vertically by y_interval. Specifically, when the upper left sample of the first template candidate is (x, y), the coordinates of the upper left sample of the second template candidate located above the first template candidate may be (x, y-y_interval), and the coordinates of the upper left sample of the third template candidate located below the first template candidate may be (x, y+y_interval).
[0333] The position of the template can be derived based on at least one of the size or shape of the current block. For example, when the coordinates of the upper left sample of the current block are (x, y), at least one template candidate that sets the position (x- N * x_interval, y - M * y_interval) as the upper left position can be set. Here, N and M can be natural numbers greater than or equal to 0.
[0334] Meanwhile, at least one of the horizontal offset x_interval and the vertical offset y_interval, which specify the position of the template candidate, may be predefined in the encoder and decoder. Alternatively, at least one of the horizontal offset x_interval and the vertical offset y_interval may be adaptively determined based on at least one of the size or shape of the current block.
[0335] Meanwhile, template candidates belonging to a different processing unit from the current block may not be available for the current block. Here, the processing unit may include at least one of a CTU, a slice, a tile, or a subpicture.
[0336] As in the example illustrated in Fig. 24, there may be empty areas between template candidates that do not belong to any template area. Alternatively, unlike the example illustrated in Fig. 24, template candidates may be adjacent to each other.
[0337] In Fig. 24, areas assigned the same index on the luminance component picture and the chroma component picture are shown to have a mutual correspondence relationship. That is, a template with index N in the luminance component picture exists in the same location as a template with index N in the chroma component picture.
[0338] In Fig. 24, each template candidate is illustrated as having a rectangular shape. Instead of a rectangular shape, the template candidate may be configured to include one of the upper restoration area and the left restoration area, as in the example illustrated in Fig. 23.
[0339] The size of the template can be determined based on the size of the current block. For example, the width of the template can be m times the width of the current block. Additionally, the height of the template can be n times the width of the current block. Here, m and n can be real numbers.
[0340] Alternatively, the size of the templates may be predefined in the encoder and decoder. For example, each template candidate may have a size of 8x8. Alternatively, the size of each template candidate may be set to the minimum size of a block (e.g., CU).
[0341] The number of template candidates may be predefined in the encoder and decoder.
[0342] Alternatively, information indicating the number of template candidates may be encoded and signaled.
[0343] When multiple template candidates are available for the current block, parameters for inter-component prediction can be derived for each of the template candidates. Here, the multiple template candidates may include at least one of an adjacent template candidate adjacent to the current block or a non-adjacent template candidate not adjacent to the current block.
[0344] Subsequently, the derived parameters can be applied to the reference region to obtain predicted values for the reference region. Then, the cost for the template candidate can be calculated based on the difference between the reconstructed samples within the reference region and the predicted samples within the reference region.
[0345] After calculating the cost of each of the multiple template candidates, the template candidate with the lowest cost can be selected to derive the prediction block for the current block. In other words, the prediction block for the chroma block can be derived based on the parameters derived from the template candidate with the lowest cost.
[0346] Alternatively, multiple template candidates can be reordered based on cost. For example, multiple template candidates can be reordered in ascending order of cost. Then, based on index information indicating one of the reordered multiple template candidates, one of the multiple template candidates can be selected, and a prediction block for the chroma block can be derived based on the selected template candidate. Meanwhile, the index information indicating one of the multiple template candidates can be encoded and signaled.
[0347] At this time, only the N template candidates with the lowest cost can be selected from among multiple template candidates. The N template candidates can be reordered according to cost, and one of the N template candidates can be selected based on index information. In this case, the index information can indicate one of the N template candidates.
[0348] The names of the syntaxes used in the above-described embodiments are merely named for convenience of explanation.
[0349] Applying the embodiments described above, focusing on the decoding or encoding process, to the encoding or decoding process is within the scope of the present disclosure. Changing the embodiments described above, in a given order, to a different order is also within the scope of the present disclosure.
[0350] Although the above-described disclosure is described based on a series of steps or a flowchart, this does not limit the chronological order of the invention, and may be performed simultaneously or in a different order as needed. In addition, each component (e.g., unit, module, etc.) constituting the block diagram in the above-described disclosure may be implemented as a hardware device or software, or multiple components may be combined to be implemented as a single hardware device or software. For example, the hardware device may include at least one of a processor for performing calculations, a memory for storing data, a transmitter for transmitting data, and a receiver for receiving data.
[0351] The above-described disclosure may be implemented in the form of program commands that can be executed by various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include program commands, data files, data structures, etc., either singly or in combination.
[0352] In addition, according to the present disclosure, a computer-readable recording medium can be provided that stores a bitstream generated by the above-described encoding method. The bitstream can be transmitted by an encoding device, and a decoding device can receive the bitstream and decode an image.
[0353] Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specifically configured to store and execute program instructions, such as ROMs, RAMs, and flash memories. The hardware devices may be configured to operate as one or more software modules to perform processing according to the present disclosure, and vice versa.
[0354] The present disclosure may be applied to a computing or electronic device capable of encoding / decoding a video signal.
Claims
1. A step of deriving a first parameter for prediction between the first components; A step of deriving a second parameter for prediction between the second components; and A video decoding method, comprising the step of obtaining a prediction block of the chroma block from a luma block corresponding to the chroma block based on at least one of the first parameter or the second parameter.
2. In paragraph 1, An image decoding method, characterized in that either the first inter-component prediction or the second inter-component prediction is an inter-component prediction mode based on linearity, and the other is an inter-component prediction mode based on convolution.
3. In paragraph 1, A video decoding method, characterized in that the prediction block of the chroma block is derived based on a lower cost among the first parameter and the second parameter.
4. In paragraph 3, The cost of the first parameter or the second parameter is, It is obtained based on the difference between the restored sample and the predicted sample within the reference area of the above chroma block, An image decoding method, characterized in that the above prediction sample is obtained by applying the first parameter or the second parameter to a restoration sample within a reference area of the luma block.
5. In paragraph 1, A video decoding method, characterized in that the prediction block of the chroma block is derived based on a first prediction block derived based on the first parameter and a second prediction block derived based on the second parameter.
6. In paragraph 5, The prediction block of the chroma block is obtained based on a weighted sum operation of the first prediction block and the second prediction block, An image decoding method, characterized in that the weights for the above weighted sum operation are determined based on the cost of the first parameter and the cost of the second parameter.
7. In paragraph 1, The above prediction block of the above chroma block is, Applying the first parameter to the first group of restored samples within the luma block, An image decoding method characterized in that it is obtained by applying the second parameter to the second group of restored samples within the luma block.
8. In paragraph 7, An image decoding method characterized in that the restored sample is classified into a first group or a second group based on a result of comparing the value of the restored sample with a threshold value.
9. In paragraph 8, The above threshold value is one of multiple threshold candidates, An image decoding method, characterized in that the threshold candidate having the smallest cost among the plurality of threshold candidates is set as the threshold candidate.
10. In paragraph 8, The first parameter and the second parameter are derived based on the template of the chroma block and the template of the luma block, A method for decoding an image, characterized in that the composition of the templates is based on one of a plurality of template candidates.
11. In paragraph 10, A video decoding method, characterized in that a template candidate having the lowest cost among the plurality of template candidates is used to construct the templates.
12. In paragraph 10, A video decoding method characterized in that the plurality of template candidates are rearranged according to cost, and the templates are configured based on index information indicating one of the rearranged template candidates.
13. In paragraph 10, A video decoding method, characterized in that a predefined number of template candidates having low costs are selected from among the plurality of template candidates, and the templates are configured based on index information indicating one of the selected predefined number of template candidates.
14. A step of deriving a first parameter for prediction between the first components; A step of deriving a second parameter for prediction between the second components; and A video encoding method, comprising the step of obtaining a prediction block of the chroma block from a luma block corresponding to the chroma block based on at least one of the first parameter or the second parameter.
15. A step of deriving a first parameter for prediction between the first components; A step of deriving a second parameter for prediction between the second components; and A computer-readable recording medium storing a bitstream generated by a video encoding method, the method comprising the step of obtaining a prediction block of the chroma block from a luma block corresponding to the chroma block based on at least one of the first parameter and the second parameter.
Citation Information
Patent Citations
A device, a method and a computer readable storage medium for industrial safety management
KR1020240081730A
Device for identifying version of microcontroller unit on printed circuit board
KR1020240126140A
Electric vehicle fire extinguishing apparatus
KR1020240129354A
Polymer NANO composite heat dissipation sheet manufacturing apparatus and method
KR102437605B1
Dispenser nozzle constructs and it's manufacturing method
KR102525972B1
