Image encoding / decoding method and apparatus
By determining multiple intra prediction modes for image blocks and selecting the optimal mode for intra prediction, the problem of insufficient intra prediction efficiency and accuracy in high-resolution images is solved, the efficiency of image encoding and decoding is improved, and the efficiency of image encoding and decoding is reduced. cost.
Patent Information
- Application Number
- CN202380028076.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-14
- Filing Date
- 2023-03-15
- Publication Date
- 2024-11-01
AI Technical Summary
When processing high-resolution and high-quality images, it is difficult for the prior art to effectively perform intra prediction, resulting in insufficient encoding efficiency and accuracy, and increasing transmission and storage costs.
By determining multiple intra prediction modes for the current block and performing intra prediction on the current block based on these modes, the difference between the prediction sample of the reference area and the reconstruction sample is calculated to determine the cost, thereby selecting the optimal intra prediction mode. , to improve coding efficiency and accuracy.
It improves the encoding efficiency and accuracy of the intra prediction mode, reduces transmission and storage costs, and is suitable for the encoding and decoding process of high-resolution images.
Smart Images

Figure CN118891871A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to methods and apparatus for processing image signals. Background Art
[0002] Recently, the demand for high-resolution and high-quality images such as HD (high-definition) images and UHD (ultra-high-definition) images has increased in various application fields. As image data becomes high-resolution and high-quality, the amount of data increases relatively compared to existing image data, so when image data is transmitted by using a medium such as an existing wired and wireless broadband circuit or when image data is stored by using an existing storage medium, transmission costs and storage costs increase. These problems generated as image data becomes high-resolution and high-quality can be solved using efficient image compression technology.
[0003] There are various technologies, such as inter-frame prediction technology that uses image compression technology to predict pixel values included in a current picture based on previous or subsequent pictures of the current picture, intra-frame prediction technology that predicts pixel values included in a current picture by using pixel information in the current picture, entropy coding technology that assigns short symbols to values with high occurrence frequencies and assigns long symbols to values with low occurrence frequencies, etc., and image data can be effectively compressed and transmitted or stored by using these image compression technologies.
[0004] On the other hand, as the demand for high-resolution images increases, the demand for stereoscopic image content as a new image service also increases. Video compression technology for efficiently providing high-resolution and ultra-high-resolution stereoscopic image content has been discussed. Summary of the invention
[0005] Technical issues
[0006] An object of the present disclosure is to provide an intra-frame prediction method and device for encoding / decoding an image signal.
[0007] An object of the present disclosure is to provide a method and apparatus for determining an intra prediction mode for intra prediction at a decoder side when encoding / decoding an image signal.
[0008] An object of the present disclosure is to provide a method and apparatus for obtaining a prediction block by using a plurality of intra prediction modes when encoding / decoding an image signal.
[0009] The technical effects of the present disclosure may not be limited to the above-mentioned technical effects, and ordinary technicians in the technical field to which the present disclosure belongs may clearly understand other unmentioned technical effects from the following description.
[0010] Technical Solutions
[0011] The image decoding method according to the present disclosure may include: determining at least one intra prediction mode for a current block; and performing intra prediction on the current block based on the at least one intra prediction mode. In this case, the at least one intra prediction mode may be determined based on a cost obtained by performing intra prediction on a reference region of the current block based on each of the plurality of intra prediction modes.
[0012] The image encoding method according to the present disclosure may include: determining at least one intra prediction mode for a current block; and performing intra prediction on the current block based on the at least one intra prediction mode. In this case, the at least one intra prediction mode may be determined based on a cost obtained by performing intra prediction on a reference region of the current block based on each of the plurality of intra prediction modes.
[0013] In the image decoding / encoding method according to the present disclosure, the cost of the intra prediction mode may be calculated based on the difference between the predicted sample of the reference region obtained by the intra prediction mode and the reconstructed sample of the reference region.
[0014] In the image decoding / encoding method according to the present disclosure, the reference region may include an upper reference region at an upper position of the current block and a left reference region at a left position of the current block.
[0015] In the image decoding / encoding method according to the contents of the present disclosure, costs of multiple intra-frame prediction modes are independently obtained for each of the upper reference area and the left reference area, and at least one of the first intra-frame prediction mode with the lowest cost for the upper reference area and the second intra-frame prediction mode with the lowest cost for the left reference area can be determined as at least one intra-frame prediction mode of the current block.
[0016] In the image decoding / encoding method according to the present disclosure, at least one intra prediction mode may be determined in ascending order of costs of a plurality of intra prediction modes.
[0017] In the image decoding / encoding method according to the contents of the present disclosure, when multiple intra-frame prediction modes are selected for a current block, intra-frame prediction can be performed on the current block based on each of the multiple intra-frame prediction modes to obtain multiple prediction blocks, and the final prediction block of the current block can be obtained by averaging operations or weighted sum operations on the multiple prediction blocks.
[0018] In the image decoding / encoding method according to the present disclosure, a plurality of intra prediction modes may include candidate modes derived based on the current block.
[0019] In the image decoding / encoding method according to the present disclosure, at least one intra prediction mode of the current block is selected from multiple candidate modes included in a candidate list, and at least one of the candidate modes can be selected in ascending order of cost of the multiple intra prediction modes.
[0020] A computer-readable recording medium storing a bit stream encoded by the image encoding method according to the present disclosure may be provided.
[0021] Technical Effects
[0022] According to the present disclosure, the encoding efficiency of the intra prediction mode of the current block may be improved by deriving the intra prediction mode from the decoder side.
[0023] According to the present disclosure, the accuracy of intra prediction can be improved by using multiple intra prediction modes.
[0024] Effects obtainable from the present disclosure are not limited to the above-mentioned effects, and other unmentioned effects may be clearly understood from the following description by a person of ordinary skill in the technical field to which the present disclosure pertains. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present disclosure.
[0026] Figure 2 is a block diagram showing an image decoding apparatus according to an embodiment of the present disclosure.
[0027] Figure 3 An image encoding / decoding method performed by an image encoding / decoding device according to the present disclosure is shown.
[0028] Figure 4 and Figure 5 Examples of multiple intra prediction modes according to the present disclosure are shown.
[0029] Figure 6 A planar mode based intra prediction method according to the present disclosure is shown.
[0030] Figure 7 A DC mode based intra prediction method according to the present disclosure is shown.
[0031] Figure 8 A directional mode based intra prediction method according to the present disclosure is shown.
[0032] Fig. 9 A method for deriving samples at fractional positions is shown.
[0033] Fig.10 and Fig.11 It is shown that the tangent value of the angle is scaled by a factor of 32 in intra prediction mode.
[0034] Fig.12 34 is a diagram showing aspects of intra prediction when the directional mode is one of mode number 34 to mode number 34.
[0035] Fig.13 is a diagram for describing an example of generating upper reference samples by interpolating left reference samples.
[0036] Fig.14 An example of performing intra prediction by using reference samples arranged in a 1D array is shown.
[0037] Fig.15 is a diagram illustrating a reference region of a current block and a configuration of reference samples for performing intra prediction on the reference region.
[0038] Figures 16 to 21 is a diagram showing how intra prediction is performed on an upper reference region and a left reference region.
[0039] Fig. 22 An example regarding the configuration of the reference area is shown.
[0040] Fig.23 The luminance blocks corresponding to the chrominance blocks are shown for each partitioning structure.
[0041] Fig.24 is a diagram for describing an example of calculating the cost of the intra prediction mode for each luminance block.
[0042] Mode for carrying out the invention
[0043] Since the present disclosure can be varied and has several embodiments, specific embodiments will be illustrated in the drawings and described in detail. However, it is not intended to limit the present disclosure to specific embodiments, and it should be understood that the present disclosure includes all changes, equivalents or substitutes included in the concept and technical scope of the present disclosure. When describing each of the drawings, similar reference numerals are used for similar parts.
[0044] Terms such as first, second, etc. may be used to describe various components, but components should not be limited by these terms. These terms are only used to distinguish one component from other components. For example, without exceeding the scope of the rights of the present disclosure, a first component may be referred to as a second component, and similarly, a second component may also be referred to as a first component. The term and / or includes a combination of multiple related input items or any item in multiple related input items.
[0045] When a component is referred to as being "linked" or "connected" to another component, it should be understood that the component may be directly linked or connected to the other component, but other components may exist in between. On the other hand, when a component is referred to as being "directly linked" or "directly connected" to another component, it should be understood that other components do not exist in between.
[0046] Because the terms used in this application are only used to describe specific embodiments, they are not intended to limit the present disclosure. Singular expressions include plural expressions unless they clearly have different meanings in the context. In this application, it should be understood that terms such as "including" or "having" refer to the presence of features, numbers, steps, motions, parts, parts or combinations thereof entered in the specification, but do not exclude the possibility of adding or existing in advance one or more other features, numbers, steps, motions, parts, parts or combinations thereof.
[0047] Hereinafter, with reference to the accompanying drawings, a desired embodiment of the present disclosure will be described in more detail. Hereinafter, the same reference numerals are used for the same components in the drawings, and repeated description of the same components is omitted.
[0048] Figure 1 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present disclosure.
[0049] Reference Figure 1 The image encoding device 100 may include: a picture segmentation unit 110, prediction units 120 and 125, a transformation unit 130, a quantization unit 135, a rearrangement 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.
[0050] because Figure 1 Each of the structural units shown in the figure is independently shown to represent different characteristic functions in the image encoding device, which does not mean that each structural unit is composed of separate hardware or one software unit. That is, since each structural unit is included by being listed as each structural unit for the convenience of description, at least two structural units of each structural unit can be combined to constitute one structural unit, or one structural unit can be divided into multiple structural units to perform functions, and even the integrated implementation and separate implementation of each structural unit are included in the scope of the rights of the present disclosure as long as they do not depart from the essence of the present disclosure.
[0051] In addition, some components may be only optional components for improving performance, rather than essential components for performing the basic functions in the present disclosure. The present disclosure may be implemented by including only structural units necessary for realizing the essence of the present disclosure without including components only for improving performance, and a structure including only essential components without including optional components only for improving performance is also included in the scope of the rights of the present disclosure.
[0052] The picture segmentation unit 110 may segment the input picture into at least one processing unit. In this case, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). In the picture segmentation unit 110, one picture may be segmented into a combination of a plurality of decoding units, prediction units, and transform units, and the picture may be encoded by selecting a combination of a decoding unit, a prediction unit, and a transform unit according to a predetermined criterion (e.g., a cost function).
[0053] For example, one picture may be divided into a plurality of decoding units. In order to divide the decoding units in the picture, a recursive tree structure such as a quadtree structure may be used, and a decoding unit divided into other decoding units by using one image or a maximum decoding unit as a root may be divided with as many child nodes as the number of divided decoding units. A decoding unit that is no longer divided according to a specific restriction becomes a leaf node. In other words, when it is assumed that only square division is possible for one decoding unit, one decoding unit may be divided into up to four other decoding units.
[0054] Hereinafter, in the embodiments of the present disclosure, a decoding unit may be used as a unit for encoding, or may be used as a unit for decoding.
[0055] The prediction unit may be partitioned into at least one square or rectangular shape of the same size in one decoding unit, or may be partitioned such that any one of the prediction units partitioned in one decoding unit may have a different shape and / or size from another prediction unit.
[0056] When a prediction unit for performing intra prediction based on a coding unit is generated and the prediction unit is not a minimum coding unit, intra prediction may be performed without partitioning the prediction unit into a plurality of prediction units N×N.
[0057] The prediction units 120 and 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 inter prediction or intra prediction is performed on the decoding unit, and detailed information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. In this case, the processing unit that performs the prediction may be different from the processing unit that determines the prediction method and details. For example, the prediction method, prediction mode, etc. may be determined in the prediction unit, and the prediction may be performed in the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform 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 may be sent to the decoding device. When a specific encoding mode is used, the original block may be encoded as is without generating a prediction block through the prediction units 120 and 125 and sent to the decoding unit.
[0058] The inter-frame prediction unit (120) may predict the prediction unit based on information about at least one picture in the previous picture or the subsequent picture of the current picture, or in some cases may predict the prediction unit based on information about some coding regions in the current picture. The inter-frame prediction unit (120) may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
[0059] The reference picture interpolation unit may receive reference picture information from the memory 155 and generate pixel information equal to or less than an integer pixel in the reference picture. For luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information equal to or less than an integer pixel in units of 1 / 4 pixels. For chroma signals, a 4-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information equal to or less than an integer pixel in units of 1 / 8 pixels.
[0060] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (block matching algorithm based on full search), TSS (three-step search), NTS (new three-step search algorithm), etc. may be used as a method for calculating a motion vector. Based on the interpolated pixel, the motion vector may have a motion vector value in units of 1 / 2 or 1 / 4 pixels. The motion prediction unit may predict the current prediction unit by changing the motion prediction method. As a motion prediction method, various methods such as a skip method, a merge method, an advanced motion vector prediction (AMVP) method, an intra-block copy method, etc. may be used.
[0061] The intra prediction unit 125 may generate a prediction unit based on reference pixel information around the current block, which is pixel information in the current picture. When the neighboring block in the current prediction unit is a block where inter prediction is performed and therefore the reference pixel is a pixel where inter prediction is performed, the reference pixel included in the block where inter prediction is performed may be used by replacing it with the reference pixel information of the surrounding blocks where intra prediction is performed. In other words, when the reference pixel is unavailable, the unavailable reference pixel information may be used by replacing it with at least one reference pixel among the available reference pixels.
[0062] The prediction mode of the intra prediction may have a directional prediction mode that uses reference pixel information according to a prediction direction when performing prediction and a non-directional mode that does not use directional information. The mode for predicting luminance information may be different from the mode for predicting chrominance information, and the intra prediction mode information for predicting luminance information or the predicted luminance signal information may be used to predict chrominance information.
[0063] When the size of the prediction unit is the same as the size of the transform unit when performing intra prediction, intra prediction for the prediction unit can be performed based on the pixel at the left position, the pixel at the upper left position, and the pixel at the upper position of the prediction unit. However, if the size of the prediction unit is different from the size of the transform unit when performing intra prediction, intra prediction can be performed by using reference pixels based on the transform unit. In addition, intra prediction using N×N partitioning can be used only for the minimum decoding unit.
[0064] The intra prediction method may generate a prediction block after applying an adaptive intra smoothing (AIS) filter to reference pixels according to a prediction mode. The type of AIS filter applied to the reference pixels may be different. In order to perform the intra prediction method, the intra prediction mode in the current prediction unit may be predicted based on the intra prediction modes in the prediction units surrounding the current prediction unit. When predicting the prediction mode in the current prediction unit by using the mode information predicted according to the surrounding prediction units, if the intra prediction mode in the current prediction unit is the same as the intra prediction mode in the surrounding prediction units, information that the prediction mode in the current prediction unit is the same as the prediction mode in the surrounding prediction units may be sent by using predetermined flag information, and if the prediction mode in the current prediction unit is different from the prediction mode in the surrounding prediction units, the prediction mode information of the current block may be encoded by performing entropy coding.
[0065] Also, a residual block including information on a residual value which is a difference value between a prediction unit predicted based on the prediction unit generated in the prediction units 120 and 125 and an original block in the prediction unit may be generated. The generated residual block may be input to the transform unit 130.
[0066] The transform unit 130 may transform the original block and the residual block including residual value information in the prediction unit generated by the prediction units 120 and 125 by using a transform method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), KLT. Whether to apply DCT, DST, or KLT to transform the residual block may be determined based on intra prediction mode information in the prediction unit used to generate the residual block.
[0067] The quantization unit 135 may quantize the value transformed to the frequency domain in the transformation unit 130. The quantization coefficient may be changed according to the importance of the block or image. The value calculated in the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.
[0068] The rearrangement unit 160 may perform rearrangement of coefficient values on the quantized residual value.
[0069] The rearrangement unit 160 may change the coefficients in the shape of a two-dimensional block into the shape of a one-dimensional vector by a coefficient scanning method. For example, the rearrangement unit 160 may scan the DC coefficient to the coefficients in the high frequency domain by using a zigzag scanning method and change it into the shape of a one-dimensional vector. Depending on the size of the transform unit and the intra-frame prediction mode, instead of the zigzag scanning, vertical scanning of scanning the coefficients in the shape of a two-dimensional block in the column direction or horizontal scanning of scanning the coefficients in the shape of a two-dimensional block in the row direction may be used. In other words, which scanning method of zigzag scanning, vertical scanning, and horizontal scanning to be used may be determined according to the size of the transform unit and the intra-frame prediction mode.
[0070] The entropy encoding unit 165 may perform entropy encoding based on the value calculated by the rearrangement unit 160. For example, the entropy encoding may use various encoding methods such as Exponential Golomb, CAVLC (Context Adaptive Variable Length Coding), and CABAC (Context Adaptive Binary Arithmetic Coding).
[0071] The entropy coding unit 165 can encode various information from the rearrangement unit 160 and the prediction units 120 and 125, such as residual value coefficient information and block type information in the coding unit, prediction mode information, partition unit information, prediction unit information and transmission unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.
[0072] The entropy encoding unit 165 may perform entropy encoding on the coefficient values in the decoding unit input from the rearrangement unit 160 .
[0073] The inverse quantization unit 140 and the inverse transform unit 145 inversely quantize the value quantized in the quantization unit 135 and inversely transform the value transformed in the transform unit 130. The residual value generated by the inverse quantization unit 140 and the inverse transform unit 145 may be combined with a prediction unit predicted by a motion prediction unit, a motion compensation unit, and an intra prediction unit included in the prediction units 120 and 125 to generate a reconstructed block.
[0074] The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
[0075] The deblocking filter can remove block distortion generated by the boundaries between blocks in the reconstructed picture. In order to determine whether to perform deblocking, it can be determined whether to apply the deblocking filter to the current block based on the pixels included in several rows or columns included in the block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied according to the required deblocking filter strength. In addition, in the case of applying the deblocking filter, when horizontal filtering and vertical filtering are performed, horizontal direction filtering and vertical direction filtering can be set to parallel processing.
[0076] The offset correction unit can correct the offset from the original image in units of pixels for the image on which deblocking is performed. In order to perform offset correction on a specific picture, the area where the offset is to be performed can be determined after dividing the pixels included in the image into a certain number of areas, and a method of applying the offset to the corresponding area or a method of applying the offset by considering edge information of each pixel can be used.
[0077] Adaptive loop filtering (ALF) may be performed based on a value obtained by comparing a filtered reconstructed image with an original image. After pixels included in an image are divided into predetermined groups, filtering may be performed differently on each group by determining a filter to be applied to the corresponding group. Information on whether ALF is applied may be transmitted per coding unit (CU) for a luminance signal, and the shape and filter coefficient of the ALF filter to be applied may vary for each block. In addition, an ALF filter having the same shape (fixed shape) may be applied regardless of the characteristics of the block to be applied.
[0078] The memory 155 may store a reconstructed block or picture calculated by the filter unit 150 , and when inter prediction is performed, may provide the stored reconstructed block or picture to the prediction units 120 and 125 .
[0079] Figure 2 is a block diagram showing an image decoding apparatus according to an embodiment of the present disclosure.
[0080] Reference Figure 2, the image decoding apparatus 200 may include: an entropy decoding unit 210 , a rearrangement unit 215 , an inverse quantization unit 220 , an inverse transform unit 225 , prediction units 230 and 235 , a filter unit 240 , and a memory 245 .
[0081] When an image bitstream is input from the image encoding device, the input bitstream may be decoded according to a process reverse to that of the image encoding device.
[0082] The entropy decoding unit 210 may perform entropy decoding according to a process opposite to the process of performing entropy encoding in the entropy encoding unit of the image encoding device. For example, various methods such as Exponential Golomb, CAVLC (Context Adaptive Variable Length Coding) and CABAC (Context Adaptive Binary Arithmetic Coding) may be applied in response to the method performed in the image encoding device.
[0083] The entropy decoding unit 210 may decode information related to intra prediction and inter prediction performed in the encoding device.
[0084] The rearrangement unit 215 may perform rearrangement based on a method of rearranging the bitstream entropy-decoded in the entropy decoding unit 210 in the coding unit. The coefficients expressed in the form of a one-dimensional vector may be rearranged by reconstructing the coefficients in the form of a two-dimensional block. The rearrangement unit 215 may receive information related to coefficient scanning performed in the coding unit, and perform rearrangement by a method of performing scanning inversely based on a scanning order performed in the corresponding coding unit.
[0085] The inverse quantization unit 220 may perform inverse quantization based on the quantization parameter provided from the encoding apparatus and the coefficient value of the rearranged block.
[0086] The inverse transform unit 225 may perform the transform performed in the transform unit, i.e., the inverse transform for DCT, DST, and KLT (i.e., inverse DCT, inverse DST, and inverse KLT), on the result of the quantization performed in the image encoding device. The inverse transform may be performed based on the transmission unit determined in the image encoding device. In the inverse transform unit 225 of the image decoding device, a transform technique (e.g., DCT, DST, KLT) may be selectively performed according to a plurality of information such as a prediction method, a size of a current block, a prediction mode, etc.
[0087] The prediction units 230 and 235 may generate a prediction block based on the information related to generation of the prediction block provided from the entropy decoding unit 210 and the pre-decoded block or picture information provided from the memory 245 .
[0088] As described above, when the size of the prediction unit is the same as the size of the transform unit when performing intra prediction in the same manner as the operation in the image encoding device, intra prediction of the prediction unit can be performed based on the pixel at the left position, the pixel at the upper left position, and the pixel at the upper position of the prediction unit, but when the size of the prediction unit is different from the size of the transform unit when performing intra prediction, intra prediction can be performed by using reference pixels based on the transform unit. In addition, intra prediction using N×N partitioning can be used only for the minimum decoding unit.
[0089] The prediction units 230 and 235 may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit may receive various information input from the entropy decoding unit 210, such as prediction unit information, prediction mode information of an intra prediction method, information related to motion prediction of an inter prediction method, etc., divide the prediction unit in the current decoding unit, and determine whether the prediction unit performs inter prediction or intra prediction. The inter prediction unit 230 may perform inter prediction on the current prediction unit based on information included in at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit, by using information required for inter prediction in the current prediction unit provided from the image encoding device. Alternatively, inter prediction may be performed based on information about some areas pre-reconstructed in the current picture including the current prediction unit.
[0090] In order to perform inter prediction, whether a motion prediction method in a prediction unit included in a corresponding coding unit is a skip mode, a merge mode, an AMVP mode, or an intra block copy mode may be determined on a coding unit basis.
[0091] The intra prediction unit 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit that performs intra prediction, intra prediction can be performed based on intra prediction mode information in the prediction unit provided from the image encoding device. The intra prediction unit 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. As a part of performing filtering on the reference pixels of the current block, the AIS filter can be applied by determining whether to apply the filter according to the prediction mode in the current prediction unit. AIS filtering can be performed on the reference pixels of the current block by using the prediction mode and AIS filter information in the prediction unit provided from the image encoding device. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.
[0092] When the prediction mode in the prediction unit is a prediction unit that performs intra-frame prediction based on a pixel value interpolated from a reference pixel, the reference pixel interpolation unit may interpolate the reference pixel so as to generate the reference pixel in units of pixels equal to or less than an integer value. When the prediction mode in 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. When the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.
[0093] The reconstructed block or picture may be provided to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset correction unit, and an ALF.
[0094] Information about whether a deblocking filter is applied to a corresponding block or picture and information about whether a strong filter or a weak filter is applied when the deblocking filter is applied may be provided from the image encoding device. Information related to the deblocking filter provided from the image encoding device may be provided in the deblocking filter of the image decoding device, and deblocking filtering of the corresponding block may be performed in the image decoding device.
[0095] The offset correction unit may perform offset correction on the reconstructed image based on offset value information applied to the image when encoding is performed, the type of offset correction, and the like.
[0096] ALF may be applied to the decoding unit based on information on whether ALF is applied, ALF coefficient information, etc. provided from the encoding device. Such ALF information may be provided by being included in a specific parameter set.
[0097] The memory 245 may store the reconstructed picture or block to be used as a reference picture or a reference block, and provide the reconstructed picture to the output unit.
[0098] As described above, hereinafter, in the embodiments of the present disclosure, for convenience of description, a coding unit is used as a term of a coding unit, but it may be a unit that performs decoding as well as encoding.
[0099] In addition, since the current block represents a block to be encoded / decoded, it may represent a decoding tree block (or decoding tree unit), a decoding block (or decoding unit), a transform block (or transform unit), or a prediction block (or prediction unit), etc., according to the encoding / decoding step. In the present specification, a "unit" may represent a basic unit for performing a specific encoding / decoding process, and a "block" may represent a pixel array of a predetermined size. Unless otherwise classified, "block" and "unit" may be used interchangeably. For example, in the embodiments described later, it may be understood that a decoding block (decoding block) and a decoding unit (decoding unit) may be used interchangeably.
[0100] Figure 3 An image encoding / decoding method performed by an image encoding / decoding device according to the present disclosure is shown.
[0101] Reference Figure 3 , a reference line for intra prediction of a current block may be determined ( S300 ).
[0102] The current block can use one or more of the multiple reference line candidates predefined in the image encoding / decoding device as a reference line for intra-frame prediction. Here, the multiple predefined reference line candidates may include adjacent reference lines adjacent to the current block to be decoded and N non-adjacent reference lines 1 sample to N samples away from the boundary of the current block. N can be an integer of 1, 2, 3 or a larger value. In the following, for ease of description, it is assumed that the multiple reference line candidates available for the current block include adjacent reference line candidates and three non-adjacent reference line candidates, but is not limited to this. In other words, the multiple reference line candidates available for the current block may of course include four or more non-adjacent reference line candidates.
[0103] The image encoding device may determine the best reference line candidate among multiple reference line candidates and encode an index for specifying the best reference line candidate. The image decoding device may determine the reference line of the current block based on the index signaled by the bitstream. The index may specify any one of the multiple candidate reference lines. The candidate reference line specified by the index may be used as the reference line of the current block.
[0104] The number of indexes signaled to determine the reference line of the current block may be 1, 2, or more. As an example, when the number of indexes signaled above is 1, the current block may perform intra-frame prediction by using only a single reference line candidate specified by the signaled index among the multiple reference line candidates. Alternatively, when the number of indexes signaled above is at least 2, the current block may perform intra-frame prediction by using multiple reference line candidates specified by multiple indexes among the multiple reference line candidates.
[0105] Reference Figure 3 , the intra prediction mode of the current block can be determined (S310).
[0106] The intra prediction mode of the current block can be determined from a plurality of intra prediction modes predefined in the image encoding / decoding device. Figure 4 and Figure 5 To describe multiple predefined intra prediction modes.
[0107] Figure 4 Examples of multiple intra prediction modes according to the present disclosure are shown.
[0108] Reference Figure 4, the plurality of intra prediction modes predefined in the image encoding / decoding device may include 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.
[0109] Directional mode can be compared Figure 4 The directional pattern shown is much more extended. Figure 5 An example in which the directional mode is extended is shown.
[0110] exist Figure 5 , adding mode -1 to mode -14 and mode 67 to mode 80 are shown. 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 based on the shape of the current block. As an example, if the current block is a non-square block having a width greater than a height, some directional modes (e.g., numbers 2 to 15) may be transformed into wide-angle intra prediction modes between numbers 67 and 80. On the other hand, if the current block is a non-square block having a height greater than a width, some directional modes (e.g., numbers 53 to 66) may be transformed into wide-angle intra prediction modes between numbers 1 and -14.
[0111] The range of available wide-angle intra prediction modes may be adaptively determined according to the ratio of the width to the height of the current block. Table 1 shows the range of available wide-angle intra prediction modes according to the ratio of the width to the height of the current block.
[0112] [Table 1]
[0113]
[0114]
[0115] Among multiple intra prediction modes, K candidate modes (most probable modes, MPMs) may be selected. A candidate list including the selected candidate modes may be generated. An index indicating any one of the candidate modes belonging to the candidate list may be signaled. The intra prediction mode of the current block may be determined based on the candidate mode indicated by the index. As an example, the candidate mode indicated by the index may be configured as the intra prediction mode of the current block. Alternatively, the intra prediction mode of the current block may be determined based on the value of the candidate mode indicated by the index and a predetermined difference. The difference may be defined as the difference between the value of the intra prediction mode of the current block and the value of the candidate mode indicated by the index. The difference may be signaled by a bitstream. Alternatively, the difference may be a value predefined in an image encoding / decoding device. Alternatively, the intra prediction mode of the current block may be determined based on a flag indicating whether there is a mode identical to the intra prediction mode of the current block in the candidate list. As an example, when the flag is 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 the multiple candidate modes belonging to the candidate list may be signaled. The candidate mode indicated by the index can be configured as the intra-frame prediction mode of the current block. On the other hand, when the flag is the second value, any one of the remaining intra-frame prediction modes can be configured as the intra-frame prediction mode of the current block. The remaining intra-frame prediction modes may refer to a mode of multiple predefined intra-frame prediction modes excluding the candidate modes belonging to the candidate list. When the flag is the second value, an index indicating any one of the remaining intra-frame prediction modes can be signaled. The intra-frame prediction mode indicated by the signaled index can be configured as the intra-frame prediction mode of the current block. The intra-frame prediction mode of a chroma block can be selected from the intra-frame prediction mode candidates of multiple chroma blocks. To this end, index information indicating one of the intra-frame prediction mode candidates of the chroma block can be explicitly encoded and signaled by the bitstream. Table 2 shows the intra-frame prediction mode candidates for the chroma block.
[0116] [Table 2]
[0117]
[0118]
[0119] In the example of Table 2, the direct mode (DM) refers to setting the intra prediction mode of the luma block present at the same position as the chroma block to the intra prediction mode of the chroma block. As an example, if the intra prediction mode of the luma block (luminance mode) is number 0 (planar mode) and the index indicates number 2, the intra prediction mode of the chroma block may be determined to be the horizontal mode (number 18).
[0120] As an example, if the intra prediction mode of the luma block (luminance mode) is number 1 (DC mode) and the index indicates number 0, the intra prediction mode of the chroma block may be determined to be the planar mode (number 0).
[0121] Therefore, the intra prediction mode of the chroma block can also be set to Figure 4 or Figure 5 One of the intra prediction modes shown. The intra prediction mode of the current block may be used to determine the reference line of the current block, and in this case, S310 may be performed before S300.
[0122] Reference Figure 3 , intra prediction may be performed on the current block based on the intra prediction mode and the reference line of the current block (S320).
[0123] In the following, by reference Figures 6 to 8 The intra prediction method of each intra prediction mode is described in detail. However, for ease of description, it is assumed that a single reference line is used for intra prediction of the current block, but even when multiple reference lines are used, the intra prediction method described later can be applied in the same / similar manner.
[0124] Figure 6 A planar mode based intra prediction method according to the present disclosure is shown.
[0125] Reference Figure 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 may be generated by interpolation in the horizontal direction. As an example, P1 may be generated by interpolating T and a reference sample located on the same horizontal line as P1. P2 may be generated by interpolation in the vertical direction. As an example, P2 may be generated by interpolating L and a reference sample located on the same vertical line as P2. As shown in the following equation 3, the current sample in the current block may be predicted by the weighted sum of P1 and P2.
[0126] [Formula 1]
[0127] (α×P1+β×P2) / (α+β)
[0128] In Formula 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 weights β may have the same value or different values. If the width and height of the current block are the same, weights α and β may be configured to be the same, and the predicted sample of the current sample may be configured as the average of P1 and P2. When the width and height of the current block are not the same, weights α and β may have different values. As an example, when the width is greater than the height, a smaller value may be configured as a weight corresponding to the width of the current block, and a larger value may be configured as a weight corresponding to the height of the current block. Conversely, when the width is greater than the height, a larger value may be configured as a weight corresponding to the width of the current block, and a smaller value may be configured as a weight corresponding to the height of the current block. Here, the weight corresponding to the width of the current block may refer to β, and the weight corresponding to the height of the current block may refer to α.
[0129] Figure 7 A DC mode based intra prediction method according to the present disclosure is shown.
[0130] Reference Figure 7 , the average value of the surrounding samples adjacent to the current block can be calculated, and the calculated average value can be configured as the prediction value of all samples in the current block. Here, the surrounding samples may include the upper reference samples and the left reference samples of the current block. However, depending on the shape of the current block, the average value may be calculated by using only the upper reference samples or the left reference samples. As an example, when the width of the current block is greater than the height, the average value may be calculated by using only the upper reference samples of the current block. Alternatively, when the ratio of the width to the height of the current block is greater than or equal to a predetermined threshold, the average value may be calculated by using only the upper reference samples of the current block. Alternatively, when the ratio of the width to the height of the current block is less than or equal to a predetermined threshold, the average value may be calculated by using only the upper reference samples of the current block. On the other hand, when the width of the current block is less than the height, the average value may be calculated by using only the left reference samples of the current block. Alternatively, when the ratio of the width to the height of the current block is less than or equal to a predetermined threshold, the average value may be calculated by using only the left reference samples of the current block. Alternatively, when the ratio of the width to the height of the current block is greater than or equal to a predetermined threshold, the average value may be calculated by using only left reference samples of the current block.
[0131] Figure 8 A directional mode based intra prediction method according to the present disclosure is shown.
[0132] When the intra-frame prediction mode of the current block is a directional mode, projection can be performed to the reference line according to the angle of the corresponding directional mode. When there is a reference sample at the projection position, the corresponding reference sample can be configured as a prediction sample of the current sample. If there is no reference sample at the projection position, a sample corresponding to the projection position can be generated by using one or more surrounding samples adjacent to the projection position. As an example, interpolation can be performed based on two or more surrounding samples adjacent to the projection position in both directions to generate a sample corresponding to the projection position. Alternatively, a surrounding sample adjacent to the projection position can be configured as a sample corresponding to the projection position. In this case, among the multiple surrounding samples adjacent to the projection position, the surrounding sample closest to the projection position can be used. The sample corresponding to the projection position can be configured as a prediction sample of the current sample.
[0133] Reference Figure 8 , for the current sample B, when projection is performed to the reference line at the corresponding position according to the angle of the intra prediction mode, there is a reference sample at the projection position (i.e., the reference sample R3 at the integer position). In this case, the reference sample at the projection position can be configured as a prediction sample for the current sample B. For the current sample A, when projection is performed to the reference line at the corresponding position according to the angle of the intra prediction mode, there is no reference sample at the projection position (i.e., the reference sample at the integer position). In this case, interpolation can be performed based on surrounding samples (e.g., R2 and R3) adjacent to the projection position to generate a sample (r) at a fractional position. The generated sample (r) at the fractional position can be configured as a prediction sample for the current sample A.
[0134] Fig. 9 A method for deriving samples at fractional positions is shown.
[0135] exist Fig. 9 In the example of , the variable h refers to the vertical distance (i.e., vertical distance) from the position of the prediction sample A to the reference sample line, and the variable w refers to the horizontal distance (i.e., horizontal distance) from the position of the prediction sample A to the fractional position sample. In addition, the variable θ refers to an angle predefined according to the directionality of the intra prediction mode, and the variable x refers to the fractional position.
[0136] The variable w can be obtained as shown in Equation 2 below.
[0137] [Formula 2]
[0138] w=htan0
[0139] Then, if we remove the integer positions from the variable w, we can finally get the fractional positions.
[0140] The fractional position samples may be generated by interpolating adjacent integer position reference samples. As an example, the fractional position reference samples at the x position may be generated by interpolating integer position reference samples R2 and integer position reference samples R3.
[0141] When deriving fractional position samples, a scaling factor can be used to avoid real number operations. As an example, when the scaling factor f is set to 32, such as Figure 8 In the example shown in (b), the distance between adjacent integer reference samples can be set to 32 instead of 1.
[0142] Furthermore, the tangent value of the angle θ determined according to the directionality of the intra prediction mode may also be scaled by using the same scaling factor (eg, 32).
[0143] Fig.10 and Fig.11 It is shown that the tangent value of the angle is scaled by a factor of 32 in intra prediction mode.
[0144] Fig.10 shows the scaling results of the tangent value for non-wide angle intra prediction mode, and Fig.11 The scaling results of the tangent values for the wide angle intra prediction mode are shown.
[0145] If the tangent value (tanθ) of the angle value used for the intra prediction mode is positive, intra prediction can be performed by using only one of the reference samples belonging to the upper line of the current block (i.e., the upper reference samples) or the reference samples belonging to the left line of the current block (i.e., the left reference samples). Meanwhile, when the tangent value of the angle value used for the intra prediction mode is negative, both the reference samples at the upper position and the reference samples at the left position are used.
[0146] In this case, in order to simplify the implementation, the left reference samples may be projected to the upper side, or the left reference samples may be projected to the left to arrange the reference samples in a 1D array form, and intra prediction may be performed using the reference samples in the 1D array form.
[0147] Fig.12 34 is a diagram showing aspects of intra prediction when the directional mode is one of mode number 34 to mode number 34.
[0148] When the intra prediction mode of the current block is one of mode numbers 34 to 49, intra prediction is performed by using not only the upper reference sample of the current block but also the left reference sample. Fig.12 In the example shown, the reference sample of the upper line may be generated by copying the reference sample at the left position of the current block to the position of the upper line or by interpolating the reference sample at the left position.
[0149] As an example, when a reference sample of position A on the upper side of the current block is obtained, projection may be performed on the left side line of the current block at position A on the upper side line, taking into account the directionality of the intra-prediction mode of the current block. If an integer position is referred to as a, a value corresponding to position a may be copied, or a fractional position value corresponding to a may be generated and set as the value of position A. As an example, if position a is an integer position, the value of position A may be generated by copying an integer position reference sample. On the other hand, when position a is a fractional position, the reference sample at the upper side position of position a and the reference sample at the bottom position of position a may be interpolated, and the interpolated value may be set as the value of position A. At the same time, at position A on the upper side of the current block, the direction of the projection to the left side line of the current block may be parallel to and opposite to the direction of the intra-prediction mode of the current block.
[0150] Fig.13 is a diagram for describing an example of generating upper reference samples by interpolating left reference samples.
[0151] exist Fig.13 , variable h represents the horizontal distance between position A on the upper line and position a on the left line. Variable w represents the vertical distance between position A on the upper line and position a on the left line. In addition, variable θ refers to an angle predefined according to the directionality of the intra prediction mode, and variable x refers to a fractional position.
[0152] The variable h can be obtained as shown in Equation 3 below.
[0153] [Formula 3]
[0154] h=w / tan0
[0155] Afterwards, if the integer positions are removed from the variable h, the fractional positions can be finally obtained.
[0156] When deriving fractional position samples, scaling factors can be used to avoid real number operations. As an example, the tangent of the variable θ can be scaled by using a scaling factor f1. Here, since the direction of the projection to the left line is parallel and opposite to the directional prediction mode, we can use Fig.10 and Fig.11 Scaled tangent values shown.
[0157] When the scaling factor f1 is applied, Equation 3 may be modified and used as in Equation 4 below.
[0158] [Formula 4]
[0159] h=(w*f1*f2) / (11*tan0)
[0160] In the same manner as described above, a 1D reference sample array may be configured with only reference samples belonging to an upper line. Therefore, intra prediction of a current block may be performed by using only upper reference samples including the 1D array.
[0161] Fig.14 An example of performing intra prediction by using reference samples arranged in a 1D array is shown.
[0162] like Fig.14 In the illustrated example, the left reference samples may be projected to generate the upper reference samples, and thus, the prediction samples of the current block may be obtained by using only the reference samples belonging to the upper line.
[0163] and Fig.12 and Fig.14 In contrast to what is shown in , the upper reference sample can be projected onto the left line to configure the 1D reference sample array with only the reference samples belonging to the left line. Specifically, for pattern numbers 19 to 33 of the directional patterns in which the tangent value (tanθ) of the angle of the directional pattern is negative, the reference sample belonging to the upper line can be projected onto the left line to generate the left reference sample.
[0164] The intra prediction mode of the current block can be derived by using reference samples around the current block. Specifically, based on the results obtained by applying multiple intra prediction modes to the reference area, the optimal intra prediction mode of the current block can be determined.
[0165] Fig.15 is a diagram illustrating a reference region of a current block and a configuration of reference samples for performing intra prediction on the reference region.
[0166] For ease of description, it is assumed that both the width w and the height h of the current block are 4.
[0167] like Fig.15 In the example shown, the reference area may include an upper reference area and a left reference area. The upper reference area may include h0 reference sample rows, and the left reference area may include w0 reference sample columns. In other words, h0 may represent the height of the upper reference area, and w0 may represent the width of the left reference area.
[0168] The height h0 of the upper reference area and the width w0 of the left reference area may be a natural number equal to or greater than 1. The height h0 of the upper reference area and the width w0 of the left reference area may be fixed in the encoder and the decoder. As an example, the height h0 of the upper reference area and the width w0 of the left reference area may be fixed to 4 or 2.
[0169] Alternatively, the values of the height h0 of the upper reference area and the width w0 of the left reference area may be determined according to the width and / or height of the current block. As an example, any one of the height h0 of the upper reference area and the width w0 of the left reference area may be set to be the same as the width of the current block, and the other may be set to be the same as the height of the current block. Alternatively, any one of the height h0 of the upper reference area and the width w0 of the left reference area may be set to 1 / N of the width of the current block, and the other may be set to 1 / N of the height of the current block. Here, N may be a natural number equal to or greater than 1.
[0170] Alternatively, the height of the upper reference area and / or the width of the left reference area may be adaptively determined based on at least one of the shape of the current block, whether intra sub-partitioning (ISP) is applied to the current block, or whether the current block borders the boundary of the CTU.
[0171] Alternatively, the sizes of the upper reference region and the left reference region may be set to be the same as the size of the current block. As an example, when the current block has a size of 4×4, Fig.15 In the example shown, the upper reference region and the left reference region may each have a size of 4×4.
[0172] Alternatively, the upper reference area may be defined as a square area based on the width of the current block, and the left reference area may be defined as a square area based on the height of the current block. As an example, if the current block has a size of w×h, the upper reference area may be set to a square shape having a size of w×w, and the left reference area may be set to a square shape having a size of h×h.
[0173] Alternatively, the size of the upper reference area and the size of the left reference area may be determined based on whether the size of the current block is equal to or greater than a threshold value. Here, the size of the current block may be at least one of the width, height, or product of the width and height of the current block. As an example, if the size of the current block is equal to or greater than the threshold value, the size of the upper reference area and / or the left reference area may be set to 4×4. On the other hand, if the size of the current block is not greater than the threshold value, the size of the upper reference area and / or the left reference area may be set to 2×2.
[0174] The reference area may also be set to have a non-square shape. As an example, the upper reference area may be set to a size of (h0 / 2)×h0 or 2h0×h0, and the left reference area may be set to a size of w0×(w0 / 2) or w0×2w0.
[0175] According to the shape of the current block, the shape of the reference region may be determined. As an example, if the current block is non-square, at least one of the upper reference region and the left reference region may be set to be non-square.
[0176] Intra prediction for a reference region may be performed by using reference samples neighboring the reference region.
[0177] Specifically, Fig.15 In the example shown in , intra prediction for the upper and left reference regions can be performed by using reference samples belonging to an upper reference line adjacent to an uppermost row of the upper reference region and a left reference line adjacent to a leftmost column of the left reference region.
[0178] exist Fig.15 In , variables w1 and h1 are variables for indicating the range of the reference sample of the reference area. Fig.15 , it is assumed that both the variable w1 and the variable h1 are 4. The variable w1 and the variable h1 may be 0 or a natural number equal to or greater than 1. In this case, the variable w1 and / or the variable h1 may be predefined in the encoder and the decoder.
[0179] As another example, at least one of the variable w1 or the variable h1 may be determined based on at least one of the size / shape of the current block, whether the ISP is applied to the current block, or whether the current block is adjacent to a boundary of the CTU. As an example, if at least one of the width or height of the current block is greater than a threshold, at least one of w1 or h1 may be set to 8 or 16. On the other hand, if at least one of the width or height of the current block is not greater than the threshold, at least one of w1 or h1 may be set to 4.
[0180] Alternatively, variable w1 may be determined based on the width w of the current block, and variable h1 may be determined based on the height h of the current block.Alternatively, variable w1 may be determined based on the width of the upper reference region, and variable h1 may be determined based on the height of the left reference region.
[0181] If the current block is square, w1 and h1 may be set identically. On the other hand, if the current block is non-square, w1 and h1 may be set differently.
[0182] like Fig.15 As shown, when the reference sample of the reference region is set, intra prediction may be performed based on the same reference sample of each of the left reference region and the upper reference region.
[0183] Based on the reference samples of the reference region, intra prediction may be performed on the reference region. Specifically, based on multiple intra prediction modes, intra prediction may be performed multiple times on each of the upper reference region and the left reference region.
[0184] Figures 16 to 18 is a diagram showing how intra prediction is performed on an upper reference region and a left reference region.
[0185] Fig.16 Reference samples used to perform intra prediction on each of the upper reference region and the left reference region based on the planar mode are shown.
[0186] As shown in the example, the planar prediction for the upper reference region can be performed based on the upper reference sample adjacent to the upper reference region and the left reference sample not adjacent to the upper reference region. In addition, the planar prediction for the left reference region can be performed based on the upper reference sample not adjacent to the left reference region and the left reference sample adjacent to the left reference region.
[0187] Fig.17 Reference samples used to perform intra prediction on each of the upper reference region and the left reference region based on the DC mode are shown.
[0188] As shown in the example, the average value (i.e., DCval) of the upper reference region can be derived based on the reference samples adjacent to the upper side of the upper reference region. In addition, the average value (i.e., DCval) of the left reference region can be derived based on the reference samples adjacent to the left side of the left reference region.
[0189] Fig.18 An example is shown in which reference samples are arranged in a 1D array for intra prediction based on a directional mode.
[0190] As an example, for a directional mode where the tangent value of the angle is negative, the reference samples may be rearranged in a 1D array. For example, if intra prediction is performed for mode numbers 34 to 49, as Fig.18 In the example shown, the value of the upper reference sample belonging to the upper reference line can be obtained by copying the left reference sample or using the value obtained by interpolating the left reference sample. Therefore, intra-frame prediction of mode numbers 34 to 49 can be performed based on the upper reference sample in the form of a 1D array.
[0191] Although not shown, if intra prediction of mode number 19 to mode number 33 is performed, the value of the upper reference sample belonging to the left reference line can be obtained by copying the upper reference sample or using the value obtained by interpolating the upper reference sample. Therefore, intra prediction of intra prediction of mode number 19 to mode number 33 can be performed based on the left reference sample in the form of a 1D array.
[0192] like Figures 15 to 18 In the example shown, when setting the reference samples of the upper reference area and the reference samples of the left reference area, there occurs a problem that some of the reference samples are too far away from the upper reference area or the left reference area.
[0193] In order to improve the correlation between the reference samples and the reference area, the reference samples of the upper reference area may include samples adjacent to the upper reference area, and the reference samples of the left reference area may include samples adjacent to the left reference area. Specifically, samples belonging to the upper reference line adjacent to the uppermost row of the upper reference area and samples belonging to the left reference line adjacent to the leftmost column of the upper reference area may be set as reference samples of the upper reference area. Alternatively, samples belonging to the upper reference line adjacent to the uppermost row of the left reference area and samples belonging to the left reference line adjacent to the leftmost column of the left reference area may be set as reference samples of the left reference area.
[0194] In this case, you can Figures 19 to 21 Changes in Figures 16 to 18 Aspects of intra prediction are shown.
[0195] Fig.19 Reference samples used for intra prediction of each of the upper reference region and the left reference region based on the planar mode are shown.
[0196] Intra-frame prediction of the left reference region based on the planar mode may be performed by using the upper reference sample adjacent to the upper side of the left reference region and the left reference sample adjacent to the left side of the left reference region. In addition, intra-frame prediction of the upper reference region based on the planar mode may be performed by using the upper reference sample adjacent to the upper side of the upper reference region and the left reference sample adjacent to the left side of the upper reference region.
[0197] Fig. 20 Reference samples used for intra prediction of each of the upper reference region and the left reference region based on the DC mode are shown.
[0198] The average value (i.e., DCval) of the left reference region may be obtained by using the upper reference sample adjacent to the upper side of the left reference region and the left reference sample adjacent to the left side of the left reference region. In addition, the average value (i.e., DCval) of the upper reference region may be obtained by using the upper reference sample adjacent to the upper side of the upper reference region and the left reference sample adjacent to the left side of the upper reference region.
[0199] Fig.21 An example is shown in which reference samples are arranged in a 1D array for intra prediction based on a directional mode.
[0200] For the left reference region, an upper reference sample adjacent to the upper side of the left reference region and a left reference sample adjacent to the left portion of the left reference region may be used. In this case, the reference samples in the form of a 1D array may be obtained by filling the upper reference line adjacent to the upper side of the left reference region with the left reference samples.
[0201] For the upper reference region, an upper reference sample adjacent to the upper side of the upper reference region and a left reference sample adjacent to the left side of the upper reference region may be used. In this case, the reference samples in the form of a 1D array may be obtained by filling the upper reference line adjacent to the upper side of the upper reference region with the left reference sample.
[0202] Based on multiple intra prediction modes, multiple intra predictions can be performed on the reference region, and the cost of each of the multiple intra prediction modes can be calculated. Specifically, after the difference between the reconstructed sample and the predicted sample at each position in the reference region is obtained, the difference or the sum of the absolute values of the difference at all positions in the reference region can be set as the cost of the intra prediction mode.
[0203] An intra prediction mode having the lowest cost among a plurality of intra prediction modes may be selected as an intra prediction mode of the current block.
[0204] Alternatively, N intra prediction modes may be selected in ascending order of cost from among the plurality of intra prediction modes. Here, N may be a natural number greater than 1. When a plurality of intra prediction modes are selected, intra prediction may be performed multiple times on the current block based on the plurality of selected intra prediction modes. Therefore, when N prediction blocks are obtained, the final prediction block of the current block may be obtained by an average operation or a weighted sum operation of the N prediction blocks.
[0205] When a weighted sum operation is used, the weight of each prediction block may be determined based on the cost of the intra-prediction mode used to obtain the corresponding prediction block. As an example, the maximum weight may be assigned to the prediction block obtained based on the intra-prediction mode with the lowest cost, and the minimum weight may be assigned to the prediction block obtained based on the intra-prediction mode with the highest cost.
[0206] The number of the plurality of intra prediction modes selected for the current block may be predefined in the encoder and the decoder. Alternatively, after comparing the cost of each intra prediction mode with a threshold, an intra prediction mode having a cost less than the threshold may be selected for the current block.
[0207] The best intra prediction mode may be determined for each of the upper reference region and the left reference region. Specifically, the cost of each of the plurality of intra prediction modes may be calculated by performing intra prediction on the upper reference region multiple times based on the plurality of intra prediction modes. Then, the intra prediction mode with the lowest cost may be determined as the intra prediction mode of the upper reference region.
[0208] Similarly, intra prediction may be performed multiple times on the left reference region based on multiple intra prediction modes to calculate the cost of each of the multiple intra prediction modes. Then, the intra prediction mode with the lowest cost may be determined as the intra prediction mode of the left reference region.
[0209] If the intra prediction mode of the upper reference region is the same as the intra prediction mode of the left reference region, the intra prediction mode of the current block may also be set to be the same as the intra prediction modes of the upper reference region and the left reference region.
[0210] If the intra prediction mode of the upper reference region is different from the intra prediction mode of the left reference region, one of the two intra prediction modes having a lower cost may be set as the intra prediction mode of the current block.
[0211] Alternatively, if the intra prediction mode of the upper reference region is different from the intra prediction mode of the left reference region, intra prediction of the current block can be performed based on the intra prediction mode of the upper reference region and the intra prediction mode of the left reference region, respectively. Therefore, when two prediction blocks are obtained, the final prediction block of the current block can be obtained based on an average operation or a weighted sum operation of the two prediction blocks.
[0212] The prediction block of the current block may be obtained by further considering at least one default mode together with at least one intra prediction mode selected from the neighboring reference region. As an example, intra prediction may be performed based on each of the intra prediction mode selected from the reference region and the default mode to obtain multiple prediction blocks of the current block. Thereafter, the final prediction block of the current block may be obtained by an average operation or a weighted sum operation on the multiple prediction blocks.
[0213] The number M of default modes may be 0 or an integer equal to or greater than 1. When N intra prediction modes are selected from the reference region, (N+M) prediction blocks may be obtained by performing intra prediction based on each of the N intra prediction modes and the M default modes. Thereafter, a final prediction block of the current block may be obtained by an average operation or a weighted sum operation on the (N+M) prediction blocks.
[0214] The number of default modes M may be predefined in the encoder and the decoder. Alternatively, the number of default modes M may be adaptively determined based on at least one of the following: the size / shape of the current block, whether the ISP is applied to the current block, or whether at least one intra prediction mode selected from the histogram includes a default mode.
[0215] The default mode may include at least one of a planar mode, a DC mode, or a predefined directional mode.
[0216] The encoder and decoder may be set to use a predefined mode (eg, planar mode) among the modes listed above as a default mode.
[0217] In the above-mentioned embodiment, it is explained that intra-frame prediction of a reference region is performed by using a reference line adjacent to the reference region. Unlike the illustrated example, intra-frame prediction of a reference region may be performed by using a reference line that is not adjacent to the reference region. As an example, for one intra-frame prediction mode, the cost of each of a plurality of reference lines may be calculated. In other words, a plurality of costs may be calculated for one intra-frame prediction mode. In this case, the lowest cost among the plurality of costs may be set as the cost of the corresponding intra-frame prediction mode.
[0218] For simplicity, one of a plurality of reference line candidates may be selected, and a cost of each of a plurality of intra prediction modes may be calculated by using the selected reference line.
[0219] All intra prediction modes can be applied to the reference region, and therefore, the costs of all intra prediction modes can be calculated. As an example, Figure 4 All intra prediction modes shown can be applied to the reference region.
[0220] For simplicity, only some intra prediction modes may be applied to the reference region. Here, some intra prediction modes may include candidate modes (MPMs) calculated based on the current block. Alternatively, a candidate mode derived based on the position and size of the upper reference region may be applied to the upper reference region, and a candidate mode derived based on the position and size of the left reference region may be applied to the left reference region.
[0221] Based on the cost of the intra-frame prediction mode, a candidate list for the current block can be configured. As an example, at least one intra-frame prediction mode can be selected in ascending order of cost, and at least one selected intra-frame prediction mode can be inserted into the candidate list as a candidate mode. In this case, the index assigned to each intra-frame prediction mode in the candidate list can be determined based on the cost. Specifically, the candidate mode index assigned to the intra-frame prediction mode with a low cost can have a smaller value than the candidate mode index assigned to the intra-frame prediction mode with a high cost. One of the candidate modes included in the candidate list can be set as the intra-frame prediction mode of the current block. Specifically, among the candidate modes included in the candidate list, the candidate mode indicated by the index can be set as the intra-frame prediction mode of the current block.
[0222] In the above embodiment, it is shown that the reference area includes the upper reference area and the left reference area. The reference area may also be configured in a manner different from that described.
[0223] Fig. 22 An example regarding the configuration of the reference area is shown.
[0224] like Fig. 22 In the example shown in (a), the reference area can be configured with only the upper reference area, or as Fig. 22 In the example shown in (b), the reference area can be configured with only the left reference area. Fig. 22 In the example shown in (c), the reference regions may be configured such that the upper reference region and the left reference region are continuous.
[0225] Whether the reference area is configured to include both the upper reference area and the left reference area can be determined based on at least one of the following: the size / shape of the current block, whether ISP is applied to the current block, whether the current block borders the boundary of the CTU, or whether the neighboring block is encoded / decoded by intra-frame prediction.
[0226] As an example, if the upper neighboring block of the current block is not encoded by intra prediction, the upper reference area can be excluded when configuring the reference area. Similarly, if the left neighboring block of the current block is not encoded by intra prediction, the left reference area can be excluded when configuring the reference area.
[0227] Alternatively, information about the shape of the reference region may be explicitly encoded and signaled.As an example, after a plurality of candidate regions are predefined in the form of reference regions, an index indicating one of the plurality of candidates may be encoded and signaled.
[0228] The segmentation of the picture can follow a single tree method or a dual tree method. The single tree method means that the segmentation structure of the luma picture is the same as the segmentation structure of the chroma picture. When the single tree method is applied, the segmentation shape of the luma block is the same as the segmentation shape of the chroma block. However, depending on the image format, the size of the luma block can be different from the size of the chroma block.
[0229] The dual-tree method indicates that the partition structure of the luma picture may be different from the partition structure of the chroma picture. When the dual-tree method is applied, the partition structure of the luma picture and the partition structure of the chroma block may be determined independently of each other.
[0230] The intra prediction mode of the chroma block can be determined by referring to the intra prediction mode of the luma block. As an example, when the DM mode is applied, the intra prediction mode of the chroma block can be set to be the same as the intra prediction mode of the co-located luma block. However, when the dual-tree method is applied, there may be a situation where multiple luma blocks exist at positions corresponding to the chroma blocks in the luma picture.
[0231] Fig.23 The luminance blocks corresponding to the chrominance blocks are shown for each partitioning structure.
[0232] For ease of description, it is assumed that the image format is 4:2:0.
[0233] exist Fig.23 In the example shown, there are four luma blocks of size 2N x 2N. When following the single tree approach, the partitioning structure of the chroma blocks is the same as that of the luma blocks. Thus, there are four chroma blocks of size N x N.
[0234] Therefore, when the DM mode is applied in a single tree structure, the intra prediction mode of four chroma blocks (chroma blocks 1 to 4) included in the N×N size may be set to be the same as the intra prediction mode of the luminance block (luminance blocks 1 to 4).
[0235] On the other hand, when the dual-tree structure is applied, the partition structure of the chrominance block can be different from the partition structure of the luminance block. Fig.23 In FIG. 1 , it is shown that a 2N×2N luminance block is divided into four luminance blocks, but the corresponding N×N chrominance block is not divided at all. In other words, in a 2N×2N area corresponding to an N×N chrominance block, there are four luminance blocks. Therefore, when the DM mode is applied, it is necessary to determine which of the four luminance blocks will be used to derive the intra prediction mode of the chrominance block.
[0236] To this end, information identifying a luma block for an intra-frame prediction mode for obtaining a chroma block among a plurality of luma blocks may be encoded and signaled. The information may be an index identifying one of the plurality of luma blocks. In this case, the index assigned to the luma block may be determined based on the segmentation depth and the segmentation method.
[0237] Alternatively, an intra prediction mode of a sample at a predefined position in a luma region corresponding to a chroma block (specifically, an intra prediction mode of a luma block including samples at the predefined position) assigned to the chroma block may be applied to the chroma block. Here, the predefined position may be a center position, an upper left position, an upper right position, a lower left position, or a lower right position.
[0238] Alternatively, after designating multiple position samples as candidate samples, information indicating one of the candidate samples may be encoded and signaled. The information may be an index identifying one of the multiple candidate samples. Here, the candidate sample may include at least one of a center sample, an upper left sample, an upper right sample, a lower left sample, or a lower right sample.
[0239] Alternatively, the intra prediction mode of a luminance block having a predefined shape or a luminance block having the largest size among a plurality of luminance blocks may be applied to the chrominance block. Here, the predefined shape may be a square. Alternatively, the predefined shape may be the same as the predefined shape of the chrominance block.
[0240] Meanwhile, when there are a plurality of luma blocks having a predefined shape or a plurality of luma blocks having the same size, an intra prediction mode of a luma block having a minimum index or a luma block located at a predefined position may be applied to a chroma block.
[0241] Alternatively, an intra prediction mode having the highest frequency among the intra prediction modes of the plurality of luma blocks may be applied to the chroma block.
[0242] Alternatively, after scanning a plurality of luma blocks in a predefined order, the intra prediction mode of the first found intra-coded luma block may be applied to the chroma blocks.
[0243] Alternatively, the intra prediction mode of each of the multiple luminance blocks may be applied to the chrominance block. In this case, multiple intra prediction modes may be selected for the chrominance block. When multiple intra prediction modes are selected, intra prediction may be performed multiple times on the chrominance block based on each of the multiple intra prediction modes to obtain multiple prediction blocks. Thereafter, the final prediction block of the chrominance block may be obtained by an average operation or a weighted sum operation of the multiple prediction blocks.
[0244] As another example, after calculating the cost of each luma block, the intra prediction mode of the luma block having the lowest cost may be applied to the chroma blocks.
[0245] Fig.24 is a diagram for describing an example of calculating the cost of the intra prediction mode for each luminance block.
[0246] When it is assumed that all luminance blocks are intra predicted by using neighboring reference lines, it can be Fig.24 The reference samples for each luma block are set as shown.
[0247] Afterwards, for each luma block, intra prediction may be performed based on the intra prediction mode of the luma block. In addition, the sum of the differences or the sum of the absolute values of the differences between the predicted sample and the reconstructed sample at each position in the luma block may be set as the cost of the luma block.
[0248] Once the cost for each luma block is calculated, the intra prediction mode of the luma block with the lowest cost can be applied to the chroma blocks.
[0249] Meanwhile, if intra prediction is performed on the luma block to obtain the intra prediction mode of the chroma block, after performing intra prediction to encode / decode the luma block, intra prediction may be performed again to calculate the intra prediction mode of the chroma block. Therefore, after storing the prediction block calculated when encoding / decoding the luma block, the cost of the luma block may be calculated by using the stored prediction block. In this case, the implementation complexity is reduced, but an additional buffer may be required to store the prediction value of the luma block.
[0250] As another example, regardless of the partition structure of the luma block, multiple intra-frame predictions may be performed on the luma region corresponding to the chroma block to calculate the cost of each of the multiple intra-frame prediction modes. As an example, when the chroma block has an N×N size, multiple intra-frame predictions may be performed on the luma block of a size of 2N×2N corresponding thereto to calculate the cost of each of the multiple intra-frame prediction modes. In this case, the intra-frame prediction may be performed by using an adjacent reference line or a non-adjacent reference line of the luma block.
[0251] Once the costs of the plurality of intra prediction modes are calculated, the intra prediction mode having the lowest cost may be applied to the chroma block. Alternatively, the plurality of intra prediction modes may be selected in ascending order of cost among the plurality of intra prediction modes.
[0252] In this case, multiple intra prediction modes applied to a 2N×2N luminance block may include Figure 4 All intra prediction modes shown in .
[0253] Alternatively, the plurality of intra prediction modes applied to the 2N×2N sized luma block may include intra prediction modes of a plurality of luma blocks (eg, luma blocks 1 to 4 ) included in the 2N×2N sized luma region.
[0254] Alternatively, the plurality of intra prediction modes applied to the 2N×2N size luma block may include at least one default mode and intra prediction modes of a plurality of luma blocks (e.g., luma blocks 1 to 4) included in the 2N×2N size luma region. Here, the default mode may include at least one of a planar mode, a DC mode, a vertical mode, or a horizontal mode.
[0255] The grammatical terms used in the above embodiments are only named for the convenience of description.
[0256] When an embodiment described based on a decoding process or an encoding process is applied to an encoding process or a decoding process, it is included in the scope of the present disclosure. When an embodiment described in a predetermined order is changed in an order different from the description, it is also included in the scope of the present disclosure.
[0257] The above disclosure is described based on a series of steps or flow charts, but it does not limit the time series order of the disclosure, and if necessary, it can be performed simultaneously or in different orders. In addition, each component (e.g., unit, module, etc.) of the block diagram in the above disclosure can be implemented as a hardware device or software, and multiple components can be combined and implemented as a hardware device or software. The above embodiment can be implemented in the form of program instructions that can be executed by various computer components, and recorded in a computer-readable recording medium. The computer-readable recording medium can include program instructions, data files, data structures, etc., individually or in combination. The computer-readable recording medium includes: hardware devices (such as ROM, RAM, flash memory, etc.) that are specifically configured to store and execute program instructions; magnetic media such as hard disks, floppy disks, and tapes; optical recording media such as CD-ROMs, DVDs; and magneto-optical media such as optical floppy disks. The hardware device can be configured to operate as one or more software modules to perform processing according to the disclosure, and the software device can be configured to operate as one or more hardware modules to perform processing according to the disclosure.
[0258] Industrial Applicability
[0259] The embodiments according to the present disclosure may be applied to electronic devices that can encode / decode images.
Claims
1. A method for decoding an image, the method comprising: determining at least one intra prediction mode for a current block; as well as Based on the at least one intra prediction mode, performing intra prediction on the current block, The at least one intra prediction mode is determined based on a cost obtained by performing the intra prediction on a reference region of the current block based on each of a plurality of intra prediction modes.
2. The method according to claim 1, wherein: The cost of the intra prediction mode is calculated based on a difference between a predicted sample of the reference area obtained through the intra prediction mode and a reconstructed sample of the reference area.
3. The method according to claim 1, wherein: The reference region includes an upper reference region at an upper position of the current block and a left reference region at a left position of the current block.
4. The method according to claim 3, wherein: For each of the upper reference region and the left reference region, independently obtaining costs of the plurality of intra prediction modes, and At least one of a first intra prediction mode having a lowest cost for the upper reference region and a second intra prediction mode having a lowest cost for the left reference region is determined as the at least one intra prediction mode of the current block.
5. The method according to claim 1, wherein: The at least one intra prediction mode is determined in ascending order of costs of the plurality of intra prediction modes.
6. The method according to claim 1, wherein: When the plurality of intra prediction modes are selected for the current block, performing the intra prediction on the current block based on each of the plurality of intra prediction modes to obtain a plurality of prediction blocks, and The final prediction block of the current block is obtained by performing an average operation or a weighted sum operation on the multiple prediction blocks.
7. The method according to claim 1, wherein: The plurality of intra prediction modes include candidate modes derived with reference to the current block.
8. The method of claim 1, wherein: selecting the at least one intra prediction mode of the current block from a plurality of candidate modes included in a candidate list, and At least one of the candidate modes is selected in ascending order of costs of the plurality of intra prediction modes.
9. A method for encoding an image, the method comprising: determining at least one intra prediction mode for a current block; as well as Based on the at least one intra prediction mode, performing intra prediction on the current block, The at least one intra prediction mode is determined based on a cost obtained by performing the intra prediction on a reference region of the current block based on each of a plurality of intra prediction modes.
10. The method according to claim 9, wherein: The cost of the intra prediction mode is calculated based on a difference between a predicted sample of the reference area obtained through the intra prediction mode and a reconstructed sample of the reference area.
11. The method according to claim 9, wherein: The reference region includes an upper reference region at an upper position of the current block and a left reference region at a left position of the current block.
12. The method according to claim 11, wherein: For each of the upper reference region and the left reference region, independently obtaining costs of the plurality of intra prediction modes, and At least one of a first intra prediction mode having a lowest cost for the upper reference region and a second intra prediction mode having a lowest cost for the left reference region is determined as the at least one intra prediction mode of the current block.
13. The method of claim 9, wherein: The at least one intra prediction mode is determined in ascending order of costs of the plurality of intra prediction modes.
14. The method according to claim 9, wherein: When the plurality of intra prediction modes are selected for the current block, performing the intra prediction on the current block based on each of the plurality of intra prediction modes to obtain a plurality of prediction blocks, and The final prediction block of the current block is obtained by performing an average operation or a weighted sum operation on the multiple prediction blocks.
15. A computer-readable recording medium storing a bit stream generated by an image encoding method, the encoding method comprising: determining at least one intra prediction mode for a current block; as well as Based on the at least one intra prediction mode, performing intra prediction on the current block, The at least one intra prediction mode is determined based on a cost obtained by performing the intra prediction on a reference region of the current block based on each of a plurality of intra prediction modes.
