Method and apparatus for processing a video signal
By replacing unavailable reference samples in video signal encoding and decoding, and using the average values of multiple reference sample lines for intra prediction, the problem of unavailable reference samples in intra prediction is solved, and prediction efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202111179190.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2016-06-24
- Filing Date
- 2017-06-22
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2037-06-22
AI Technical Summary
When encoding and decoding video signals, the problem of unavailable reference samples encountered during intra prediction, resulting in inefficient prediction and difficulty in effectively processing data in multiple reference lines.
Ensure the accuracy and efficiency of the predicted samples by selecting available reference samples from multiple reference sample rows to replace unavailable reference samples and calculating the mean based on the selected reference sample rows.
Effective intra prediction of encoding and decoding target blocks is realized, prediction efficiency is improved, unavailable samples can be replaced during generation of multiple reference lines, ensuring the accuracy and efficiency of prediction.
Smart Images

Figure CN113873240B_ABST
Abstract
Description
[0001] This application is a divisional application of the PCT application with national application number 201780038981.0, date of entry into the Chinese national phase on December 21, 2018, and invention name “Method and device for processing video signals”. Technical Field
[0002] The invention relates to a method and an apparatus for processing a video signal. Background Art
[0003] Recently, the demand for high-resolution and high-quality images (e.g., high-definition (HD) images and ultra-high-definition (UHD) images) has increased in various application fields. However, the data amount of image data with higher resolution and quality increases compared to conventional image data. Therefore, when the image data is transmitted by using a medium (e.g., conventional wired and wireless broadband networks), or when the image data is stored by using a conventional storage medium, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data increase, efficient image encoding / decoding technology can be used.
[0004] The image compression technology includes various technologies, including: an inter-frame prediction technology that predicts a pixel value included in a current picture based on a previous picture or a subsequent picture of the current picture; an intra-frame prediction technology that predicts a pixel value included in a current picture by using pixel information in the current picture; an entropy coding technology that assigns a short code to a value with a high frequency of occurrence and a long code to a value with a low frequency of occurrence, etc. Image data can be effectively compressed by using such an image compression technology, and the image data can be transmitted or stored.
[0005] Meanwhile, as the demand for high-resolution images increases, the demand for stereoscopic image content as a new image service is also increasing. Video compression technology for efficiently providing stereoscopic image content with high resolution and ultra-high resolution is being explored. Summary of the invention
[0006] Technical issues
[0007] An object of the present invention is to provide a method and apparatus for efficiently performing intra prediction on an encoding / decoding target block when encoding / decoding a video signal.
[0008] An object of the present invention is to provide a method and apparatus for performing intra prediction on an encoding / decoding target block based on a plurality of reference lines.
[0009] An object of the present invention is to provide a method and apparatus for replacing unavailable reference samples with available reference samples during generation of a plurality of reference lines when encoding / decoding a video signal.
[0010] An object of the present invention is to provide a method and apparatus for calculating an average value of any one of a plurality of reference lines when encoding / decoding a video signal.
[0011] The technical objectives to be achieved by the present invention are not limited to the above technical problems. In addition, according to the following description, those skilled in the art will clearly understand other technical problems not mentioned.
[0012] Technical Solution
[0013] The method and apparatus for decoding a video signal according to the present invention can: obtain a plurality of reference sample rows for a current block, select a reference sample row for intra prediction of the current block from the plurality of reference sample rows, and perform intra prediction on the current block using the selected reference sample row. At this time, if an unavailable reference sample is included in a first reference sample row among the plurality of reference sample rows, the unavailable reference sample is replaced with an available reference sample included in the first reference sample row or in a second reference sample row different from the first reference sample row.
[0014] The method and apparatus for encoding a video signal according to the present invention can: obtain a plurality of reference sample rows for a current block, select a reference sample row for intra-frame prediction of the current block from the plurality of reference sample rows, and perform intra-frame prediction on the current block using the selected reference sample row. At this time, if an unavailable reference sample is included in a first reference sample row among the plurality of reference sample rows, the unavailable reference sample is replaced with an available reference sample included in the first reference sample row or in a second reference sample row different from the first reference sample row.
[0015] In the method and apparatus for encoding / decoding a video signal according to the present invention, unavailable reference samples are replaced with available reference samples having the shortest distance from the unavailable reference samples among available reference samples included in a first reference sample row or a second reference sample row.
[0016] In a method and apparatus for encoding / decoding a video signal according to the present invention, if a distance between an unavailable reference sample and an available reference sample included in a first reference row is equal to or greater than a threshold, the unavailable reference sample is replaced with an available reference sample included in a second reference row.
[0017] In the method and apparatus for encoding / decoding a video signal according to the present invention, the second reference line has a larger index value than the first reference line.
[0018] In the method and apparatus for encoding / decoding a video signal according to the present invention, a prediction sample of a current block is generated based on an average value of a portion of reference samples included in a selected reference sample row.
[0019] In the method and apparatus for encoding / decoding a video signal according to the present invention, the number of reference samples used to calculate an average value among reference samples included in a selected reference sample row is determined based on the size of a current block.
[0020] A method for decoding a video according to the present invention includes: determining a reference sample row of a current block from among one or more reference sample row candidates; obtaining reference samples included in the reference sample row; and performing intra-frame prediction of the current block using the reference samples in the reference sample row, wherein: the number of the one or more reference sample row candidates is determined based on information transmitted by a signal at a sequence level.
[0021] The method for encoding a video according to the present invention includes: obtaining a reference sample of a current block; and performing intra-frame prediction of the current block using a reference sample in a reference sample row, wherein: the reference sample row including the reference sample of the current block is selected from one or more reference sample row candidates, and information for determining the number of the one or more reference sample row candidates is encoded at a sequence level.
[0022] According to the device for storing compressed video data generated using program instructions of the present invention, when the program instructions are executed, the device is configured to: obtain reference samples of a current block; and perform intra-frame prediction of the current block using reference samples in a reference sample row, wherein: the reference sample row including the reference sample of the current block is selected from one or more reference sample row candidates, and information for determining the number of the one or more reference sample row candidates is encoded at a sequence level.
[0023] The features briefly summarized above are merely illustrative aspects of the detailed description of the invention that follows and do not limit the scope of the invention.
[0024] Beneficial Effects
[0025] According to the present invention, efficient intra prediction can be performed on an encoding / decoding target block.
[0026] According to the present invention, intra prediction for an encoding / decoding target block can be performed based on a plurality of reference lines.
[0027] According to the present invention, unavailable reference samples are replaced with available reference samples during the generation of a plurality of reference lines.
[0028] According to the present invention, intra prediction for an encoding / decoding target block is performed by calculating an average value of one of the plurality of reference lines.
[0029] Effects that can be obtained by the present invention are not limited to the above-mentioned effects, and other effects that are not mentioned can be clearly understood by those skilled in the art from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present invention.
[0031] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present invention.
[0032] Figure 3 is a diagram showing an example of hierarchical division of a coding block based on a tree structure according to an embodiment of the present invention.
[0033] Figure 4 is a diagram showing a partitioning mode that can be applied to a coding block when the coding block is encoded through inter prediction.
[0034] Figure 5 is a diagram illustrating types of predefined intra prediction modes of an apparatus for encoding / decoding a video according to an embodiment of the present invention.
[0035] Figure 6 is a diagram illustrating an extended intra prediction mode according to an embodiment of the present invention.
[0036] Figure 7 is a flowchart briefly illustrating an intra prediction method according to an embodiment of the present invention.
[0037] Figure 8 is a diagram illustrating a method of correcting a prediction sample of a current block based on differential information of adjacent samples according to an embodiment of the present invention.
[0038] Fig. 9 and Fig.10 is a diagram illustrating a method of correcting a prediction sample based on a predetermined correction filter according to an embodiment of the present invention.
[0039] Fig.11 A range of reference samples used for intra prediction according to an embodiment to which the present invention is applied is shown.
[0040] Figure 12 to Figure 14 An example of filtering reference samples according to an embodiment of the present invention is shown.
[0041] Fig.15 is a diagram illustrating a plurality of reference sample rows according to an embodiment of the present invention.
[0042] Fig.16is a flowchart illustrating a method of performing intra prediction using an extended reference line according to the present invention.
[0043] Fig.17 is a diagram illustrating multiple reference rows for non-square blocks according to the present invention.
[0044] Fig.18 is a diagram for explaining an example in which an unavailable reference sample is replaced with an available reference sample located at the shortest distance from the unavailable reference sample.
[0045] Fig.19 and Fig. 20 is a diagram for explaining an embodiment in which the positions of available reference samples are adaptively determined according to the distances between the unavailable reference samples and the available reference samples included in the same reference row as the unavailable reference samples.
[0046] Fig.21 and Fig. 22 is a diagram showing reference samples used to obtain an average value of a reference row according to an embodiment to which the present invention is applied. DETAILED DESCRIPTION
[0047] The present invention can be modified in various ways, and there are various embodiments of the present invention, and examples of the embodiments will now be provided with reference to the accompanying drawings, and they will be described in detail. However, the present invention is not limited thereto, and the exemplary embodiments may be interpreted as including all modifications, equivalents or alternatives within the technical concept and technical scope of the present invention. In the described drawings, similar reference numerals refer to similar elements.
[0048] The terms "first", "second", etc. used in the specification may be used to describe various components, but these components are not to be construed as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, a "first" component may be referred to as a "second" component, and a "second" component may also be similarly referred to as a "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple terms.
[0049] It should be understood that in this specification, when an element is simply referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, the element may be “directly connected to” or “directly coupled to” another element, or the element may be connected to or coupled to another element with other elements interposed therebetween. Conversely, it should be understood that when an element is referred to as being “directly coupled to” or “directly connected to” another element, there are no intervening elements.
[0050] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Expressions used in the singular include expressions in the plural form unless the expression has a significantly different meaning in the context. In this specification, it should be understood that terms such as "including", "having" and the like are intended to indicate the presence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added.
[0051] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same constituent elements in the drawings are denoted by the same reference numerals, and repeated description of the same elements will be omitted.
[0052] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present invention.
[0053] Reference Figure 1 The device 100 for encoding a video may include: a picture division module 110, prediction modules 120 and 125, a transformation module 130, a quantization module 135, a rearrangement module 160, an entropy coding module 165, an inverse quantization module 140, an inverse transformation module 145, a filter module 150 and a memory 155.
[0054] Figure 1 The components shown are shown independently to represent the characteristic functions that are different from each other in the device for encoding video. Therefore, this does not mean that each component is composed of a separate hardware or software component unit. In other words, for convenience, each component includes each of the listed components. Therefore, at least two components of each component can be combined to form a component, or a component can be divided into multiple components to perform each function. Without departing from the essence of the present invention, the embodiment of combining each component and the embodiment of dividing a component are also included in the scope of the present invention.
[0055] In addition, some of the components may not be essential components for performing the basic functions of the present invention, but are optional components only for improving the performance of the present invention. The present invention can be implemented by excluding components for improving performance and only including essential components for implementing the essence of the present invention. Structures that exclude optional components only for improving performance and only include essential components are also included in the scope of the present invention.
[0056] The picture partitioning module 110 may partition an input picture into one or more processing units. Here, a processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture partitioning module 110 may partition a picture into a combination of a plurality of coding units, prediction units, and transform units, and may encode a picture by selecting a combination of coding units, prediction units, and transform units using a predetermined criterion (e.g., a cost function).
[0057] For example, a picture can be divided into multiple coding units. A recursive tree structure (e.g., a quadtree structure) can be used to divide a picture into coding units. Coding units divided into other coding units with a picture or a maximum coding unit as the root can be divided in a manner that the child nodes correspond to the number of divided coding units. Coding units that cannot be further divided according to predetermined restrictions are used as leaf nodes. That is, when it is assumed that only square division is feasible for a coding unit, a coding unit can be divided into up to four other coding units.
[0058] Hereinafter, in an embodiment of the present invention, a coding unit may mean a unit that performs encoding or a unit that performs decoding.
[0059] The prediction unit may be one of partitions split into a square shape or a rectangular shape having the same size in a single coding unit, or the prediction unit may be one of partitions split so as to have different shapes / sizes in a single coding unit.
[0060] When a prediction unit to be intra-predicted is generated based on a coding unit and the coding unit is not a minimum coding unit, intra-prediction may be performed without splitting the coding unit into a plurality of prediction units N×N.
[0061] The prediction modules 120 and 125 may include an inter prediction module 120 that performs inter prediction and an intra prediction module 125 that performs intra prediction. It may be determined whether inter prediction or intra prediction is performed for the prediction unit, and detailed information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. Here, the processing unit to be predicted may be different from the processing unit for which the prediction method and detailed content are determined. For example, the prediction method, prediction mode, etc. may be determined by the prediction unit, and the prediction may be performed by the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform module 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value by the entropy encoding module 165, and may be transmitted to a device for decoding a video. When a specific encoding mode is used, it may be transmitted to a device for decoding a video by encoding the original block without generating a prediction block through the prediction modules 120 and 125.
[0062] The inter-frame prediction module 120 may predict a prediction unit based on information of 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 of some coding regions in the current picture. The inter-frame prediction module 120 may include a reference picture interpolation module, a motion prediction module, and a motion compensation module.
[0063] The reference picture interpolation module may receive reference picture information from the memory 155, and may generate pixel information of integer pixels or less than integer pixels according to the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information of integer pixels or less than integer pixels in units of 1 / 4 pixels. In the case of chrominance signals, a 4-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information of integer pixels or less than integer pixels in units of 1 / 8 pixels.
[0064] The motion prediction module can perform motion prediction based on the reference picture interpolated by the reference picture interpolation module. Various methods can be used as methods for calculating motion vectors, for example, full search based block matching algorithm (FBMA), three-step search (TSS) and new three-step search algorithm (NTS), etc. Based on the interpolated pixels, the motion vector can have a motion vector value in units of 1 / 2 pixel or 1 / 4 pixel. The motion prediction module can predict the current prediction unit by changing the motion prediction method. Various methods can be used as motion prediction methods, for example, a skip method, a merge method, an AMVP (Advanced Motion Vector Prediction) method, an intra-frame block copy method, etc.
[0065] The intra prediction module 125 may generate a prediction unit based on reference pixel information adjacent to a current block as pixel information in a current picture. When an adjacent block of the current prediction unit is a block to be inter-predicted and thus a reference pixel is a pixel to be inter-predicted, reference pixel information of an adjacent block to be intra-predicted may be used to replace the reference pixel included in the block to be inter-predicted. That is, when a reference pixel is unavailable, at least one reference pixel among available reference pixels may be used to replace the unavailable reference pixel information.
[0066] The prediction mode in the intra prediction may include a directional prediction mode using reference pixel information according to the prediction direction and a non-directional prediction mode that does not use directional information when performing prediction. The mode for predicting luminance information may be different from the mode for predicting chrominance information, and in order to predict chrominance information, the intra prediction mode information for predicting luminance information or the predicted luminance signal information may be used.
[0067] When performing intra prediction, when the size of the prediction unit is the same as the size of the transform unit, intra prediction can be performed on the prediction unit based on pixels located on the left, upper left, and top of the prediction unit. However, when performing intra prediction, when the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed using reference pixels based on the transform unit. In addition, intra prediction with N×N partitioning can be used only for the minimum coding unit.
[0068] In the intra prediction method, a prediction block may be generated after applying an AIS (Adaptive Intra Smoothing) filter to a reference pixel according to a prediction mode. The type of the AIS filter applied to the reference pixel may vary. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit may be predicted according to the intra prediction mode of a prediction unit adjacent to the current prediction unit. In predicting the prediction mode of the current prediction unit by using the mode information predicted according to the adjacent prediction unit, when the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the adjacent prediction unit, predetermined flag information may be used to transmit information indicating that the prediction mode of the current prediction unit and the prediction mode of the adjacent prediction unit are the same as each other. When the prediction mode of the current prediction unit is different from the prediction mode of the adjacent prediction unit, entropy coding may be performed to encode the prediction mode information of the current block.
[0069] In addition, a residual block including information on a residual value that is a difference between a prediction unit to be predicted and an original block of the prediction unit may be generated based on the prediction unit generated by the prediction modules 120 and 125. The generated residual block may be input to the transform module 130.
[0070] The transform module 130 may transform the residual block including information on the residual value between the original block and the prediction unit generated by the prediction modules 120 and 125 by using a transform method such as discrete cosine transform (DCT), discrete sine transform (DST), and KLT. Whether to apply DCT, DST, or KLT in order to transform the residual block may be determined based on intra prediction mode information of the prediction unit used to generate the residual block.
[0071] The quantization module 135 may quantize the value transformed to the frequency domain by the transform module 130. The quantization coefficient may vary depending on the importance of the picture or the block. The value calculated by the quantization module 135 may be provided to the inverse quantization module 140 and the rearrangement module 160.
[0072] The rearrangement module 160 may rearrange coefficients of the quantized residual value.
[0073] The rearrangement module 160 may convert the coefficients in the two-dimensional block form into coefficients in the one-dimensional vector form by a coefficient scanning method. For example, the rearrangement module 160 may use a zigzag scanning method to scan from the DC coefficient to the coefficients in the high frequency domain so as to convert the coefficients into the one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, the zigzag scanning may be replaced by a vertical direction scanning of the coefficients in the two-dimensional block form along the column direction or a horizontal direction scanning of the coefficients in the two-dimensional block form along the row direction. That is, it may be determined which scanning method to use among the zigzag scanning, the vertical direction scanning, and the horizontal direction scanning depending on the size of the transform unit and the intra-frame prediction mode.
[0074] The entropy encoding module 165 may perform entropy encoding based on the value calculated by the rearrangement module 160. The entropy encoding may use various encoding methods, for example, exponential Golomb coding, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC).
[0075] The entropy coding module 165 can encode various information from the rearrangement module 160 and the prediction modules 120 and 125, such as residual value coefficient information and block type information of the coding unit, prediction mode information, partition unit information, prediction unit information, transformation unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.
[0076] The entropy encoding module 165 may entropy encode coefficients of the coding unit input from the rearrangement module 160 .
[0077] The inverse quantization module 140 may inversely quantize the value quantized by the quantization module 135, and the inverse transform module 145 may inversely transform the value transformed by the transform module 130. The residual values generated by the inverse quantization module 140 and the inverse transform module 145 may be combined with the prediction units predicted by the motion estimation module, the motion compensation module, and the intra prediction module of the prediction modules 120 and 125, so that a reconstructed block may be generated.
[0078] The filter module 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
[0079] The deblocking filter can remove block distortion that occurs due to the boundaries between blocks in the reconstructed picture. In order to determine whether to perform deblocking, the pixels included in several rows or columns of the block can be the basis for determining whether to apply the deblocking filter to the current block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied depending on the required deblocking filter strength. In addition, when applying the deblocking filter, horizontal direction filtering and vertical direction filtering can be processed in parallel.
[0080] The offset correction module can correct the offset from the original picture in units of pixels in the picture to be deblocked. In order to perform offset correction on a specific picture, a method of applying an offset considering edge information of each pixel can be used, or the following method can be used: the pixels of the picture are divided into a predetermined number of regions, the region to be offset is determined, and the offset is applied to the determined region.
[0081] Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing a filtered reconstructed picture with an original picture. The pixels included in the picture can be divided into predetermined groups, the filter to be applied to each group can be determined, and filtering can be performed separately for each group. Information on whether to apply ALF and a luminance signal can be transmitted by a coding unit (CU). The shape and filter coefficient of the filter used for ALF can vary depending on each block. In addition, regardless of the characteristics of the application target block, a filter of the same shape (fixed shape) for ALF can be applied.
[0082] The memory 155 may store the reconstructed block or the reconstructed picture calculated by the filter module 150. The stored reconstructed block or the reconstructed picture may be provided to the prediction modules 120 and 125 when performing inter prediction.
[0083] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present invention.
[0084] Reference Figure 2The apparatus 200 for decoding a video may include an entropy decoding module 210 , a rearrangement module 215 , an inverse quantization module 220 , an inverse transform module 225 , prediction modules 230 and 235 , a filter module 240 , and a memory 245 .
[0085] When a video bitstream is input from the apparatus for encoding a video, the input bitstream may be decoded according to an inverse process of the apparatus for encoding a video.
[0086] The entropy decoding module 210 may perform entropy decoding according to an inverse process of entropy encoding performed by an entropy encoding module of a device for encoding a video. For example, corresponding to a method performed by a device for encoding a video, various methods may be applied, such as exponential Golomb coding, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC).
[0087] The entropy decoding module 210 may decode information on intra prediction and inter prediction performed by the apparatus for encoding a video.
[0088] The rearrangement module 215 may perform rearrangement on the bitstream entropy-decoded by the entropy decoding module 210 based on the rearrangement method used in the apparatus for encoding a video. The rearrangement module may reconstruct and rearrange coefficients in a one-dimensional vector form into coefficients in a two-dimensional block form. The rearrangement module 215 may receive information related to coefficient scanning performed in the apparatus for encoding a video, and may perform rearrangement via a method of inversely scanning coefficients based on a scanning order performed in the apparatus for encoding a video.
[0089] The inverse quantization module 220 may perform inverse quantization based on a quantization parameter received from the apparatus for encoding a video and coefficients of the rearranged block.
[0090] The inverse transform module 225 may perform an inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, which is an inverse process of the transform, i.e., DCT, DST, and KLT, performed by the transform module on the quantization result of the device for encoding the video. The inverse transform may be performed based on a transform unit determined by the device for encoding the video. The inverse transform module 225 of the device for decoding the video may selectively perform a transform scheme (e.g., DCT, DST, KLT) depending on a plurality of pieces of information (e.g., a prediction method, a size of a current block, a prediction direction, etc.).
[0091] The prediction modules 230 and 235 may generate a prediction block based on the information on prediction block generation received from the entropy decoding module 210 and the picture information or the previously decoded block received from the memory 245 .
[0092] As described above, similar to the operation of the apparatus for encoding a video, when performing intra prediction, when the size of the prediction unit is the same as the size of the transform unit, intra prediction can be performed on the prediction unit based on pixels located on the left, upper left, and top of the prediction unit. When performing intra prediction, when the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed 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.
[0093] The prediction modules 230 and 235 may include a prediction unit determination module, an inter-frame prediction module, and an intra-frame prediction module. The prediction unit determination module may receive various information from the entropy decoding module 210, such as prediction unit information, prediction mode information of an intra-frame prediction method, information on motion prediction of an inter-frame prediction method, etc., may divide the current coding unit into prediction units, and may determine whether to perform inter-frame prediction or intra-frame prediction on the prediction unit. By using the information required for inter-frame prediction of the current prediction unit received from the device for encoding a video, the inter-frame prediction module 230 may perform inter-frame prediction on the current prediction unit based on information about at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit. Alternatively, inter-frame prediction may be performed based on information about some pre-reconstructed areas in the current picture including the current prediction unit.
[0094] In order to perform inter prediction, which one of the skip mode, the merge mode, the AMVP mode, and the inter block copy mode to use as a motion prediction method of a prediction unit included in the coding unit may be determined for a coding unit.
[0095] The intra prediction module 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit to be intra predicted, intra prediction can be performed based on the intra prediction mode information of the prediction unit received from the device for encoding the video. The intra prediction module 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation module, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block, and whether to apply the filter may depend on the prediction mode of the current prediction unit. AIS filtering may be performed on the reference pixels of the current block by using the AIS filter information received from the device for encoding the video and the prediction mode of the prediction unit. 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.
[0096] When the prediction mode of the prediction unit is a prediction mode in which intra prediction is performed based on pixel values obtained by interpolating reference pixels, the reference pixel interpolation module may interpolate the reference pixels to generate reference pixels that are integer pixels or smaller than integer pixels. When the prediction mode of the current prediction unit is a prediction mode in which a prediction block is generated without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is a DC mode, a DC filter may generate a prediction block by filtering.
[0097] The reconstructed block or the reconstructed picture may be provided to the filter module 240. The filter module 240 may include a deblocking filter, an offset correction module, and an ALF.
[0098] Information about whether to apply a deblocking filter to a corresponding block or picture and information about which filter of a strong filter and a weak filter to apply when applying the deblocking filter can be received from a device for encoding a video. A deblocking filter of a device for decoding a video can receive information about the deblocking filter from a device for encoding a video, and can perform deblocking filtering on a corresponding block.
[0099] The offset correction module may perform offset correction on the reconstructed picture based on the type of offset correction applied to the picture when encoding is performed and offset value information.
[0100] The AFL may be applied to the coding unit based on information on whether the ALF is applied and ALF coefficient information, etc., received from the apparatus for encoding a video. The ALF information may be provided to be included in a specific parameter set.
[0101] The memory 245 may store the reconstructed picture or the reconstructed block to be used as a reference picture or a reference block, and may provide the reconstructed picture to the output module.
[0102] As described above, in the embodiments of the present invention, for convenience of explanation, a coding unit is used as a term indicating a unit for encoding, however, the coding unit may be used as a unit that performs decoding as well as encoding.
[0103] In addition, the current block may represent a target block to be encoded / decoded. Also, the current block may represent a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit), a prediction block (or prediction unit), etc. depending on the encoding / decoding step.
[0104] A picture may be encoded / decoded by dividing the picture into a square or non-square basic block. At this time, the basic block may be referred to as a coding tree unit. Information about whether the coding tree unit has a square shape or a non-square shape or information about the size of the coding tree unit may be transmitted through a sequence parameter set, a picture parameter set, or a slice header. The coding tree unit may be divided into a quadtree structure or a binary tree structure, so that a coding unit may be generated.
[0105] Figure 3 is a diagram showing an example of hierarchical division of a coding block based on a tree structure according to an embodiment of the present invention.
[0106] The input video signal is decoded in predetermined block units. Such a default unit for decoding the input video signal is a coding block. A coding block may be a block that performs intra / inter prediction, transformation, and quantization. In addition, a prediction mode (e.g., an intra prediction mode or an inter prediction mode) is determined in units of coding blocks, and the prediction blocks included in the coding block may share the determined prediction mode. A coding block may be a square block or a non-square block of any size in the range of 8×8 to 64×64, or may be a square block or a non-square block of a size of 128×128, 256×256, or larger.
[0107] Specifically, the coding block can be hierarchically divided based on at least one of a quadtree and a binary tree. Here, quadtree-based division may mean dividing a 2N×2N coding block into four N×N coding blocks, and binary tree-based division may mean dividing one coding block into two coding blocks. Binary tree-based division may be performed symmetrically or asymmetrically. The coding block based on binary tree division may be a square block or a non-square block, for example, a rectangular shape. Binary tree-based division may be performed on the coding block for which quadtree-based division is no longer performed. Quadtree-based division may no longer be performed on the coding block based on binary tree division.
[0108] In order to implement adaptive partitioning based on quadtree or binary tree, the following information may be used: information indicating quadtree-based partitioning, information about the size / depth of coding blocks for which quadtree-based partitioning is allowed, information indicating binary tree-based partitioning, information about the size / depth of coding blocks for which binary tree-based partitioning is allowed, information about the size / depth of coding blocks for which binary tree-based partitioning is not allowed, information about whether binary tree-based partitioning is performed in a vertical direction or a horizontal direction, etc.
[0109] like Figure 3As shown, the first coding block 300 with a partition depth (split depth) of k can be divided into multiple second coding blocks based on a quadtree. For example, the second coding blocks 310 to 340 can be square blocks with half the width and half the height of the first coding block, and the partition depth of the second coding block can be increased to k+1.
[0110] The second coding block 310 having a split depth of k+1 may be split into a plurality of third coding blocks having a split depth of k+2. The splitting of the second coding block 310 may be performed by selectively using one of a quadtree and a binary tree depending on the splitting method. Here, the splitting method may be determined based on at least one of information indicating quadtree-based splitting and information indicating binary-based splitting.
[0111] When the second coding block 310 is divided based on a quadtree, the second coding block 310 may be divided into four third coding blocks 310a having half the width and half the height of the second coding block, and the division depth of the third coding block 310a may be increased to k+2. In contrast, when the second coding block 310 is divided based on a binary tree, the second coding block 310 may be divided into two third coding blocks. Here, each of the two third coding blocks may be a non-square block having half the width and half the height of the second coding block, and the division depth may be increased to k+2. The second coding block may be determined as a non-square block in the horizontal direction or the vertical direction depending on the division direction, and the division direction may be determined based on information about whether the binary tree-based division is performed in the vertical direction or in the horizontal direction.
[0112] At the same time, the second coding block 310 may be determined as a leaf coding block that is no longer partitioned based on a quadtree or a binary tree. In this case, the leaf coding block may be used as a prediction block or a transform block.
[0113] Similar to the division of the second coding block 310, the third coding block 310a may be determined as a leaf coding block, or may be further divided based on a quadtree or a binary tree.
[0114] At the same time, the third coding block 310b based on the binary tree division can be further divided into a coding block 310b-2 in the vertical direction or a coding block 310b-3 in the horizontal direction based on the binary tree, and the division depth of the relevant coding block can be increased to k+3. Alternatively, the third coding block 310b can be determined as a leaf coding block 310b-1 that is no longer divided based on the binary tree. In this case, the coding block 310b-1 can be used as a prediction block or a transform block. However, the above-mentioned division processing can be performed restrictively based on at least one of the following information: information about the size / depth of the coding block that allows quadtree-based division, information about the size / depth of the coding block that allows binary tree-based division, and information about the size / depth of the coding block that does not allow binary tree-based division.
[0115] The number of multiple candidates representing the size of the coding block may be limited to a predetermined number, or the size of the coding block in a predetermined unit may have a fixed value. As an example, the size of the coding block in a sequence or a picture may be limited to 256x256, 128x128, or 32x32. Information indicating the size of the coding block in the sequence or in the picture may be transmitted by information through a sequence header or a picture header.
[0116] The coding block is encoded using at least one of a skip mode, intra prediction, inter prediction, or a skip method. Once the coding block is determined, the prediction block can be determined by predictive partitioning of the coding block. The predictive partitioning of the coding block can be performed by a partitioning mode (Part_mode) indicating the partitioning type of the coding block. The size or shape of the prediction block can be determined according to the partitioning mode of the coding block. For example, the size of the prediction block determined according to the partitioning mode can be equal to or less than the size of the coding block.
[0117] Figure 4 is a diagram showing a partitioning mode that can be applied to a coding block when the coding block is encoded through inter prediction.
[0118] When a coding block is encoded by inter-frame prediction, such as in Figure 4 In the example shown, one of 8 partition modes (PART_2Nx2N, PART_Nx2N, PART_2NxN, PART_NxN, PART_nLx2N, PART_nRx2N, PART_2NxnU, PART_2NxnD) may be applied to the coding block.
[0119] When the coding block is encoded through intra prediction, a partition mode PART_2Nx2N or a partition mode PART_NxN may be applied to the coding block.
[0120] When the coding block has a minimum size, PART_NxN can be applied. Here, the minimum size of the coding block can be predefined in the encoder and decoder. Alternatively, information about the minimum size of the coding block can be transmitted via the bitstream. For example, the minimum size of the coding block can be transmitted via the slice header, so that the minimum size of the coding block can be defined per slice.
[0121] In general, the prediction block may have a size from 64×64 to 4×4. However, when the coding block is encoded by inter prediction, the prediction block may be restricted to not have a 4×4 size in order to reduce memory bandwidth when performing motion compensation.
[0122] Figure 5 is a diagram illustrating types of predefined intra prediction modes of an apparatus for encoding / decoding a video according to an embodiment of the present invention.
[0123] The apparatus for encoding / decoding a video may perform intra prediction using one of the predefined intra prediction modes. The predefined intra prediction modes for intra prediction may include a non-directional prediction mode (eg, planar mode, DC mode) and 33 directional prediction modes.
[0124] Alternatively, in order to improve the accuracy of intra-frame prediction, a larger number of directional prediction modes than 33 directional prediction modes can be used. That is, M extended directional prediction modes (M>33) can be defined by subdividing the angle of the directional prediction mode, and at least one of the 33 predefined directional prediction modes can be used to obtain a directional prediction mode with a predetermined angle.
[0125] You can use the ratio Figure 5 The intra prediction modes more than 35 are used. For example, more than 35 intra prediction modes may be used by subdividing the angle of the directional prediction mode or by obtaining a directional prediction mode with a predetermined angle using at least one of a predefined number of directional prediction modes. In this case, using more than 35 intra prediction modes may be referred to as an extended intra prediction mode.
[0126] Figure 6 An example of an extended intra prediction mode is shown, and the extended intra prediction mode may include two non-directional prediction modes and 65 extended directional prediction modes. The same number of extended intra prediction modes may be used for luma components and chroma components, or a different number of intra prediction modes may be used for each component. For example, 67 extended intra prediction modes may be used for luma components, and 35 intra prediction modes may be used for chroma components.
[0127] Alternatively, depending on the chroma format, a different number of intra prediction modes may be used when performing intra prediction. For example, in the case of a 4:2:0 format, 67 intra prediction modes may be used for the luma component to perform intra prediction, and 35 intra prediction modes may be used for the chroma component. In the case of a 4:4:4 format, 67 intra prediction modes may be used for both the luma component and the chroma component to perform intra prediction.
[0128] Alternatively, depending on the size and / or shape of the block, different numbers of intra prediction modes may be used to perform intra prediction. That is, depending on the size and / or shape of the PU or CU, 35 intra prediction modes or 67 intra prediction modes may be used to perform intra prediction. For example, when the CU or PU has a size less than 64×64 or is divided asymmetrically, 35 intra prediction modes may be used to perform intra prediction. When the size of the CU or PU is equal to or greater than 64×64, 67 intra prediction modes may be used to perform intra prediction. For Intra_2N×2N, 65 directional intra prediction modes may be allowed, while for Intra_N×N, only 35 directional intra prediction modes may be allowed.
[0129] The size of the block to which the extended intra prediction mode is applied may be set differently for each sequence, picture, or slice. For example, the extended intra prediction mode is set to be applied to a block (e.g., CU or PU) having a size greater than 64×64 in the first slice. On the other hand, the extended intra prediction mode is set to be applied to a block having a size greater than 32×32 in the second slice. Information indicating the size of the block to which the extended intra prediction mode is applied may be transmitted by information in units of a sequence, a picture, or a slice. For example, information indicating the size of the block to which the extended intra prediction mode is applied may be defined as "log2_extended_intra_mode_size_minus4" obtained by taking the logarithm of the block size and then subtracting the integer 4. For example, if the value of log2_extended_intra_mode_size_minus4 is 0, it may be indicated that the extended intra prediction mode may be applied to a block having a size equal to or greater than 16×16. And if the value of log2_extended_intra_mode_size_minus4 is 1, it may indicate that the extended intra prediction mode may be applied to a block having a size equal to or greater than 32×32.
[0130] As described above, the number of intra prediction modes may be determined considering at least one of a color component, a chroma format, and a size or shape of a block. In addition, the number of intra prediction mode candidates (e.g., the number of MPMs) for determining an intra prediction mode of a current block to be encoded / decoded may also be determined according to at least one of a color component, a color format, and a size or shape of a block. A method for determining an intra prediction mode of a current block to be encoded / decoded and a method for performing intra prediction using the determined intra prediction mode will be described in conjunction with the accompanying drawings.
[0131] Figure 7 is a flowchart briefly illustrating an intra prediction method according to an embodiment of the present invention.
[0132] Reference Figure 7 , the intra prediction mode of the current block may be determined at step S800 .
[0133] Specifically, the intra prediction mode of the current block can be obtained based on the candidate list and the index. Here, the candidate list includes multiple candidates, and multiple candidates can be determined based on the intra prediction mode of the adjacent blocks adjacent to the current block. The adjacent blocks may include at least one of the blocks located at the top, bottom, left, right, and corner of the current block. The index can specify one candidate among the multiple candidates in the candidate list. The candidate specified by the index can be set to the intra prediction mode of the current block.
[0134] The intra prediction mode used for intra prediction in the adjacent block may be set as a candidate. In addition, an intra prediction mode having a directionality similar to that of the intra prediction mode of the adjacent block may be set as a candidate. Here, the intra prediction mode having similar directionality may be determined by adding a predetermined constant value to the intra prediction mode of the adjacent block or subtracting a predetermined constant value from the intra prediction mode of the adjacent block. The predetermined constant value may be an integer, for example, one, two, or more.
[0135] The candidate list may further include a default mode. The default mode may include at least one of a planar mode, a DC mode, a vertical mode, and a horizontal mode. The default mode may be adaptively added in consideration of the maximum number of candidates that may be included in the candidate list of the current block.
[0136] The maximum number of candidates that can be included in the candidate list can be three, four, five, six or more. The maximum number of candidates that can be included in the candidate list can be a fixed value preset in the device for encoding / decoding the video, or can be variably determined based on the characteristics of the current block. The characteristics can mean the position / size / shape of the block, the number / type of intra-frame prediction modes that the block can use, the color type, the color format, etc. Alternatively, information indicating the maximum number of candidates that can be included in the candidate list can be separately transmitted by signal, and the maximum number of candidates that can be included in the candidate list can be variably determined using the information. The information indicating the maximum number of candidates can be transmitted by information at at least one of the sequence level, the picture level, the slice level, and the block level.
[0137] When the extended intra prediction mode and the 35 predefined intra prediction modes are selectively used, the intra prediction mode of the adjacent block can be transformed into an index corresponding to the extended intra prediction mode, or transformed into an index corresponding to the 35 intra prediction modes, thereby obtaining a candidate. In order to transform into an index, a predefined table can be used, or a scaling operation based on a predetermined value can be used. Here, the predefined table can define a mapping relationship between different intra prediction mode groups (e.g., extended intra prediction mode and 35 intra prediction modes).
[0138] For example, when the left neighboring block uses 35 intra prediction modes and the intra prediction mode of the left neighboring block is 10 (horizontal mode), the intra prediction mode may be transformed into index 16 corresponding to the horizontal mode in the extended intra prediction mode.
[0139] Alternatively, when the top neighboring block uses the extended intra prediction mode and the intra prediction mode of the top neighboring block has an index of 50 (vertical mode), the intra prediction mode may be transformed into an index of 26 corresponding to the vertical mode among the 35 intra prediction modes.
[0140] Based on the above method of determining the intra prediction mode, the intra prediction mode may be independently obtained for each of the luminance component and the chrominance component, or the intra prediction mode of the chrominance component may be obtained depending on the intra prediction mode of the luminance component.
[0141] Specifically, as shown in Table 1 below, the intra prediction mode of the chrominance component may be determined based on the intra prediction mode of the luminance component.
[0142] [Table 1]
[0143]
[0144] In Table 1, intra_chroma_pred_mode means information signaled to specify an intra prediction mode of a chroma component, and IntraPredModeY indicates an intra prediction mode of a luma component.
[0145] Reference Figure 7 At step S710, reference samples for intra prediction of the current block may be obtained.
[0146] Specifically, reference samples for intra prediction may be obtained based on neighboring samples of the current block. The neighboring samples may be reconstructed samples of neighboring blocks, and the reconstructed samples may be reconstructed samples before applying an in-loop filter, or reconstructed samples after applying an in-loop filter.
[0147] Adjacent samples reconstructed before the current block can be used as reference samples, and adjacent samples filtered based on a predetermined intra-frame filter can be used as reference samples. Filtering of adjacent samples using an intra-frame filter can also be referred to as reference sample smoothing. The intra-frame filter may include at least one of a first intra-frame filter applied to multiple adjacent samples located on the same horizontal line and a second intra-frame filter applied to multiple adjacent samples located on the same vertical line. Depending on the position of the adjacent samples, one of the first intra-frame filter and the second intra-frame filter may be selectively applied, or two intra-frame filters may be applied. At this time, at least one filter coefficient of the first intra-frame filter or the second intra-frame filter may be (1, 2, 1), but is not limited thereto.
[0148] Filtering may be adaptively performed based on at least one of the intra prediction mode of the current block and the size of the transform block of the current block. For example, when the intra prediction mode of the current block is a DC mode, a vertical mode, or a horizontal mode, filtering may not be performed. When the size of the transform block is N×M, filtering may not be performed. Here, N and M may be the same value or different values, or may be 4, 8, 16 or greater. For example, if the size of the transform block is 4×4, filtering may not be performed. Alternatively, filtering may be selectively performed based on the result of comparing a predefined threshold with the difference between the intra prediction mode of the current block and the vertical mode (or horizontal mode). For example, filtering may be performed when the difference between the intra prediction mode of the current block and the vertical mode is greater than a threshold. As shown in Table 2, a threshold may be defined for each size of the transform block.
[0149] [Table 2]
[0150] 8x8 Transform 16x16 Transform 32x32 Transform Threshold 7 1 0
[0151] The intra filter may be determined as one of a plurality of intra filter candidates predefined in the apparatus for encoding / decoding a video. To this end, an index of the intra filter of the current block may be specified in the plurality of intra filter candidates by signal transmission. Alternatively, the intra filter may be determined based on at least one of the following: the size / shape of the current block, the size / shape of the transform block, information on the filter strength, and a change in neighboring samples.
[0152] Reference Figure 7 At step 720, intra prediction may be performed using the reference sample and the intra prediction mode of the current block.
[0153] That is, the prediction sample of the current block can be obtained using the intra prediction mode determined at step S700 and the reference sample obtained at step S710. However, in the case of intra prediction, the boundary samples of the adjacent blocks may be used, and thus the quality of the predicted picture may be reduced. Therefore, a correction process may be performed on the prediction samples generated by the above prediction process, and the reference samples may be used as the reference samples. Figures 8 to 10 However, the correction process is not limited to being applied only to intra-prediction samples, and the correction process may be applied to inter-prediction samples or reconstructed samples.
[0154] Figure 8 is a diagram illustrating a method of correcting a prediction sample of a current block based on differential information of adjacent samples according to an embodiment of the present invention.
[0155] The prediction samples of the current block may be corrected based on differential information of a plurality of adjacent samples of the current block. The correction may be performed on all prediction samples in the current block, or may be performed on prediction samples in a predetermined local area. The local area may be one row / column or a plurality of rows / columns, and these may be preset areas for correction in an apparatus for encoding / decoding video. For example, correction may be performed on a row / column located at the boundary of the current block, or correction may be performed on a plurality of rows / columns from the boundary of the current block. Alternatively, the local area may be variably determined based on at least one of the size / shape of the current block and an intra prediction mode.
[0156] The neighboring samples may belong to a neighboring block located at the top, left, or upper left corner of the current block. The number of neighboring samples used for correction may be two, three, four, or more. The positions of the neighboring samples may be variably determined depending on the position of the prediction sample as the correction target in the current block. Alternatively, some of the neighboring samples may have fixed positions regardless of the position of the prediction sample as the correction target, and the remaining neighboring samples may have variable positions depending on the position of the prediction sample as the correction target.
[0157] The difference information of the adjacent samples may mean the difference samples between the adjacent samples, or may mean a value obtained by scaling the difference samples by a predetermined constant value (e.g., one, two, three, etc.). Here, the predetermined constant value may be determined in consideration of the position of the prediction sample as the correction target, the position of the row or column including the prediction sample as the correction target, the position of the prediction sample within the row or column, etc.
[0158] For example, when the intra prediction mode of the current block is a vertical mode, as shown in Equation 1, the final prediction sample can be obtained using the differential sample between the upper left adjacent sample p(-1,-1) and the adjacent sample p(-1,y) adjacent to the left boundary of the current block.
[0159] [Equation 1]
[0160] P'(0,y)=P(0,y)+((p(-1,y)-p(-1,-1))>>1where y=0...N-1
[0161] For example, when the intra prediction mode of the current block is the horizontal mode, as shown in Equation 2, the final prediction sample can be obtained using the differential sample between the upper left neighboring sample p(-1,-1) and the neighboring sample p(x,-1) adjacent to the upper boundary of the current block.
[0162] [Equation 2]
[0163] P′(x,0)=p(x,0)+((p(x,-1)-p(-1,-1))>>1where x=0...N-1
[0164] For example, when the intra prediction mode of the current block is a vertical mode, the final prediction sample can be obtained using the difference sample between the upper left adjacent sample p(-1,-1) and the adjacent sample p(-1,y) adjacent to the left boundary of the current block. Here, the difference sample can be added to the prediction sample, or the difference sample can be scaled by a predetermined constant value and then added to the prediction sample. The predetermined constant value used in scaling can be determined differently depending on the row and / or column. For example, the prediction sample can be corrected as shown in Equation 3 and Equation 4.
[0165] [Equation 3]
[0166] P'(0,y)=P(0,y)+((p(-1,y)-p(-1,-1))>>1where y=0...N-1
[0167] [Equation 4]
[0168] P'(1,y)=P(1,y)+((p(-1,y)-p(-1,-1))>>2 where y=0...N-1
[0169] For example, when the intra prediction mode of the current block is a horizontal mode, the final prediction sample can be obtained using the difference sample between the upper left neighboring sample p(-1,-1) and the neighboring sample p(x,-1) adjacent to the upper boundary of the current block, as described in the case of the vertical mode. For example, the prediction sample can be corrected as shown in Equations 5 and 6.
[0170] [Equation 5]
[0171] P′(x,0)=p(x,0)+((p(x,-1)-p(-1,-1))>>1where x=0...N-1
[0172] [Equation 6]
[0173] P′(x, 1)=p(x, 1)+((p(x, -1)-p(-1, -1))>>2where x=0...N-1
[0174] Fig. 9 and Fig.10 is a diagram illustrating a method of correcting a prediction sample based on a predetermined correction filter according to an embodiment of the present invention.
[0175] The prediction sample may be corrected based on the neighboring samples of the prediction sample as the correction target and a predetermined correction filter. Here, the neighboring samples may be specified by the angle line of the directional prediction mode of the current block, or the neighboring samples may be at least one sample located on the same angle line as the prediction sample as the correction target. In addition, the neighboring samples may be the prediction samples in the current block, or may be the reconstructed samples in the neighboring blocks reconstructed before the current block.
[0176] At least one of the number of taps, strength, and filter coefficients of the correction filter can be determined based on at least one of the following: the position of the prediction sample as the correction target, whether the prediction sample as the correction target is located on the boundary of the current block, the intra-frame prediction mode of the current block, the angle of the directional prediction mode, the prediction mode of the adjacent block (inter-frame mode or intra-frame mode), and the size / shape of the current block.
[0177] Reference Fig. 9 , when the directional prediction mode has an index of 2 or 34, a final prediction sample may be obtained using at least one prediction / reconstruction sample located at the lower left side of the prediction sample as a correction target and a predetermined correction filter. Here, the prediction / reconstruction sample at the lower left side may belong to a previous row of a row including the prediction sample as a correction target. The prediction / reconstruction sample at the lower left side may belong to the same block as the current sample, or to a neighboring block adjacent to the current block.
[0178] The filtering of the prediction samples may be performed only on the rows located at the block boundary, or may be performed on multiple rows. The following correction filter may be used: at least one of the number of filter taps and the filter coefficient is different for each row. For example, a (1 / 2, 1 / 2) filter may be used for the first row on the left closest to the block boundary, a (12 / 16, 4 / 16) filter may be used for the second row, a (14 / 16, 2 / 16) filter may be used for the third row, and a (15 / 16, 1 / 16) filter may be used for the fourth row.
[0179] Alternatively, when the directional prediction mode has an index of 3 to 6 or 30 to 33, it may be as follows Fig.10 Filtering is performed on the block boundary as shown, and a 3-tap correction filter can be used to correct the prediction sample. Filtering can be performed using the lower left sample of the prediction sample as the correction target, the bottom sample of the lower left sample, and a 3-tap correction filter that takes the prediction sample as the correction target as input. The position of the adjacent sample used by the correction filter can be determined differently based on the directional prediction mode. The filter coefficient of the correction filter can be determined differently depending on the directional prediction mode.
[0180] Different correction filters may be applied depending on whether the neighboring blocks are encoded in inter mode or intra mode. When the neighboring blocks are encoded in intra mode, a filtering method that gives more weight to the prediction samples may be used than when the neighboring blocks are encoded in inter mode. For example, in the case where the intra prediction mode is 34, when the neighboring blocks are encoded in inter mode, a (1 / 2, 1 / 2) filter may be used, and when the neighboring blocks are encoded in intra mode, a (4 / 16, 12 / 16) filter may be used.
[0181] The number of rows to be filtered in the current block may vary depending on the size / shape of the current block (e.g., a coding block or a prediction block). For example, when the size of the current block is equal to or less than 32×32, filtering may be performed only on one row at the block boundary; otherwise, filtering may be performed on multiple rows including one row at the block boundary.
[0182] Although Fig. 9 and Fig.10 Based on use Figure 4 The present invention is not limited to the case of 35 intra-frame prediction modes in , but can also be equally / similarly applied to the case of using extended intra-frame prediction modes.
[0183] Fig.11 A range of reference samples used for intra prediction according to an embodiment to which the present invention is applied is shown.
[0184] Reference Fig.11, intra prediction can be performed by using reference samples P(-1,-1), P(-1,y)(0<=y<=2N-1) and P(x,-1)(0<=x<=2N-1) located at the boundary of the current block. At this time, filtering of the reference samples is selectively performed based on at least one of the intra prediction mode of the current block (e.g., the index, directionality, angle, etc. of the intra prediction mode) or the size of the transform block related to the current block.
[0185] The filtering of the reference samples can be performed using an intra-frame filter predefined in the encoder and decoder. For example, an intra-frame filter with filter coefficients (1, 2, 1) or an intra-frame filter with filter coefficients (2, 3, 6, 3, 2) can be used to obtain the final reference samples used in intra-frame prediction.
[0186] Alternatively, at least one of a plurality of intra filter candidates may be selected to perform filtering on the reference sample. Here, the plurality of intra filter candidates may differ from each other in at least one of filter strength, filter coefficient, or number of taps (e.g., number of filter coefficients, filter length). The plurality of intra filter candidates may be defined at least one of a sequence level, a picture level, a slice level, or a block level. That is, a sequence, a picture, a slice, or a block including the current block may use the same plurality of intra filter candidates.
[0187] Hereinafter, for convenience of explanation, it is assumed that the plurality of intra filter candidates include a first intra filter and a second intra filter. It is also assumed that the first intra filter is a (1,2,1) 3-tap filter and the second intra filter is a (2,3,6,3,2) 5-tap filter.
[0188] When the reference samples are filtered by applying the first intra filter, the filtered reference samples may be obtained as shown in Equation 7.
[0189] [Equation 7]
[0190] P(-1,-1)=(P(-1,0)+2P(-1,-1)+P(0,-1)+2)>>2
[0191] P(-1,y)=(P(-1,y+1)+2P(-1,y)+P(-1,y-1)+2)>>2
[0192] P(x,-1)=(P(x+1,-1)+2P(x,-1)+P(x-1,-1)+2)>>2
[0193] When the reference sample is filtered by applying the second intra filter, the filtered reference sample may be obtained as shown in Equation 8 below.
[0194] [Equation 8]
[0195] P(-1,-1)=(2P(-2,0)3P(-1,0)+6P(-1,-1)+3P(0,-1)+2P(0,-2)+8)>>4
[0196] P(-1,y)=(2P(-1,y+2)+3P(-1,y+1)+6P(-1,y)+3P(-1,y-1)+2P(-1,y-2)+8)>>4
[0197] P(x,-1)=(2P(x+2,-1)+3P(x+1,-1)+6P(x,-1)+3P(x-1,-1)+2P(x-2,-1)+8)>>4
[0198] In the above Equation 7 and Equation 8, x may be an integer between 0 and 2N-2, and y may be an integer between 0 and 2N-2.
[0199] Alternatively, based on the position of the reference sample, one of a plurality of intra-frame filter candidates may be determined, and filtering of the reference sample may be performed by using the determined one intra-frame filter candidate. For example, a first intra-frame filter may be applied to the reference samples included in the first range, and a second intra-frame filter may be applied to the reference samples included in the second range. Here, the first range and the second range may be distinguished based on whether they are adjacent to the boundary of the current block, whether they are located at the top side or the left side of the current block, or whether they are adjacent to the corner of the current block. For example, Fig.12 As shown, filtering of reference samples (P(-1, -1), P(-1,0), P(-1,1), ..., P(-1, N-1) and P(0, -1), P(1, -1), ...) adjacent to the boundary of the current block is performed by applying a first intra filter as shown in Equation 7, and filtering of other reference samples not adjacent to the boundary of the current block is performed by applying a second reference filter as shown in Equation 8. One of a plurality of intra filter candidates may be selected based on a transform type for the current block, and filtering of the reference samples is performed using the selected one of the intra filter candidates. Here, the transform type may mean (1) a transform scheme, such as DCT, DST, or KLT (2) a transform mode indicator, such as 2D transform, 1D transform, or non-transform, or (3) the number of transforms, such as a first transform and a second transform. In the following, for ease of description, it is assumed that the transform type means a transform scheme such as DCT, DST, and KLT.
[0200] For example, if the current block is encoded using DCT, filtering may be performed using a first intra-frame filter, and if the current block is encoded using DST, filtering may be performed using a second intra-frame filter. Alternatively, if the current block is encoded using DCT or DST, filtering may be performed using a first intra-frame filter, and if the current block is encoded using KLT, filtering may be performed using a second intra-frame filter.
[0201] Filtering may be performed using a filter selected based on the transform type of the current block and the position of the reference sample. For example, if the current block is encoded using DCT, the reference samples P(-1,-1), P(-1,0), P(-1,1), ..., P(-1,N-1) and P(0,-1), P(1,-1), ..., P(N-1,-1) may be filtered by using a first intra-frame filter, and other reference samples may be filtered by using a second intra-frame filter. If the current block is encoded using DST, the reference samples P(-1,-1), P(-1,0), P(-1,1), ..., P(-1,N-1) and P(0,-1), P(1,-1), ..., P(N-1,-1) may be filtered by using a second intra-frame filter, and other reference samples may be filtered by using the first intra-frame filter.
[0202] One of a plurality of intra-frame filter candidates may be selected based on whether a transform type of a neighboring block including a reference sample is the same as a transform type of a current block, and filtering may be performed using the selected intra-frame filter candidate. For example, when the current block and the neighboring block use the same transform type, filtering is performed using a first intra-frame filter, and when the transform types of the current block and the neighboring block are different from each other, a second intra-frame filter may be used to perform filtering.
[0203] Any one of a plurality of intra-frame filter candidates may be selected based on the transform type of the neighboring block, and filtering may be performed on the reference sample using the selected one of the intra-frame filter candidates. That is, a specific filter may be selected considering the transform type of the block including the reference sample. For example, Fig.13 As shown, if the block adjacent to the left / lower left of the current block is a block encoded using DCT, and the block adjacent to the upper / upper right of the current block is a block encoded using DST, the reference samples adjacent to the left / lower left of the current block are filtered by applying a first intra-frame filter, and the reference samples adjacent to the upper / upper right of the current block are filtered by applying a second intra-frame filter.
[0204] In the unit of the predetermined area, the filter that can be used in the corresponding area can be defined. In this article, the unit of the predetermined area can be any one of a sequence, a picture, a slice, a block group (e.g., a row of a coding tree unit), or a block (e.g., a coding tree unit). Alternatively, another area that shares one or more filters can be defined. The reference sample can be filtered by using a filter mapped to the area including the current block.
[0205] For example, Fig.14 As shown, different filters in the CTU unit may be used to perform filtering on the reference sample. In this case, information indicating whether the same filter is used in a sequence or a picture, the type of filter used for each CTU, and an index specifying the filter used in the corresponding CTU among the available intra filter candidates may be signaled via a sequence parameter set (SPS) or a picture parameter set (PPS).
[0206] The above intra-frame filter may be applied in units of coding units. For example, filtering may be performed by applying the first intra-frame filter or the second intra-frame filter to reference samples around the coding unit.
[0207] When the intra prediction mode of the current block is determined, the intra prediction can be performed using reference samples adjacent to the current block. For example, the prediction samples of the current block can be generated by averaging the reference samples, or the prediction samples of the current block can be generated by copying the reference samples in a specific direction considering the directionality of the intra prediction mode. Fig.11 As described in the example, P(-1,-1), P(-1,y) (0<=y<=2N-1), and P(x,-1) (0<=x<=2N-1) located at the boundary of the current block can be used as reference samples.
[0208] When it is determined that a sample included in a neighboring block adjacent to the current block is not available as a reference sample, the unavailable sample may be replaced with an available reference sample. For example, when the position of the sample included in the neighboring block is outside the picture, the sample included in the neighboring block exists in a slice different from the current block, or the sample included in the neighboring block is included in a block encoded by inter-frame prediction, the neighboring sample may be determined to be unavailable. Here, when performing intra-frame prediction of the current block, it may be determined whether the sample included in the block encoded by inter-frame prediction is unavailable based on information indicating whether the sample included in the block encoded by inter-frame prediction is used as a reference sample. Here, the information may be a 1-bit flag (e.g., 'constrained_intra_prediction_flag'), but is not limited thereto. For example, when the value of 'constrained_intra_prediction_flag' is 1, it may be determined that the sample included in the block encoded by inter-frame prediction is not available as a reference sample. Hereinafter, a sample that cannot be used as a reference sample will be referred to as an unavailable reference sample.
[0209] exist Fig.11 In the example shown, when it is determined that the sample located at the bottom left (e.g., P(-1, 2N-1)) is not available, the sample located at the bottom left may be replaced by the first available reference sample that is first searched by scanning the available samples in a predetermined order. Here, the scanning order may be sequentially performed from samples adjacent to the bottom left sample. For example, in Fig.11 In the example shown, when sample P(-1, 2N-1) is not available, scanning can be performed in the order of P(-1, -2N-2) to P(-1, -1), P(-1) to P(2N-1, -1). P(-1, 2N-1) can be replaced with the first available reference sample found as a result of the scan.
[0210] In the case where the left reference samples other than the reference sample located at the bottom left are unavailable, the left reference samples may be replaced with reference samples adjacent to the bottom of the left reference samples. For example, the unavailable reference sample P(-1,y) between P(-1,2N-1) and P(-1,-1) may be replaced with the reference sample P(-1,y+1).
[0211] In the case where the top reference sample is unavailable, the top reference sample can be replaced with a reference sample adjacent to the left of the top reference sample. For example, the unavailable reference sample P(x,-1) between P(0,-1) and P(2N-1,-1) can be replaced with the reference sample P(x-1,-1).
[0212] The reference sample set for the current block may be referred to as a "reference row" (or "intra-frame reference row" or "reference sample row"). Here, a reference row may include a set of reference samples consisting of a row and a column. Fig.11 In the example shown, the "reference row" represents a reference sample set including P(-1, 2N-1) to P(-1, -1), P(0, -1) to P(2N-2, -1). Intra-prediction of the current block can be performed based on the reference samples included in the reference row. Intra-prediction of the current block can be performed using the reference samples included in the reference row based on the intra-prediction mode of the current block. For example, in the case where the intra-prediction mode of the current block is the DC mode, the prediction signal can be generated using the average and weighted prediction of the reference samples included in the reference row. For example, in the case where the intra-prediction mode of the current block is the DC mode, the prediction sample of the current block can be obtained according to Equation 9.
[0213] [Equation 9]
[0214] P(0,0)=(P(-1,0)+P(0,-1)+2*dcVal)>>2
[0215] P(x,0)=(P(x,-1)+3*dcVal)>>2
[0216] P(0,y)=(P(-1,y)+3*dcVal)>>2
[0217] In Equation 9, dcVal may be generated based on an average value of samples other than P(-1, -1) among reference samples included in the reference row.
[0218] The planar mode provides effective prediction efficiency in smooth areas without strong edges, and effectively improves the discontinuity of block boundaries or image quality degradation of block boundaries. In the case where the intra prediction mode of the current block is the planar mode, the horizontal temporary prediction samples of the current block can be obtained using the reference samples adjacent to the upper right corner of the current block and the reference samples having the same y coordinate as the horizontal temporary prediction samples, and the vertical temporary prediction samples of the current block can be obtained using the reference samples adjacent to the lower left corner of the current block and the reference samples having the same x coordinate as the vertical temporary prediction samples. For example, the horizontal temporary prediction samples and the vertical temporary prediction samples of the current block can be obtained according to Equation 10.
[0219] [Equation 10]
[0220] P h (x,y)=(N-1-x)*P(-1,y)+(x+1)*P(N,-1)
[0221] Pv (x,y)=(N-1-y)*P(x,-1)+(y+1)*P(-1,N)
[0222] The prediction sample of the current block may be generated by summing the temporary prediction sample in the horizontal direction and the temporary prediction sample in the vertical direction, and then shifting the summation result by a value determined according to the size of the current block. For example, the prediction sample of the current block may be obtained according to Equation 11.
[0223] [Equation 11]
[0224] P(x, y) = (P h (x,y)+P v (x, y)+N)>>(log2(N)+1)
[0225] Multiple reference rows may be used to perform intra prediction on the current block. Assuming the current block has a size of W×H, the kth reference row may include p(-k,-k), reference samples located in the same row as p(-k,-k) (e.g., reference samples from p(-k+1,-k) to p(W+H+2(k-1),-k) or reference samples from p(-k+1,-k) to p(2W+2(k-1),-k)), and reference samples located in the same column as p(-k,-k) (e.g., reference samples from p(-k,-k+1) to p(-k,W+H+2(k-1) or reference samples from p(-k,-k+1) to p(-k,2H+2(k-1))).
[0226] Fig.15 Multiple reference sample lines are illustrated. Fig.15 In the example shown in , in a case where the first reference row adjacent to the boundary of the current block is referred to as “reference row 0 ”, the kth reference row may be set to be adjacent to the (k−1)th reference row.
[0227] Alternatively, with Fig.15 Different from the example shown, it is also possible to configure all reference rows to have the same number of reference samples.
[0228] Intra-frame prediction of the current block may be performed by at least one reference line among the plurality of reference lines. The method of performing intra-frame prediction using the plurality of reference lines as described above may be referred to as an "intra-frame prediction method using extended reference samples" or an "extended intra-frame prediction method". In addition, the plurality of reference lines may be referred to as "extended reference lines".
[0229] Whether to perform intra prediction using an extended reference line may be determined based on information transmitted by a bitstream signal. Here, the information may be a 1-bit flag, but is not limited thereto. Information about whether to perform intra prediction using an extended reference line may be transmitted in units of coding tree units, coding units, or prediction units, or may be transmitted in units of sequences, pictures, or slices. That is, whether to perform intra prediction using an extended reference line may be determined in units of sequences, pictures, slices, CTUs, CUs, or PUs.
[0230] Alternatively, whether to perform intra prediction using an extended reference row may be determined based on at least one of a size, a shape, a depth, or an intra prediction mode of the current block.
[0231] In the case where it is determined that an extended reference line is used to perform intra prediction, a plurality of reference lines may be determined. Here, the number of reference lines may have a fixed value, and the number of reference lines may be adaptively determined according to the size, shape, or intra prediction mode of the current block. For example, in the case where the intra prediction mode of the current block is a non-directional mode, one reference line is used to perform intra prediction of the current block. In the case where the intra prediction mode of the current block is a directional mode, a plurality of reference lines may be used to perform intra prediction of the current block.
[0232] For additional examples, multiple reference lines may be determined by information signaled in units of a sequence, a picture, a slice, or a unit to be decoded. Here, the unit to be decoded may represent a coding tree unit, a coding unit, a transform unit, a prediction unit, etc. For example, a syntax element "max_intra_line_idx_minus2" indicating the number of available reference lines available in a sequence or a slice may be signaled through a sequence header or a slice header. In this case, the number of available reference lines may be set to max_intra_line_idx_minus2+2.
[0233] Hereinafter, a method of performing intra prediction using an extended reference line will be described in detail.
[0234] Fig.16 is a flowchart illustrating a method of performing intra prediction using an extended reference line according to the present invention.
[0235] First, the decoder may generate a plurality of reference lines (S1610). Reference samples included in each reference line may be generated based on reconstructed samples included in a block decoded earlier than a current block.
[0236] In the case where the intra prediction mode of the current block is a directional mode, the decoder may generate a reference line considering the directionality of the intra prediction mode. Considering the directionality of the intra prediction mode, a greater number of reference samples may be included in the kth reference line than in the (k-1)th reference line. That is, a reference line far from the current block may include a greater number of reference samples than a reference line close to the current block.
[0237] Here, the number of reference samples further included in the kth reference line compared to the (k-1)th reference line may be variably determined according to the size, shape, or intra prediction mode of the current block.
[0238] For example, when the current block has a size of 4×4, the kth reference line may further include four more reference samples (specifically, 2 in the horizontal direction and 2 in the vertical direction) than the (k-1)th reference line. In addition, when the current block has a size of 8×8, the kth reference line may further include eight more reference samples (specifically, 4 in the horizontal direction and 4 in the vertical direction) than the (k-1)th reference line.
[0239] Reference Fig.15 , since the size of the current block is 4×4, it is illustrated that the first reference row includes a total of 9 reference samples, and the second reference row includes a total of 13 (=9+2×2) reference samples.
[0240] In the case where the current block is non-square, the number of reference samples included in the reference line may be determined according to the horizontal length and the vertical length of the current block.
[0241] For example, Fig.17 is a diagram illustrating multiple reference lines for non-square blocks. By comparison Fig.15 and Fig.17 Described, as the width of the current block is reduced to ½, the number of top reference samples excluding the top left reference sample included in the reference line 0 is reduced from 8 to 4.
[0242] That is to say, according to Fig.15 and Fig.17 , assuming that the current block has a size of W×H, the kth reference line may include a total of 2{(W+H)+2(k-1)}+1 reference samples, including: W+H+2(k-1) top reference samples (or 2W+2(k-1) top reference samples) (i.e., horizontal reference samples), W+H+2(k-1) left reference samples (or 2H+2(k-1) left reference samples) (i.e., vertical reference samples) and top-left reference samples.
[0243] If the unavailable reference sample is included in the reference row, the unavailable reference sample may be replaced by an adjacent available reference sample. At this time, the adjacent sample replacing the unavailable reference sample may be included in the same reference row as the unavailable reference sample, or may be included in a different reference row from the unavailable reference sample.
[0244] For example, if the position of the reference sample is outside the picture or in a slice different from the current block when intra prediction is performed using an extended reference line, or if the reference sample is included in a block encoded by inter prediction when intra prediction is performed using an extended reference line, it can be determined that the reference sample is unavailable. When it is set not to use the reference sample included in the block encoded by inter prediction (for example, only when the value of constrained_intra_prediction_flag is 0), it can be determined that the reference sample included in the block encoded by inter prediction is unavailable. Alternatively, if it is set that the block encoded by intra prediction should be decoded earlier than the block encoded by inter prediction, when the block encoded by intra prediction is decoded, the block encoded by inter prediction has not yet been reconstructed. Therefore, it can be determined that the reference sample included in the block encoded by inter prediction is unavailable.
[0245] The reference sample used to replace the unavailable reference sample may be determined in consideration of the position of the unavailable reference sample, the distance between the unavailable reference sample and the available reference sample, etc. For example, the unavailable sample may be replaced with an available sample having the shortest distance from the unavailable reference sample. That is, the available reference sample having the shortest distance may replace the unavailable reference sample, and the available reference sample is selected by comparing the distance between the available reference sample included in the same reference row as the unavailable reference sample and the unavailable sample (first offset) and the distance between the available reference sample included in a different reference row from the unavailable reference sample and the unavailable sample (second offset).
[0246] exist Fig.18 In the illustrated example, it is depicted that the distance between the unavailable reference sample included in the reference row 0 and the available reference sample included in the reference row 0 is 4, and the distance between the unavailable reference sample included in the reference row 0 and the available reference sample included in the reference row 2 is 2. Therefore, the unavailable sample included in the reference row 0 may be replaced by using the available reference sample included in the reference row 2.
[0247] If the first offset and the second offset are the same, the unavailable reference samples may be replaced with available reference samples included in the same reference row as the unavailable reference samples.
[0248] The unavailable reference sample may be replaced with the available reference sample included in a reference row different from the unavailable reference sample only when the distance between the available sample included in the same reference row as the unavailable reference sample (i.e., the first offset) is equal to or greater than N. Alternatively, even when the first offset is equal to or greater than N, the available reference sample included in a reference row different from the unavailable reference sample may be used to replace the unavailable reference sample only when the second offset is less than the first offset. Here, N may represent an integer of 1 or greater.
[0249] If the first offset is not equal to or greater than N, the unavailable reference samples may be replaced with available reference samples included in the same reference row as the unavailable reference samples.
[0250] Fig.19 and Fig. 20 An example is shown in which unavailable reference samples are replaced with available reference samples when N is 2. If the distance between the unavailable reference samples included in reference row 0 and the available reference samples included in reference row 0 is 2, then Fig.19 In the example shown, unusable reference samples included in reference row 0 may be replaced with usable reference samples included in reference row 1 .
[0251] On the other hand, if the distance between the unavailable reference sample included in the reference row 0 and the available reference sample included in the reference row 0 is 1, then Fig. 20 In the example shown, unusable reference samples included in reference row 0 may be replaced with usable reference samples included in reference row 0 .
[0252] The unavailable reference sample may be replaced with an available reference sample included in the same reference row as the unavailable reference sample or an available reference sample included in a reference row adjacent to the reference row including the unavailable reference sample. Here, the reference row adjacent to the reference row including the unavailable reference sample may refer to a reference row having an index difference of 1 with the reference row including the unavailable reference sample. Alternatively, the unavailable reference sample may be replaced with an available reference sample included in a reference row having an index difference of two or more with the reference row including the unavailable reference sample.
[0253] Alternatively, the unavailable reference sample may be replaced with an available reference sample included in a reference row having a larger index value or a smaller index value than the reference row including the unavailable reference sample. For example, if a reference row having a larger index value than the reference row including the unavailable reference sample is used, the unavailable reference sample may be replaced with a reference sample located to the left or top of the unavailable reference sample.
[0254] The search for available reference samples for replacing the unavailable reference samples may be performed in a predetermined direction. For example, the unavailable reference samples may be replaced with only reference samples located in a direction of the top, bottom, left, or right of the unavailable samples among reference samples included in the same reference row as the unavailable reference samples. Alternatively, the unavailable samples may be replaced with only reference samples located in a direction of the top, bottom, left, or right of the unavailable samples among reference samples included in a reference row different from the unavailable reference samples.
[0255] The decoder may decode the index information specifying one of the plurality of reference lines based on the bitstream (S1620). Fig.15 In the example shown, where four reference lines are available, the index information may specify any one of the four reference lines.
[0256] The reference row for performing intra prediction on the current block can be adaptively determined based on the size of the current block, the type of the current block, the intra prediction mode of the current block, index information in a neighboring block, or the difference between the intra prediction mode of the current block and a predetermined intra prediction mode.
[0257] When any one of the plurality of reference lines is determined, the decoder may perform intra prediction on the current block using the determined reference line ( S1630 ).
[0258] For example, when the intra prediction mode of the current block is the DC mode, the prediction sample of the current block may be generated based on the average value (dcVal) of the reference samples included in the determined reference row. Fig.21 and Fig. 22 , the calculation of the average value of the reference samples included in the reference row will be described in detail.
[0259] Alternatively, when the intra prediction mode of the current block is a directional mode, the prediction sample of the current block may be generated based on the reference sample specified by the directional mode among the reference samples included in the determined reference row. At this time, if a line segment extending from the prediction sample toward the direction indicated by the directional mode points between the reference samples, the prediction sample of the current block may be generated based on a weighted sum (weighted prediction) of the first reference sample and the second reference sample, the first reference sample and the second reference sample being located on both sides of the point indicated by the line segment extending toward the direction indicated by the directional mode.
[0260] When the intra prediction mode of the current block is the DC mode, it is necessary to calculate the average value (dcVal) of the reference samples included in the reference row in order to perform prediction on the current block. At this time, the average value of the reference samples in the k-th reference row may be calculated using only a portion of the reference samples included in the k-th reference row. At this time, the number of reference samples used to obtain the average value may be the same for each reference row, or may be different for each reference row.
[0261] Alternatively, the average value of the reference samples in the k-th reference row may be obtained using all reference samples included in the k-th reference row. Alternatively, whether to use a part of the reference samples in the k-th reference row to obtain the average value or to use all the reference samples in the k-th reference row to obtain the average value may be determined based on the size of the current block, the shape of the current block, or the position of the reference row.
[0262] Fig.21 is a diagram showing reference samples used to obtain an average value of a reference row.
[0263] Fig.21 An example of using a portion of the reference samples included in the reference row to obtain the reference sample average value of the kth reference row is shown. Fig.21 In the example shown, the first reference row adjacent to the current block (ie, Fig.21 That is, when the size of the current block is N×N, a total of 4N reference samples (eg, 2N top reference samples and 2N left reference samples) may be used to calculate the average value of the first reference row.
[0264] The number of reference samples used to calculate the average value of the reference samples of the kth reference row may be the same as the number of reference samples used to calculate the average value of the reference samples of the first reference row. At this time, the positions of the reference samples used to calculate the average value of the kth reference row may correspond to the positions of the reference samples used to calculate the average value of the reference samples of the first reference row.
[0265] The reference samples in the k-th reference row corresponding to the reference samples of the first reference row may have the same x coordinate or the same y coordinate as the reference samples of the first reference row. For example, the coordinates of the top reference samples included in the k-th reference row corresponding to the top reference samples P(i, j) included in the first reference row may be P(i, j-k+1) having the same x coordinate as P(i, j). For example, the coordinates of the left reference samples in the k-th reference row corresponding to the left reference samples P(i, j) included in the first reference row may be P(i-k+1, j) having the same y coordinate as P(i, j).
[0266] exist Fig.21 , reference samples of the second to fourth reference rows corresponding to the upper reference samples and the left reference samples in the first reference row are shown. Fig.21 The reference samples shown are used to calculate the reference sample average for each reference row.
[0267] exist Fig.21 In , it is assumed that the current block has a square shape, but even if the current block has a non-square shape, the above embodiment can be applied as is. For example, when the current block is a non-square block with a WxH size, a total of 2 (W+H) reference samples (e.g., 2W top reference samples and 2H left reference samples) can be used to calculate the reference sample average of each reference row. Therefore, as in Fig. 22 In the example shown, the number of reference samples used to calculate the average value of the kth reference row can have the same value as the number of reference samples used to calculate the average value of the first reference row. In addition, the positions of the reference samples used to calculate the average value of the kth reference row can correspond to the positions of the reference samples used to calculate the average value of the reference samples of the first reference row.
[0268] exist Fig.21 and Fig. 22 In the example, up to twice the width of the current block and up to twice the height of the current block are used to calculate the reference sample average of the reference row. Fig.21 and 22 The reference samples shown may be fewer or more than the reference samples shown to calculate the reference sample average of the reference row. For example, the reference sample average of the reference row may be calculated using the same number of top reference samples as the width of the current block and the same number of left reference samples as the height of the current block.
[0269] The reference sample average of the reference row may be calculated by assigning different weights to the reference samples depending on the shape of the current block and the position of the reference samples. For example, if the current block has a square shape, the reference sample average may be calculated by assigning the same weight to the top reference sample and the left reference sample. On the other hand, when the current block has a non-square shape, the reference sample average may be calculated by assigning a larger weight to one of the top reference sample and the left reference sample. For example, if the height of the current block is greater than the width, the average may be calculated by assigning a larger weight to the top reference sample than to the left reference sample. On the other hand, when the width of the current block is greater than the height, the average may be calculated by assigning a larger weight to the left reference sample than to the top reference sample.
[0270] For example, when the size of the current block is N / 2×N, the average value dcVal of the k-th reference row can be calculated by the following Equation 12.
[0271] [Equation 12]
[0272]
[0273] For example, when the size of the current block is NxN / 2, the average value dcVal of the k-th reference row can be calculated by the following Equation 13.
[0274] [Equation 13]
[0275]
[0276] In Equation 12 and Equation 13, k may be set to a value between 1 and max_intra_line_idx_minus2+2.
[0277] In the example described through 16, it is illustrated that the index information specifying one of the multiple reference lines is decoded after the multiple reference lines are generated. It is also possible to obtain only the reference line specified by the index information among the multiple reference lines after the index information specifying one of the multiple reference lines is decoded.
[0278] In passing Fig.16 In the described embodiment, it is described that intra prediction for a current block is performed using any one of a plurality of reference lines specified by index information. It is also possible to use two or more reference lines of a plurality of reference lines to perform intra prediction for the current block. Whether to use two or more reference lines when performing intra prediction on the current block can be determined based on information transmitted by a signal from a bitstream, a size of the current block, a type of the current block, an intra prediction mode of the current block, whether the intra prediction mode of the current block is non-directional, or a difference between the intra prediction mode of the current block and a predetermined intra prediction mode, etc.
[0279] Two or more reference lines may be specified by a plurality of index information signaled from a bitstream. For example, in the case where two reference lines are set to be used, any one of the two reference lines may be specified by a first index information, and the other reference line may be specified by a second index information.
[0280] Alternatively, two or more reference lines may be spatially continuous. In this case, index information for specifying any one of the two or more reference lines may be transmitted by information in the bitstream. If any one of the two or more reference lines is selected by the index information, the remaining reference lines may be automatically selected based on spatial adjacency to the selected reference line. For example, when two reference lines are set to be used and the index information indicates "reference line 0", intra-frame prediction of the current block may be performed based on reference line 0 and reference line 1 adjacent to reference line 0.
[0281] In the case where a plurality of reference lines are set to be used, intra prediction of the current block may be performed based on an average value, a maximum value, a minimum value, or a weighted sum of reference samples included in the plurality of reference lines.
[0282] For example, assuming that the intra prediction mode of the current block is a directional mode (i.e., an angle mode), the prediction sample of the current block can be generated based on the first reference sample and the second reference sample, each of which is included in the differential reference row. Here, the first reference row including the first reference sample and the second reference row including the second reference sample can be positioned adjacent to each other, but are not limited to this. In addition, the first reference sample and the second reference sample can be determined by the intra prediction mode of the current block. The first reference sample and the second reference sample can be positioned adjacent to each other, but are not limited to this. The prediction sample of the current block can be generated by considering the weighted sum of the first reference sample and the second reference sample, or the prediction sample of the current block can be generated based on the average value, minimum value, or maximum value of the first reference sample and the second reference sample.
[0283] Intra prediction of the current block may be performed by performing a first intra prediction based on a portion of the plurality of reference lines and performing a second intra prediction based on the remaining reference lines. Here, the intra prediction mode used in the first intra prediction and the intra prediction mode used in the second intra prediction may be the same or different. The prediction sample of the current block may be generated based on the first prediction sample generated by performing the first intra prediction and the second prediction sample generated by performing the second intra prediction.
[0284] The above embodiment is described mainly with respect to the decoding process, the encoding process may be performed in the same order as the described order or in the reverse order.
[0285] Although the above-mentioned embodiments have been described based on a series of steps or flow charts, they do not limit the chronological order of the present invention, and can be performed simultaneously or in different orders as required. In addition, each of the components (e.g., units, modules, etc.) constituting the block diagram in the above-mentioned embodiments can be implemented by hardware devices or software and multiple components. Alternatively, multiple components can be combined and implemented by a single hardware device or software. The above-mentioned embodiments can be implemented in the form of program instructions, which can be executed and recorded in a computer-readable recording medium by various computer components. The computer-readable recording medium can include one or a combination of program commands, data files, data structures, etc. The example of a computer-readable medium includes magnetic media (such as hard disks, floppy disks and tapes), optical recording media (such as CD-ROMs and DVDs), magneto-optical media (such as optical magnetic floppy disks), media, and hardware devices (such as ROMs, RAMs, flash memories) etc. that are specially configured to store and execute program instructions. The hardware device can be configured to operate as one or more software modules for performing a process according to the present invention, and vice versa.
[0286] Industrial Applicability
[0287] The present invention can be used in electronic devices capable of encoding / decoding videos.
[0288] According to the above description, the embodiments of the present invention also disclose the following technical solutions, including but not limited to:
[0289] Solution 1. A method for decoding a video, the method comprising:
[0290] Obtaining a plurality of reference sample rows for a current block, wherein if a first reference sample row among the plurality of reference sample rows includes an unavailable reference sample, replacing the unavailable reference sample with an available reference sample included in the first reference sample row or in a second reference sample row different from the first reference sample row;
[0291] Selecting a reference sample row for intra prediction of the current block from the plurality of reference sample rows; and
[0292] The intra prediction is performed on the current block using the selected reference sample row.
[0293] Scheme 2. The method according to Scheme 1,
[0294] The unavailable reference sample is replaced by an available reference sample having the shortest distance from the unavailable reference sample among the available reference samples included in the first reference sample row or the second reference sample row.
[0295] Scheme 3. The method according to Scheme 1,
[0296] If the distance between the unavailable reference sample and the available reference sample included in the first reference row is equal to or greater than a threshold, the unavailable reference sample is replaced with the available reference sample included in the second reference row.
[0297] Scheme 4. The method according to Scheme 3,
[0298] The second reference row has a larger index value than the first reference row.
[0299] Scheme 5. The method according to Scheme 1,
[0300] The prediction sample of the current block is generated based on an average value of a portion of the reference samples included in the selected reference sample row.
[0301] Scheme 6. The method according to Scheme 5,
[0302] The number of reference samples included in the selected reference sample row and used to calculate the average value is determined based on the size of the current block.
[0303] Solution 7. A method for encoding a video, the method comprising:
[0304] Obtaining a plurality of reference sample rows for a current block, wherein if a first reference sample row among the plurality of reference sample rows includes an unavailable reference sample, replacing the unavailable reference sample with an available reference sample included in the first reference sample row or in a second reference sample row different from the first reference sample row;
[0305] Selecting a reference sample row for intra prediction of the current block from the plurality of reference sample rows; and
[0306] The intra prediction is performed on the current block using the selected reference sample row.
[0307] Scheme 8. The method according to Scheme 7,
[0308] The unavailable reference sample is replaced by an available reference sample having the shortest distance from the unavailable reference sample among the available reference samples included in the first reference sample row or the second reference sample row.
[0309] Scheme 9. The method according to Scheme 7,
[0310] If the distance between the unavailable reference sample and the available reference sample included in the first reference row is equal to or greater than a threshold, the unavailable reference sample is replaced with the available reference sample included in the second reference row.
[0311] Scheme 10. The method according to Scheme 2,
[0312] The second reference row has a larger index value than the first reference row.
[0313] Scheme 11. The method according to Scheme 7,
[0314] The prediction sample of the current block is generated based on an average value of a portion of the reference samples included in the selected reference sample row.
[0315] Scheme 12. The method according to Scheme 11,
[0316] The number of reference samples included in the selected reference sample row and used to calculate the average value is determined based on the size of the current block.
[0317] Solution 13. A device for decoding a video, the device comprising:
[0318] an intra prediction unit, configured to obtain a plurality of reference sample rows for a current block, select a reference sample row for intra prediction of the current block from the plurality of reference sample rows, and perform the intra prediction on the current block using the selected reference sample row,
[0319] If a first reference sample row among the plurality of reference sample rows includes unavailable reference samples, the unavailable reference samples are replaced with available reference samples included in the first reference sample row or in a second reference sample row different from the first reference sample row.
[0320] Solution 14. A device for encoding a video, the device comprising:
[0321] an intra prediction unit, configured to obtain a plurality of reference sample rows for a current block, select a reference sample row for intra prediction of the current block from the plurality of reference sample rows, and perform the intra prediction on the current block using the selected reference sample row,
[0322] If a first reference sample row among the plurality of reference sample rows includes unavailable reference samples, the unavailable reference samples are replaced with available reference samples included in the first reference sample row or in a second reference sample row different from the first reference sample row.
[0323] Solution 15. A video signal processing method, comprising the following steps:
[0324] Creating multiple most probable mode (MPM) candidates;
[0325] Determine whether there is an MPM candidate with the same intra prediction mode as the current block among the multiple MPM candidates;
[0326] acquiring an intra prediction mode of a current block based on the determined result; and
[0327] Intra prediction on the current block is performed based on the intra prediction mode of the current block.
Claims
1. A method for decoding a video, the method comprising: Determine a reference sample row of a current block from a plurality of reference sample row candidates; Determining an intra prediction mode of the current block; obtaining a reference sample included in the reference sample row; as well as Using the reference samples in the reference sample row and the intra prediction mode of the current block, obtaining a prediction sample of the current block, in: determining a reference sample row for the current block based on index information signaled for the current block, wherein the index information specifies one of the plurality of reference sample row candidates, and Based on a flag signaled at a sequence level, it is determined whether selection of the reference sample row from among the plurality of reference sample row candidates is permitted.
2. The method according to claim 1, wherein: The method also includes determining whether to filter the reference samples, and The determination is based on whether the reference sample is adjacent to the current block.
3. The method according to claim 1, wherein: The reference sample row candidates include adjacent reference sample rows and non-adjacent reference sample rows, and When the intra prediction mode of the current block is a non-directional intra prediction mode, the intra prediction of the current block is performed by using only the adjacent reference sample rows, and the non-directional intra prediction mode includes DC or plane.
4. A method for encoding a video, the method comprising: Get the reference sample of the current block; as well as Based on the reference sample and the intra prediction mode of the current block, obtaining a prediction sample of the current block, in: A reference sample row including a reference sample of the current block is selected from a plurality of reference sample row candidates, For the current block, index information is encoded, wherein the index information specifies a reference sample row among a plurality of reference sample row candidates, and A flag indicating whether selection of the reference sample row from among the plurality of reference sample row candidates is allowed is encoded at a sequence level.
5. The method according to claim 4, wherein: The method also includes determining whether to filter the reference samples, and The determination is based on whether the reference sample is adjacent to the current block.
6. The method according to claim 4, wherein: The reference sample row candidates include adjacent reference sample rows and non-adjacent reference sample rows, and When the intra prediction mode of the current block is a non-directional intra prediction mode, the intra prediction of the current block is performed by using only the adjacent reference sample rows, and the non-directional intra prediction mode includes DC or plane.
7. A device for transmitting compressed video data, the device comprising: one or more hardware units configured to obtain the compressed video data and transmit the compressed video data, Wherein, obtaining the compressed video data comprises: Get the reference sample of the current block; and Based on the reference sample and the intra prediction mode of the current block, obtaining a prediction sample of the current block, in: A reference sample row including a reference sample of the current block is selected from a plurality of reference sample row candidates, For the current block, index information is encoded, wherein the index information specifies a reference sample row among a plurality of reference sample row candidates, and A flag indicating whether selection of the reference sample row from among the plurality of reference sample row candidates is allowed is encoded at a sequence level.
Citation Information
Patent Citations
Method for encoding and decoding video using intra prediction, and apparatus thereof
KR1020140124443A
