Image encoding / decoding method and apparatus for transmitting compressed video data

By optimizing the intra prediction mode candidates for chroma blocks in video encoding/decoding, the method addresses the inefficiencies in high-resolution video compression, reducing data volume and associated costs.

WO2025216497A1PCT designated stage Publication Date: 2025-10-16KT CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2025/004620
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-04-02
Filing Date
2025-04-04
Publication Date
2025-10-16

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and high-quality video content, particularly stereoscopic video, leads to higher data volumes, resulting in increased transmission and storage costs due to the inefficiencies of existing image compression technologies.

Method used

A method for determining and rearranging intra prediction mode candidates of a chroma block in video encoding/decoding, utilizing reference samples and index information to optimize the encoding/decoding process.

Benefits of technology

Improves encoding/decoding efficiency by reducing the amount of data to be processed, thereby lowering transmission and storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2025004620_16102025_PF_FP_ABST
    Figure KR2025004620_16102025_PF_FP_ABST
Patent Text Reader

Abstract

An image encoding / decoding method according to the present invention may comprise the steps of: deriving a first parameter for first inter-component prediction; deriving a second parameter for second inter-component prediction; and obtaining, from a luma block corresponding to a chroma block, a prediction block of the chroma block on the basis of at least one of the first parameter and the second parameter.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding / decoding method and device for transmitting compressed video data

[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 for determining an intra prediction mode of a chroma block in encoding / decoding a video signal and a device for performing the same.

[0006] The present disclosure aims to provide a method for rearranging intra prediction mode candidates of a chroma block and determining an intra prediction mode of the chroma block based on the rearranged candidates, and a device for performing the same.

[0007] The present disclosure aims to provide a method for deriving intra prediction mode candidates of a chroma block and a device for performing the same.

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

[0009] A video decoding method according to the present disclosure may include the steps of: determining an intra prediction mode of a current chroma block; deriving reference samples of the current chroma block; and deriving a prediction block of the current chroma block based on the intra prediction mode and the reference samples. The step of determining the intra prediction mode of the current chroma block may include the steps of: deriving intra prediction mode candidates for the current chroma block; and reordering the intra prediction mode candidates. In this case, the intra prediction mode may be determined based on index information indicating one of the reordered intra prediction mode candidates.

[0010] A video encoding method according to the present disclosure may include the steps of: determining an intra prediction mode of a current chroma block; deriving intra prediction mode candidates for the current chroma block; and rearranging the intra prediction mode candidates. At this time, a prediction block of the current chroma block is derived based on the intra prediction mode and reference samples of the current chroma block, and index information indicating an intra prediction mode candidate identical to the intra prediction mode among the rearranged intra prediction mode candidates may be encoded in a bitstream.

[0011] In the image decoding / encoding method according to the present disclosure, the intra prediction mode candidates can be rearranged in ascending order of error.

[0012] In the video decoding / encoding method according to the present disclosure, the error of the intra prediction mode candidate can be derived based on the difference between the prediction value obtained by performing prediction on the template of the current chroma block based on the intra prediction mode candidate and the restored value within the template.

[0013] In the video decoding / encoding method according to the present disclosure, the error of the intra prediction mode candidate can be derived based on the difference between the prediction value obtained by performing prediction on the area corresponding to the current chroma block in the luma picture based on the intra prediction mode candidate and the restoration value in the corresponding area.

[0014] In the image decoding / encoding method according to the present disclosure, the intra prediction mode candidates can be determined by referring to a lookup table that stores a mapping relationship between a luma mode and intra prediction mode candidates.

[0015] In the video decoding / encoding method according to the present disclosure, the luma mode may be an intra prediction mode of a luma block at the same position as the current chroma block in a luma picture.

[0016] In the video decoding / encoding method according to the present disclosure, when a plurality of luma blocks are included in an area corresponding to the current chroma block in the luma picture, a luma block including a predefined position among the plurality of luma blocks can be determined as the same-position luma block.

[0017] In the video decoding / encoding method according to the present disclosure, at least one of the intra prediction mode candidates may be derived from a neighboring block adjacent to the current chroma block.

[0018] In the video decoding / encoding method according to the present disclosure, at least one of the intra prediction mode candidates may be derived from a luma block belonging to an area corresponding to the current chroma block in a luma picture.

[0019] In the video decoding / encoding method according to the present disclosure, at least one of the intra prediction mode candidates may be a default intra prediction mode.

[0020] In the video decoding / encoding method according to the present disclosure, when the number of derived intra prediction mode candidates is less than a threshold, the default intra prediction mode can be set as the intra prediction mode candidate.

[0021] In the video decoding / encoding method according to the present disclosure, at least one of the intra prediction mode candidates is excluded from the reordering target, and the intra prediction mode candidate excluded from the reordering target may be assigned a smallest index or a largest index.

[0022] In the image decoding / encoding method according to the present disclosure, the intra prediction mode candidate excluded from the reordering target may be DM (Direct Mode).

[0023] According to the present disclosure, a computer-readable recording medium having recorded thereon a command for storing / transmitting a bitstream generated by an image encoding method can be provided.

[0024] According to the present disclosure, a computer-readable recording medium having recorded thereon a command for performing an image decoding method or an image encoding method can be provided.

[0025] The features briefly summarized above regarding the present disclosure are merely exemplary aspects of the detailed description of the present disclosure that follows and do not limit the scope of the present disclosure.

[0026] According to the present disclosure, encoding / decoding efficiency can be improved by providing a method for determining an intra prediction mode of an improved chroma block.

[0027] According to the present disclosure, the amount of data to be encoded / decoded can be reduced by rearranging intra prediction mode candidates of a chroma block and encoding / decoding index information for the chroma block based on the rearranged candidates.

[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 is a diagram illustrating a surrounding restoration area referenced for rearranging intra prediction modes.

[0045] FIG. 21 is a diagram illustrating an example of rearranging intra prediction mode candidates with reference to the same location luma block.

[0046] Figure 22 is a diagram illustrating an example of deriving an intra prediction mode candidate of the current chroma block.

[0047] The present disclosure may be modified in various ways and encompasses numerous 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 disclosure to specific embodiments, but rather to encompass all modifications, equivalents, and alternatives falling within the spirit and technical scope of the present disclosure. Similar reference numerals have been used to designate similar components throughout the description of each drawing.

[0048] 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 disclosure, a first component could be referred to as a "second component," and similarly, a second component could 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.

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

[0050] The terminology used in this application is only used to describe specific embodiments and is not intended to limit the present disclosure. 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 preclude the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0051] Hereinafter, preferred embodiments of the present disclosure will be described in more detail with reference to the attached drawings. Hereinafter, identical components in the drawings will be designated by the same reference numerals, and redundant descriptions of identical components will be omitted.

[0052] FIG. 1 is a block diagram illustrating an image encoding device according to an embodiment of the present disclosure.

[0053] 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).

[0054] Each component shown in Fig. 1 is independently depicted to represent 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 disclosure as long as they do not deviate from the essence of the present disclosure.

[0055] Additionally, some components may not be essential components that perform the essential functions of the present disclosure, but may be optional components merely used to enhance performance. The present disclosure may be implemented by including only components essential to implementing the essence of the present disclosure, 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 disclosure.

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

[0057] For example, a picture can be split into multiple coding units. A recursive tree structure such as a quad tree, a ternary tree, or a binary tree 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. For example, assuming that a quad tree split is applied to a coding unit, a coding unit can be split into at most four different coding units.

[0058] Hereinafter, in the embodiments of the present disclosure, the encoding unit may be used to mean a unit that performs encoding or may be used to mean a unit that performs decoding.

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

[0060] When predicting within a screen, the transformation unit and the prediction unit can be set to be the same. In this case, the encoding unit can be divided into multiple transformation units, and then intra-screen prediction can be performed for each transformation unit. The encoding unit can be divided in the horizontal direction or the vertical direction. The number of transformation units generated by dividing the encoding unit can be 2 or 4, depending on the size of the encoding unit. Alternatively, when the size of the transformation unit is small, multiple transformation units can be set as a single prediction unit.

[0061] 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 an encoding unit, and specific information (e.g., reference sample line, 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, etc. are determined in the encoding unit, and the prediction may be performed in the prediction unit or 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).

[0062] The inter-screen 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-screen prediction unit (120) may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

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

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

[0065] The on-screen prediction unit (125) can generate a prediction block based on reference pixel information, which is pixel information within the current picture. The reference pixel information can be derived from one selected from among a plurality of reference pixel lines. The Nth reference pixel line among the plurality of reference pixel lines can include left pixels having an x-axis difference of N from the upper left pixel within the current block and upper pixels having a y-axis difference of N from the upper left pixel. The number of reference pixel lines that the current block can select can be 1, 2, 3, or 4.

[0066] If the neighboring blocks of the current prediction unit are blocks that have performed inter-screen prediction and the reference pixel is a pixel that has performed inter-screen prediction, the reference pixel included in the block that has performed inter-screen prediction can be replaced with the reference pixel information of the neighboring block that has performed intra-screen prediction. That is, if the reference pixel is unavailable, the unavailable reference pixel information can be replaced with information from at least one of the available reference pixels.

[0067] In intra-screen 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-screen prediction mode information used to predict luminance information or the predicted luminance signal information can be utilized to predict chrominance information.

[0068] When performing intra-screen prediction, if the size of the prediction unit and the size of the transformation unit are the same, intra-screen prediction for the prediction unit can be 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.

[0069] The on-screen prediction method can generate prediction blocks by applying a smoothing filter to reference pixels according to the prediction mode. Depending on the selected reference pixel line, whether or not the smoothing filter is applied can be determined.

[0070] In order to perform an intra-screen prediction method, the intra-screen prediction mode of the current prediction unit can be predicted from the intra-screen prediction modes of prediction units existing around the current prediction unit. When the prediction mode of the current prediction unit is predicted using mode information predicted from the surrounding prediction units, if the intra-screen 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 at least one of the size of the transformation unit, the shape of the transformation unit, the prediction mode of the prediction unit, or the prediction mode information within the screen of the prediction unit. Meanwhile, the transformation can be performed by separating the horizontal direction and the vertical direction.

[0073] After performing transformations in the horizontal and vertical directions, a secondary transformation can be performed. The secondary transformation may be in a form in which the horizontal and vertical directions are not separated. The secondary transformation can be performed on the transformation coefficients obtained by the primary transformation to generate final transformation coefficients. Meanwhile, the number of final transformation coefficients output by the secondary transformation may be smaller than the number of transformation coefficients input for the secondary transformation. Specifically, the secondary transformation can be performed using a reduced transformation matrix having different numbers of columns and rows.

[0074] 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).

[0075] The rearrangement unit (160) can perform rearrangement of coefficient values ​​for quantized residual values.

[0076] The reordering unit (160) can change a two-dimensional block-shaped coefficient into a one-dimensional vector form through a coefficient scanning method. For example, the reordering 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 conversion unit and the intra-screen prediction mode, a vertical scan that scans the two-dimensional block-shaped coefficient in the column direction, a horizontal scan that scans the two-dimensional block-shaped coefficient in the row direction, or a diagonal scan that scans the two-dimensional block-shaped coefficient in the diagonal direction may be used instead of the zig-zag scan. That is, depending on the size of the conversion unit and the intra-screen prediction mode, it is possible to determine which scan method among the zig-zag scan, the vertical scan, the horizontal scan, or the diagonal scan is to be used.

[0077] 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).

[0078] The entropy encoding unit (165) can encode various information such as residual value coefficient information of the 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).

[0079] The entropy encoding unit (165) can entropy encode the coefficient values ​​of the encoding unit input from the rearrangement unit (160).

[0080] 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-screen prediction unit included in the prediction unit (120, 125) to generate a reconstructed block.

[0081] The filter unit (150) may include at least one of a deblocking filter, an offset correction unit, and an ALF (Adaptive Loop Filter).

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

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

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

[0085] The memory (155) can store a restoration block or picture produced through the filter unit (150), and the stored restoration block or picture can be provided to the prediction unit (120, 125) when performing inter-screen prediction.

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

[0087]

[0088] *Referring to FIG. 92, 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).

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

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

[0091] The entropy decoding unit (210) can decode information related to intra-screen prediction and inter-screen prediction performed in the encoding device.

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

[0093] The dequantization unit (220) can perform dequantization based on the quantization parameters provided from the encoding device and the coefficient values ​​of the rearranged block.

[0094] The inverse transform unit (225) can perform an inverse transform of the transform performed by the transform unit on the quantization result performed by the image encoding device. That is, at least one of an inverse transform of a secondary transform (secondary inverse transform) or an inverse transform for DCT, DST, and KLT (i.e., first inverse transform) can be performed. The inverse transform can be performed based on a transmission unit determined by the image encoding device. The inverse transform unit (225) of the image decoding device can determine a transform matrix for the second inverse transform or a transform technique (e.g., DCT, DST, KLT) for the first inverse transform according to a plurality of pieces of information such as a prediction method, the size and shape of the current block, the prediction mode, and the prediction direction within the screen. Alternatively, information for determining the transform matrix or the transform technique may be explicitly encoded and signaled.

[0095] The prediction unit (230, 235) can generate a prediction block based on prediction block generation related information provided from the entropy decoding unit (210) and previously decoded block or picture information provided from the memory (245).

[0096] As described above, when performing intra-screen 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-screen 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-screen prediction, if the size of the prediction unit and the size of the transformation unit are different, intra-screen prediction can be performed using reference pixels based on the transformation unit. In addition, intra-screen prediction using NxN division only for the minimum coding unit can be used.

[0097] The prediction unit (230, 235) may include a prediction unit determination unit, an inter-screen prediction unit, and an intra-screen 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-screen prediction method, and motion prediction-related information of an inter-screen prediction method, and may distinguish a prediction unit from a current encoding unit and determine whether the prediction unit performs inter-screen prediction or intra-screen prediction. The inter-screen prediction unit (230) may perform inter-screen 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-screen prediction of the current prediction unit provided from the video encoding device. Alternatively, inter-screen prediction may be performed based on information on a pre-restored portion of the current picture including the current prediction unit.

[0098] In order to perform inter-screen 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-screen Block Copy Mode based on the encoding unit.

[0099] The intra-screen prediction unit (235) can generate a prediction block based on pixel information within the current picture. If the prediction unit is a prediction unit that has performed intra-screen prediction, intra-screen prediction can be performed based on intra-screen prediction mode information of the prediction unit provided by the video encoding device. The intra-screen 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 video 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.

[0100] The reference pixel interpolation unit can generate a reference pixel of a pixel unit less than an integer value by interpolating the reference pixel when the prediction mode of the prediction unit is a prediction unit that performs intra-screen prediction based on the pixel value interpolated from the reference pixel. If 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.

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

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

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

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

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

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

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

[0108] FIG. 3 illustrates an image encoding / decoding method performed by an image encoding / decoding device according to the present disclosure.

[0109] Referring to FIG. 3, a reference line for intra prediction of the current block can be determined (S300).

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

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

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

[0113] Referring to FIG. 3, the intra prediction mode of the current block can be determined (S310).

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

[0115] FIG. 4 illustrates an example of multiple intra prediction modes according to the present disclosure.

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

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

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

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

[0120] 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

[0121] 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.The intra prediction mode indicated by the signaled index can be set as the intra prediction mode of the current block.

[0122] The intra prediction mode of a chroma block can be selected from among 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 can be explicitly encoded and signaled through the bitstream. Table 2 illustrates intra prediction mode candidates of the chroma block.

[0123] 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

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

[0125] 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).

[0126] 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 the reference line of the current block, in which case step S310 may be performed before step S300.

[0127] Meanwhile, in the present disclosure, a chroma block may represent at least one of a Cb component block or a Cr component block.

[0128] 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).

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

[0130] FIG. 6 illustrates an intra prediction method based on a planar mode according to the present disclosure.

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

[0132]

[0133] 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 α.

[0134] FIG. 7 illustrates an intra prediction method based on DC mode according to the present disclosure.

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

[0136] FIG. 8 illustrates an intra prediction method based on a directional mode according to the present disclosure.

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

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

[0139] Figure 9 illustrates a method for deriving samples of fractional positions.

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

[0141] The variable w can be derived as shown in the following mathematical expression 2.

[0142]

[0143] Afterwards, by removing the integer position from the variable w, the fractional position can be finally derived.

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

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

[0146] 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).

[0147] Figures 10 and 11 illustrate that the tangent value for the angle is scaled by a factor of 32 for each intra prediction mode.

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

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

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

[0151] Figure 12 is a diagram illustrating an intra prediction aspect when the directional mode is one of modes 34 to 49.

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

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

[0154] Figure 13 is a drawing for explaining an example of generating an upper reference sample by interpolating left reference samples.

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

[0156] The variable h can be derived as shown in the following mathematical expression 3.

[0157]

[0158] Afterwards, by removing the integer position from the variable h, the fractional position can be finally derived.

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

[0160] When the scaling factor f1 is applied, Equation 3 can be transformed into Equation 4 below.

[0161]

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

[0163] Figure 14 shows an example in which intra prediction is performed using reference samples arranged in a 1D array.

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

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

[0166] 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).

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

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

[0169] Figure 15 is a flowchart illustrating a method for predicting a chroma block using a restored luma block.

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

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

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

[0173] If the video format is not 4:4:4, the luma block is downsampled to the same size as the chroma block.

[0174] Figures 16 to 18 illustrate examples of downsampling a luma block.

[0175] For convenience of explanation, the video format is assumed to be 4:2:0.

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

[0177]

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

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

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

[0181] The shape of the filter may be predefined in the encoder and decoder.

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

[0183] Alternatively, information indicating one of multiple filter candidates may be encoded and signaled.

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

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

[0186] The application position of the downsampling filter can also be set differently from that shown in Fig. 17.

[0187] Figure 18 shows various examples of application locations of the downsampling filter.

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

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

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

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

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

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

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

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

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

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

[0198] Meanwhile, the location where downsampling is applied within the reference region may be predefined in the encoder and decoder.

[0199] As another example, the decoder may itself determine where in the reference region downsampling is applied, in the same way as the encoder.

[0200] Figure 19 is a drawing for explaining an example related to the location where down sampling is applied.

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

[0202] 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).

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

[0204] 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).

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

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

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

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

[0209]

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

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

[0212]

[0213]

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

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

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

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

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

[0219]

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

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

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

[0223] In the above example, it is exemplified that the intra-screen prediction mode (hereinafter referred to as the chroma mode) of a chroma block is determined using a table predefined in the encoder and decoder. That is, as in the example of Table 2, it is exemplified that the intra-prediction mode corresponding to the index information for the chroma block is determined as the chroma mode by referring to the luma mode.

[0224] Meanwhile, depending on the luma mode, intra prediction modes applicable to chroma blocks can be referred to as intra prediction mode candidates. That is, the chroma mode can be set to be identical to the intra prediction mode candidate indicated by the index information among multiple intra prediction mode candidates.

[0225] The indices assigned to intra prediction mode candidates may be predefined in the encoder and decoder. At this time, the indices assigned to intra prediction mode candidates may be modified to derive chroma modes. For example, the intra prediction mode candidates sorted according to Table 2 may be reordered according to a predetermined criterion. Accordingly, the indices assigned to intra prediction mode candidates may differ from those in Table 2.

[0226] Meanwhile, the reordering of intra prediction mode candidates can be performed with reference to the restoration region existing around the chroma block.

[0227] Figure 20 is a diagram illustrating a surrounding restoration area referenced for rearranging intra prediction modes.

[0228] A template can be set based on a restoration area around a chroma block. The template may include restoration samples restored before the chroma block. The template may include at least one of an upper template composed of restoration samples positioned at the upper end of the chroma block, a left template composed of restoration samples positioned to the left of the current chroma block, or an upper-left template composed of restoration samples positioned at the upper left end of the chroma block. The chroma block to be currently encoded / decoded is referred to as the current chroma block, and the template of the current chroma block is referred to as the current template.

[0229] In Fig. 20, the current template is illustrated as including an upper restoration region (i.e., the upper template) and a left restoration region (i.e., the left template). Unlike the illustrated example, the current template can be configured to include only the upper restoration region of the current chroma block, or only the left restoration region. Alternatively, the template can be configured to include an upper restoration region, a left restoration region, and an upper-left restoration region.

[0230] Referring to Table 2, when the intra prediction mode (i.e., luma mode) used in the luma block is 0, intra prediction mode candidates applicable to the current chroma block may include mode 66 (when the index is 0), mode 50 (when the index is 1), mode 18 (when the index is 2), mode 1 (when the index is 3), and luma mode (when the index is 4).

[0231] Based on each intra prediction mode candidate applicable to the current chroma block, intra prediction can be performed on the current template. At this time, to perform intra prediction on the current template, reconstructed samples adjacent to the current template can be set as reference samples. Specifically, as in the example illustrated in FIG. 20, reconstructed samples belonging to the sample line adjacent to the top of the upper template and the sample line adjacent to the left of the left template can be set as reference samples.

[0232] Based on the results of prediction performed on the current template, the cost of an intra prediction mode candidate can be calculated. Specifically, the cost of an intra prediction mode candidate can be calculated based on the difference between the reconstructed sample and the predicted sample within the current template. For example, the cost may represent the Sum of Absolute Difference (SAD) or Mean Removed SAD (MRSAD). After calculating the cost for each intra prediction mode candidate, the intra prediction mode candidates can be reordered according to the cost. Through the reordering, the index assigned to each intra prediction mode candidate can be determined. For example, the candidate with the lowest cost may be assigned the smallest index, and the index with the highest cost may be assigned the largest index.

[0233] For example, if the results of sorting the intra prediction mode candidates in ascending order of cost are mode 1, luma mode (i.e., DM mode), mode 66, mode 50, and mode 18, the indices of the intra prediction mode candidates can be changed as shown in Table 3 below.

[0234] Intra prediction mode candidate for chroma block before change (luma mode 0) After change index 0662150321843104DM1

[0235] The index information of the current chroma block can indicate the index of one of the intra prediction mode candidates to which the index is reallocated (i.e., the index after the change).

[0236] Intra prediction mode candidates can also be rearranged by referencing the luma block in the same location as the current chroma block.

[0237] FIG. 21 is a diagram illustrating an example of rearranging intra prediction mode candidates with reference to the same location luma block.

[0238] When a dual tree structure is applied between a chroma block and a luma block, multiple luma blocks may exist within an area corresponding to a chroma block within a luma picture.

[0239] For example, in the example illustrated in FIG. 21, a coding block including an area corresponding to the current chroma block in a luma picture is QT-segmented, and then vertical BT segmentation is additionally applied to the two coding blocks on the left, which are child nodes of the coding block.

[0240] That is, the area corresponding to the current chroma block in the luma picture is exemplified as containing four luma blocks.

[0241] When a plurality of luma blocks are included in an area corresponding to a current chroma block in a luma picture (hereinafter, referred to as a corresponding area), the intra prediction mode of a luma block at a predefined position among the plurality of luma blocks is set to the 'luma mode' of Table 2, thereby deriving intra prediction mode candidates that can be applied to the current chroma block. Here, the predefined position may include at least one of a center position, an upper left position, an upper right position, a lower right position, or a lower left position within the corresponding area. When the predefined position is assumed to be a center position, intra prediction mode candidates of the current chroma block can be deriving based on the intra prediction mode of a luma block including a sample at a center position within the corresponding area.

[0242] Meanwhile, if the luma block containing the predefined position does not have an intra prediction mode stored (e.g., if the luma block is not encoded in an intra mode), the intra prediction mode of a neighboring luma block adjacent to the luma block may be set to 'luma mode'. Here, the neighboring luma block may be adjacent to the top or left of the luma block containing the predefined position.

[0243] Alternatively, if the intra prediction mode is not stored in the luma block including the predefined position, the intra prediction mode of the luma block including a position different from the predefined position may be set to 'luma mode'. For example, the center position, the upper left position, the upper right position, the lower right position, and the lower left position within the corresponding area may be sequentially searched in a predefined order, and the first searched available intra prediction mode may be set to 'luma mode'.

[0244] Alternatively, if the luma block containing the predefined position does not have an intra prediction mode stored, the default mode can be set to 'luma mode'. The default mode can be a planar mode, a DC mode, or a predefined directional prediction mode.

[0245] Alternatively, if there are multiple luma blocks within the corresponding area, the intra prediction mode with the highest frequency for the multiple luma blocks can be set to 'luma mode'.

[0246] Alternatively, if multiple luma blocks exist within a corresponding region, the cost for the intra prediction mode of a block encoded using intra prediction can be calculated. Here, the cost can be derived based on the difference between the reconstructed and predicted samples within the luma block. The intra prediction mode with the lowest cost can then be set as the "luma mode."

[0247] Once intra prediction mode candidates for the current chroma block are derived based on the luma mode, intra prediction can be performed for a corresponding region within the luma picture based on each intra prediction mode candidate. Referring to the example illustrated in Fig. 21, intra prediction can be performed for a region including four luma blocks based on the intra prediction mode candidates of the current chroma block.

[0248] Thereafter, based on the intra prediction results for the corresponding region, the cost of the intra prediction mode candidate can be calculated. Specifically, the cost of the intra prediction mode candidate can be calculated based on the difference between the reconstructed sample and the predicted sample within the corresponding region.

[0249] After calculating the cost for each intra prediction mode candidate, the intra prediction mode candidates can be reordered based on cost. This reordering can determine the index assigned to each intra prediction mode candidate. For example, the candidate with the lowest cost can be assigned the smallest index, and the index with the highest cost can be assigned the largest index.

[0250] Meanwhile, in deriving the cost of each intra prediction mode candidate, it is possible to consider whether two chroma components (i.e., Cb component and Cr component) share an intra prediction mode.

[0251] For example, if the Cb component block and the Cr component block do not share an intra prediction mode, the costs of the intra prediction mode candidates can be independently calculated for each of the Cb component block and the Cr component block. That is, the costs of the intra prediction mode candidates for the Cb component block can be obtained based on templates adjacent to the Cb component block, and the costs of the intra prediction mode candidates for the Cr component block can be obtained based on templates adjacent to the Cr component block.

[0252] Meanwhile, even if it is determined that the Cb component block and the Cr component block do not share an intra prediction mode, the intra prediction modes of the Cb component block and the Cr component block may have the same value depending on the index information or acquired cost of each component.

[0253] Alternatively, if the Cb component block and the Cr component block do not share an intra prediction mode, the intra prediction mode used in the Cb component block may be set to be unavailable as an intra prediction mode of the Cr component block. In this case, the cost may be calculated only for the remaining intra prediction mode candidates, excluding the candidate used as the intra prediction mode of the Cb component block among the intra prediction mode candidates of the Cr component block. In addition, the index information of the Cr component block may indicate one of the remaining intra prediction mode candidates.

[0254] Alternatively, when encoding / decoding is performed in the order of the Cr component block and the Cb component block, the intra prediction mode used in the Cr component block may be set to be unavailable as the intra prediction mode of the Cb component block.

[0255] Alternatively, information indicating whether the Cb component and the Cr component share an intra prediction mode can be encoded and signaled.

[0256] Alternatively, whether the Cb component and the Cr component share an intra prediction mode may be predefined in the encoder and decoder. For example, the encoder and decoder may always be configured to share an intra prediction mode with the Cb component and the Cr component. Or, conversely, the encoder and decoder may be configured to not share an intra prediction mode with the Cb component and the Cr component.

[0257] Meanwhile, when color components are encoded / decoded according to the pre-restored order, the cost of the pre-restored component and the template cost of the component to be currently encoded / decoded can be weighted to produce the Bing of the intra prediction mode candidate.

[0258] For example, it is assumed that encoding / decoding is performed in the order of luma component, Cb component, and Cr component. If the current encoding / decoding target component is the Cb component, the cost of the luma component can be referenced, and if the current encoding / decoding target component is the Cr component, at least one of the cost of the luma component or the cost of the Cb component can be referenced. For convenience of explanation, it is assumed that the encoding / decoding target component is the Cb component.

[0259] The cost of the intra prediction mode candidate of the Cb component block can be derived by weighting the cost CostY derived from the luma component block and the cost CostCb derived from the template of the Cb component block, thereby deriving the final cost C for the intra prediction mode candidate.

[0260] That is, the final cost C of the intra prediction mode can be derived as shown in the following mathematical expression 10.

[0261]

[0262] In the above mathematical expression 10, WY and WCb represent weights applied to the cost CostY derived from the luma component block and weights applied to the cost CostCb derived from the template of the Cb component block, respectively.

[0263] The weights WY and WCb may be predefined in the encoder and decoder.

[0264] Alternatively, the weights WY and WCb may be one of the pairs predefined in the encoder and decoder. For example, WY: WCb may be 12:1, 10:1, 8:1, 6:1, or 4:1.

[0265] Afterwards, for the Cb component block, the intra prediction mode candidates are reordered in cost order, and the intra prediction mode of the Cb component block can be derived from the reordered intra prediction mode candidates.

[0266] If the current encoding / decoding target component is the Cr component, as described above, the cost of the intra prediction mode candidates can be derived by referring to the cost of the luma component or the Cb component. For example, if the current encoding / decoding target component is the Cr component and is set to refer to the luma component, in Equation 10, the cost CostCb derived from the template of the Cb component block can be replaced with the cost CostCr derived from the template of the Cr component block. In addition, WCb is changed to WCr. Here, WCr represents a weight applied to the cost CostCr derived from the template of the Cr component block.

[0267] Alternatively, if the current encoding / decoding target component is a Cr component and is set to refer to a Cb component, in Equation 10, the cost CostY derived from the luma component block can be replaced with the cost CostCb' derived from the Cb component block. Meanwhile, the cost CostCb' derived from the Cb component block may be derived based on the intra prediction result for the Cb component block, or may be derived based on the intra prediction result for a template adjacent to the Cb component block.

[0268] Meanwhile, the cost CostCb' of the Cb component block can be derived based on the determined intra mode of the Cb component block. Alternatively, the cost CostCb' of the Cb component block can be derived based on the intra prediction mode candidate of the Cr component block.

[0269] Accordingly, for the Cr component block, the cost of each intra prediction mode candidate can be calculated.

[0270] Meanwhile, the cost CostY of the luma component block can be derived based on the differential value between the reconstructed sample and the predicted sample within the luma component block. Specifically, when the target component to be encoded / decoded is Cb, prediction is performed on the luma component block based on the intra-screen prediction mode candidate of the Cb component block, and then the reconstructed block and predicted block of the luma component block are differentiated to derive the cost CostY of the luma component block.

[0271] Alternatively, we can derive the cost CostY of the luma component block using the 'Luma Mode'.

[0272] When the Cb component block and the Cr component block share a single intra prediction mode, a template cost is derived for each of the Cb component block and the Cr component block, and the final cost is derived through a weighted sum of the two costs. For example, if the template cost of the Cb component block is CostCb and the template cost of the Cr component block is CostCr, the cost C of the intra prediction mode candidate can be derived as in the following mathematical expression 11.

[0273]

[0274] In the above mathematical expression 10, WCb and WCr represent the weights applied to the cost CostCb derived from the template of the Cb component block and the weights applied to the cost CostCr derived from the template of the Cr component block, respectively. At this time, the values ​​of WCb and WCr may be the same. For example, WCb:WCr may be 1:1.

[0275] Mathematical expression 11 can also be transformed into the following mathematical expression 12.

[0276]

[0277] That is, when calculating the cost of an intra prediction mode candidate, in addition to the cost CostCb derived from the template of the Cb component block and the cost CostCr derived from the template of the Cr component block, the cost CostY derived from the luma component block can also be additionally used. At this time, WY:WCb:WCr can be set to 12:1:1, 10:1:1, 8:1:1, 6:1:1, or 4:1:1.

[0278] As described above, the cost CostY of a luma component block may be derived based on the luma mode, or may be derived based on the intra prediction mode candidates of the chroma component block.

[0279] Afterwards, intra prediction mode candidates for chroma components (Cb component and Cr component) can be reordered according to cost.

[0280] Meanwhile, in the above-described embodiments, it has been exemplified that reordering is performed on all intra prediction mode candidates of the current chroma block. As another example, predefined candidates among the intra prediction mode candidates of the current chroma block may be excluded from the reordering target.

[0281] For example, the luma mode (i.e., DM mode) can be excluded from the reordering. In this case, the cost calculation process for the luma mode is omitted, and costs can be calculated only for the remaining intra prediction mode candidates.

[0282] Candidates excluded from the reordering can be assigned a predefined index. For example, the index of a candidate excluded from the reordering can be set to the smallest or largest value.

[0283] In the above example, it is illustrated that the intra prediction mode candidates available for the current chroma block are determined based on a lookup table defining the mapping relationship between the luma mode and the chroma mode. The lookup table may be predefined / stored in the encoder and decoder.

[0284] Meanwhile, instead of deriving intra prediction mode candidates of the current chroma block based on a lookup table, intra prediction mode candidates of the current chroma block may be derived based on at least one of a spatial neighboring block of the current chroma block, a luma block existing in a corresponding region, or a spatial neighboring block of a luma block existing in a corresponding region.

[0285] Figure 22 is a diagram illustrating an example of deriving an intra prediction mode candidate of the current chroma block.

[0286] The intra prediction mode of at least one neighboring block adjacent to the current chroma block can be set as an intra prediction mode candidate of the current chroma block. Here, the at least one neighboring block can include at least one of a left neighboring block including a position (d) adjacent to the left of the current chroma block, an upper neighboring block including a position (b) adjacent to the top of the current chroma block, a lower left neighboring block including a position (e) adjacent to the lower left corner of the current chroma block, an upper right neighboring block including a position (c) adjacent to the upper right corner of the current chroma block, or an upper left neighboring block including a position (a) adjacent to the upper left corner of the current chroma block.

[0287] The intra prediction mode of at least one luma block belonging to an area corresponding to the current chroma block in the luma picture can be set as an intra prediction mode candidate of the current chroma block.

[0288] Here, intra prediction mode candidates for the current chroma block can be derived from all luma blocks belonging to the corresponding region.

[0289] Alternatively, the intra prediction mode candidate of the current chroma block may be derived from at least one luma block including a predefined position. For example, the at least one luma block may include at least one of a luma block including a central position (C) within the corresponding region, a luma block including an upper-left position (A) within the corresponding region, a luma block including an upper-right position (B) within the corresponding region, a luma block including a lower-left position (D) within the corresponding block, or a luma block including a lower-right position (E) within the corresponding block.

[0290] Intra prediction mode candidates of the current chroma block can be derived from at least one neighboring block adjacent to the current chroma block or at least one luma block within a corresponding region.

[0291] Specifically, following the example illustrated in FIG. 22, up to five intra prediction mode candidates can be derived from at least one neighboring block adjacent to the current chroma block, and up to five intra prediction mode candidates can be derived from at least one luma block within the corresponding region.

[0292] The derived intra prediction mode candidates can be inserted into a candidate list. A maximum of N intra prediction mode candidates can be inserted into the candidate list. Here, N can be a natural number greater than or equal to 2, and for example, 10.

[0293] Intra prediction mode candidates can be inserted into a candidate list in a predefined order. The index assigned to each intra prediction mode candidate can be determined based on the order in which they are inserted into the candidate list. For example, the lowest index (i.e., 0) can be assigned to the intra prediction mode candidate inserted first into the candidate list, and the highest index (i.e., N-1) can be assigned to the intra prediction mode candidate inserted last into the candidate list.

[0294] Meanwhile, when inserting intra prediction mode candidates into a candidate list, a redundancy check can be performed. That is, if an intra prediction mode candidate identical to the intra prediction mode candidate to be inserted exists in the candidate list, the candidate may not be inserted into the candidate list.

[0295] If an intra prediction mode candidate identical to the intra prediction mode candidate to be inserted exists in the candidate list, the index of the candidate already in the candidate list can be adjusted to a smaller value without inserting the candidate into the candidate list. Accordingly, the higher the frequency of the intra prediction mode, the smaller the index assigned.

[0296] That is, the index assigned to each intra prediction mode candidate in the candidate list can be determined based on at least one of the insertion order and the occurrence frequency.

[0297] If there is no default mode among the intra prediction mode candidates derived from at least one neighboring block adjacent to the current chroma block and / or at least one luma block included in the corresponding region, the default mode may be inserted into the candidate list as an intra prediction mode candidate. For example, the default mode may include at least one of a Planar, a DC, a vertical mode, a horizontal mode, a top-left diagonal mode, a top-right diagonal mode, or a bottom-left diagonal mode.

[0298] Meanwhile, in the above-described example, it is illustrated that the intra prediction mode is derived from at least one neighboring block adjacent to the current chroma block and at least one luma block belonging to the corresponding region.

[0299] Unlike the above, the candidate list may be constructed using only at least one neighboring block adjacent to the current chroma block, or only at least one luma block belonging to the corresponding region.

[0300] Alternatively, if the number of intra prediction mode candidates derived based on at least one neighboring block adjacent to the current chroma block does not reach the maximum, an intra prediction mode candidate may be additionally derived from at least one luma block belonging to the corresponding region.

[0301] Conversely, if the number of intra prediction mode candidates derived based on at least one luma block belonging to the corresponding region does not reach the maximum, an intra prediction mode candidate may be additionally derived from at least one neighboring block adjacent to the current chroma block.

[0302] Although not shown, an intra prediction mode candidate may also be derived from at least one luma neighboring block adjacent to the corresponding region. The at least one luma neighboring block may include at least one of a left neighboring block, an upper neighboring block, a lower-left neighboring block, an upper-right neighboring block, or an upper-left neighboring block of the corresponding region.

[0303] Alternatively, depending on the tree structure, it may be determined whether to derive an intra prediction mode candidate from at least one luma neighboring block. For example, if a dual tree structure is applied between a luma block and a chroma block, at least one luma neighboring block may not be used when deriving an intra prediction mode candidate. On the other hand, if a single tree structure is applied between a luma block and a chroma block, at least one luma neighboring block may be used when deriving an intra prediction mode candidate.

[0304] Alternatively, if the number of intra prediction mode candidates included in the candidate list does not reach the maximum, the intra prediction mode candidate may be derived from at least one luma neighboring block.

[0305] Alternatively, intra prediction mode candidates can be derived from a buffer that accumulates and stores intra prediction modes of blocks encoded / decoded before the current chroma block. That is, if the number of intra prediction mode candidates included in the candidate list does not reach the maximum, the intra prediction mode candidates stored in the buffer can be inserted into the candidate list.

[0306] Using the candidate list, the intra prediction mode of the current chroma block can be determined. Specifically, the intra prediction mode of the current chroma block can be determined based on index information indicating one of the intra prediction mode candidates included in the candidate list.

[0307] Alternatively, reordering can be performed on the intra prediction mode candidates included in the candidate list. As described above, reordering can be based on the cost calculated by performing intra prediction on the current template or the cost calculated by performing intra prediction on the corresponding region. Since embodiments related to reordering have been described above, a detailed description is omitted in this embodiment.

[0308] Thereafter, the intra prediction mode of the current chroma block can be determined based on an index indicating one of the rearranged intra prediction mode candidates.

[0309]

[0310] The names of the syntaxes used in the above-described embodiments are merely named for convenience of explanation.

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

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

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

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

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

[0316] The present disclosure may be applied to a computing or electronic device capable of encoding / decoding a video signal.

Claims

1. A step of determining the intra prediction mode of the current chroma block; a step of deriving reference samples of the current chroma block; and A step of deriving a prediction block of the current chroma block based on the intra prediction mode and the reference samples, The step of determining the intra prediction mode of the current chroma block is: A step of deriving intra prediction mode candidates for the current chroma block; and comprising a step of rearranging the intra prediction mode candidates, A video decoding method, characterized in that the intra prediction mode is determined based on index information indicating one of the rearranged intra prediction mode candidates.

2. In paragraph 1, A video decoding method, characterized in that the intra prediction mode candidates are reordered in ascending order of error.

3. In paragraph 2, The error of the intra prediction mode candidate is, A video decoding method characterized in that the method is derived based on the difference between a prediction value obtained by performing prediction on a template of the current chroma block based on the intra prediction mode candidate and a restoration value within the template.

4. In paragraph 2, The error of the intra prediction mode candidate is, A video decoding method characterized in that the method is derived based on the difference between a prediction value obtained by performing prediction on an area corresponding to the current chroma block in a luma picture based on the intra prediction mode candidate and a restoration value in the corresponding area.

5. In paragraph 1, An image decoding method, characterized in that the intra prediction mode candidates are determined by referring to a lookup table that stores a mapping relationship between a luma mode and intra prediction mode candidates.

6. In paragraph 5, A video decoding method, characterized in that the above luma mode is an intra prediction mode of a luma block in the same position as the current chroma block in a luma picture.

7. In paragraph 6, A video decoding method, characterized in that, when a plurality of luma blocks are included in an area corresponding to the current chroma block in the luma picture, a luma block including a predefined position among the plurality of luma blocks is determined as the same-position luma block.

8. In paragraph 1, A video decoding method, wherein at least one of the intra prediction mode candidates is derived from a neighboring block adjacent to the current chroma block.

9. In paragraph 1, A method for decoding an image, wherein at least one of the intra prediction mode candidates is derived from a luma block belonging to an area corresponding to the current chroma block in a luma picture.

10. In paragraph 1, A video decoding method, characterized in that at least one of the intra prediction mode candidates is a default intra prediction mode.

11. In paragraph 10, A video decoding method, characterized in that when the number of derived intra prediction mode candidates is less than a threshold, the default intra prediction mode is set as an intra prediction mode candidate.

12. In paragraph 1, At least one of the intra prediction mode candidates is excluded from the reordering target, A video decoding method, characterized in that the smallest index or the largest index is assigned to an intra prediction mode candidate excluded from the above reordering target.

13. In paragraph 12, A video decoding method, characterized in that the intra prediction mode candidate excluded from the above reordering target is DM (Direct Mode).

14. A step of determining the intra prediction mode of the current chroma block; A step of deriving intra prediction mode candidates for the current chroma block; and Including a step of rearranging the intra prediction mode candidates, Based on the intra prediction mode and the reference samples of the current chroma block, a prediction block of the current chroma block is derived, A video encoding method, characterized in that index information indicating an intra prediction mode candidate identical to the intra prediction mode among the rearranged intra prediction mode candidates is encoded in a bitstream.

15. A processor that generates compressed video data; and In a device including a transmitter for transmitting the compressed video data, The process of generating the above compressed video is as follows: A step of determining the intra prediction mode of the current chroma block; A step of deriving intra prediction mode candidates for the current chroma block; and comprising a step of rearranging the intra prediction mode candidates, Based on the intra prediction mode and the reference samples of the current chroma block, a prediction block of the current chroma block is derived, A device for transmitting compressed video data, characterized in that index information indicating an intra prediction mode candidate identical to the intra prediction mode among the rearranged intra prediction mode candidates is encoded in a bitstream.

Citation Information

Patent Citations

  • Intra-prediction device, image coding device, image decoding device, and program

    JP2017228827A

  • Method of grouping 3D shapes and constructing standard shapes

    KR1020250079575A

  • Sensor shifting module and camera module having the same

    KR102597176B1

  • Monitoring system and operating method of the same

    KR102633848B1

  • Method and device for encoding / decoding images

    WO2012128453A1