Method for decoding or encoding video and apparatus for transmitting compressed video data
By using the cross component linear model (CCLM) mode for intra prediction in video signal processing, the problem of high-resolution image data compression and transmission costs is solved, and a more efficient encoding and decoding process is achieved.
Patent Information
- Application Number
- CN202411646067.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-08-28
- Filing Date
- 2020-08-28
- Publication Date
- 2025-02-25
AI Technical Summary
With the increasing demand for high resolution and high-quality images, it is difficult for the prior art to effectively compress and transmit or store image data, resulting in increased transmission and storage costs.
The cross component linear model (CCLM) mode is used to perform intra prediction of video signals, and the CCLM parameters are derived using adjacent chrominance samples and filtered adjacent luminance samples to generate prediction blocks for chrominance blocks.
The encoding/decoding efficiency of video signals is improved, and the chromaticity samples are predicted by using brightness to reconstruct samples, which reduces the amount of data and reduces the transmission and storage costs.
Smart Images

Figure CN119520777A_ABST
Abstract
Description
[0001] This application is a divisional application of the Chinese patent application with an application date of August 28, 2020, an international application number of PCT / KR2020 / 011547, an invention name of “Video Signal Processing Method and Device”, and an application number of 202080061291.9 after entering the Chinese national stage. Technical Field
[0002] The present disclosure relates to methods and apparatus for processing video signals. Background Art
[0003] 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 the image data is transmitted by using a medium such as an existing wired and wireless broadband circuit or when the image data is stored by using an existing storage medium, the transmission cost and the storage cost increase. These problems generated by the image data becoming high-resolution and high-quality can be solved by using an efficient image compression technology.
[0004] 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.
[0005] 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
[0006] Technical Purpose
[0007] The object of the present disclosure is to provide an intra-frame prediction method and apparatus for encoding / decoding a video signal.
[0008] An object of the present disclosure is to provide a method and apparatus for predicting a chrominance component by reconstructing a sample using a luma component in encoding / decoding a video 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] A video signal decoding method according to the present disclosure includes: determining whether a CCLM (cross component linear model) mode is applied to a chroma block; when it is determined that the CCLM mode is determined for the chroma block, obtaining filtered adjacent luminance samples of adjacent chroma samples adjacent to the chroma block; deriving CCLM parameters by using the adjacent chroma samples and the filtered adjacent luminance samples; and generating a prediction block for the chroma block by using the CCLM parameters.
[0012] A video signal encoding method according to the present disclosure includes: determining whether a CCLM (cross component linear model) mode is applied to a chroma block; when it is determined that the CCLM mode is determined for the chroma block, obtaining filtered adjacent luminance samples of adjacent chroma samples adjacent to the chroma block; deriving CCLM parameters by using the adjacent chroma samples and the filtered adjacent luminance samples; and generating a prediction block for the chroma block by using the CCLM parameters.
[0013] In the video signal decoding method according to the present disclosure, filtered adjacent luma samples may be generated by applying a down-sampling filter to co-located luma samples corresponding to adjacent chroma samples and adjacent luma samples adjacent to the co-located luma samples.
[0014] In the video signal decoding method according to the present disclosure, when at least one of the co-located luma sample and the adjacent luma sample is unavailable, reconstructed samples located on the boundary in the luma block may be filled to the position of the unavailable sample.
[0015] In the video signal decoding method according to the present disclosure, the type of the down-sampling filter may be determined based on the type of the current image.
[0016] In the video signal decoding method according to the present disclosure, the type of the down-sampling filter may be determined based on the positions of adjacent chroma samples.
[0017] In the video signal decoding method according to the present disclosure, adjacent chroma samples may be extracted by sub-sampling a plurality of adjacent chroma samples adjacent to a chroma block.
[0018] In the video signal decoding method according to the present disclosure, the subsampling rate may be determined based on at least one of the size or the shape of the chroma block.
[0019] A method for decoding a video according to the present disclosure includes: determining whether a cross-component linear model (CCLM) prediction is applied to a chroma block; when CCLM prediction is applied to a chroma block, determining a CCLM mode of the chroma block from among a plurality of CCLM mode candidates; based on the CCLM mode, deriving CCLM parameters based on chroma reference samples and filtered luminance reference samples of the chroma block; and obtaining predicted samples of the chroma block based on downsampled luminance samples and CCLM parameters, wherein the downsampled luminance samples are obtained based on common position luminance samples in the luminance block and neighboring luminance samples adjacent to the common position luminance samples, wherein unavailable neighboring luminance samples among neighboring luminance samples adjacent to the common position luminance samples are set equal to the common position luminance samples, wherein the filtered luminance reference samples are obtained by applying a downsampled filter to reference luminance samples of the luminance block, and wherein the type of downsampled filter applied to the reference luminance samples is determined based on whether the luminance block is adjacent to an upper boundary of a coding tree unit.
[0020] The video encoding method according to the content of the present disclosure includes: based on a cross-component linear model (CCLM) mode of a chroma block, deriving CCLM parameters based on a chroma reference sample of the chroma block and filtered adjacent luminance samples, wherein the CCLM mode is determined from multiple CCLM mode candidates; obtaining a prediction sample of the chroma block based on a downsampled luminance sample and the CCLM parameters; and encoding information indicating whether CCLM prediction is applied to the chroma block, wherein the downsampled luminance sample is obtained based on a common position luminance sample in the luminance block and adjacent luminance samples adjacent to the common position luminance sample, wherein unavailable adjacent luminance samples among the adjacent luminance samples adjacent to the common position luminance sample are set equal to the common position luminance sample, wherein the filtered luminance reference sample is obtained by applying a downsampled filter to a reference luminance sample of the luminance block, and wherein the type of downsampled filter applied to the reference luminance sample is determined based on whether the luminance block is adjacent to an upper boundary of a coding tree unit.
[0021] A device for transmitting compressed video data according to the present disclosure includes: a processor configured to obtain compressed video data; and a transmission unit configured to transmit the compressed video data, wherein obtaining the compressed video data includes: deriving CCLM parameters based on a cross-component linear model (CCLM) mode of a chroma block, based on a chroma reference sample of the chroma block and filtered adjacent luminance samples, wherein the CCLM mode is determined from multiple CCLM mode candidates; obtaining a prediction sample of the chroma block based on downsampled luminance samples and CCLM parameters; and encoding information indicating whether CCLM prediction is applied to the chroma block, wherein the downsampled luminance samples are obtained based on a common position luminance sample in the luminance block and adjacent luminance samples adjacent to the common position luminance sample, wherein unavailable adjacent luminance samples among the adjacent luminance samples adjacent to the common position luminance sample are set equal to the common position luminance sample, wherein the filtered luminance reference samples are obtained by applying a downsampled filter to a reference luminance sample of the luminance block, and wherein the type of downsampled filter applied to the reference luminance sample is determined based on whether the luminance block is adjacent to an upper boundary of a coding tree unit.
[0022] It will be appreciated that the foregoing summarized features are exemplary aspects of the following detailed description of the present disclosure and do not limit the scope of the present disclosure.
[0023] Technical Effects
[0024] According to the present disclosure, encoding / decoding efficiency may be improved by predicting chrominance samples using luma reconstructed samples.
[0025] According to the present disclosure, the encoding / decoding efficiency of the CCLM mode may be improved by determining the downsampling filter type regardless of the availability of neighboring samples.
[0026] According to the present disclosure, the encoding / decoding efficiency of the CCLM mode may be improved by subsampling adjacent samples to derive CCLM parameters.
[0027] Effects obtainable from the present disclosure may not be 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
[0028] Figure 1 : is a block diagram showing an image encoding device according to an embodiment of the present disclosure.
[0029] Figure 2 is a block diagram showing an image decoding apparatus according to an embodiment of the present disclosure.
[0030] Figure 3is a flowchart illustrating an intra prediction method according to an embodiment of the present disclosure.
[0031] Figure 4 The type of intra prediction mode is shown.
[0032] Figure 5 is a diagram for describing an example of deriving prediction samples in planar mode.
[0033] Figure 6 A plurality of reference sample set candidates are shown.
[0034] Figure 7 Describes the method for deriving prediction samples in DC mode.
[0035] Figure 8 is a flowchart illustrating a method of obtaining a prediction sample of a chrominance component according to an embodiment of the present disclosure.
[0036] Fig. 9 The downsampling filter type for each chroma sample position when the current image is an HDR image is shown.
[0037] Fig.10 The downsampling filter type for each chroma sample position when the current image is not an HDR image is shown.
[0038] Fig.11 and Fig.12 An example is shown in which the down-sampling filter type is determined regardless of the availability of neighboring samples adjacent to the luma block.
[0039] Fig.13 An example of differently setting the range of reconstructed pixels for deriving CCLM parameters according to the CCLM mode type is shown.
[0040] Fig.14 Shown is the type of downsampling filter applied to co-located luma samples of upper neighboring samples when the current image is not an HDR image.
[0041] Fig.15 The type of downsampling filter applied to co-located luma samples of upper neighboring samples when the current image is an HDR image is shown.
[0042] Fig.16 An example of applying a fixed type of filter according to the position of upper neighboring samples is shown.
[0043] Fig.17 The type of downsampling filter applied to co-located luma samples of left-neighboring samples is shown. DETAILED DESCRIPTION
[0044] Since the present disclosure can make various changes and has several embodiments, specific embodiments will be illustrated and described in detail in the drawings. 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 thought and technical scope of the present disclosure. When describing each of the accompanying drawings, the same reference numerals are used for the same parts.
[0045] It is possible to use terms such as first, second, etc. to describe various components, but the components should not be limited by the 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, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term "and / or" includes a combination of multiple relative input items or any items of multiple relative input items.
[0046] When a component is referred to as being "linked" or "connected" to other components, it should be understood that the component can be directly linked or connected to other components, but other components can exist in between. On the other hand, when a component is referred to as being "directly linked" or "directly connected" to other components, it should be understood that other components do not exist in between.
[0047] 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 existence of characteristics, numbers, stages, movements, components, parts, or combinations thereof entered in the specification, but do not exclude the existence or possibility of adding one or more other characteristics, numbers, stages, movements, components, parts, or combinations thereof in advance.
[0048] 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 accompanying drawings, and repeated description of the same components is omitted.
[0049] Figure 1 : is a block diagram showing an image encoding device according to an embodiment of the present disclosure.
[0050] Reference Figure 1 The image encoding device 100 may include: a picture division unit 110, a prediction unit 120 and a prediction unit 125, a transformation unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, a dequantization unit 140, an inverse transformation unit 145, a filter unit 150 and a memory 155.
[0051] because Figure 1Each construction unit in the image encoding device is shown independently to show different characteristic functions in the image encoding device, which does not mean that each construction unit is composed of a separate hardware or a software unit. That is, since each construction unit is included by being listed as each construction unit for the convenience of description, at least two construction units of each construction unit may be combined to constitute one construction unit, or one construction unit may be divided into a plurality of construction units to perform functions, and even an integrated implementation and a separate implementation of each construction 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.
[0052] 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 the structural units required to realize 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.
[0053] The picture division unit 110 may divide the input picture into at least one processing unit. In this regard, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). In the picture division unit 110, one picture may be divided into a combination of a plurality of coding units, prediction units, and transform units, and the picture may be encoded by selecting a combination of a coding unit, a prediction unit, and a transform unit according to a predetermined criterion (e.g., a cost function).
[0054] For example, a picture may be divided into a plurality of coding units. In order to divide the coding units in a picture, a recursive tree structure such as a quadtree structure may be used, and a coding unit divided into other coding units by using an image or a maximum coding unit as a path may be divided into as many child nodes as the number of divided coding units. Coding units that are no longer divided according to certain restrictions become leaf nodes. In other words, when it is assumed that only square division is possible for one coding unit, one coding unit may be divided into up to four other coding units.
[0055] Hereinafter, in an embodiment of the present disclosure, a coding unit may be used as a unit for encoding or may be used as a unit for decoding.
[0056] The prediction units may be divided in at least one square or rectangular shape of the same size in one coding unit, or may be divided such that any one of the prediction units divided in one coding unit may have a different shape and / or size from another prediction unit.
[0057] In generating a prediction unit for performing intra prediction based on a coding block, when the prediction unit is not a minimum coding unit, intra prediction may be performed without performing splitting into a plurality of prediction units N×N.
[0058] The prediction unit 120 and the prediction unit 125 may include an inter-frame prediction unit 120 that performs inter-frame prediction and an intra-frame prediction unit 125 that performs intra-frame prediction. It may be determined whether inter-frame prediction or intra-frame prediction is performed for the prediction unit, and specific information (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. In this regard, 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 using 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 unit 120 or the prediction unit 125 and sent to the decoding unit.
[0059] The inter-frame prediction unit 120 may predict a prediction unit based on information about at least one of a previous picture or a subsequent picture of the current picture, or in some cases, may predict a 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.
[0060] The reference picture interpolation unit may receive the 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 DCT-based interpolation filter 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 DCT-based interpolation filter 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.
[0061] 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 (Full search-based Block Matching Algorithm), TSS (Three Step Search), NTS (New Three-Step Search Algorithm), etc. may be used as a method for calculating a motion vector. The motion vector may have a motion vector value in units of 1 / 2 or 1 / 4 pixels based on interpolated pixels. The motion prediction unit may predict the current prediction unit by changing the 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 as a motion prediction method.
[0062] 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 for performing inter-frame prediction and thus the reference pixel is a pixel for performing inter-frame prediction, the reference pixel included in the block for performing inter-frame prediction may be used by replacing it with the reference pixel information of the surrounding blocks for performing intra-frame prediction. 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.
[0063] The prediction mode of 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 chrominance information may be predicted using the intra prediction mode information for predicting luminance information or the predicted luminance signal information.
[0064] When the size of the prediction unit is the same as the size of the transform unit when performing intra prediction, 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. However, 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 coding unit.
[0065] In the intra prediction method, a prediction block may be generated after an adaptive intra smoothing (AIS) filter is applied to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels may be different. In order to perform the intra prediction method, an intra prediction mode in a current prediction unit may be predicted based on intra prediction modes in prediction units surrounding the current prediction unit. When the prediction mode in the current prediction unit is predicted by using mode information predicted based on 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.
[0066] In addition, a residual block including information on a residual value which is a difference value between a prediction unit predicted based on the prediction units 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.
[0067] The transform unit 130 may transform the original block and the residual block including the residual value information in the prediction unit generated by the prediction unit 120 and the prediction unit 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.
[0068] The quantization unit 135 may quantize the value transformed into the frequency domain in the transformation unit 130. The quantization coefficient may be changed according to the importance or block of the image. The value calculated in the quantization unit 135 may be provided to the dequantization unit 140 and the rearrangement unit 160.
[0069] The rearrangement unit 160 may perform rearrangement on coefficient values of the quantized residual value.
[0070] The rearrangement unit 160 may change the coefficients in the two-dimensional block form into a one-dimensional vector form by a coefficient scanning method. For example, the rearrangement unit 160 may scan from the DC coefficient to the coefficients in the high frequency domain by using a zigzag scanning method and change it into the form of a one-dimensional vector. Depending on the size of the transform unit and the intra-frame prediction mode, the zigzag scan may be replaced by a vertical scan that scans the coefficients in the two-dimensional block form in the column direction or a horizontal scan that scans the coefficients in the two-dimensional block form in the row direction. In other words, which scanning method of the zigzag scan, the vertical direction scan, and the horizontal direction scan to be used may be determined according to the size of the transform unit and the intra-frame prediction mode.
[0071] The entropy encoding unit 165 may perform entropy encoding based on the value calculated by the rearrangement unit 160. 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).
[0072] The entropy coding unit 165 can encode various information from the rearrangement unit 160 and the prediction unit 120 and the prediction unit 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.
[0073] The entropy encoding unit 165 may perform entropy encoding on coefficient values in the coding unit input from the rearrangement unit 160 .
[0074] The dequantization unit 140 and the inverse transform unit 145 perform dequantization on the value quantized in the quantization unit 135, and perform inverse transform on the value transformed in the transform unit 130. The residual value generated by the dequantization 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.
[0075] The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
[0076] 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 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, when applying the deblocking filter, when performing horizontal filtering and vertical filtering, horizontal directional filtering and vertical directional filtering can be set to parallel processing.
[0077] The offset correction unit can correct the offset from the original image in units of pixels for the image to be deblocked. 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.
[0078] Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing a filtered reconstructed image with an original image. After the pixels included in the image are divided into predetermined groups, filtering can be performed on each group differently by determining a filter to be applied to the corresponding group. Information about whether ALF will be applied can be transmitted per coding unit (CU) for a luminance signal, and the shape and filter coefficient of the ALF filter to be applied can be different for each block. In addition, regardless of the characteristics of the block to be applied, an ALF filter of the same shape (fixed shape) can be applied.
[0079] 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 .
[0080] Figure 2 is a block diagram showing an image decoding apparatus according to an embodiment of the present disclosure.
[0081] Reference Figure 2 , the image decoding device 200 may include: an entropy decoding unit 210, a rearrangement unit 215, a dequantization unit 220, an inverse transformation unit 225, a prediction unit 230 and a prediction unit 235, a filter unit 240 and a memory 245.
[0082] When an image bit stream is input from the image encoding device, the input bit stream may be decoded according to a process reverse to that of the image encoding device.
[0083] 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), CABAC (Context Adaptive Binary Arithmetic Coding) may be applied in response to the method performed in the image encoding device.
[0084] The entropy decoding unit 210 may decode information related to intra prediction and inter prediction performed in the encoding apparatus.
[0085] 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. Coefficients represented in a one-dimensional vector form may be rearranged by reconstructing coefficients in a two-dimensional block form. 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.
[0086] The dequantization unit 220 may perform dequantization based on the quantization parameter provided from the encoding device and the coefficient value of the rearranged block.
[0087] The inverse transform unit 225 may perform the transform performed in the transform unit, that is, the inverse transform for DCT, DST, and KLT, that is, the inverse DCT, inverse DST, and inverse KLT for the quantization result 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 direction, and the like.
[0088] The prediction units 230 and 235 may generate a prediction block based on information related to generation of the prediction block provided from the entropy decoding unit 210 and pre-decoded block or picture information provided from the memory 245 .
[0089] As described above, when intra prediction is performed in the same manner as the operation in the image encoding device, when the size of the prediction unit is the same as the size of the transform unit, the 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, the intra prediction can be performed by using reference pixels based on the transform unit. In addition, intra prediction using N×N division can be used only for the minimum coding unit.
[0090] The prediction unit 230 and the prediction unit 235 may include: a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit may receive various information such as prediction unit information, prediction mode information of an intra prediction method, motion prediction related information of an inter prediction method, etc. input from the entropy decoding unit 210, divide the prediction unit in the current coding 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 picture 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.
[0091] In order to perform inter prediction, whether a motion prediction method in a prediction unit included in a corresponding coding unit is a skip mode, a merge mode, an AMVP mode, or an intra block copy mode may be determined based on the coding unit.
[0092] 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. By using the prediction mode and AIS filter information in the prediction unit provided from the image encoding device, AIS filtering can be performed on the reference pixels of the current block. 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.
[0093] 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 to generate a reference pixel in units of pixels equal to or less than an integer value. When the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. When the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.
[0094] 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.
[0095] Information on whether to apply a deblocking filter to a corresponding block or picture and information on whether to apply a strong filter or a weak filter when applying the deblocking filter 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 for the corresponding block may be performed in the image decoding device.
[0096] The offset correction unit may perform offset correction on the reconstructed image based on the offset value information, the type of offset correction applied to the image when encoding is performed.
[0097] ALF may be applied to the coding 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.
[0098] The memory 245 may store the reconstructed picture or block to be used as a reference picture or a reference block, and also provide the reconstructed picture to the output unit.
[0099] 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.
[0100] In addition, since the current block represents a block to be encoded / decoded, according to the encoding / decoding step, it can represent a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit) or a prediction block (or prediction unit), etc. In this specification, a "unit" can represent a basic unit for performing a specific encoding / decoding process, and a "block" can represent a pixel array of a predetermined size. Unless otherwise classified, "block" and "unit" can be used interchangeably. For example, in the embodiments described later, it can be understood that coding blocks (coding blocks) and coding units (coding units) can be used interchangeably.
[0101] Figure 3 is a flowchart illustrating an intra prediction method according to an embodiment of the present disclosure.
[0102] Reference Figure 3 , an index of a reference sample row of the current block may be determined S301. The index may specify one of a plurality of reference sample row candidates. The plurality of reference sample row candidates may include an adjacent reference sample row adjacent to the current block and at least one non-adjacent reference sample row not adjacent to the current block.
[0103] In an example, a neighboring reference sample row including a neighboring row whose y-axis coordinate is 1 less than the uppermost row of the current block and a neighboring column whose x-axis coordinate is 1 less than the leftmost column of the current block may be used as a reference sample row candidate.
[0104] A first non-adjacent reference sample row including a non-adjacent row having a y-axis coordinate less than 2 than the uppermost row of the current block and a non-adjacent column having an x-axis coordinate less than 2 than the leftmost column of the current block may be used as a reference sample row candidate.
[0105] A second non-adjacent reference sample row including a non-adjacent row having a y-axis coordinate less than 3 from the uppermost row of the current block and a non-adjacent column having an x-axis coordinate less than 3 from the leftmost column of the current block may be used as a reference sample row candidate.
[0106] The index may indicate one of an adjacent reference sample row, a first non-adjacent reference sample row, or a second non-adjacent reference sample row. In an example, when the index is 0, it means that an adjacent reference sample row is selected, and when the index is 1, it means that a first non-adjacent reference sample row is selected, and when the index is 2, it means that a second non-adjacent reference sample row is selected.
[0107] An index specifying one of a plurality of reference sample row candidates may be signaled in the bitstream.
[0108] Alternatively, the index may be signaled for the luma component block, and the signaling of the index may be omitted for the chroma component block. When the signaling of the index is omitted, the index may be considered to be 0. In other words, for the chroma component block, intra prediction may be performed by using adjacent reference sample rows.
[0109] The reconstructed samples included in the selected reference sample row may be derived as reference samples.
[0110] Next, the intra prediction mode of the current block may be determined S302.
[0111] Figure 4 The type of intra prediction mode is shown. Figure 4 In the example shown, the intra prediction modes include non-directional prediction modes (DC and planar) and directional prediction modes. Figure 4 It is shown that 65 directional prediction modes are defined.
[0112] A flag indicating whether the intra prediction mode of the current block is the same as the MPM (most probable mode) can be signaled in the bitstream. In the example, when the value of the MPM flag is 1, it indicates that there is an MPM that is the same as the intra prediction mode of the current block. On the other hand, when the value of the MPM flag is 0, it indicates that there is no MPM that is the same as the intra prediction mode of the current block.
[0113] When the value of the MPM flag is 1, a flag indicating whether the intra prediction mode of the current block is the same as the default intra prediction mode may be signaled. The default intra prediction mode may be at least one of DC, plane, vertical directional prediction mode, or horizontal directional prediction mode. In the example, intra_not_planar_flag may be signaled, which is a flag indicating whether the intra prediction mode of the current block is a plane mode. When the value of the flag intra_not_planar_flag is 0, it indicates that the intra prediction mode of the current block is a plane. On the other hand, when the value of the flag intra_not_planar_flag is 1, it indicates that the intra prediction mode of the current block is not a plane. When the value of the flag intra_not_planar_flag is 1, an index of one of the specified MPM candidates may be signaled. The intra prediction mode of the current block may be set to be the same as the MPM indicated by the MPM index.
[0114] Based on the intra prediction mode and the reference samples belonging to the reference sample row, a prediction sample may be derived S303.
[0115] When the intra prediction mode of the current block is a directional prediction mode, a prediction sample may be derived by using a reference sample positioned on a line following an angle of the directional prediction mode.
[0116] When the intra prediction mode of the current block is the planar mode, the prediction sample may be derived by using a reference sample in a vertical direction and a reference sample in a horizontal direction of the prediction target sample.
[0117] Figure 5 is a diagram for describing an example of deriving prediction samples in planar mode.
[0118] exist Figure 5 In , T represents a reference sample adjacent to the upper right corner of the current block, and L represents a reference sample adjacent to the lower left corner of the current block.
[0119] In the planar mode, for the prediction target sample, a horizontally oriented prediction sample P1 and a vertically oriented prediction sample P2 can be obtained.
[0120] The horizontally directional prediction sample P1 may be generated by performing linear interpolation on the upper right reference sample T and the reference sample H positioned on the same horizontal line as the prediction target sample.
[0121] The vertically oriented prediction sample P2 may be generated by performing linear interpolation on the lower left reference sample L and a reference sample V positioned on the same vertical line as the prediction target sample.
[0122] Subsequently, based on the weighted sum operation of the horizontally oriented prediction sample P1 and the vertically oriented prediction sample P2, a prediction sample may be obtained. Formula 1 represents an example of obtaining a prediction sample P through the weighted sum operation of the horizontally oriented prediction sample P1 and the vertically oriented prediction sample P2.
[0123] [Formula 1]
[0124] P = (α × P1 - β × P2) / (α + β)
[0125] In Equation 1, α represents a weight applied to the horizontally oriented prediction sample P1, and β represents a weight applied to the vertically oriented prediction sample P2.
[0126] The weights α and β can be determined based on the size or shape of the current block. Specifically, the weights α and β can be determined by considering at least one of the width or height of the current block. In the example, when the width and height of the current block are the same, the weights α and β can be set to the same value. When the weights α and β are the same, it can be concluded that the predicted sample is the average value of the horizontally oriented prediction sample P1 and the vertically oriented prediction sample P2. On the other hand, when the width and height of the current block are different, the weights α and β can be set differently. In the example, when the width of the current block is greater than the height, the weight β can be set to a value greater than the weight α, and when the height of the current block is greater than the width, the weight α can be set to a value greater than the weight β. Alternatively, on the contrary, when the width of the current block is greater than the height, the weight α can be set to a value greater than the weight β, and when the height of the current block is greater than the width, the weight β can be set to a value greater than the weight α.
[0127] In another example, weights α and β may be derived from one of a plurality of weight set candidates. In the example, when weight candidate sets (1,1), (3,1), and (1,3) representing combinations of weights α and β are predefined, weights α and β may be selected to be the same as one of the weight candidate sets.
[0128] An index indicating one of a plurality of weight set candidates may be signaled in a bitstream. The index may be signaled at a block level. In an example, the index may be signaled in units of coding blocks or transform blocks.
[0129] Alternatively, the index may be signaled at the level of a coding tree unit, a slice, a picture, or a sequence. The blocks included in the index transmission unit may determine the weights α and β by referring to the index signaled at a higher level. In other words, for the blocks included in the index transmission unit, the weights α and β may be set to be the same.
[0130] exist Figure 5In the example of , it is shown that the upper right reference sample T is used to derive the horizontally oriented prediction sample P1, and the lower left reference sample L is used to derive the vertically oriented prediction sample P2.
[0131] The horizontally oriented prediction sample P1 may be derived by using a reference sample other than the upper right reference sample, or the vertically oriented prediction sample P2 may be derived by using a reference sample other than the lower left reference sample. In an example, the horizontally oriented prediction sample P1 and the vertically oriented prediction sample P2 may be derived by configuring a reference sample set candidate for deriving a first reference sample for the horizontally oriented prediction sample P1 and a second reference sample for deriving the vertically oriented prediction sample P2 and using one candidate selected from a plurality of reference sample set candidates.
[0132] An index identifying one of a plurality of reference sample set candidates may be signaled in a bitstream. The index may be signaled in units of blocks, sub-blocks, or samples.
[0133] Alternatively, based on the position of the prediction target sample, a reference sample set candidate may be selected.
[0134] Figure 6 A plurality of reference sample set candidates are shown.
[0135] exist Figure 6 In the example of , the indication of (y,x) represents the combination of the y coordinate and the x coordinate of each sample. For example, (2,1) represents a sample with a y coordinate of 2 and an x coordinate of 1.
[0136] exist Figure 6 In the example of , the first reference sample set candidate can be configured to have a reference sample T1 adjacent to the upper right corner of the current block and a reference sample L1 adjacent to the upper left corner of the current block. When the position of the upper left sample of the current block is (0,0), T1 represents the reference sample of the (-1,W) coordinate, and L1 represents the reference sample of the (H,-1) coordinate. Here, W and H represent the width and height of the current block, respectively.
[0137] The second reference sample set candidate may be configured to have reference sample T2 adjacent to the top of T1 and reference sample L2 adjacent to the left of L1. In the example, T2 represents a reference sample of (-2, W) coordinates, and L2 represents a reference sample of (H, -2) coordinates.
[0138] The third reference sample set candidate may be configured to have reference sample T3 adjacent to the top of T2 and reference sample L3 adjacent to the left of L2. In the example, T3 represents a reference sample of (-3, W) coordinates, and L3 represents a reference sample of (H, -3) coordinates.
[0139] The fourth reference sample set candidate may be configured to have reference sample T4 adjacent to the top of T3 and reference sample L4 adjacent to the left of L3. In the example, T4 represents a reference sample of (-4, W) coordinates, and L4 represents a reference sample of (H, -4) coordinates.
[0140] The reference sample set candidates are not limited to the examples shown. Figure 6 In the example of FIG. 1 , it is shown that a combination of a reference sample whose x-axis coordinate is W and a reference sample whose y-axis coordinate is H of the current block is set as a reference sample set candidate. However, contrary to the example shown, a reference sample whose x-axis coordinate is W / 2 or (W / 2)-1 or a reference sample whose y-axis coordinate is H / 2 or (H / 2)-1 may configure a reference sample set candidate.
[0141] The reference sample set may be adaptively selected according to at least one of the position or size of the current block. In an example, when the current block has a square shape with the same width and height, a reference sample set configured with reference sample (-1, W) and reference sample (H, -1) may be used. When the current block has a non-square shape with a width greater than a height, a reference sample set configured with reference sample (-1, W / 2) and reference sample (H, -1) may be used. When the current block has a non-square shape with a height greater than a width, a reference sample set configured with reference sample (-1, W) and reference sample (H / 2, -1) may be used.
[0142] When the intra prediction mode of the current block is DC, the prediction sample may be obtained based on the average value of the reference samples.
[0143] Figure 7 Describes the method for deriving prediction samples in DC mode.
[0144] An average value of reference samples adjacent to the current block may be calculated, and the average value calculated for all samples in the current block may be set as a prediction value.
[0145] The average value may be derived based on an upper reference sample adjacent to an upper portion of the current block and a left reference sample adjacent to a left portion of the current block.
[0146] Alternatively, depending on the shape of the current block, the average value may be derived by using only the upper reference sample or the left reference sample. In the example, when the current block is a square block, the average value may be derived by using the upper reference sample and the left reference sample. When the width of the current block is greater than the height or when the ratio of the width to the height is equal to or greater than (or less than) a predefined value, the average value may be derived by using only the upper reference sample. When the height of the current block is greater than the width or when the ratio of the width to the height is equal to or greater than (or less than) a predefined value, the average value may be derived by using only the left reference sample.
[0147] When deriving the average value, specific reference samples can be excluded. In an example, when the average value of the reconstructed pixels is m and the standard deviation is σ, the average value can be calculated using reference samples that do not exceed a range of k times the standard deviation from the average value, and other reference samples can be excluded from the calculation of the average value. In this case, k is a natural number and can have values of 1, 2, 3, 4, etc. The value of k can be predefined in the encoder and decoder. Alternatively, the value of k can be determined based on at least one of the size or shape of the block. Alternatively, information representing the value of k can be signaled in the bitstream.
[0148] Whether to use a reference sample can be determined by setting any threshold value instead of the standard deviation σ. In an example, when the mean is derived, reference samples whose absolute value of the difference from the mean is equal to or less than the threshold value can be set to be available. On the other hand, when the mean is derived, reference samples whose absolute value of the difference from the mean is greater than the threshold value can be set to be unavailable. The threshold value can be predefined in the encoder and the decoder. Alternatively, the threshold value can be determined based on at least one of the size or shape of the block. Alternatively, information representing the threshold value can be signaled in the bitstream.
[0149] The reference sample can be subsampled to reduce the complexity of calculating the average value, and the average value can be calculated by using the subsampled reference sample. In the example, when subsampling is performed at intervals of 2 samples, the upper reference sample at the coordinate (-1, 2m) can be used to derive the average value, or the upper reference sample at the coordinate (-1, 2m+1) can be used to derive the average value in the upper reference sample. In addition, the left reference sample at the coordinate (2n, -1) can be used to derive the average value, or the left reference sample at the coordinate (2n+1, -1) can be used to derive the average value in the left reference sample. Here, m is a natural number from 0 to (W / 2)-1, and n is a natural number from 0 to (H / 2)-1. Based on the subsampling rate, the range of m and n can be determined. The subsampling rate can be adaptively determined according to the size or shape of the current block.
[0150] In subsampling, reference samples may be selected at fixed intervals. In this case, a value representing the interval between reference samples may be predefined in the encoder and the decoder. Alternatively, the interval between reference samples may be adaptively determined based on at least one of the size or shape of the current block. Alternatively, the interval between reference samples may be determined based on index information specifying one of the plurality of candidates.
[0151] In another example, after configuring a plurality of set candidates for the reference sample, an average value may be derived based on one candidate selected from the plurality of set candidates.
[0152] In one example, the first set of candidates may include all upper reference samples adjacent to the upper boundary of the current block and all left reference samples adjacent to the left boundary of the current block.
[0153] The second set candidates may include an upper reference sample at a (−1, 2m) position among upper reference samples of the current block and a left reference sample at a (2n, −1) position among left reference samples of the current block.
[0154] The third set candidates may include an upper reference sample at a (-1, 2m+1) position among upper reference samples of the current block and a left reference sample at a (2n+1, -1) position among left reference samples of the current block.
[0155] The number and type of set candidates are not limited to the above examples. More or fewer set candidates than the above examples may be defined.
[0156] The encoder may generate a prediction block for each set candidate and determine the optimal set candidate by measuring the cost of each prediction block. And, an index specifying the optimal set candidate may be encoded and signaled in the bitstream.
[0157] Alternatively, the optimal set candidate may be determined based on at least one of the size or shape of the current block.
[0158] In another example, one of a set candidate configured using reference samples before performing subsampling (e.g., at least one of a left reference sample and an upper reference sample) and a set candidate configured using reference samples performing subsampling may be selected as the optimal set candidate.
[0159] The intra prediction mode of the chroma component may be determined based on the intra prediction mode of the luma component. Specifically, the intra prediction mode of the chroma component is determined by referring to the intra prediction mode of the luma component, but the method of determining the intra prediction mode of the chroma component may differ according to the chroma mode.
[0160] The chroma mode may include at least one of a DC mode, a planar mode, a VER mode, a HOR mode, or a DM mode. Table 1 shows a method of deriving an intra prediction mode of a chroma component according to the chroma mode.
[0161] [Table 1]
[0162]
[0163]
[0164] Index information for specifying a chroma mode may be signaled in a bitstream. In an example, a chroma mode index indicating one of a DC mode, a planar mode, a VER mode, a HOR mode, or a DM mode may be signaled in a bitstream.
[0165] Referring to Table 1, when the chroma mode is the planar mode (eg, when the chroma mode index is 0), except when the intra prediction mode of the luma component is 0, the intra prediction mode of the chroma component may be set to the planar mode (Planar).
[0166] When the chroma mode is the VER mode (eg, when the chroma mode index is 1), except when the intra prediction mode of the luma component is 50, the intra prediction mode of the chroma component may be set to be in the vertical direction (vertical direction).
[0167] When the chroma mode is the HOR mode (for example, when the chroma mode index is 2), except when the intra prediction mode of the luma component is 18, the intra prediction mode of the chroma component may be set to be in the horizontal direction (horizontal direction).
[0168] When the chroma mode is the DC mode (eg, when the chroma mode index is 3), except when the intra prediction mode of the luma component is 1, the intra prediction mode of the chroma component may be set to DC (DC).
[0169] When the chroma mode is the DM mode (eg, when the chroma mode index is 4), the intra prediction mode of the chroma component may be set to be the same as the intra prediction mode of the luma component.
[0170] In the example of Table 1, a CCLM (Cross Component Linear Mode) mode may be additionally defined as a chrominance mode. Table 2 shows an example of adding a CCLM mode as a new chrominance mode.
[0171] [Table 2]
[0172]
[0173]
[0174] In Table 2, it is shown that the index allocated to the DM mode is changed from the 4th to the 7th, and the CCLM mode is added to the 4th to the 6th.
[0175] A plurality of CCLM modes may be defined. In an example, in Table 2, indexes 4 to 6 indicate a first CCLM mode (LM mode), a second CCLM mode (LM-A (up) mode), and a third CCLM mode (LM-L (left) mode), respectively.
[0176] Based on the chroma mode index, it can be determined whether the chroma mode is the CCLM mode.
[0177] The maximum length of the chroma mode index may be variably determined according to whether the CCLM mode is enabled. In an example, when the CCLM mode is not enabled, the chroma mode index may indicate one of 0 to 4, as shown in Table 1. On the other hand, when the CCLM mode is enabled, the chroma mode index may indicate one of 0 to 7, as shown in Table 2.
[0178] In another example, a flag indicating whether the chroma mode is the CCLM mode may be signaled. In the example, when the flag ccm_mode_flag is 1, it indicates that the chroma mode is the CCLM mode. On the other hand, when the flag ccm_mode_flag is 0, it indicates that the chroma mode is not the CCLM mode.
[0179] When the flag ccm_mode_flag is 0, a chroma mode index specifying one of the residual chroma modes may be signaled in the bitstream. Since whether the CCLM mode is applied is determined by a separate flag, the maximum length of the chroma mode index may have a fixed value regardless of whether the CCLM mode is enabled.
[0180] When the flag ccm_mode_flag is 1, an index for specifying one of a plurality of CCLM modes may be additionally signaled. In an example, according to the index ccm_mode_idx, any one of the LM mode, the LM-A mode, or the LM-L mode may be determined as the chroma mode.
[0181] In another example, based on at least one of the chroma subsampling format, size, and / or shape of the current block or whether CCLM is applied to a neighboring block, it can be determined whether a flag indicating whether CCLM is applied will be used, whether an index specifying one of multiple CCLM modes will be used, or whether the flag indicating whether the CCLM mode is applied and the index will be encoded / decoded before the chroma mode index.
[0182] In CCLM mode, the prediction samples of the chrominance component can be obtained based on the reconstructed luminance component samples. Therefore, the redundancy between the luminance component samples and the chrominance component samples can be removed by using CCLM mode. Equation 2 shows an example of obtaining the prediction samples of the chrominance component in CCLM mode.
[0183] [Formula 2]
[0184] Pred C [y, x] = α·Pred L ′[y,x]+β, (y,x∈coordinates in the block)
[0185] In Formula 2, Pred c Represents the predicted samples of the chrominance component. L ' represents the reconstructed luminance component sample. In addition, α and β represent CCLM parameters. Specifically, α represents a weight, and β represents an offset.
[0186] Hereinafter, in the CCLM mode, a method of obtaining a prediction sample of a chroma component will be described in detail.
[0187] Figure 8 is a flowchart illustrating a method of obtaining a prediction sample of a chrominance component according to an embodiment of the present disclosure.
[0188] First, it is checked whether the size of the luma image is the same as the size of the chroma image S801. In the example, when the chroma subsampling format is 4:4:4, it can be determined that the size of the luma image is the same as the size of the chroma image. On the other hand, when the chroma subsampling format is 4:2:2 or 4:2:0, it can be determined that the size of the luma image is different from the size of the chroma image.
[0189] When the size of the luma image is different from that of the chroma image, the reconstructed samples included in the luma image may be downsampled S802. By applying a downsampling filter to a luma block corresponding to the current chroma block, a filtered luma block having the same size as the current chroma block may be obtained.
[0190] When the size of the luma image is the same as that of the chroma image, applying the downsampling filter to the luma block may be omitted.
[0191] The type of downsampling filter may be determined based on at least one of the type of the current image, the CCLM mode type, or the position of the sample. For different types of filters, at least one of the shape of the filter, the number of taps, or the coefficients may be different. The type of the current image indicates whether the current picture is an HDR (high dynamic range) image. The CCLM mode type indicates one of the LM mode, the LM-A mode, or the LM-L mode.
[0192] Information for determining the type of the current image may be signaled in the bitstream. In an example, a flag indicating whether the position of the chroma component samples is relatively moved compared to the position of the co-located luma samples may be signaled in the bitstream. When the flag is 1, it indicates that the position of the chroma component samples is the same as the position of the co-located luma samples. This indicates that the current image is an HDR image. On the other hand, when the flag is 0, it indicates that the position of the chroma component samples is relatively moved downward by 0.5 pixels compared to the position of the co-located luma samples. This indicates that the current image is not an HDR image.
[0193] According to the size of the luma image and the size of the chroma image, the position of the common position luma sample corresponding to the chroma sample can be determined. In the example, the position of the common position luma sample corresponding to the chroma sample at the (y, x) position can be determined as (y*subHeightC, x*subWidthC). Here, the variables subWidthC and subHeightC can be determined based on the chroma subsampling format. In the example, when the chroma subsampling format is 4:4:4, the variables subWidthC and subHeightC can be set to 1. When the chroma subsampling format is 4:2:2, the variable subWidthC can be set to 2 and the variable subHeightC can be set to 1. When the chroma subsampling format is 4:2:0, the variables subWidthC and subHeightC can be set to 2.
[0194] Fig. 9 The downsampling filter type for each chroma sample position when the current image is an HDR image is shown.
[0195] In the illustrated example, A represents a sample at the upper left corner position of the current chroma block. B represents the remaining samples except the upper left sample A among the samples included in the uppermost row of the current chroma block. C represents the remaining samples except the upper left sample A among the samples included in the leftmost column of the current chroma block. D represents the remaining samples except the samples included in the uppermost row and the samples included in the leftmost column of the current chroma block.
[0196] The variable AvailL indicates whether the left neighboring block of the luminance block is available. The variable AvailT indicates whether the upper neighboring block of the luminance block is available. The variables AvailL and AvailT may be determined based on at least one of the following: CCLM mode type, whether the neighboring block is encoded by intra prediction, whether the luminance block and the neighboring block are included in the same coding tree unit, or whether the neighboring block leaves the boundary of the picture.
[0197] A cross-shaped downsampling filter may be applied to luma samples corresponding to the chroma samples D. Specifically, the downsampling filter may be applied to the co-located luma samples of the chroma samples D, luma samples adjacent in the horizontal direction of the co-located luma samples, and luma samples adjacent in the vertical direction of the co-located luma samples. In this case, a ratio of a filter coefficient applied to the co-located luma samples to a filter coefficient applied to adjacent luma samples may be 4:1.
[0198] The downsampling filter type of the luma sample corresponding to the chroma sample C included in the leftmost column of the chroma block can be determined based on the variable AvailL. In the example, when the left adjacent sample adjacent to the luma block is available, a cross filter can be applied. When the cross filter is applied, the downsampling filter can be applied to the common position luma sample of the chroma sample C, the luma sample adjacent in the horizontal direction of the common position luma sample, and the luma sample adjacent in the vertical direction of the common position luma sample. In this case, the ratio of the filter coefficient applied to the common position luma sample to the filter coefficient applied to the adjacent luma sample can be 4:1.
[0199] On the other hand, when the left neighboring sample adjacent to the luma block is not available, a vertical directional filter may be applied. When the vertical directional filter is applied, the downsampling filter may be applied to the co-located luma sample of the chroma sample C and the luma sample adjacent in the vertical direction to the co-located luma sample. In this case, the ratio of the filter coefficient applied to the co-located luma sample to the filter coefficient applied to the adjacent luma sample may be 2:1.
[0200] The downsampling filter type of the luma sample corresponding to the chroma sample B included in the uppermost row in the chroma block can be determined based on the variable AvailT. In the example, when the upper adjacent sample adjacent to the luma block is available, a cross filter can be applied. When the cross filter is applied, the downsampling filter can be applied to the common position luma sample of the chroma sample B, the luma sample adjacent in the horizontal direction of the common position luma sample, and the luma sample adjacent in the vertical direction of the common position luma sample. In this case, the ratio of the filter coefficient applied to the common position luma sample to the filter coefficient applied to the adjacent luma sample can be 4:1.
[0201] On the other hand, when the upper neighboring sample adjacent to the luma block is not available, a horizontal directional filter may be applied. When the horizontal directional filter is applied, the downsampling filter may be applied to the co-located luma sample of the chroma sample C and the luma sample adjacent in the horizontal direction of the co-located luma sample. In this case, the ratio of the filter coefficient applied to the co-located luma sample to the filter coefficient applied to the adjacent luma sample may be 2:1.
[0202] The downsampling filter type of the luma sample corresponding to the upper left chroma sample A in the chroma samples can be determined based on the variable AvailL and the variable AvailT. In the example, when all left adjacent samples and upper adjacent samples adjacent to the luma block are available, a cross filter can be applied. When a cross filter is applied, the downsampling filter can be applied to the common position luma sample of the chroma sample A, the luma samples adjacent in the horizontal direction of the common position luma sample, and the luma samples adjacent in the vertical direction of the common position luma sample. In this case, the ratio of the filter coefficient applied to the common position luma sample to the filter coefficient applied to the adjacent luma sample can be 4:1.
[0203] When the left neighboring sample adjacent to the luma block is available but the upper neighboring sample is not available, a vertical directional filter may be applied. When the vertical directional filter is applied, a downsampling filter may be applied to the co-located luma sample of the chroma sample A and the luma sample adjacent in the vertical direction of the co-located luma sample. In this case, the ratio of the filter coefficient applied to the co-located luma sample to the filter coefficient applied to the adjacent luma sample may be 2:1.
[0204] When the upper neighboring sample adjacent to the luma block is available but the left neighboring sample is not available, a horizontal directional filter may be applied. When the horizontal directional filter is applied, a downsampling filter may be applied to the common luma sample of the chroma sample A and the luma sample adjacent in the horizontal direction of the common luma sample. In this case, the ratio of the filter coefficient applied to the common luma sample to the filter coefficient applied to the adjacent luma sample may be 2:1.
[0205] When all the above-neighboring samples and the left-neighboring samples adjacent to the luma block are not available, the downsampling filter may not be applied to the co-located luma samples corresponding to the chroma sample A.
[0206] Fig.10 The downsampling filter type for each chroma sample position when the current image is not an HDR image is shown.
[0207] A 6-tap downsampling filter may be applied to co-located luma samples corresponding to samples (e.g., B and D) included in the remaining columns other than the leftmost column of the chroma block. Specifically, the downsampling filter may be applied to horizontally oriented adjacent samples adjacent in the horizontal direction of the co-located luma samples, and lower adjacent samples from the co-located luma samples and lower adjacent samples at positions below the co-located luma samples, respectively. In this case, a ratio of filter coefficients applied to the co-located luma samples and lower adjacent samples to filter coefficients applied to the horizontally oriented adjacent samples may be 2:1.
[0208] For chroma component samples (e.g., A and C) included in the leftmost column of the luma block, downsampling filters of different shapes may be applied according to the variable AvailL. In the example, when the left-neighboring sample of the luma block is available, a 6-tap downsampling filter may be applied to the common-position luma sample corresponding to the chroma component sample A or C. On the other hand, when the left-neighboring sample of the luma block is not available, a 2-tap downsampling filter may be applied to the common-position luma sample corresponding to the chroma component sample A or C. The 2-tap downsampling filter may be applied to the common-position luma sample and the lower-neighboring sample at a position below the common-position luma sample. In this case, the ratio of the filter coefficients applied to the common-position luma sample and the lower-neighboring sample may be 1:1.
[0209] exist Fig. 9 and Fig.10 , it is shown that the down-sampling filter type is determined based on at least one of a variable AvailL indicating whether the left adjacent sample of the luminance block is available or a variable AvailT indicating whether the upper adjacent sample of the luminance block is available.
[0210] In another example, the down-sampling filter may be determined independently of the variable AvailL and the variable AvailT. Specifically, regardless of the variable AvailL and the variable AvailT, a fixed-shape down-sampling filter may be applied.
[0211] Fig.11 and Fig.12 An example is shown in which the down-sampling filter type is determined regardless of the availability of neighboring samples adjacent to the luma block. Fig.11 shows aspects of the application of a downsampling filter when the current image is an HDR image, and Fig.12 Aspects of the application of the downsampling filter when the current image is not an HDR image are shown.
[0212] In the example, Fig.11 In the example shown, the downsampling filter corresponding to each chroma sample may be determined without considering the availability of neighboring samples adjacent to the luma block.
[0213] To this end, the downsampling filter type that uses neighboring samples adjacent to the luma block can be set to be unavailable. Fig. 9 and Fig.10 In the example shown, the down-sampling filter selected when the variable AvailL and the variable AvailT are false may be fixedly applied.
[0214] In an example, when the luma block is an HDR image, a cross filter may be applied to co-located luma samples corresponding to chroma samples D in the chroma block.
[0215] A vertically directional filter may be applied to co-located luma samples corresponding to chroma samples C in a chroma block.
[0216] A horizontally directional filter may be applied to co-located luma samples corresponding to chroma sample B in a chroma block.
[0217] It may be arranged that the downsampling filter is not applied to the co-located luma samples corresponding to chroma sample A in the chroma block.
[0218] When the luma block is not an HDR image, a 6-tap downsampling filter may be applied to the co-located luma samples corresponding to chroma samples D or B in the chroma block.
[0219] A 2-tap downsampling filter may be applied to co-located luma samples corresponding to chroma samples A or C in a chroma block.
[0220] and Fig.11 and Fig.12 In contrast to the example shown, a downsampling filter type that uses neighboring samples adjacent to the luma block may be fixedly applied to the luma block. Fig. 9 and Fig.10 In the example shown, the down-sampling filter selected when the variable AvailL and the variable AvailT are true may be fixedly applied.
[0221] In this case, when the neighboring samples adjacent to the luminance block are unavailable, the pixels located on the boundary in the luminance block may be filled to the position of the unavailable neighboring samples. In other words, the unavailable neighboring samples may be replaced with the pixels located on the boundary in the luminance block. For example, when the left neighboring samples adjacent to the left side of the luminance block are unavailable, the reconstructed samples included in the leftmost column in the luminance block may be filled to the left. Alternatively, when the upper neighboring samples adjacent to the top of the luminance block are unavailable, the reconstructed samples included in the uppermost row in the luminance block may be filled to the top.
[0222] exist Figures 9 to 12 In the illustrated example, it is shown that a different downsampling filter type is determined for each category after each of the chroma samples is classified into one of A to D. In this case, it is shown that the classification of the chroma samples is performed based on at least one of whether the chroma sample is included in the uppermost row or whether the chroma sample is included in the leftmost column.
[0223] Depending on the size of the block, the conditions for chroma sample classification can be set differently. In the example, when the size of the chroma block is 4×4, it can follow Figures 9 to 12 The classification criteria shown.
[0224] On the other hand, when the size of the chroma block is equal to or greater than 16×16, the chroma samples may be classified based on whether the chroma samples are included in the upper 2 rows in the chroma block or whether the chroma samples are included in the leftmost 2 columns in the chroma block. In an example, when the chroma block is 16×16, the chroma samples in the upper left area of 2×2 size included in the chroma block may be classified as A. In addition, the remaining chroma samples other than the chroma samples classified as A among the chroma samples included in the upper 2 rows of the chroma block may be classified as B. The remaining chroma samples other than the chroma samples classified as A among the chroma samples included in the leftmost 2 columns of the chroma block may be classified as C. The remaining chroma samples in the chroma block may be classified as D.
[0225] The CCLM parameters α and β S803 may be derived based on the reconstructed pixels around the chrominance block and the reconstructed pixels around the luma block. When the size of the luma image is different from the size of the chrominance image, the reconstructed pixels around the luma block may be downsampled.
[0226] The CCLM parameter may be derived based on at least one of an upper neighboring sample adjacent to the upper side of the luma block and the chroma block or a left neighboring block adjacent to the left side of the luma block and the chroma block.
[0227] According to the CCLM mode, when deriving CCLM parameters, it can be determined whether to use the upper neighboring samples and the left neighboring samples. In an example, in the LM mode, the CCLM parameters can be derived based on the upper neighboring samples and the left neighboring samples. In the LM-A mode, the CCLM parameters can be derived based only on the upper neighboring samples. In the LM-L mode, the CCLM parameters can be derived based only on the left neighboring samples.
[0228] Alternatively, the number or range of adjacent reconstructed pixels may be determined based on at least one of the size or shape of the current block, the type of the current image, the CCLM mode type, or the chroma subsampling format.
[0229] Fig.13 An example is shown in which the range of reconstructed pixels used to derive CCLM parameters is set differently according to the CCLM mode type.
[0230] For ease of description, assume that the width W and height H of the chrominance block are both 4.
[0231] When the LM mode is applied to a chroma block, CCLM parameters may be derived by using W upper neighboring samples adjacent to the upper boundary of the chroma block and H left neighboring samples adjacent to the left boundary of the chroma block.
[0232] When the LM-A mode is applied to a chroma block, CCLM parameters may be derived by using 2W upper neighboring samples adjacent to the upper side of the chroma block.
[0233] When the LM-L mode is applied to a chroma block, the CCLM parameters may be derived by using 2H left-neighboring samples adjacent to the left side of the chroma block.
[0234] Alternatively, after sub-sampling neighboring samples adjacent to the chroma block, the CCLM parameters may be derived by using only the sub-sampled neighboring samples.
[0235] In an example, when the LM mode is applied to the chroma block, the W upper neighboring samples of the upper boundary of the adjacent chroma block may be subsampled at intervals of 2, and the H left neighboring samples of the left boundary of the adjacent chroma block may be subsampled at intervals of 2. Formula 3 represents the position combination of the subsampled neighboring samples for deriving CCLM parameters in the LM mode.
[0236] [Formula 3]
[0237] (-1, W / 4), (-1, 3W / 4), (H / 4, -1), (3H / 4, -1)
[0238] In Equation 3, the first value in the brackets represents the y coordinate of the adjacent sample, and the second value represents the x coordinate of the adjacent sample.
[0239] When the LM-A mode is applied to the chroma block, 2W upper adjacent samples adjacent to the upper side of the chroma block may be sub-sampled. Equation 4 represents the position combination of the sub-sampled adjacent samples used to derive CCLM parameters.
[0240] [Formula 4]
[0241] (-1, W / 4), (-1, 3W / 4), (-1, 5W / 4), (-1, 7W / 4)
[0242] When the LM-L mode is applied to the chroma block, 2H left-neighboring samples adjacent to the left side of the chroma block may be sub-sampled. Equation 5 represents the position combination of the sub-sampled neighboring samples used to derive CCLM parameters.
[0243] [Formula 5]
[0244] (H / 4,-1), (3H / 4,-1), (5H / 4,-1), (7h / 4,-1)
[0245] Co-located luma samples corresponding to adjacent chroma samples may be extracted from the luma image. In this case, when the size of the luma image is different from the size of the chroma image, luma samples to which a downsampling filter is applied may be derived.
[0246] The downsampling filter may be applied to the co-located luma pixel and neighboring samples adjacent to the co-located luma pixel.
[0247] The type of downsampling filter may be determined based on the type of the current image, the position of the common position luminance pixel, the variable AvailL, the variable AvailT, or whether the current block is adjacent to the boundary of the coding tree unit. For different types of filters, at least one of the shape of the filter, the number of taps, or the coefficients may be different.
[0248] Hereinafter, an example of deriving filtered luma samples of an upper neighboring block adjacent to the upper side of a chroma block and an example of deriving filtered luma samples of a left neighboring block adjacent to the left side of a chroma block will be described in detail.
[0249] The filtered luma samples of the upper adjacent samples above the chroma block may be derived using reconstructed samples included in up to N rows from the upper boundary of the luma block. In this case, the number of rows may be determined based on at least one of the chroma subsampling format, the CCLM mode type, the image type, the shape or size of the current block, whether the current block is adjacent to the boundary of the coding tree unit, or the type of the downsampling filter. In the present disclosure, it is assumed that when a downsampling filter is applied to the co-located luma samples at the upper position of the luma block, reconstructed samples included in 2 rows around the upper boundary of the luma block are used.
[0250] Fig.14 Shown is the type of downsampling filter applied to co-located luma samples of upper neighboring samples when the current image is not an HDR image.
[0251] Fig.15 The type of downsampling filter applied to co-located luma samples of upper neighboring samples when the current image is an HDR image is shown.
[0252] exist Fig.14 and Fig.15 In the example shown, the variable AvailTL can be derived by applying an AND operator between the variable AvailL and the variable AvailT. In other words, when all left-neighboring samples and upper-neighboring samples are available, the value of the variable AvailTL can be set to 1, and when at least one of the left-neighboring samples and the upper-neighboring samples is not available, the variable AvailTL can be set to 0.
[0253] The type of down-sampling filter applied to the co-located luma samples may be determined based on at least one of a variable AvailL, a variable AvailT, a position of an upper neighboring sample, and whether the current block adjoins an upper boundary of a coding tree unit.
[0254] First, aspects of application of a downsampling filter when the current image is not an HDR image are described.
[0255] For the upper adjacent samples of the chroma component whose x-axis coordinate is greater than 0, a 6-tap downsampling filter may be applied to the co-located luminance samples when all upper adjacent samples and left adjacent samples are available and the current block is not adjacent to the upper boundary of the coding tree unit. Specifically, the downsampling filter may be applied to the horizontally oriented adjacent samples adjacent in the horizontal direction of the co-located samples, and the lower adjacent samples from the co-located luminance samples and the lower adjacent samples at the position below the co-located luminance samples. In this case, the ratio of the filter coefficients applied to the co-located samples and the lower adjacent samples to the filter coefficients applied to the horizontally oriented adjacent samples may be 2:1.
[0256] On the other hand, when at least one of the upper neighboring sample and the left neighboring sample is not available and the current block is adjacent to the upper boundary of the coding tree unit, a horizontal directional filter may be applied to the common position luma sample. Specifically, a downsampling filter may be applied to the common position luma sample and the luma sample adjacent in the horizontal direction of the common position luma sample. In this case, the ratio of the filter coefficient applied to the common position luma sample to the filter coefficient applied to the adjacent luma sample may be 2:1.
[0257] For chroma component upper neighboring samples whose x-axis coordinates are equal to or less than 0, a 6-tap downsampling filter may be applied to the co-located luma samples when all upper neighboring samples and left neighboring samples are available and the current block does not adjoin the upper boundary of a coding tree unit.
[0258] When all upper and left neighboring samples are available but the current block adjoins the upper boundary of a coding tree unit, a horizontally directional downsampling filter may be applied.
[0259] On the other hand, when the current coding block is not adjacent to the upper boundary of the coding tree unit but at least one of the upper neighboring sample and the left neighboring sample is not available, a 2-tap vertical directional filter may be applied to the common position luma sample. The 2-tap vertical directional filter may be applied to the common position luma sample and the lower neighboring sample at a position below the common position luma sample. In this case, the ratio of the filter coefficients applied to the common position luma sample and the lower neighboring sample may be 1:1.
[0260] On the other hand, when at least one of the upper neighboring sample and the left neighboring sample is not available and the current block is adjacent to the upper boundary of the coding tree unit, it can be set that the downsampling filter is not applied to the common position luma sample.
[0261] Next, when the current image is an HDR image, aspects of application of the down-sampling filter are described.
[0262] For the upper adjacent samples of the chroma component whose x-axis coordinate is greater than 0, a cross filter may be applied to the common position luma samples when all upper adjacent samples and left adjacent samples are available and the current block is not adjacent to the upper boundary of the coding tree unit. Specifically, the downsampling filter may be applied to the common position luma samples, the luma samples adjacent in the horizontal direction of the common position samples, and the luma samples adjacent in the vertical direction of the common position luma samples. In this case, the ratio of the filter coefficients applied to the common position luma samples to the filter coefficients applied to the adjacent luma samples may be 4:1.
[0263] On the other hand, when at least one of the upper neighboring sample and the left neighboring sample is not available or the current block is adjacent to the upper boundary of the coding tree unit, a horizontal directional filter may be applied to the common position luma sample. Specifically, a downsampling filter may be applied to the common position luma sample and the luma sample adjacent in the horizontal direction of the common position luma sample. In this case, the ratio of the filter coefficient applied to the common position luma sample to the filter coefficient applied to the adjacent luma sample may be 2:1.
[0264] For chroma component upper neighboring samples whose x-axis coordinates are equal to or less than 0, a cross filter may be applied to co-located luma samples when all upper neighboring samples and left neighboring samples are available and the current block does not adjoin the upper boundary of a coding tree unit.
[0265] When all upper and left neighboring samples are available but the current block adjoins the upper boundary of a coding tree unit, a horizontally directional downsampling filter may be applied.
[0266] On the other hand, when the current coding block is not adjacent to the upper boundary of the coding tree unit but at least one of the upper neighboring sample and the left neighboring sample is not available, it can be set that the downsampling filter is not applied to the common position luma sample.
[0267] Even when at least one of the upper neighboring sample and the left neighboring sample is not available and the current block adjoins the upper boundary of the coding tree unit, it may be set that the downsampling filter is not applied to the co-located luma sample.
[0268] exist Fig.14 and Fig.15 In the example shown, it is shown that the type of downsampling filter applied to co-located luma samples is determined based on the picture type, the variable AvailTL, and whether the current block is adjacent to the upper boundary of a coding tree unit.
[0269] In another example, the down-sampling filter type may be determined regardless of at least one of the image type, the variable AvailTL, or whether the current block is adjacent to an upper boundary of a coding tree unit.
[0270] Fig.16 An example of applying a fixed type of filter according to the position of upper neighboring samples is shown.
[0271] Regardless of whether the current image is an HDR image, a horizontally directional filter may be applied to co-located luma samples when the x-coordinates of neighboring samples on the chroma components are greater than 0.
[0272] On the other hand, when the x-axis coordinates of the adjacent samples on the chrominance component are equal to or less than 0, the down-sampling filter may not be applied to the co-located luma samples.
[0273] In another example, by considering whether the current image is an HDR image, when the current image is an HDR image, a first type of downsampling filter may be applied to all upper adjacent samples. On the other hand, when the current image is not an HDR image, a second type of downsampling filter may be applied to all upper adjacent samples.
[0274] Here, at least one of the filter shape, the number of taps or coefficients may be different for the first type and the second type.In an example, the first type downsampling filter may represent a 3-tap horizontal directional filter and the second type downsampling filter may represent a 6-tap filter.
[0275] In this case, when the neighboring samples adjacent to the luminance block are not available, the available reconstructed samples may be filled to the position of the unavailable neighboring samples. In the example, when the left neighboring samples adjacent to the left side of the luminance block are not available, the reconstructed samples included in the leftmost column of the luminance block may be filled to the left. Alternatively, when the upper neighboring samples adjacent to the upper side of the luminance block are not available, the reconstructed samples included in the uppermost row of the luminance block may be filled to the upper side.
[0276] By filling the positions of unavailable samples, the downsampling filter type can be determined without considering the availability of neighboring samples.
[0277] Next, a method of deriving filtered luma samples of left-neighboring samples will be described.
[0278] When deriving the filtered luma samples, reconstructed samples included in up to M rows from the left boundary of the luma block may be used. In this case, the number of rows may be determined based on at least one of a chroma subsampling format, a CCLM mode type, an image type, a shape or size of a current block, whether the current block is adjacent to a boundary of a coding tree unit, or a type of a downsampling filter. In the present disclosure, it is assumed that when a downsampling filter is applied to a common position luma sample at a left position of the luma block, reconstructed samples included in 3 columns around the left boundary of the luma block are used.
[0279] A down-sampling filter may be applied to the co-located luma pixel and neighboring pixels adjacent to the co-located luma pixel.
[0280] Fig.17 The type of downsampling filter applied to co-located luma samples of left-neighboring samples is shown.
[0281] The type of down-sampling filter applied to the co-located luma samples may be determined based on at least one of the image type, the variable AvailL, the variable AvailT, and the position of the left neighboring sample.
[0282] First, when the current image is an HDR image, aspects of application of the downsampling filter are described.
[0283] When all upper and left adjacent samples are available, a cross filter may be applied to the common position luma sample. Specifically, a downsampling filter may be applied to the common position luma sample, the luma sample adjacent in the horizontal direction of the common position sample, and the luma sample adjacent in the vertical direction of the common position luma sample. In this case, the ratio of the filter coefficient applied to the common position luma sample to the filter coefficient applied to the adjacent luma sample may be 4:1.
[0284] When the y-axis coordinate of the upper neighboring sample of the chroma component is greater than 0, a cross filter may be applied to the co-located metric sample regardless of the availability of the left neighboring reference sample and the upper neighboring reference sample.
[0285] When the y-axis coordinate of the adjacent sample on the chrominance component is equal to or less than 0 and at least one of the left adjacent reference sample and the upper adjacent reference sample is not available, a horizontally oriented downsampling filter may be applied. Specifically, the downsampling filter may be applied to the common position luma sample and the luma sample adjacent in the horizontal direction of the common position sample. In this case, the ratio of the filter coefficient applied to the common position luma sample to the filter coefficient applied to the horizontally oriented adjacent sample may be 2:1.
[0286] When the current image is not an HDR image, a 6-tap downsampling filter may be applied to the common position luma samples. Specifically, the downsampling filter may be applied to horizontally oriented adjacent samples adjacent in the horizontal direction of the common position samples, and to the lower adjacent samples from the common position luma samples and the lower adjacent samples at the lower position of the common position luma samples. In this case, the ratio of the filter coefficients applied to the common position samples and the lower adjacent samples to the filter coefficients applied to the horizontally oriented adjacent samples may be 2:1.
[0287] exist Fig.16In the example shown, the type of downsampling filter applied to co-located luma samples is shown to be determined based on the image type and the variable AvailTL.
[0288] In another example, the down-sampling filter type may be determined regardless of the image type or at least one of the variables AvailTL.
[0289] Fig.17 An example of applying a fixed type of filter according to the type of a current image is shown.
[0290] When the current image is an HDR image, a horizontally directional filter may be applied to the co-located luma samples.
[0291] On the other hand, when the current image is not an HDR image, a 6-tap downsampling filter may be applied to the co-located luma samples.
[0292] In this case, when the neighboring samples adjacent to the luminance block are not available, the available reconstructed samples may be filled to the position of the unavailable neighboring samples. In the example, when the left neighboring samples adjacent to the left side of the luminance block are not available, the reconstructed samples included in the leftmost column of the luminance block may be filled to the left. Alternatively, when the upper neighboring samples adjacent to the upper side of the luminance block are not available, the reconstructed samples included in the uppermost row of the luminance block may be filled to the upper side.
[0293] By filling the positions of unavailable samples, the downsampling filter type can be determined without considering the availability of neighboring samples.
[0294] Information about a method for determining a downsampling filter may be signaled in a bitstream. In an example, information specifying one of a first method in which the downsampling filter type is determined by considering at least one of the image type, the variable AvailTL, or whether the current block is adjacent to an upper boundary of a coding tree unit, or a second method in which the downsampling filter type is determined regardless of at least one of the conditions may be signaled in a bitstream.
[0295] In another example, at least one of the first method or the second method can be selected based on at least one of the following: the type of the current image, the size and / or shape of the current block, whether the current block is adjacent to the upper boundary of the coding tree unit, the chroma subsampling format, the CCLM mode type, the variable AvailL, the variable AvailT, or the variable AvailTL.
[0296] Alternatively, as described above, the filter type may be determined by considering only whether the current image is an HDR image. In an example, when the current image is an HDR image, only the first type of downsampling filter may be fixedly applied to the upper adjacent sample or the left adjacent sample, and when the current image is not an HDR image, only the second type of downsampling filter may be fixedly applied to the upper adjacent sample or the left adjacent sample. Here, for the first type and the second type, at least one of the filter shape, the number of taps, or the coefficient may be different.
[0297] In this case, padding may be pre-performed on N rows around the upper boundary of the luminance block and / or M rows around the left boundary of the luminance block. When padding is performed, all neighboring samples around the luminance block may be set to be available, and therefore, the filter type may be determined regardless of whether the neighboring samples are available.
[0298] exist Fig.13 In the example shown, it is described that the adjacent samples for deriving CCLM parameters are selected by subsampling. In this case, the positions of the adjacent samples of the subsampling can be set to a combination different from the described example. In the example, instead of Formula 3, the adjacent samples of the subsampling can be derived according to the following Formula 6.
[0299] [Formula 6]
[0300] (-1, a·W / c), (-1, b·W / c), (a·H / c, -1), (b·H / c, -1)
[0301] In Equation 6, W and H represent the width and height of the current chrominance block, respectively. In Equation 6, a combination of variables a, b, and c may be determined based on one of Table 3 below.
[0302] [Table 3]
[0303] (a,b) c (3,5) 8 (5,11) 16 (11,21) 32 (21,43) 64
[0304] Instead of subsampling adjacent samples by using Formula 3, it may be effective to subsample adjacent samples by using a combination of Formula 6 and Table 3 to appropriately maintain the interval of adjacent samples to be subsampled. In an example, when subsampling is performed by using Formula 3, when the width or height of the current block is greater than the other, the interval between 2 samples to be subsampled may be changed in a non-uniform manner. On the other hand, when one of the variables defined in Formula 6 and Table 3 is used, the interval between 2 samples to be subsampled can be maintained more uniformly than when Formula 3 is used.
[0305] One of the variable combinations defined in Table 3 may be selected based on at least one of the size or shape of the current block, the CCLM mode type, the type of the current image, and the chroma subsampling format. In an example, at least one of the width or height of the current block may be set to the variable c, and the combination of (a, b) corresponding to the determined variable c may be called. In an example, when at least one of the width or height of the current block is 4, the combination of (a, b) may be set to (3, 5), when at least one of the width or height of the current block is 8, the combination of (a, b) may be set to (5, 11), when at least one of the width or height of the current block is 16, the combination of (a, b) may be set to (11, 21), and when at least one of the width or height of the current block is equal to or greater than 32, the combination of (a, b) may be set to (21, 43).
[0306] When the current block has a non-square shape, the combination of variables in the horizontal direction may be set to be different from the combination of variables in the vertical direction. In the example, subsampling of the upper adjacent samples of the current block may be performed by calling a combination of (a, b) corresponding to the set variable c after setting the width W of the current block to the variable c. On the other hand, subsampling of the left adjacent samples of the current block may be performed by calling a combination of (a, b) corresponding to the set variable c after setting the width H of the current block to the variable c.
[0307] In another example, information for specifying at least one of the variables a, b, and c may be signaled in the bitstream. In an example, information for specifying each of the variables a, b, and c may be signaled through a sequence parameter set or a picture parameter set.
[0308] Alternatively, index information specifying one of the combinations of variables a, b, and c may be signaled in a bitstream.
[0309] Alternatively, the values of variables a, b and c may be fixed in the encoder and decoder.
[0310] The number of chroma samples to be subsampled may be increased or decreased compared to those described in Equations 3 to 5. In this case, the number of chroma samples to be subsampled may be determined based on at least one of the size or shape of the current block, the type of the current image, whether the current block is adjacent to a boundary of a coding tree unit, a CCLM mode type, a chroma subsampling format, a variable AvailT, a variable AvailL, or a variable AvailTL.
[0311] In the example, Fig.13 In the illustrated example, it is described that when a chroma block has a size of 4×4, a total of 4 adjacent samples are selected by subsampling.
[0312] When the size of the chroma block is larger than 4×4, more neighboring samples may be selected. In an example, when a total of 8 neighboring samples are to be selected, Equations 3 to 5 may be changed to Equations 7 to 9 below.
[0313] [Formula 7]
[0314] (-1, 0W / 4), (-1, W / 4), (-1, 2W / 4), 9-1, 3W / 4), (0H / 4, -1), (1H / 4, -1), (2H / 4-1), (3H / 4-1)
[0315] [Formula 8]
[0316] (-1, 0W / 4), (-1, W / 4), (-1, 2W / 4), (-1, 3W / 4), (-1, 4W / 4), (-1, 5W / 4), (-1, 6W / 4), (-1, 7W / 4)
[0317] [Formula 9]
[0318] (OH / 4, -1), (1H / 4, -1), (2H / 4, -1), (3H / 4, -1), (4H / 4, -1), (5h / 4, -1) (6H / 4, -1), (7H / 4, -1)
[0319] Equations 7 to 9 represent combinations of adjacent samples of sub-sampling in the LM mode, the LM-A mode, and the LM-L mode, respectively.
[0320] The number of sub-sampled neighboring samples can be adjusted based on the size of the current block. In the example, when the current block is smaller than the threshold WxH, 4 neighboring samples can be selected. On the other hand, when the current block is equal to or greater than the threshold WxH, 8 neighboring samples can be selected.
[0321] In the above embodiment, it is shown that a down-sampling filter is applied to the common position luma samples corresponding to the chroma samples to derive CCLM parameters. In another example, CCLM parameters can be derived without applying the down-sampling filter to the common position luma samples. Here, when the down-sampling filter is not applied, it means that the value of the common position luma sample is used as it is when deriving CCLM parameters.
[0322] In another example, whether to apply a downsampling filter may be determined based on the number of neighboring samples. In the example, when 4 neighboring samples are selected, a downsampling filter may be applied to the co-located luma samples. On the other hand, when 8 neighboring samples are selected, a downsampling filter may not be applied to the co-located luma samples.
[0323] In another example, the downsampling filter type may be adaptively determined according to the number of adjacent samples. In an example, at least one of the shape, number of taps or coefficients of the downsampling filter may be different for the case of selecting 4 adjacent samples and the case of selecting 8 adjacent samples.
[0324] The specificity of the reconstructed pixel can be removed or mitigated by applying a low pass filter to the chrominance image or the luminance image. In an example, the low pass filter can be applied before selecting neighboring samples around the chrominance block. When the low pass filter is applied, the block characteristics can be better reflected when deriving the CCLM parameters.
[0325] The low pass filter can be set to be applied only to the chrominance image. This is because for the reconstructed pixels in the luminance image, the specificity of the reconstructed pixels can be removed or mitigated by the downsampling filter.
[0326] In another example, a low pass filter may be applied to both the chrominance image and the luma image.
[0327] Information indicating whether a low pass filter is to be applied may be signaled in the bitstream.The information may be signaled for each of the luma component and the chroma component.
[0328] The CCLM parameters α and β may be derived by using neighboring samples adjacent to the chrominance block and neighboring samples adjacent to the luma block.
[0329] When deriving CCLM parameters, the brightness component neighboring samples can be classified into 2 groups. The classification can be based on the values of the neighboring samples. In an example, when 4 neighboring samples are selected, the 2 maximum values of the 4 neighboring samples can be classified into the first group, and the 2 minimum values can be classified into the second group.
[0330] The chrominance component adjacent samples may also be classified into two groups. The classification may be based on the classification result of the luminance component. In other words, if the adjacent luminance samples are classified into the Nth group, the corresponding adjacent chrominance samples may also be classified into the Nth group.
[0331] Then, for each of the luma component and the chroma component, the sample average of each group can be obtained. In the example, for the luma component, the average value Xb can be obtained by averaging adjacent luma samples belonging to the first group, and the average value Xa can be obtained by averaging adjacent luma samples belonging to the second group. In addition, for the chroma component, the average value Yb can be obtained by averaging adjacent chroma samples belonging to the first group, and the average value Ya can be obtained by averaging adjacent chroma samples belonging to the second group.
[0332] The CCLM parameters may be derived based on the derived average values. In an example, the weight α and the offset β may be derived based on the following equations 10 and 11.
[0333] [Formula 10]
[0334] α=(Y a -Y b ) / (X a -X b )
[0335] [Formula 11]
[0336] β=Y a -αX a
[0337] When the CCLM parameters are derived, the chrominance samples may be predicted by using the downsampled luma samples S804. Specifically, the chrominance prediction samples may be obtained by adding an offset β to the product of the downsampled luma samples and a weight α.
[0338] The luminance component neighboring samples and the chrominance component neighboring samples may be classified into 3 or more groups. In an example, n of the N luminance neighboring samples may be classified into a first group, m luminance neighboring samples may be classified into a second group, and (Nnm) luminance neighboring samples may be classified into a third group. The classification may be based on the value of the neighboring luminance samples.
[0339] It is also possible to classify the chrominance component neighboring samples into three or more groups by referring to the classification results of the luminance component neighboring samples.
[0340] When the neighboring samples are classified into 3 or more groups, CCLM parameters can be derived by using only 2 of the 3 or more groups. In an example, CCLM parameters can be derived by using a group including neighboring samples with a maximum value and a group including neighboring samples with a minimum value.
[0341] In the above example, it is described that the chroma neighboring samples are classified by referring to the classification results of the luma neighboring samples. In contrast to the described example, the luma neighboring samples may be classified by referring to the classification results of the chroma neighboring samples after the chroma neighboring samples are classified.
[0342] In another example, adjacent luma samples and adjacent chroma samples may be independently classified into groups.
[0343] The present disclosure also has the following configurations:
[0344] 1. A method for decoding a video, the method comprising:
[0345] Determines whether CCLM (cross-component linear model) mode is applied to chroma blocks;
[0346] When it is determined that the CCLM mode is determined for the chroma block, obtaining filtered adjacent luma samples of adjacent chroma samples adjacent to the chroma block;
[0347] deriving CCLM parameters by using the neighboring chroma samples and the filtered neighboring luma samples; and
[0348] A prediction block of the chroma block is generated by using the CCLM parameters.
[0349] 2. The method of claim 1 , wherein the filtered adjacent luma samples are generated by applying a downsampling filter to co-located luma samples corresponding to the adjacent chroma samples and adjacent luma samples adjacent to the co-located luma samples.
[0350] 3. The method according to scheme 2, wherein, when at least one of the co-located luma samples and the adjacent luma samples is unavailable, reconstructed samples located on the boundary in the luma block are filled to the position of the unavailable sample.
[0351] 4. The method according to scheme 2, wherein the type of the downsampling filter is determined based on the type of the current image.
[0352] 5. The method according to claim 2, wherein the type of the downsampling filter is determined based on the positions of the adjacent chroma samples.
[0353] 6. The method according to scheme 1, wherein the adjacent chroma samples are extracted by subsampling a plurality of adjacent chroma samples adjacent to the chroma block.
[0354] 7. The method of claim 6, wherein the subsampling rate is determined based on at least one of a size or a shape of the chroma block.
[0355] 8. A video encoding method, comprising:
[0356] Determines whether CCLM (cross-component linear model) mode is applied to chroma blocks;
[0357] When it is determined that the CCLM mode is determined for the chroma block, obtaining filtered adjacent luma samples of adjacent chroma samples adjacent to the chroma block;
[0358] deriving CCLM parameters by using the neighboring chroma samples and the filtered neighboring luma samples; and
[0359] A prediction block of the chroma block is generated by using the CCLM parameters.
[0360] 9. A computer-readable recording medium storing a bit stream encoded by a video encoding method, wherein:
[0361] The video encoding method comprises:
[0362] Determines whether CCLM (cross-component linear model) mode is applied to chroma blocks;
[0363] When it is determined that the CCLM mode is determined for the chroma block, obtaining filtered adjacent luma samples of adjacent chroma samples adjacent to the chroma block;
[0364] deriving CCLM parameters by using the neighboring chroma samples and the filtered neighboring luma samples; and
[0365] A prediction block of the chroma block is generated by using the CCLM parameters.
[0366] The syntax used in the above embodiments is named only for the convenience of description.
[0367] 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.
[0368] The above-mentioned embodiments are described based on a series of stages or flow charts, but they do not limit the time series order of the present disclosure, and if necessary, they can be performed simultaneously or in different orders. In addition, each component (e.g., unit, module, etc.) of the block diagram in the above-mentioned embodiments can be implemented as a hardware device or software, and a plurality of components can be combined and implemented as a hardware device or software. By realizing in the form of program instructions that can be executed by various computer components, the above-mentioned embodiments can be 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 hardware device that is particularly configured to store and execute magnetic media such as hard disks, floppy disks and tapes, optical recording media such as CD-ROMs, DVDs, magneto-optical media such as optical floppy disks, and program instructions such as ROMs, RAMs, flash memories, etc. is included in the computer-readable recording medium. The hardware device can be configured to operate as one or more software modules to perform processing according to the present disclosure, and vice versa.
[0369] Industrial Applicability
[0370] The present disclosure may be applied to an electronic device that can encode / decode an image.
Claims
1. A method for decoding a video, the method comprising: Determines whether the cross-component linear model (CCLM) prediction is applied to the chroma block; When the CCLM prediction is applied to a chroma block, determining a CCLM mode of the chroma block among a plurality of CCLM mode candidates; Based on the CCLM mode, deriving CCLM parameters based on chroma reference samples and filtered luma reference samples of the chroma block; as well as Obtain predicted samples of the chrominance block based on the downsampled luma samples and the CCLM parameters, wherein the downsampled luminance samples are obtained based on a common position luminance sample in a luminance block and adjacent luminance samples adjacent to the common position luminance sample, wherein unavailable adjacent luminance samples among adjacent luminance samples adjacent to the common position luminance sample are set equal to the common position luminance sample, wherein the filtered luma reference samples are obtained by applying a downsampling filter to reference luma samples of the luma block, and The type of down-sampling filter applied to the reference luma sample is determined based on whether the luma block is adjacent to an upper boundary of a coding tree unit.
2. The method according to claim 1, wherein: When the luma block is adjacent to an upper boundary of the coding tree unit, generating the filtered luma reference sample by a one-dimensional horizontal downsampling filter, and Wherein, when the luma block is not adjacent to an upper boundary of the coding tree unit, the filtered luma reference sample is generated by applying a cross-shaped down-sampling filter to the luma reference sample.
3. The method according to claim 1, wherein: The type of the down-sampling filter is also determined based on the type of the current image.
4. The method according to claim 3, wherein: Determine whether the type of the current image is one of a high dynamic range (HDR) type or a non-HDR type, and The type of the down-sampling filter is different when the current image is of HDR type and when the current image is of non-HDR type.
5. The method according to claim 1, wherein: The chroma reference samples are located at sub-sampling positions outside the chroma block.
6. The method according to claim 5, wherein: A subsampling rate for determining the subsampling position is determined based on at least one of a size or a shape of the chroma block.
7. A video encoding method, comprising: A CCLM mode based on a chroma block, wherein CCLM parameters are obtained based on chroma reference samples and filtered adjacent luminance samples of the chroma block, wherein the CCLM mode is determined from a plurality of CCLM mode candidates; Obtain predicted samples of the chrominance block based on the downsampled luma samples and the CCLM parameters; as well as encoding information indicating whether CCLM prediction is applied to the chroma block, wherein the downsampled luminance samples are obtained based on a common position luminance sample in a luminance block and adjacent luminance samples adjacent to the common position luminance sample, wherein unavailable adjacent luminance samples among adjacent luminance samples adjacent to the common position luminance sample are set equal to the common position luminance sample, wherein the filtered luma reference samples are obtained by applying a downsampling filter to reference luma samples of the luma block, and The type of down-sampling filter applied to the reference luma sample is determined based on whether the luma block is adjacent to an upper boundary of a coding tree unit.
8. A device for transmitting compressed video data, the device comprising: a processor configured to obtain compressed video data; as well as a transmission unit configured to transmit the compressed video data, The compressed video data is obtained by: A CCLM mode based on a chroma block, wherein CCLM parameters are obtained based on chroma reference samples and filtered adjacent luminance samples of the chroma block, wherein the CCLM mode is determined from a plurality of CCLM mode candidates; Obtaining prediction samples of the chrominance block based on the downsampled luma samples and the CCLM parameters; and encoding information indicating whether CCLM prediction is applied to the chroma block, wherein the downsampled luminance samples are obtained based on a common position luminance sample in a luminance block and adjacent luminance samples adjacent to the common position luminance sample, wherein unavailable adjacent luminance samples among adjacent luminance samples adjacent to the common position luminance sample are set equal to the common position luminance sample, wherein the filtered luma reference samples are obtained by applying a downsampling filter to reference luma samples of the luma block, and The type of down-sampling filter applied to the reference luma sample is determined based on whether the luma block is adjacent to an upper boundary of a coding tree unit.