Video encoding / decoding method and device

The method improves video encoding/decoding efficiency by generating predicted blocks through intra prediction and filtering based on intra prediction mode, addressing inefficiencies in high-resolution video compression.

JP7818727B2Active Publication Date: 2026-02-20ELECTRONICS & TELECOMM RES INST
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2025028153
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2012-06-20
Filing Date
2025-02-25
Publication Date
2026-02-20
Estimated Expiration
2032-06-20

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies face challenges in improving efficiency for high-resolution, high-quality video compression, particularly in handling intra prediction and filtering processes.

Method used

A method and apparatus for generating predicted blocks through intra prediction and filtering, where the filtering process is based on the intra prediction mode of the current block, applying specific filter types and coefficients to improve video encoding/decoding efficiency.

Benefits of technology

Enhances video encoding/decoding efficiency by minimizing prediction errors and discontinuities, thereby improving the overall compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007818727000012
    Figure 0007818727000012
  • Figure 0007818727000013
    Figure 0007818727000013
  • Figure 0007818727000014
    Figure 0007818727000014
Patent Text Reader

Abstract

To provide a video encoding / decoding method, a prediction block generating method, an intra prediction method, and a filtering execution method that improve video encoding / decoding efficiency.SOLUTION: A filtering method includes the steps of performing intra prediction on a current block to generate a predicted block, performing filtering on pixels to be filtered in the predicted block on the basis of an intra prediction mode of the current block to generate a final predicted block, and generating a reconstructed block on the basis of a reconstructed differential block corresponding to the current block and the final predicted block.SELECTED DRAWING: Figure 10
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to video processing, and more particularly to an intra prediction method and apparatus. [Background technology]

[0002] Recently, as HD (High Definition) broadcasting services have expanded not only in Korea but also around the world, many users have become accustomed to high-resolution, high-quality images, and as a result, many organizations are spurring the development of next-generation video equipment.In addition to HDTV, there has been growing interest in UHD (Ultra High Definition), which has a resolution four times that of HDTV, and there is a demand for compression techniques for higher-resolution, high-quality images.

[0003] For video compression, techniques such as inter-prediction, which predicts pixel values ​​contained in a current picture from previous and / or subsequent pictures, intra-prediction, which predicts pixel values ​​contained in a current picture using pixel information within the current picture, and entropy coding, which assigns short codes to symbols that occur frequently and long codes to symbols that occur infrequently, can be used. Summary of the Invention [Problem to be solved by the invention]

[0004] An object of the present invention is to provide a video encoding method and apparatus capable of improving video encoding / decoding efficiency.

[0005] Another technical object of the present invention is to provide a video decoding method and apparatus capable of improving video encoding / decoding efficiency.

[0006] Another technical object of the present invention is to provide a method and apparatus for generating a predicted block, which can improve video encoding / decoding efficiency.

[0007] Another technical object of the present invention is to provide an intra prediction method and apparatus capable of improving video encoding / decoding efficiency.

[0008] Another technical object of the present invention is to provide a filtering method and apparatus capable of improving video encoding / decoding efficiency. [Means for solving the problem]

[0009] According to an embodiment of the present invention, there is provided a video decoding method, the method including: generating a predicted block by performing intra prediction on a current block; generating a final predicted block by performing filtering on pixels to be filtered in the predicted block based on an intra prediction mode of the current block; and generating a reconstructed block based on a reconstructed differential block (hereinafter, the term "differential block" may be used interchangeably with "residual block") corresponding to the current block and the final predicted block, wherein the pixels to be filtered are predicted pixels included in a region to be filtered in the predicted block, and a filter type applied to the pixels to be filtered and the region to be filtered are determined based on the intra prediction mode of the current block.

[0010] If the intra prediction mode of the current block is DC mode, the filtering target area includes a left vertical predicted pixel line, which is a vertical pixel line located at the leftmost position in the prediction block, and an upper horizontal predicted pixel line, which is a horizontal pixel line located at the topmost position in the prediction block.

[0011] In the final predicted block generation step, filtering is performed if the current block is a luma component block, and filtering is not performed if the current block is a chroma component block.

[0012] The filter type includes information on a filter shape, filter taps, and a plurality of filter coefficients, and the final predicted block generation step performs filtering based on a predetermined fixed filter type regardless of the size of the current block.

[0013] If the pixel to be filtered is a left-side upper predicted pixel located at the uppermost left side in the predicted block, the final predicted block generation step performs filtering on the pixel to be filtered by applying a 3-tap filter based on the pixel to be filtered, an upper reference pixel adjacent to the pixel to be filtered above, and a left reference pixel adjacent to the pixel to be filtered on the left side, wherein the upper reference pixel and the left reference pixel are reconstructed reference pixels adjacent to the current block, respectively, and in the 3-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 2 / 4, a filter coefficient assigned to a filter tap corresponding to the upper reference pixel is 1 / 4, and a filter coefficient assigned to a filter tap corresponding to the left reference pixel is 1 / 4.

[0014] If the pixel to be filtered is a predicted pixel included in the left vertical predicted pixel line and is not the left-side upper predicted pixel, the final predicted block generation step performs filtering on the pixel to be filtered by applying a horizontal 2-tap filter based on the pixel to be filtered and a left reference pixel adjacent to the left side of the pixel to be filtered, the left reference pixel being a reconstructed reference pixel adjacent to the current block, and in the horizontal 2-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 3 / 4, and a filter coefficient assigned to a filter tap corresponding to the left reference pixel is 1 / 4.

[0015] If the pixel to be filtered is a predicted pixel included in the upper horizontal predicted pixel line and is not the left upper predicted pixel, the final predicted block generation step performs filtering on the pixel to be filtered by applying a vertical 2-tap filter based on the pixel to be filtered and an upper reference pixel adjacent to the upper side of the pixel to be filtered, the upper reference pixel being a reconstructed reference pixel adjacent to the current block, and in the vertical 2-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 3 / 4, and a filter coefficient assigned to a filter tap corresponding to the upper reference pixel is 1 / 4.

[0016] Another embodiment of the present invention is a video decoding method, the method including: generating a predicted block by performing prediction on a pixel to be predicted in a current block based on an intra prediction mode of the current block; and generating a reconstructed block based on a reconstructed differential block corresponding to the current block and the final predicted block, wherein the predictive block generating step performs prediction on the pixel to be predicted based on a first offset if the intra prediction mode of the current block is a vertical mode and the pixel to be predicted is a pixel on a left vertical pixel line; and performs prediction on the pixel to be predicted based on a second offset if the intra prediction mode of the current block is a horizontal mode and the pixel to be predicted is a pixel on an upper horizontal pixel line, the left vertical pixel line being a vertical pixel line located at the leftmost position in the current block, and the upper horizontal pixel line being a horizontal pixel line located at the uppermost position in the current block.

[0017] In the predicted block generation step, if the intra prediction mode of the current block is a vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, the predicted value of the pixel to be predicted is derived by adding the first offset value to the pixel value of a first reference pixel that is on the same vertical line as the pixel to be predicted among the reconstructed reference pixels adjacent to the upper side of the current block, and the first offset value is determined based on the difference between the pixel value of a second reference pixel adjacent to the left side of the pixel to be predicted and the pixel value of a third reference pixel adjacent to the left side of the first reference pixel.

[0018] In the generating the predicted block, if the current block is a chroma component block, the pixel value of the first reference pixel is determined as a predicted value of the pixel to be predicted.

[0019] In the predicted block generation step, if the intra prediction mode of the current block is a horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, the second offset value is added to the pixel value of a first reference pixel that is adjacent to the left side of the current block and exists on the same horizontal line as the pixel to be predicted, to derive a predicted value of the pixel to be predicted, and the second offset value is determined based on a difference between the pixel value of the second reference pixel adjacent to the upper side of the pixel to be predicted and the pixel value of the third reference pixel adjacent to the upper side of the first reference pixel.

[0020] In the generating the predicted block, if the current block is a chroma component block, the pixel value of the first reference pixel is determined as a predicted value of the pixel to be predicted.

[0021] Another embodiment of the present invention is a video decoding apparatus, including: a prediction block generator configured to generate a prediction block by performing intra prediction on a current block, a filter unit configured to generate a final prediction block by performing filtering on pixels to be filtered in the prediction block based on an intra prediction mode of the current block, and a reconstructed block generator configured to generate a reconstructed block based on a reconstructed difference block corresponding to the current block and the final prediction block, wherein the pixels to be filtered are prediction pixels included in a region to be filtered in the prediction block, and a filter type applied to the pixels to be filtered and the region to be filtered are determined based on the intra prediction mode of the current block.

[0022] If the intra prediction mode of the current block is DC mode, the filtering target area includes a left vertical predicted pixel line, which is a vertical pixel line located at the leftmost position in the prediction block, and an upper horizontal predicted pixel line, which is a horizontal pixel line located at the topmost position in the prediction block.

[0023] When the pixel to be filtered is a left-side upper predicted pixel located at the uppermost left side in the predicted block, the filter unit performs filtering on the pixel to be filtered by applying a 3-tap filter based on the pixel to be filtered, an upper reference pixel adjacent to the pixel to be filtered above, and a left reference pixel adjacent to the pixel to be filtered on the left side, wherein the upper reference pixel and the left reference pixel are reconstructed reference pixels adjacent to the current block, respectively, and in the 3-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 2 / 4, a filter coefficient assigned to a filter tap corresponding to the upper reference pixel is 1 / 4, and a filter coefficient assigned to a filter tap corresponding to the left reference pixel is 1 / 4.

[0024] If the pixel to be filtered is a predicted pixel included in the left vertical predicted pixel line and is not the left-side upper predicted pixel, the filter unit performs filtering on the pixel to be filtered by applying a horizontal 2-tap filter based on the pixel to be filtered and a left reference pixel adjacent to the left side of the pixel to be filtered, the left reference pixel being a reconstructed reference pixel adjacent to the current block, and in the horizontal 2-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 3 / 4, and a filter coefficient assigned to a filter tap corresponding to the left reference pixel is 1 / 4.

[0025] If the pixel to be filtered is a predicted pixel included in the upper horizontal predicted pixel line and is not the left upper predicted pixel, the filter unit performs filtering on the pixel to be filtered by applying a vertical 2-tap filter based on the pixel to be filtered and an upper reference pixel adjacent to the upper side of the pixel to be filtered, the upper reference pixel being a reconstructed reference pixel adjacent to the current block, and in the vertical 2-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 3 / 4, and a filter coefficient assigned to a filter tap corresponding to the upper reference pixel is 1 / 4.

[0026] Another embodiment of the present invention is a video decoding apparatus, the apparatus including: a prediction block generator configured to generate a prediction block by performing prediction on a pixel to be predicted in a current block based on an intra prediction mode of the current block; and a reconstructed block generator configured to generate a reconstructed block based on a reconstructed differential block corresponding to the current block and the final predicted block, wherein the prediction block generator performs prediction on the pixel to be predicted based on a first offset when the intra prediction mode of the current block is a vertical mode and the pixel to be predicted is a pixel on a left vertical pixel line, and performs prediction on the pixel to be predicted based on a second offset when the intra prediction mode of the current block is a horizontal mode and the pixel to be predicted is a pixel on an upper horizontal pixel line, the left vertical pixel line being a vertical pixel line located at the leftmost position in the current block, and the upper horizontal pixel line being a horizontal pixel line located at the uppermost position in the current block.

[0027] When the intra prediction mode of the current block is a vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, the prediction block generation unit derives a predicted value of the pixel to be predicted by adding the first offset value to a pixel value of a first reference pixel that is on the same vertical line as the pixel to be predicted among reconstructed reference pixels adjacent to the upper side of the current block, and the first offset value is determined based on a difference between a pixel value of a second reference pixel adjacent to the left side of the pixel to be predicted and a pixel value of a third reference pixel adjacent to the left side of the first reference pixel.

[0028] When the intra prediction mode of the current block is a horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, the prediction block generation unit derives a predicted value of the pixel to be predicted by adding the second offset value to a pixel value of a first reference pixel that is on the same horizontal line as the pixel to be predicted among reconstructed reference pixels adjacent to the left side of the current block, and the second offset value is determined based on a difference value between a pixel value of a second reference pixel adjacent to the pixel to be predicted above and a pixel value of a third reference pixel adjacent to the first reference pixel above. [Effects of the Invention]

[0029] According to the video encoding method of the present invention, video encoding / decoding efficiency can be improved.

[0030] According to the video decoding method of the present invention, video encoding / decoding efficiency can be improved.

[0031] According to the method for generating a predicted block according to the present invention, video encoding / decoding efficiency can be improved.

[0032] The intra prediction method according to the present invention can improve video encoding / decoding efficiency.

[0033] According to the filtering method of the present invention, video encoding / decoding efficiency can be improved. [Brief explanation of the drawings]

[0034] [Figure 1] 1 is a block diagram showing a configuration of an embodiment of a video encoding device to which the present invention is applied. [Figure 2] 1 is a block diagram showing a configuration of an embodiment of a video decoding device to which the present invention is applied; [Figure 3] FIG. 1 is a conceptual diagram illustrating an embodiment in which one unit is divided into multiple sub-units. [Figure 4a] 1 is a diagram illustrating an embodiment of an intra prediction process; [Figure 4b] 10 is a diagram illustrating an embodiment of an intra prediction process. [Figure 5] 1 illustrates a schematic example of an intra prediction method in planar mode. [Figure 6] 1 is a flowchart illustrating an example of a video encoding method according to the present invention. [Figure 7] 10 shows a schematic diagram of an embodiment of the detailed difference block generation process. [Figure 8] 1 is a flowchart illustrating an example of a video decoding method according to the present invention. [Figure 9] 10 shows a schematic diagram of an embodiment of the detailed difference block generation process. [Figure 10] 1 is a flow chart that schematically illustrates an embodiment of a method for performing filtering according to the present invention. [Figure 11] 10A and 10B illustrate an example of a method for determining whether to perform filtering based on coding parameters of neighboring blocks of a current block. [Figure 12] 10A and 10B illustrate an example of a method for determining whether to perform filtering based on information about whether neighboring blocks adjacent to a current block exist (and / or whether the neighboring blocks are available). [Figure 13]10 illustrates an example of a method for determining a filtering execution region based on an intra-prediction mode of a current block. [Figure 14] 10 illustrates an example embodiment of a method for determining a filtering execution region based on the size and / or depth of a current block. [Figure 15] 10 illustrates an example of a method for determining a filtering execution region based on coding modes of neighboring blocks adjacent to a current block. [Figure 16a] 10 illustrates an embodiment of a method for determining a filter type according to an intra-prediction mode of a current block. [Figure 16b] 10 illustrates an embodiment of a method for determining a filter type according to an intra-prediction mode of a current block. [Figure 17] A simplified method for determining a filter type according to the embodiment of Figs. 16a and 16b is shown. [Figure 18] 10A and 10B illustrate examples of filter types that are applied when the prediction mode of the current block is a vertical mode and / or a horizontal mode. [Figure 19] 3 shows a schematic representation of another embodiment of a filter type according to the invention; [Figure 20] 10 is a diagram illustrating intra prediction modes and filter types applied to Table 9. DETAILED DESCRIPTION OF THE INVENTION

[0035] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing the examples of this specification, if a detailed description of related known configurations or functions is deemed to obscure the gist of this specification, the detailed description will be omitted.

[0036] When a component is referred to as being "coupled" or "connected" to another component, it should be understood that the component may be directly coupled or connected to the other component, but that there may be other components in between. Furthermore, in the present invention, when a component is described as "including" a specific component, it does not exclude components other than the component, but rather means that additional components may be included within the scope of the implementation or technical idea of ​​the present invention.

[0037] Terms such as "first" and "second" may be used to describe various components, but the components should not be limited by these terms. These terms are used only to distinguish one component from another. For example, a first component may be called a "second component," and similarly, a second component may be called a "first component," without departing from the scope of the present invention.

[0038] Furthermore, the components shown in the embodiments of the present invention are illustrated independently to show different characteristic functions, and do not mean that each component is configured as a separate hardware or software unit. That is, each component is included as a separate component for the convenience of explanation, and at least two of the components may be integrated into one component, or one component may be divided into multiple components to perform its function. Such integrated and separated embodiments of each component are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0039] In addition, some components are not essential components for performing essential functions in the present invention, but are optional components merely for improving performance. The present invention may be embodied by including only components essential for embodying the essence of the present invention, excluding components merely used for improving performance, and a structure including only essential components, excluding optional components merely used for improving performance, is also included in the scope of the present invention.

[0040] FIG. 1 is a block diagram showing the configuration of an embodiment of a video encoding device to which the present invention is applied.

[0041] Referring to FIG. 1, the video encoding device 100 includes a motion prediction unit 111, a motion compensation unit 112, an intra prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.

[0042] The video encoding device 100 may perform encoding on an input image in intra mode or inter mode and output a bitstream. Intra prediction refers to intra-frame prediction, and inter prediction refers to inter-frame prediction. In the intra mode, the switch 115 may be switched to intra, and in the inter mode, the switch 115 may be switched to inter. The video encoding device 100 may generate a prediction block for an input block of the input image, and then encode a residual between the input block and the prediction block.

[0043] In the case of intra mode, the intra prediction unit 120 can generate a predicted block by performing spatial prediction using pixel values ​​of already coded blocks surrounding the current block.

[0044] In the case of inter mode, the motion prediction unit 111 may obtain a motion vector by searching for an area that best matches an input block in a reference image stored in the reference picture buffer 190 during the motion prediction process. The motion compensation unit 112 may generate a prediction block by performing motion compensation using the motion vector. Here, the motion vector is a two-dimensional vector used in inter prediction and may indicate an offset between a current image to be coded / decoded and a reference image.

[0045] The subtractor 125 can generate a residual block based on the difference between the input block and the generated prediction block. The transform unit 130 can output transform coefficients by performing a transform on the residual block. The quantization unit 140 can quantize the input transform coefficients using a quantization parameter and output quantized coefficients.

[0046] The entropy coding unit 150 can output a bit stream by performing entropy coding based on the value calculated by the quantization unit 140 or the coding parameter value calculated during the coding process.

[0047] When entropy coding is applied, fewer bits are assigned to symbols with higher occurrence probabilities and more bits are assigned to symbols with lower occurrence probabilities to represent the symbols, thereby reducing the size of the bit string for the symbols to be coded. Therefore, the compression performance of video coding can be improved through entropy coding. The entropy coding unit 150 can use coding methods such as exponential golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) for entropy coding.

[0048] 1 performs inter-prediction coding, i.e., inter-frame predictive coding, so that a currently coded image needs to be decoded and stored to be used as a reference image. Therefore, the quantized coefficients are inversely quantized by an inverse quantization unit 160 and inversely transformed by an inverse transform unit 170. The inversely quantized and inversely transformed coefficients are added to a predicted block via an adder 175 to generate a reconstructed block.

[0049] The reconstructed block passes through the filter unit 180, which can apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or picture. The filter unit 180 is also called an adaptive in-loop filter. The deblocking filter can remove block distortion that occurs at boundaries between blocks. The SAO can add an appropriate offset value to pixel values ​​to compensate for coding errors. The ALF can perform filtering based on a value obtained by comparing a reconstructed image with an original image. The reconstructed block that has passed through the filter unit 180 can be stored in the reference picture buffer 190.

[0050] FIG. 2 is a block diagram showing the configuration of an embodiment of a video decoding device to which the present invention is applied.

[0051] Referring to FIG. 2, the video decoding apparatus 200 includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference picture buffer 270.

[0052] The video decoding apparatus 200 receives a bitstream output from an encoder and performs decoding in an intra mode or an inter mode to output a reconstructed image, i.e., a restored image. In the intra mode, a switch may be converted to intra, and in the inter mode, a switch may be converted to inter. The video decoding apparatus 200 may obtain a residual block from the input bitstream to generate a prediction block, and then generate a reconstructed block, i.e., a restored block, by adding the residual block and the prediction block.

[0053] The entropy decoding unit 210 may entropy decode the input bitstream according to a probability distribution to generate symbols including symbols in the form of quantized coefficients. The entropy decoding method is similar to the entropy coding method described above.

[0054] When the entropy decoding method is applied, a smaller number of bits are assigned to symbols having a higher occurrence probability, and a larger number of bits are assigned to symbols having a lower occurrence probability, thereby reducing the size of the bit string for each symbol. Therefore, the entropy decoding method can improve the compression performance of video decoding.

[0055] The quantized coefficients are inversely quantized in the inverse quantization unit 220 and inversely transformed in the inverse transform unit 230, and a residual block can be generated as a result of the inverse quantization / inverse transformation of the quantized coefficients.

[0056] In the case of an intra mode, the intra prediction unit 240 may generate a predicted block by performing spatial prediction using pixel values ​​of previously coded blocks surrounding the current block. In the case of an inter mode, the motion compensation unit 250 may generate a predicted block by performing motion compensation using a motion vector and a reference picture stored in the reference picture buffer 270.

[0057] The residual block and the prediction block are added via an adder 255, and the added block may pass through a filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, SAO, and ALF to the reconstructed block or the reconstructed picture. The filter unit 260 may output a reconstructed image, i.e., a reconstructed image. The reconstructed image may be stored in a reference picture buffer 270 and used for inter prediction.

[0058] Hereinafter, the term "unit" refers to a unit of video encoding and decoding. The encoding or decoding unit during video encoding and decoding refers to the unit into which an image is divided and encoded or decoded, and may therefore be referred to as a coding unit (CU), a prediction unit (PU), a transform unit (TU), etc. In addition, in the embodiments described below, a unit may also be referred to as a block. One unit may be divided into smaller sub-units.

[0059] FIG. 3 is a conceptual diagram that illustrates an example in which one unit is divided into multiple sub-units.

[0060] A unit can be hierarchically divided into subunits having depth information under a tree structure. Each divided subunit can have depth information. The depth information can include information on the size of the subunit to indicate the number and / or degree to which the unit is divided.

[0061] Referring to 310 in Figure 3, the highest node may be called a root node and may have the smallest depth value, in which case the highest node may have a depth of level 0 and may indicate the first unit that is not divided.

[0062] A subnode with a depth of level 1 may indicate a unit in which the initial unit is divided once, and a subnode with a depth of level 2 may indicate a unit in which the initial unit is divided twice. For example, in 320 of Figure 3, unit a corresponding to node a is a unit in which the initial unit is divided once, and may have a depth of level 1.

[0063] A leaf node at level 3 may represent a unit that is obtained by dividing the initial unit three times. For example, in 320 of FIG. 3, unit d corresponding to node d is a unit that is obtained by dividing the initial unit three times and may have a depth of level 3. Therefore, the leaf node at level 3, which is the lowest node, may have the deepest depth.

[0064] In the following embodiments, a block to be coded / decoded may also be referred to as a current block, and when intra prediction is performed on the block to be coded / decoded, the block to be coded / decoded may also be referred to as a predicted block.

[0065] Meanwhile, a video signal may generally include three color signals representing the three primary color components of light. The three color signals representing the three primary color components of light are R (Red), G (Green), and B (Blue). The R, G, and B signals may be converted into one luma signal and two chroma signals to reduce the frequency bandwidth used for video processing. In this case, one video signal may include one luma signal and two chroma signals. The luma signal is a component representing the brightness of the screen and corresponds to Y, and the chroma signal is a component representing the color of the screen and may correspond to U, V, or Cb, Cr. Since the human eye is sensitive to luma signals and insensitive to chroma signals, when the R, G, and B signals are converted into luma signals and chroma signals using this characteristic, the frequency bandwidth used for video processing can be reduced. In the following embodiments, a block having a luma component is referred to as a luma block, and a block having a chroma component is referred to as a chroma block.

[0066] 4a and 4b are diagrams illustrating an embodiment of an intra prediction process. Reference numerals 410 and 420 in FIG. 4a illustrate an embodiment of prediction directions of intra prediction modes and mode values ​​assigned to each prediction direction. Reference numeral 430 in FIG. 4b illustrates the positions of reference pixels used in intra prediction of a block to be coded / decoded. A pixel may have the same meaning as a sample, and in the embodiments described below, a pixel may also be referred to as a sample in some cases.

[0067] As described in detail in the embodiments of FIGS. 1 and 2, an encoder and a decoder may generate a prediction block by performing intra prediction based on pixel information within a current picture. That is, when performing intra prediction, the encoder and the decoder may perform directional prediction and / or non-directional prediction based on at least one reconstructed reference pixel. Here, the prediction block refers to a block generated as a result of performing intra prediction. The prediction block may correspond to at least one of a coding unit (CU), a prediction unit (PU), and a transform unit (TU). In addition, the prediction block may be a square block having a size such as 2×2, 4×4, 8×8, 16×16, 32×32, or 64×64, or may be a rectangular block having a size such as 2×8, 4×8, 2×16, 4×16, or 8×16.

[0068] Meanwhile, intra prediction may be performed according to the intra prediction mode of the current block. The number of intra prediction modes that the current block may have may be a predetermined fixed value or may be a value that varies depending on the size of the prediction block. For example, the number of intra prediction modes that the current block may have may be 3, 5, 9, 17, 34, 35, or 36.

[0069] 4A shows an example of prediction directions of intra prediction modes and mode values ​​assigned to each prediction direction. In 410 of FIG. 4A, the numbers assigned to each intra prediction mode may indicate the mode values.

[0070] 4a, for example, in a vertical mode where the mode value is 0, prediction may be performed vertically based on the pixel value of a reference pixel, and in a horizontal mode where the mode value is 1, prediction may be performed horizontally based on the pixel value of a reference pixel. Even in a directional mode other than the modes described above, the encoder and decoder may perform intra prediction using reference pixels according to a corresponding angle.

[0071] In 410 of Figure 4a, an intra prediction mode having a mode value of 2 may be referred to as a DC mode, and an intra prediction mode having a mode value of 34 may be referred to as a planar mode. The DC mode and the planar mode may correspond to non-directional modes. For example, in the DC mode, a prediction block may be generated by averaging pixel values ​​of multiple reference pixels. An example of a method for generating each prediction pixel in a prediction block in planar mode will be described later with reference to Figure 5.

[0072] The number of intra prediction modes and / or mode values ​​assigned to each intra prediction mode are not limited to those in the above-described embodiments, and may be determined differently depending on implementation and / or needs. For example, the prediction direction of the intra prediction modes and the mode values ​​assigned to each prediction mode may be determined differently from those in 410 of Figure 4a, such as 420 of Figure 4a. For convenience of explanation, in the embodiments described below, it is assumed that intra prediction is performed based on the intra prediction mode such as 410 of Figure 4a, unless otherwise specified.

[0073] 4a, the intra prediction modes having mode values ​​of 5, 6, 12, 13, 22, 23, 24, and 25 may correspond to the vertical-right mode 413, and the intra prediction modes having mode values ​​of 8, 9, 16, 17, 30, 31, 32, and 33 may correspond to the horizontal-below mode 416.

[0074] Meanwhile, referring to 430 in FIG. 4b, reconstructed reference pixels used for intra prediction of the current block include, for example, a below-left reference pixel 431, a left reference pixel 433, an above-left corner reference pixel 435, an above reference pixel 437, and an above-right reference pixel 439. Here, the left reference pixel 433 refers to a reconstructed reference pixel adjacent to the left outside the current block, the above reference pixel 437 refers to a reconstructed reference pixel adjacent to the above outside the current block, and the above-left corner reference pixel 435 refers to a reconstructed reference pixel located in the upper left corner outside the current block. In addition, the lower left reference pixel 431 refers to a reference pixel located below the left pixel line formed by the left reference pixels 433 among pixels located on the same line as the left pixel line, and the upper right reference pixel 439 refers to a reference pixel located to the right of the upper pixel line among pixels located on the same line as the upper pixel line formed by the upper reference pixels 437. The names of the reference pixels described in detail in this specification may be equally applied to other embodiments described later.

[0075] The reference pixels used for intra prediction of the current block may vary depending on the intra prediction mode of the current block. For example, when the intra prediction mode of the current block is vertical mode (intra prediction mode with a mode value of 0 in 410 of FIG. 4a), the upper reference pixel 437 may be used for intra prediction, and when the intra prediction mode of the current block is horizontal mode (intra prediction mode with a mode value of 1 in 410 of FIG. 4a), the left reference pixel 433 may be used for intra prediction. Also, when an intra prediction mode with a mode value of 13 is used, the upper right reference pixel 439 may be used for intra prediction, and when an intra prediction mode with a mode value of 7 is used, the lower left reference pixel 431 may be used for intra prediction.

[0076] When the position of a reference pixel determined based on the prediction direction of an intra prediction mode and a pixel to be predicted is an integer position, the encoder and decoder may determine the reference pixel value at the corresponding position as a predicted pixel value for the pixel to be predicted. When the position of a reference pixel determined based on the prediction direction of an intra prediction mode and a pixel to be predicted is not an integer position, the encoder and decoder may generate an interpolated reference pixel based on the reference pixel at the integer position and determine the pixel value of the interpolated reference pixel as a predicted pixel value.

[0077] According to the above-described embodiments, the encoder and decoder may perform intra prediction on a block to be coded / decoded based on reconstructed or generated reference pixels. However, as described above, the reference pixels used for intra prediction may vary depending on the intra prediction mode of the current block, and discontinuity may occur between the generated predicted block and a neighboring block. For example, in the case of directional intra prediction, the farther a pixel in a predicted block is from a reference pixel, the larger the prediction error may be. In this case, discontinuity may occur due to the prediction error, limiting the improvement of coding efficiency.

[0078] Therefore, to solve the above-described problems, an encoding / decoding method may be provided that performs filtering on a predicted block generated by intra prediction. For example, a filter may be adaptively applied to a region having a large prediction error within a predicted block generated based on reference pixels. In this case, the prediction error may be reduced, discontinuities between blocks may be minimized, and encoding / decoding efficiency may be improved.

[0079] FIG. 5 shows a schematic example of an embodiment of an intra prediction method in planar mode.

[0080] Reference numeral 510 in Fig. 5 indicates one embodiment of an intra prediction method in planar mode, and reference numeral 530 in Fig. 5 indicates another embodiment of an intra prediction method in planar mode. Reference numerals 515 and 535 in Fig. 5 indicate blocks to be coded / decoded (hereinafter, having the same meaning as a current block), and the sizes of blocks 515 and 535 are each referred to as nS × nS.

[0081] In Figure 5, the position of a pixel in a current block is indicated by a predetermined coordinate. For convenience, the coordinates of the uppermost left corner of the current block are assumed to be (0,0). In this case, the y value may increase downward on the coordinate axis, and the x value may increase toward the right. In the embodiments described below, pixel coordinates are indicated by the same coordinate axes as those used in Figure 5.

[0082] 5, the encoder and decoder may derive a pixel value of a predicted pixel for a pixel (nS-1, nS-1) located at the lower rightmost position in the current block, i.e., a lower right predicted pixel 520. The encoder and decoder may derive a pixel value of a predicted pixel for a pixel on a vertical line located at the rightmost position in the current block, i.e., a right vertical line predicted pixel, based on a reference pixel 523 located at the rightmost position (nS-1, -1) among the upper reference pixels and the lower right predicted pixel 520, and may derive a pixel value of a predicted pixel for a pixel on a horizontal line located at the lowermost position in the current block, i.e., a lower horizontal line predicted pixel, based on a reference pixel 526 located at the lowermost position (-1, nS-1) among the left reference pixels and the lower right predicted pixel 520.

[0083] In this case, the predicted values ​​for the remaining pixels in the current block, excluding the pixels on the right vertical line and the pixels on the lower horizontal line, can be obtained by applying weights based on the upper reference pixels, the left reference pixels, the right vertical line predicted pixels, and the lower horizontal line predicted pixels.

[0084] As another example, the encoder and decoder may derive a predicted value for a pixel to be predicted 540 in a current block 535 using the method shown in 530 of Figure 5. In 530 of Figure 5, the coordinates of the pixel to be predicted 540 are (x, y). Referring to 530 of Figure 5, the encoder and decoder may derive a predicted value for the pixel to be predicted 540 by performing averaging and / or weighted averaging based on the uppermost reference pixel (-1, nS) 541 among the lower left reference pixels, the reference pixel (-1, y) 543 among the left reference pixels located on the same horizontal line as the pixel to be predicted 540, the reference pixel (x, -1) 545 among the upper reference pixels located on the same vertical line as the pixel to be predicted 540, and the leftmost reference pixel (nS, -1) among the upper right reference pixels.

[0085] FIG. 6 is a flowchart illustrating an example of a video encoding method according to the present invention.

[0086] 6, the encoder may generate a predicted block by performing intra prediction on a current block to be coded (S610). A specific example of the method for generating the predicted block has been described in detail with reference to FIGS. 4a and 4b, and therefore will not be described here.

[0087] 6, the encoder may perform filtering on the prediction block based on coding parameters of the current block to be coded and / or neighboring blocks of the current block to be coded (S620). Here, the coding parameters may include not only information coded by the encoder and transmitted to the decoder, such as syntax elements, but also information that can be inferred during the coding or decoding process, and refer to information required when coding or decoding an image. The coding parameters may include, for example, intra / inter prediction mode, motion vector, reference picture index, coded block pattern (CBP), presence or absence of residual signal, quantization parameter, block size, block partition information, etc.

[0088] As an example, the encoder may perform filtering on the prediction block based on information such as the intra prediction mode of the block to be encoded, whether the block to be encoded is a luma block or a chroma block, the size (and / or depth) of the block to be encoded, the coding parameters of surrounding blocks adjacent to the block to be encoded (e.g., the coding mode of the surrounding blocks), and / or the existence or non-existence of surrounding blocks (and / or whether the surrounding blocks are available blocks).

[0089] In the detailed filtering process, the encoder is described as always performing filtering, but the encoder may not perform filtering on the predicted block. For example, the encoder may determine whether to perform filtering based on coding parameters of the current block to be coded and / or neighboring blocks of the current block to be coded, and if it determines that filtering is not to be performed, the encoder does not perform filtering on the predicted block.

[0090] Meanwhile, the detailed filtering process is a separate process independent of the prediction block generation process, but may be combined with the prediction block generation process and executed as a single process. That is, the encoder may generate a prediction block by simultaneously applying a process corresponding to the filtering execution process based on the coding parameters of the encoding target block and / or neighboring blocks in the prediction block generation process. A specific example of a filtering execution method will be described later.

[0091] 6, the encoder may generate a difference block based on an original block corresponding to the position of the current block to be encoded and a predicted block (S630). Here, the predicted block may be a filtered predicted block or an unfiltered predicted block.

[0092] FIG. 7 schematically illustrates an embodiment of the detailed differential block generation process. Reference numeral 710 in FIG. 7 illustrates an embodiment of a process for generating a differential block based on an original block and a filtered predicted block. In reference numeral 710 in FIG. 7, block 713 represents the original block, block 716 represents the filtered predicted block, and block 719 represents the differential block. Referring to reference numeral 710 in FIG. 7, the encoder and decoder may generate the differential block by subtracting the filtered predicted block from the original block. Reference numeral 720 in FIG. 7 illustrates an embodiment of a process for generating a differential block based on an original block and an unfiltered predicted block. In reference numeral 720 in FIG. 7, block 723 represents the original block, block 726 represents the unfiltered predicted block, and block 729 represents the differential block. Referring to reference numeral 720 in FIG. 7, the encoder and decoder may generate the differential block by subtracting the unfiltered predicted block from the original block.

[0093] The generated difference block can be transmitted to a decoder after undergoing processes such as transformation, quantization, and entropy coding.

[0094] FIG. 8 is a flowchart illustrating an example of a video decoding method according to the present invention.

[0095] 8, the decoder may generate a predicted block by performing intra prediction on a current block to be decoded (S810). A specific example of the method for generating the predicted block has been described in detail with reference to FIGS. 4a and 4b, and therefore will not be described here.

[0096] 8, the decoder may perform filtering on the prediction block based on coding parameters of the block to be decoded and / or neighboring blocks adjacent to the block to be decoded (S820). Here, the coding parameters may include not only information coded by the encoder and transmitted to the decoder, such as syntax elements, but also information that can be inferred during the coding or decoding process, and refer to information required when coding or decoding an image. The coding parameters may include, for example, intra / inter prediction mode, motion vector, reference picture index, coded block pattern (CBP), presence or absence of residual signal, quantization parameter, block size, block partition information, etc.

[0097] As an example, the decoder may perform filtering on the prediction block based on information such as the intra prediction mode of the block to be decoded, whether the block to be decoded is a luma block or a chroma block, the size (and / or depth) of the block to be decoded, the coding parameters of surrounding blocks adjacent to the block to be decoded (e.g., the coding mode of the surrounding blocks), and / or the existence or non-existence of surrounding blocks (and / or whether the surrounding blocks are available blocks).

[0098] In the detailed filtering process, the decoder is described as always performing filtering, but the decoder may not perform filtering on the predicted block. For example, the decoder may determine whether to perform filtering based on decoding parameters of the block to be decoded and / or neighboring blocks adjacent to the block to be decoded. If it is determined that filtering is not to be performed, the decoder does not perform filtering on the predicted block.

[0099] Meanwhile, the detailed filtering process is a separate process independent of the prediction block generation process, but may be combined with the prediction block generation process and performed as a single process. That is, the decoder may generate a prediction block by simultaneously applying a process corresponding to the filtering execution process based on the coding parameters of the block to be decoded and / or neighboring blocks in the prediction block generation process. In this case, the decoder does not perform a separate filtering process on the prediction block.

[0100] The method for performing filtering in the decoder is the same as that in the encoder, and a specific example of how filtering is performed will be described later.

[0101] 8, the decoder may generate a reconstructed block based on a reconstructed differential block corresponding to the position of the block to be decoded and a predicted block (S830). Here, the predicted block may be a filtered predicted block or an unfiltered predicted block.

[0102] FIG. 9 schematically illustrates an embodiment of the detailed differential block generation process. Reference numeral 910 in FIG. 9 illustrates an embodiment of a process for generating a reconstructed block based on a reconstructed differential block and a filtered predicted block. In FIG. 910, block 913 represents the reconstructed differential block, block 916 represents the filtered predicted block, and block 919 represents the reconstructed block. Referring to FIG. 910, the encoder and decoder may generate the reconstructed block by adding the reconstructed differential block and the filtered predicted block. Reference numeral 920 in FIG. 9 illustrates an embodiment of a process for generating a reconstructed block based on a reconstructed differential block and an unfiltered predicted block. In FIG. 920, block 923 represents the reconstructed differential block, block 926 represents the unfiltered predicted block, and block 929 represents the reconstructed block. Referring to FIG. 920, the encoder and decoder may generate the reconstructed block by adding the reconstructed differential block and the unfiltered predicted block.

[0103] FIG. 10 is a flow chart that outlines one embodiment of a method for performing filtering according to the present invention.

[0104] Referring to FIG. 10, the encoder and decoder may determine whether to perform filtering on a prediction block (and / or a prediction pixel) (S1010).

[0105] As described above, the encoder and decoder may perform intra prediction on a current block to be coded / decoded based on previously restored reference pixels. In this case, the reference pixels used in the intra prediction and / or the predicted pixel values ​​in the predicted block generated by the intra prediction may vary depending on the intra prediction mode of the current block. Therefore, in this case, the encoder and decoder may reduce prediction errors by filtering predicted pixels that have little correlation with the reference pixels used in the intra prediction. On the other hand, it is more efficient not to filter predicted pixels that have a high correlation with the reference pixels used in the intra prediction.

[0106] Therefore, the encoder and decoder may determine whether to perform filtering on a prediction block (and / or prediction pixels) based on at least one of the following: an intra prediction mode of a block to be coded / decoded; whether the block to be coded / decoded is a luma block or a chroma block; the size (and / or depth) of the block to be coded / decoded; coding parameters of neighboring blocks adjacent to the block to be coded / decoded (e.g., the size and / or coding mode of the neighboring blocks); and information on the existence or non-existence of neighboring blocks (and / or whether the neighboring blocks are available). Whether to perform filtering may be determined during the coding / decoding process, or may be determined in advance according to various conditions. Specific examples of a method for determining whether to perform filtering will be described below.

[0107] In one embodiment, the encoder and decoder may determine whether to perform filtering on a prediction block based on the intra prediction mode of a block to be coded / decoded. As described above, the reference pixels and prediction direction used for intra prediction may be determined differently depending on the intra prediction mode of the block to be coded / decoded. Therefore, it is efficient to determine whether to perform filtering based on the intra prediction mode of the block to be coded / decoded.

[0108] Table 1 below shows an example of a method for determining whether to perform filtering based on the intra prediction mode. In Table 1, it is assumed that the prediction direction of the intra prediction mode and the mode value assigned to each prediction mode are determined in the same manner as in 410 of FIG. 4a.

[0109] [Table 1]

[0110] Here, among the values ​​assigned to the intra prediction modes, 0 may indicate that filtering is not performed, and 1 may indicate that filtering is performed.

[0111] As an example, when the prediction mode of the current block is DC mode (e.g., a prediction mode with a mode value of 2), a prediction block is generated by averaging pixel values ​​of multiple reference pixels, resulting in less correlation between the prediction pixel and the reference pixel. Therefore, in this case, the encoder and decoder may perform filtering on the prediction pixel in the prediction block. As another example, when the prediction mode of the current block is planar mode (e.g., a prediction mode with a mode value of 34), the encoder and decoder may derive a right vertical line prediction pixel and a lower horizontal line prediction pixel as described in detail in FIG. 5, and then derive a prediction value for each pixel in the current block by applying weights based on the derived prediction pixel and reference pixel. Therefore, in this case, since there is less correlation between the prediction pixel and the reference pixel, the encoder and decoder may perform filtering on the prediction pixel in the prediction block.

[0112] As another example, when the intra prediction mode of the current block is a vertical right mode (e.g., a prediction mode with a mode value of 5, 6, 12, 13, 22, 23, 24, or 25), the encoder and decoder perform intra prediction on the current block using upper reference pixels and / or upper right reference pixels, which may result in less correlation between the predicted pixel located in the left region of the prediction block and the left reference pixel. Therefore, in such a case, filtering may be performed on the pixel located in the left region of the prediction block. As another example, when the intra prediction mode of the current block is a horizontal down mode (e.g., a prediction mode with a mode value of 8, 9, 16, 17, 30, 31, 32, or 33), the encoder and decoder perform intra prediction on the current block using the left reference pixel and / or lower left reference pixel, which may result in less correlation between the predicted pixel located in the upper region of the prediction block and the upper reference pixel. Therefore, in such a case, filtering may be performed on the pixel located in the upper region of the prediction block.

[0113] In addition, unlike the embodiment of Table 1, the encoder and decoder may also perform filtering for vertical mode (e.g., a prediction mode with a mode value of 0) and horizontal mode (e.g., a prediction mode with a mode value of 1). When the intra prediction mode of the current block is a vertical mode, the encoder and decoder perform intra prediction for the current block using upper reference pixels, which may result in less correlation between the prediction pixel located in the left region of the prediction block and the left reference pixel. Therefore, in this case, filtering may be performed on the pixel located in the left region of the prediction block. As another example, when the intra prediction mode of the current block is a horizontal mode (e.g., a prediction mode with a mode value of 1), the encoder and decoder perform intra prediction for the current block using the left reference pixel, which may result in less correlation between the prediction pixel located in the upper region of the prediction block and the upper reference pixel. Therefore, in this case, filtering may be performed on the pixel located in the upper region of the prediction block.

[0114] Meanwhile, if the intra prediction mode of the current block corresponds to one of the remaining prediction modes excluding the detailed prediction modes (for example, prediction modes with mode values ​​of 3, 4, 7, 10, 11, 14, 15, 18, 19, 20, 21, 26, 27, 28, and 29), the encoder and decoder can use at least one reference pixel from the upper reference pixel and the upper right reference pixel for intra prediction, and can use at least one reference pixel from the left reference pixel and the lower left reference pixel for intra prediction. Therefore, in this case, all of the prediction pixels located in the left and upper regions within the prediction block can maintain correlation with the reference pixels, so the encoder and decoder do not perform filtering on the prediction block.

[0115] Examples of regions in the current block and / or predicted block where filtering is performed and / or pixel locations in the current block where filtering is performed for each case are described below.

[0116] In another embodiment, the encoder and decoder may determine whether to perform filtering on a prediction block based on the size and / or depth of a current block (and / or a block to be predicted), where the current block may correspond to at least one of a CU, a PU, or a TU.

[0117] Table 2 below shows an example of a method for determining whether to perform filtering based on the block size, and Table 3 below shows an example of a method for determining whether to perform filtering based on the depth value of the current block. In the examples of Tables 2 and 3, the current block may correspond to a TU, and the size of the TU may be, for example, 2x2, 4x4, 8x8, 16x16, 32x32, 64x64, etc. However, the present invention is not limited thereto, and the current block may also correspond to a CU and / or PU, etc., other than a TU.

[0118] [Table 2]

[0119] [Table 3]

[0120] Here, among the values ​​assigned to the intra prediction modes, 0 may indicate that filtering is not performed, and 1 may indicate that filtering is performed.

[0121] The encoder and decoder may also determine whether to perform filtering on the current block and / or predicted block by considering both the intra prediction mode of the current block and the size of the current block. That is, the encoder and decoder may determine whether to perform filtering based on the size of the current block for each intra prediction mode. In this case, whether to perform filtering may be determined differently depending on the size of the current block for each intra prediction mode. Table 4 below shows one embodiment of a method for determining whether to perform filtering based on the intra prediction mode of the current block and the size of the current block.

[0122] [Table 4]

[0123] Here, among the values ​​assigned to each intra prediction mode, 0 may indicate that filtering is not performed, and 1 may indicate that filtering is performed.

[0124] In another embodiment, the encoder and decoder may determine whether to perform filtering on the prediction block based on information indicating whether the current block corresponds to a luma block or a chroma block, i.e., color component information of the current block. For example, the encoder and decoder may perform filtering on the prediction block only when the current block corresponds to a luma block, and may not perform filtering when the current block corresponds to a chroma block.

[0125] In another embodiment, the encoder and decoder may determine whether to perform filtering based on coding parameters of neighboring blocks adjacent to the current block, whether Constrained Intra Prediction (CIP) is applied to the current block, and / or information on the existence of neighboring blocks (and / or whether the neighboring blocks are available), etc. Specific examples of methods for determining whether to perform filtering for each of the above will be described later.

[0126] 10, if it is determined that filtering is to be performed on the current block and / or the predicted block, the encoder and decoder may determine an area in the current block and / or the predicted block where filtering is to be performed (S1020). Here, the area in which filtering is to be performed may correspond to one or more samples in the current block and / or the predicted block.

[0127] As described in detail above, the encoder and decoder may reduce prediction errors by filtering prediction pixels that have little correlation with reference pixels used in intra prediction. That is, the encoder and decoder may determine a region in the current block and / or predicted block where the prediction error is relatively large as a filtering execution region. In this case, the encoder and decoder may determine the filtering execution region based on at least one of the intra prediction mode of the current block, the size (and / or depth) of the current block, and the coding mode of a neighboring block adjacent to the current block. Here, the coding mode of the neighboring block may indicate whether the neighboring block is coded / decoded in inter mode or intra mode. A specific example of a method for determining a filtering execution region will be described later.

[0128] The encoder and decoder may also determine a filter type to be applied to each predicted pixel in the filtering execution region (S1030).

[0129] In this case, the filter type may include information on a filter shape, filter taps, and filter coefficients. A plurality of intra prediction modes may have different prediction directions, and a method of using reconstructed reference pixels may vary depending on the position of a pixel to be filtered. Therefore, the encoder and decoder may adaptively determine a filter type to improve filtering efficiency. For example, the encoder and decoder may determine a filter type to be applied to each pixel to be filtered based on the intra prediction mode of the current block, the size (and / or depth) of the current block, and / or the position of the pixel to be filtered. Filter shapes include horizontal, vertical, and diagonal shapes, and filter taps include 2-tap, 3-tap, and 4-tap.

[0130] In addition, the encoder and decoder may determine filter coefficients based on the size of the prediction block and / or the position of the pixel to be filtered. That is, the encoder and decoder may vary the filter coefficients applied to the pixel to be filtered depending on the size of the prediction block and / or the position of the pixel to be filtered. Thus, the filter strength for the pixel to be filtered may be adaptively determined. For example, when a 2-tap filter is used, the filter coefficients may be [1:3], [1:7], [3:5], etc. As another example, when a 3-tap filter is used, the filter coefficients may be [1:2:1], [1:4:1], [1:6:1], etc.

[0131] On the other hand, the filter determined by the filter type does not have to be a filter defined by a filter shape, filter taps, filter coefficients, etc. For example, the encoder and decoder may perform the filtering process by adding an offset value determined by a predetermined process to the pixel value of the reference pixel. In this case, the filtering process may be combined with the predicted block generation process and performed as a single process. That is, the filtered predicted pixel value of each pixel in the current block may be derived only by the filtering process described above, and in this case, the filtering process described above may correspond to a single process including both the predicted pixel generation process and the filtering process for the generated predicted pixel.

[0132] A specific example of the filter type determination method will be described later.

[0133] Once the filter application region and filter type are determined, the encoder and decoder may perform filtering on each predicted pixel in the prediction block based on the determined filter application region and filter type (S1040). If it is determined that filtering is not to be performed on the prediction block, the encoder and decoder do not perform filtering on the prediction block (and / or each predicted pixel in the prediction block) (S1050).

[0134] FIG. 11 illustrates an example of a method for determining whether to perform filtering based on coding parameters of neighboring blocks adjacent to a current block.

[0135] 11, the coding parameters of the surrounding blocks include an intra prediction mode, an inter prediction mode, a coding mode, etc. Here, the coding mode of the surrounding blocks may indicate whether the surrounding blocks are coded / decoded in an inter mode or an intra mode.

[0136] 1110 of Figure 11 shows an embodiment of a method for determining whether to perform filtering based on the intra prediction mode of a neighboring block adjacent to a current block. 1113 of Figure 11 shows a current block (C), and 1116 of Figure 11 shows a left neighboring block (A) adjacent to the left side of the current block. In 1110 of Figure 11, it is assumed that the intra prediction mode of the current block corresponds to the vertical right mode. In this case, since the encoder and decoder perform intra prediction on the current block using upper reference pixels and / or upper right reference pixels, filtering can be performed on pixels located in a left region 1119 of the prediction block.

[0137] However, similar to 1110 of FIG. 11, when the prediction direction of the left peripheral block (A) 1116 adjacent to the filtering target region 1119 and the prediction direction of the current block (C) 1113 are different from each other, it is more efficient not to perform filtering on the filtering target region 1119. Therefore, when the prediction direction of the peripheral block 1116 adjacent to the filtering target region 1119 and the prediction direction of the current block 1113 are different from each other, the encoder and decoder do not perform filtering on the filtering target region 1119. Conversely, when the prediction direction of the peripheral block 1116 adjacent to the filtering target region 1119 and the prediction direction of the current block 1113 are the same or similar to each other (e.g., when the prediction angle difference value is equal to or less than a predetermined threshold), the prediction error can be reduced by performing filtering on the filtering target region 1119.

[0138] 1120 of Figure 11 shows an embodiment of a method for determining whether to perform filtering based on the coding mode of a neighboring block of a current block when Constrained Intra Prediction (CIP) is applied to the current block. 1123 of Figure 11 shows a current block (C), and 1126 of Figure 11 shows a left neighboring block (A) adjacent to the left side of the current block. In 1120 of Figure 11, it is assumed that the intra prediction mode of the current block corresponds to the vertical right mode. In this case, since the encoder and decoder perform intra prediction on the current block using upper reference pixels and / or upper right reference pixels, filtering can be performed on pixels located in a left region 1129 of the prediction block.

[0139] However, when CIP is applied to the current block (C) 1123, the encoder and decoder do not perform filtering on the filtering target region 1129 according to the coding mode of the left peripheral block (A) 1126 adjacent to the filtering target region 1129.

[0140] When CIP is applied to the current block 1123, the encoder and decoder do not use pixels in neighboring blocks coded in inter mode as reference pixels when performing intra prediction on the current block 1123. For example, in 1120 of FIG. 11, if the left neighboring block (A) 1126 is coded in inter mode, the reference pixels in the left neighboring block 1126, i.e., the left reference pixels, are not used for inter prediction of the current block 1123. In this case, the encoder and decoder can perform intra prediction after inserting the pixel values ​​of the reference pixels in the block coded in intra mode into the positions of the left reference pixels. That is, the encoder and decoder can enhance error resilience by not using pixels to which inter mode is applied for intra prediction.

[0141] Therefore, similar to 1120 in Figure 11, if CIP is applied to the current block 1123 and the coding mode of the left surrounding block 1126 adjacent to the region to be filtered 1129 is inter mode, the encoder and decoder do not perform filtering on the region to be filtered 1129.

[0142] FIG. 12 illustrates an example of a method for determining whether to perform filtering based on information about the presence or absence of neighboring blocks adjacent to a current block (and / or whether the neighboring blocks are available).

[0143] 1210 in Figure 12 indicates a current block (C), and 1220 in Figure 12 indicates a neighboring block (A) on the left side of the current block. In Figure 12, it is assumed that the intra prediction mode of the current block 1210 corresponds to the vertical right mode. In this case, since the encoder and decoder perform intra prediction on the current block using upper reference pixels and / or upper right reference pixels, filtering may be performed on pixels located in a left region 1230 within the prediction block.

[0144] However, if there are no neighboring blocks adjacent to the region to be filtered or if they are unavailable, the encoder and decoder do not perform filtering on the region to be filtered. Here, if there are no neighboring blocks adjacent to the region to be filtered or if they are unavailable, there are cases where the current block is located on the boundary of the current picture, or where the neighboring blocks adjacent to the current block are located outside the boundary of the slice to which the current block belongs.

[0145] When a neighboring block adjacent to the region to be filtered does not exist or is unavailable, the encoder and decoder may generate reference pixel values ​​at positions adjacent to the region to be filtered using available reference pixels, and then perform intra prediction. However, in this case, the generated reference pixels may have similar values ​​to each other, and the values ​​of the generated reference pixels may not be similar to pixel values ​​in the current block. Therefore, performing filtering on the current block based on the generated reference pixels may reduce coding efficiency. Therefore, the encoder and decoder do not perform filtering on the region to be filtered.

[0146] 12, a reconstructed block (B) D exists around a current block (C) 1210. In addition, a left peripheral block (A) 1220 adjacent to a filtering target region 1230 in the current block 1210 exists outside a boundary 1240 of a slice to which the current block 1210 belongs. In this case, since the left peripheral block (A) 1220 adjacent to the filtering target region 1230 corresponds to an unavailable block, the encoder and decoder do not perform filtering on the filtering target region 1230.

[0147] FIG. 13 illustrates an example of a method for determining a filtering execution region based on the intra-prediction mode of a current block.

[0148] As described in detail above, the encoder and decoder may perform intra prediction on a block to be encoded / decoded based on previously restored reference pixels. At this time, since the reference pixels and / or prediction direction used for intra prediction may vary depending on the intra prediction mode of the current block, it is efficient to determine a region having a relatively large prediction error as a filtering execution region in consideration of the intra prediction mode of the current block. More specifically, prediction pixels located in a region adjacent to reference pixels not used for intra prediction in a prediction block may have a low correlation with the reference pixels and may have a large prediction error. Therefore, the encoder and decoder may reduce prediction errors and improve prediction efficiency by filtering prediction pixels in a region adjacent to reference pixels not used for intra prediction among prediction pixels in a prediction block.

[0149] 1310 in Figure 13 shows an example of a filtering execution region when the prediction mode of the current block is the DC mode and / or the planar mode. In 1310 in Figure 13, 1313 may indicate a prediction block, and 1316 may indicate a filtering execution region.

[0150] As described above, when the prediction mode of the current block is DC mode, the prediction block 1313 is generated by averaging pixel values ​​of a plurality of reference pixels, resulting in less correlation between the prediction pixel and the reference pixel. Therefore, in this case, the encoder and decoder may determine one or more horizontal pixel lines located at the top of the prediction block 1313 (hereinafter referred to as upper horizontal predicted pixel lines) and one or more vertical pixel lines located at the leftmost side of the prediction block 1313 (hereinafter referred to as left vertical predicted pixel lines) as the filtering execution region 1316. In this case, the number of horizontal pixel lines included in the upper horizontal predicted pixel line and the number of vertical pixel lines included in the left vertical predicted pixel line are predetermined fixed numbers. For example, the upper horizontal predicted pixel line and the left vertical predicted pixel line may each include one pixel line. Also, as in the embodiment of FIG. 14 described below, the number of pixel lines included in the upper horizontal predicted pixel line and the number of pixel lines included in the left vertical predicted pixel line may be determined based on the size of the current block and / or the prediction block 1313. That is, the number of pixel lines included in the upper horizontal predicted pixel line and the number of pixel lines included in the left vertical predicted pixel line may have variable values ​​depending on the size of the current block and / or the predicted block 1313. For example, the number of pixel lines included in the upper horizontal predicted pixel line and the number of pixel lines included in the left vertical predicted pixel line may be 1, 2, or 4, respectively.

[0151] On the other hand, even when the prediction mode of the current block is a planar mode (e.g., a prediction mode with a mode value of 34), there is little correlation between the predicted pixel and the reference pixel. Therefore, in this case, the encoder and decoder may determine the upper horizontal predicted pixel line and the left vertical predicted pixel line as the filtering execution region 1316, as in the DC mode.

[0152] 1320 in Figure 13 shows an example of a filtering execution region when the intra prediction mode of the current block is a vertical right mode (e.g., a prediction mode with a mode value of 5, 6, 12, 13, 22, 23, 24, or 25). In 1320 in Figure 13, 1323 may indicate a prediction block, and 1326 may indicate a filtering execution region.

[0153] When the prediction mode of the current block is the vertical right mode, the encoder and decoder perform intra prediction on the current block based on the upper reference pixels and / or the upper right reference pixels, which may reduce correlation between the predicted pixels located in the left region of the prediction block 1323 and the left reference pixels. Therefore, in this case, the encoder and decoder may determine one or more vertical pixel lines located at the leftmost side of the prediction block 1323, i.e., the left vertical predicted pixel lines, as the filtering execution region 1326 and perform filtering, thereby improving prediction efficiency. In this case, the number of vertical pixel lines included in the left vertical predicted pixel line is a predetermined fixed number, and for example, the left vertical predicted pixel line may include one vertical pixel line. Also, as in the embodiment of FIG. 14 described below, the number of vertical pixel lines included in the left vertical predicted pixel line may be determined based on the size of the current block and / or the prediction block 1323. That is, the number of vertical pixel lines included in the left vertical predicted pixel line may have a variable value according to the size of the current block and / or predicted block 1323, for example, 1, 2, or 4.

[0154] On the other hand, when the prediction mode of the current block is a vertical mode, the encoder and decoder perform intra prediction on the current block using upper reference pixels, so that the correlation between the predicted pixel located in the left region of the predicted block and the left reference pixel may be weak. Therefore, even in this case, the encoder and decoder may determine the left vertical predicted pixel line as the filtering execution region and perform filtering.

[0155] 1330 in Figure 13 shows an example of a filtering execution region when the intra prediction mode of the current block is a horizontal-down mode (e.g., a prediction mode with a mode value of 8, 9, 16, 17, 30, 31, 32, or 33). In 1330 in Figure 13, 1333 may indicate a prediction block, and 1336 may indicate a filtering execution region.

[0156] When the prediction mode of the current block is the horizontal-down mode, the encoder and decoder perform intra prediction on the current block using left reference pixels and / or lower-left reference pixels, which may reduce correlation between predicted pixels located in an upper region of the prediction block 1333 and upper reference pixels. Therefore, in this case, the encoder and decoder may determine one or more horizontal pixel lines located at the topmost position in the prediction block 1333, i.e., upper horizontal predicted pixel lines, as the filtering execution region 1336 and perform filtering, thereby improving prediction efficiency. In this case, the number of horizontal pixel lines included in the upper horizontal predicted pixel line is a predetermined fixed number, and for example, the upper horizontal predicted pixel line may include one pixel line. Also, as with the embodiment of FIG. 14 described below, the number of horizontal pixel lines included in the upper horizontal predicted pixel line may be determined based on the size of the current block and / or the prediction block 1333. That is, the number of horizontal pixel lines included in the upper horizontal predicted pixel line may have a variable value depending on the size of the current block and / or predicted block 1333, for example, 1, 2, or 4.

[0157] On the other hand, when the prediction mode of the current block is a horizontal mode, the encoder and decoder perform intra prediction on the current block using the left reference pixel, so that the correlation between the predicted pixel located in the upper region of the predicted block and the upper reference pixel may be weak. Therefore, even in this case, the encoder and decoder may determine the upper horizontal predicted pixel line as the filtering execution region and perform filtering.

[0158] FIG. 14 illustrates an example of a method for determining a filtering execution region based on the size and / or depth of the current block.

[0159] When the size of the current block (and / or the block to be predicted) is large, the size of a region having a large prediction error in the current block is also large, and when the size of the current block (and / or the block to be predicted) is small, the size of a region having a large prediction error in the current block is also small. Therefore, the encoder and decoder can improve coding efficiency by determining a filtering execution region based on the size (and / or depth) of the current block (and / or the block to be predicted). In this case, the encoder and decoder can determine a region having a relatively large prediction error as the filtering execution region.

[0160] 1410 of FIG. 14 illustrates an example of a filtering execution region when the size of a current block is 8x8. In 1410 of FIG. 14, 1413 indicates the current block, and 1416 indicates the region to be filtered. In 1410 of FIG. 14, it is assumed that the intra prediction mode of the current block 1413 corresponds to a vertical right mode (e.g., a prediction mode with a mode value of 6). In this case, since the encoder and decoder perform intra prediction on the current block using the upper reference pixels and / or the upper right reference pixels, the prediction error is large in the left region of the prediction block that is far from the above reference pixels and the above right reference pixels. Therefore, in this case, the encoder and decoder may determine one or more vertical pixel lines located at the leftmost position in the prediction block, i.e., the left vertical prediction pixel line, as the filtering execution region 1416.

[0161] 1420 of FIG. 14 shows an example of a filtering execution region when the size of the current block is 32×32. In 1420 of FIG. 14, 1423 indicates the current block, and 1426 indicates the region to be filtered. In 1420 of FIG. 14, it is assumed that the intra prediction mode of the current block 1423 corresponds to a vertical right mode (e.g., a prediction mode with a mode value of 6). In this case, since the encoder and decoder perform intra prediction on the current block using the upper reference pixels and / or the upper right reference pixels, the prediction error is large in the left region of the prediction block that is far from the above reference pixels and the above right reference pixels. Therefore, in this case, the encoder and decoder may determine one or more vertical pixel lines located at the leftmost position in the prediction block, i.e., the left vertical prediction pixel line, as the filtering execution region 1426.

[0162] In the detailed 1410 and 1420 of Figure 14, the number of vertical pixel lines constituting the left vertical predicted pixel line may be determined based on the size of the current block 1413 and / or the predicted block. In 1410 of Figure 14, the size of the current block 1413 is 8x8, so the number is relatively small. Therefore, in this case, the size of the region with a large prediction error is relatively small, so the encoder and decoder may determine two vertical pixel lines in the order of the leftmost positions in the predicted block as the filtering execution region. On the other hand, in 1420 of Figure 14, the size of the current block 1423 is 32x32, so the number is relatively large. Therefore, in this case, the size of the region with a large prediction error is relatively large, so the encoder and decoder may determine four vertical pixel lines in the order of the leftmost positions in the predicted block as the filtering execution region.

[0163] Table 5 below shows an example of a filtering execution area according to block size, and Table 6 below shows an example of a filtering execution area according to the depth value of the current block. The encoder and decoder can determine the filtering execution area based on the size and / or depth of the current block, as shown in Tables 5 and 6 below.

[0164] [Table 5]

[0165] [Table 6]

[0166] Here, the current block may correspond to a TU, and the size of the TU may be, for example, 2x2, 4x4, 8x8, 16x16, 32x32, 64x64, etc. However, the present invention is not limited thereto, and the current block may also correspond to a CU and / or PU, which is not a TU.

[0167] The size and / or position of the filtering execution region determined according to the size and / or depth of the current block is not limited to the above-described embodiment, and may be determined to be a size and / or position different from those of the above-described embodiment. In addition, although the above-described embodiment describes the method of determining the filtering execution region mainly for the vertical right mode, this is for convenience of explanation only, and the same or similar method may be applied even when the prediction mode of the current block corresponds to a mode other than the vertical right mode.

[0168] FIG. 15 illustrates an example of a method for determining a filtering execution region based on the coding modes of neighboring blocks adjacent to a current block.

[0169] 15, it is assumed that the intra prediction mode of a current block (C) 1510 corresponds to a vertical right mode. In this case, the encoder and decoder perform intra prediction on the current block 1510 using upper reference pixels and / or upper right reference pixels, and therefore, can determine the left region of the prediction block as the region to be filtered.

[0170] However, if the coding mode of a neighboring block adjacent to the current block is inter mode, the restored pixel values ​​in the neighboring block are likely to be unreliable due to errors occurring in the network, and performing filtering based on the restored pixel values ​​in the neighboring block whose coding mode is inter mode may reduce coding efficiency. Therefore, the encoder and decoder do not perform filtering on the area adjacent to the neighboring block whose coding mode is inter mode. That is, the encoder and decoder may determine the filtering execution area based on the coding mode of the neighboring block adjacent to the current block.

[0171] 15, neighboring blocks adjacent to the left side of a current block 1510 include a reconstructed neighboring block (A) 1520 and a reconstructed neighboring block (B) 1530. Here, it is assumed that the coding mode of the neighboring block (A) 1520 is intra mode and the coding mode of the neighboring block (B) 1530 is inter mode. In this case, the encoder and decoder may determine only a region 1540 adjacent to the neighboring block (B) 1530 coded in intra mode from among the left regions in the prediction block as a region to be filtered.

[0172] 16a and 16b show an embodiment of a method for determining a filter type according to an intra-prediction mode of a current block.

[0173] 16a shows an example of a method for determining a filter type when the prediction mode of the current block is DC mode and / or planar mode, where 1610 in Fig. 16a shows a prediction block 1615 and 1620 shows a filter tap to be applied to the pixel to be filtered.

[0174] As described above, when the prediction mode of the current block is DC mode, the prediction block 1615 is generated by averaging pixel values ​​of multiple reference pixels, resulting in less correlation between the prediction pixel and the reference pixel. Therefore, in this case, the encoder and decoder may determine the prediction pixels (e.g., (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) included in the upper horizontal prediction pixel line (e.g., the uppermost horizontal pixel line in the prediction block 1615) and the left vertical prediction pixel line (e.g., the leftmost vertical pixel line in the prediction block 1615) as the filtering execution region. In addition, when the prediction mode of the current block is planar mode, there is less correlation between the prediction pixel and the reference pixel. Therefore, in this case, the encoder and decoder can determine the predicted pixels included in the upper horizontal predicted pixel line and the left vertical predicted pixel line as the filtering execution region, similar to the DC mode.

[0175] When the prediction mode of the current block is DC mode and / or planar mode, the encoder and decoder may apply a 3-tap filter 1629 of [1 / 4, 2 / 4, 1 / 4] to the left-top predicted pixel (0,0) located at the top left corner of the predicted block. In this case, the encoder and decoder may perform filtering on the pixel to be filtered based on the pixel to be filtered (0,0), a reference pixel (0,-1) adjacent to the pixel to be filtered above, and a reference pixel (-1,0) adjacent to the pixel to be filtered on the left. In this case, the filter coefficient applied to the pixel to be filtered is 2 / 4, and the filter coefficients applied to the reference pixel adjacent to the pixel to be filtered above and the reference pixel adjacent to the pixel to the left are 1 / 4.

[0176] In addition, when the prediction mode of the current block is the DC mode and / or the planar mode, the encoder and decoder may apply a [1 / 4, 3 / 4] horizontal 2-tap filter 1623 to each of the predicted pixels included in the left vertical predicted pixel line, excluding the upper left predicted pixel (e.g., (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)). In this case, assuming that the position of the pixel to be filtered is (0,y), the encoder and decoder may perform filtering on the pixel to be filtered based on the pixel to be filtered (0,y) and a reference pixel (-1,y) adjacent to the left side of the pixel to be filtered. In this case, the filter coefficient applied to the pixel to be filtered is 3 / 4, and the filter coefficient applied to the reference pixel adjacent to the left side of the pixel to be filtered is 1 / 4.

[0177] In addition, when the prediction mode of the current block is the DC mode and / or the planar mode, the encoder and decoder may apply a [1 / 4, 3 / 4] vertical 2-tap filter 1625 to each of the predicted pixels included in the upper horizontal predicted pixel line, excluding the left upper predicted pixel (e.g., (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)). In this case, assuming that the position of the pixel to be filtered is (x,0), the encoder and decoder may perform filtering on the pixel to be filtered based on the pixel to be filtered (x,0) and a reference pixel (x,-1) adjacent to the upper side of the pixel to be filtered. In this case, the filter coefficient applied to the pixel to be filtered is 3 / 4, and the filter coefficient applied to the reference pixel adjacent to the upper side of the pixel to be filtered is 1 / 4.

[0178] In the above-described embodiments, the encoder and decoder may use different filter types (e.g., filter shapes, filter taps, and / or filter coefficients, etc.) depending on the size of the current block. In this case, the encoder and decoder may adaptively determine the filter type based on the size of the current block. However, as in the above-described embodiments, the encoder and decoder may always use a predetermined fixed filter type (e.g., filter shapes, filter taps, and / or filter coefficients, etc.) regardless of the size of the current block and / or the predicted block.

[0179] 1630 in Figure 16a shows an example of a method for determining a filter type when the prediction mode of the current block is a vertical right mode (e.g., a prediction mode with mode values ​​of 5, 6, 12, 13, 22, 23, 24, or 25). In 1630 in Figure 16a, 1635 indicates a prediction block, and 1640 indicates a filter tap to be applied to the pixel to be filtered.

[0180] As described above, when the prediction mode of the current block is the vertical right mode, the encoder and decoder perform intra prediction on the current block based on the upper reference pixel and / or the upper right reference pixel, so there may be less correlation between the predicted pixel located in the left region and the left reference pixel in the prediction block 1635. Therefore, in this case, the encoder and decoder may determine the predicted pixels (e.g., (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) included in the left vertical predicted pixel line (e.g., one vertical pixel line located at the leftmost position in the prediction block 1635) as the filtering execution region.

[0181] On the other hand, when the prediction mode of the current block is a vertical mode (e.g., a prediction mode with a mode value of 0), the encoder and decoder perform intra prediction on the current block using upper reference pixels, so the correlation between the prediction pixel located in the left region of the prediction block and the left reference pixel may be weak. Therefore, even in this case, the encoder and decoder may determine the prediction pixel included in the left vertical prediction pixel line as the filtering execution region. However, the filter type applied to the vertical mode is different from the filter type applied to the vertical right mode.

[0182] When the prediction mode of the current block is the vertical right mode, the encoder and decoder may apply a [1 / 4, 3 / 4] diagonal 2-tap filter 1640 to each of the prediction pixels included in the left vertical predicted pixel line (e.g., (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), and (0,7)). Assuming that the pixel to be filtered is located at (0,y), the encoder and decoder may filter the pixel to be filtered based on the pixel to be filtered (0,y) and a reference pixel (-1,y+1) adjacent to the lower side of the reference pixel adjacent to the left side of the pixel to be filtered. In this case, the filter coefficient applied to the pixel to be filtered is 3 / 4, and the filter coefficient applied to the reference pixel adjacent to the lower side of the reference pixel adjacent to the left side of the pixel to be filtered is 1 / 4.

[0183] 1650 in Figure 16b shows an example of a filter type determination method when the prediction mode of the current block is a horizontal-down mode (e.g., a prediction mode with mode values ​​of 8, 9, 16, 17, 30, 31, 32, or 33). In 1650 in Figure 16b, 1655 indicates a prediction block, and 1660 indicates a filter tap to be applied to the pixel to be filtered.

[0184] As described above, when the prediction mode of the current block is the horizontal-down mode, the encoder and decoder perform intra prediction on the current block using the left reference pixel and / or the lower-left reference pixel, so there may be less correlation between the predicted pixel located in the upper region and the upper reference pixel in the prediction block 1655. Therefore, in this case, the encoder and decoder may determine the predicted pixel (e.g., (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)) included in the upper horizontal predicted pixel line (e.g., the uppermost vertical pixel line in the prediction block 1655) as the filtering execution region.

[0185] On the other hand, when the prediction mode of the current block is a horizontal mode (e.g., a prediction mode with a mode value of 1), the encoder and decoder perform intra prediction on the current block using left reference pixels, which may reduce the correlation between the predicted pixels located in the upper region of the prediction block 1655 and the upper reference pixels. Therefore, even in this case, the encoder and decoder may determine the predicted pixels included in the upper horizontal predicted pixel line as the filtering execution region. However, the filter type applied to the horizontal mode may be different from the filter type applied to the horizontal-lower mode.

[0186] When the prediction mode of the current block is the horizontal-downward mode, the encoder and decoder may apply a [1 / 4, 3 / 4] diagonal 2-tap filter 1660 to each of the prediction pixels included in the upper horizontal predicted pixel line (e.g., (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), and (7,0)). Assuming that the pixel to be filtered is located at (x,0), the encoder and decoder may filter the pixel to be filtered based on the pixel to be filtered (x,0) and a reference pixel (x+1,-1) adjacent to the right of the reference pixel adjacent above the pixel to be filtered. In this case, the filter coefficient applied to the pixel to be filtered is 3 / 4, and the filter coefficient applied to the reference pixel adjacent to the right of the reference pixel adjacent above the pixel to be filtered is 1 / 4.

[0187] 1670 in Figure 16b shows an embodiment of a method for adaptively determining a filter type (e.g., filter shape, filter coefficients, filter taps, etc.) depending on the intra prediction mode (particularly, directional prediction mode) of a current block. In 1670 in Figure 16b, 1675 indicates a prediction block, and 1680 indicates a filter tap to be applied to a pixel to be filtered.

[0188] As in the detailed embodiments 1630 and 1650, the encoder and decoder may apply a predetermined fixed filter type for each of the vertical right mode and / or horizontal down mode. However, the encoder and decoder may also apply various filter types according to the intra prediction mode in addition to the detailed filter types. In this case, the encoder and decoder may adaptively determine the filter type based on the intra prediction mode of the current block.

[0189] As an example, the encoder and decoder may use a 3-tap filter 1681 that performs filtering based on a pixel to be filtered (x, y), a reference pixel (x+2, y-1), and a reference pixel (x+3, y-1). In this case, the filter coefficient applied to the pixel to be filtered (x, y) is 12, the filter coefficient applied to the reference pixel (x+2, y-1) is 3, and the filter coefficient applied to the reference pixel (x+3, y-1) is 1. As another example, the encoder and decoder may use 3-tap filters 1683, 1685, and 1687 that perform filtering based on a pixel to be filtered (x, y), a reference pixel (x+1, y-1), and a reference pixel (x+2, y-1). In this case, the filter coefficient applied to the pixel to be filtered (x, y) is 12, the filter coefficient applied to the reference pixel (x+1, y-1) is 1, and the filter coefficient applied to the reference pixel (x+2, y-1) is 3 (1683). Also, the filter coefficient applied to the pixel to be filtered (x, y) is 12, the filter coefficient applied to the reference pixel (x+1, y-1) is 2, and the filter coefficient applied to the reference pixel (x+2, y-1) is 2 (1685). Also, the filter coefficient applied to the pixel to be filtered (x, y) is 8, the filter coefficient applied to the reference pixel (x+1, y-1) is 6, and the filter coefficient applied to the reference pixel (x+2, y-1) is 2 (1687). As another example, the encoder and decoder may use a 2-tap filter 1689 that performs filtering based on the pixel to be filtered (x, y) and the reference pixel (x+1, y-1). In this case, the filter coefficient applied to the pixel to be filtered (x, y) is 8, and the filter coefficient applied to the reference pixel (x+1, y-1) is 8.

[0190] Meanwhile, if the intra prediction mode of the current block corresponds to one of the remaining prediction modes excluding the detailed prediction modes (for example, prediction modes with mode values ​​of 3, 4, 7, 10, 11, 14, 15, 18, 19, 20, 21, 26, 27, 28, and 29), the encoder and decoder can use at least one reference pixel from the upper reference pixel and the upper right reference pixel for intra prediction, and can use at least one reference pixel from the left reference pixel and the lower left reference pixel for intra prediction. Therefore, in this case, all of the prediction pixels located in the left and upper regions within the prediction block can maintain correlation with the reference pixels, so the encoder and decoder do not perform filtering on the prediction block.

[0191] 10, the encoder and decoder can determine whether to perform filtering on the prediction block based on color component information of the current block, and therefore the encoder and decoder can perform the filtering process described in detail in FIG. 16A and FIG. 16B only when the current block corresponds to a luma block. That is, the filtering process according to the above-described embodiment is applied only when the current block corresponds to a luma block, and is not applied when the current block corresponds to a chroma block.

[0192] FIG. 17 shows a simplified method for determining the filter type according to the embodiment of FIGS. 16a and 16b.

[0193] 1710 in Figure 17 shows an example of a filter type when the prediction mode of the current block is DC mode and / or planar mode, which is the same filter type as the filter type shown in 1610 in Figure 16a.

[0194] As detailed in 1610 of FIG. 16a, when the prediction mode of the current block is DC mode (e.g., a prediction mode with a mode value of 2) and / or planar mode (e.g., a prediction mode with a mode value of 34), the encoder and decoder may apply a 3-tap filter to the left-top predicted pixel located at the top left of the prediction block (e.g., pixel c in 1710 of FIG. 17). In addition, the encoder and decoder may apply a horizontal 2-tap filter to each of the predicted pixels included in the left vertical predicted pixel line, excluding the left-top predicted pixel (e.g., pixel g in 1710 of FIG. 17). In addition, the encoder and decoder may apply a vertical 2-tap filter to each of the predicted pixels included in the top horizontal predicted pixel line, excluding the left-top predicted pixel (e.g., pixel e in 1710 of FIG. 17). As an example, this is represented by the following Equation 1.

[0195] (Number 1) F_g=(f+3*g+2)>>2 F_e=(d+3*e+2)>>2 F_c=(a+2*c+b+2)>>2

[0196] Here, F_x denotes the filtered predicted pixel value generated by performing filtering on the predicted pixel value at the x position.

[0197] 1730 in Figure 17 shows an example of a filter type when the prediction mode of the current block is a vertical right mode (e.g., a prediction mode with mode values ​​of 5, 6, 12, 13, 22, 23, 24, or 25). 1730 in Figure 17 shows the same filter type as 1630 in Figure 16a.

[0198] As detailed in 1630 of FIG. 16a, when the prediction mode of the current block is the vertical-right mode, the encoder and decoder may apply a 2-tap filter to each of the predicted pixels included in the left vertical predicted pixel line (e.g., pixel i and pixel k in 1730 of FIG. 17). Since the prediction direction is diagonal in the vertical-right mode, the encoder and decoder may determine the shape of the filter to be diagonal. As an example, this is shown in Equation 2 below.

[0199] (Number 2) F_i=(h+3*i+2)>>2 F_k=(j+3*k+2)>>2

[0200] Here, F_x denotes the filtered predicted pixel value generated by performing filtering on the predicted pixel value at the x position.

[0201] 1750 in Figure 17 shows an example of a filter type when the prediction mode of the current block is a horizontal-down mode (e.g., a prediction mode with mode values ​​of 8, 9, 16, 17, 30, 31, 32, or 33). 1750 in Figure 17 shows the same filter type as 1650 in Figure 16b.

[0202] As detailed in 1650 of Figure 16b, when the prediction mode of the current block is the horizontal-down mode, the encoder and decoder may apply a 2-tap filter to each of the predicted pixels included in the upper horizontal predicted pixel line (e.g., m pixel and o pixel in 1750 of Figure 17). Since the prediction direction is diagonal in the horizontal-down mode, the encoder and decoder may determine the diagonal shape of the filter. As an example, this is shown in Equation 3 below.

[0203] (Number 3) F_m=(l+3*m+2)>>2 F_o=(n+3*o+2)>>2

[0204] Here, F_x denotes the filtered predicted pixel value generated by performing filtering on the predicted pixel value at the x position.

[0205] FIG. 18 illustrates an example of a filter type that is applied when the prediction mode of the current block is a vertical mode and / or a horizontal mode.

[0206] In the embodiments described below, terms such as a first reference pixel, a second reference pixel, and a third reference pixel are used independently in 1810 of Figure 18 and 1820 of Figure 18. For example, the first reference pixel used in 1810 of Figure 18 is not the same as the first reference pixel used in 1820 of Figure 18, and the second reference pixel and the third reference pixel may also have independent meanings in 1810 of Figure 18 and 1820 of Figure 18.

[0207] As described in detail, the filter determined by the filter type does not necessarily have to be a filter defined by a filter shape, filter taps, filter coefficients, etc. For example, the encoder and decoder may perform the filtering process by adding an offset value determined by a predetermined process to the pixel value of a reference pixel. In this case, the filtering process may be combined with the predicted block generation process and performed as a single process. That is, the filtered predicted pixel value of each pixel in the current block may be derived only through the filtering process described in detail. In this case, the filtering process described in detail may correspond to a single process including both the predicted pixel generation process and the filtering process for the generated predicted pixel. In this case, the filtering process may be considered as a process of generating a final predicted pixel (and / or a filtered predicted pixel) using the reference pixel. Therefore, FIG. 18 illustrates an embodiment from the perspective of predicted pixel generation.

[0208] Reference numeral 1810 in FIG. 18 illustrates an embodiment of a predicted pixel generation method when the prediction mode of the current block is the vertical mode.

[0209] As described above, when the prediction mode of the current block is the vertical mode, the encoder and decoder may generate a predicted block by performing intra prediction on the current block using upper reference pixels. In this case, since there is little correlation between the predicted pixel located in the left region of the predicted block and the left reference pixel, the predicted pixel located in the left region of the predicted block may have a large prediction error. Therefore, the encoder and decoder may generate a predicted block as follows for each of the pixels ((0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) included in one vertical pixel line located at the leftmost position in the current block 1815 (hereinafter referred to as the left vertical pixel line):

[0210] Referring to 1810 of Figure 18, there may be pixels at positions (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), and (0,7) on the left vertical pixel line. In 1810 of Figure 18, it is assumed that the pixel to be currently predicted is pixel (0,4) among the pixels on the left vertical pixel line.

[0211] Since the prediction mode of the current block 1815 is the vertical mode, the encoder and decoder may input the pixel value of the first reference pixel (0,-1) (e.g., the leftmost reference pixel among the above reference pixels) located on the same vertical line as the pixel to be predicted into the position of the pixel to be predicted. That is, when the prediction mode of the current block 1815 is the vertical mode, the pixel value of the first reference pixel may be determined as the predicted pixel value of the pixel to be predicted.

[0212] However, in this case, since the generated predicted pixel value may have a large prediction error, the encoder and decoder may derive a final predicted pixel value by adding an offset value to the first reference pixel value. Here, the process of adding the offset value may correspond to a filtering process or a part of the predicted pixel generation process. In this case, the offset value may be derived based on a second reference pixel (-1, 4) adjacent to the left of the pixel to be predicted and a third reference pixel (-1, -1) adjacent to the left of the first reference pixel. For example, the offset value may correspond to a value obtained by subtracting the pixel value of the third reference pixel from the pixel value of the second reference pixel. That is, the encoder and decoder may derive a predicted value of the pixel to be predicted by adding a difference between the second and third reference pixel values ​​to the first reference pixel value. The detailed predicted pixel generation process may be applied in the same or similar manner to pixels other than pixel (0, 4) on the left vertical pixel line.

[0213] The detailed predicted pixel generation process is shown by the following Equation 4 as an example.

[0214] (Number 4) p′[x,y]=p[x,-1]+((p[-1,y]-p[-1,-1])>>1)),{x=0, y=0,...,nS-1}

[0215] Here, p'[x,y] denotes the final predicted pixel value for the pixel to be predicted at position (x,y), p[x,-1] denotes the first reference pixel located on the same vertical line as the pixel to be predicted among the upper reference pixels, p[-1,y] denotes the second reference pixel adjacent to the left of the pixel to be predicted, p[-1,-1] denotes the third reference pixel adjacent to the left of the first reference pixel, and nS denotes the height of the current block.

[0216] Meanwhile, when the prediction mode of the current block 1815 is the vertical mode, the region to which the offset and / or filtering is applied is not limited to the above-described embodiment. For example, the encoder and decoder may apply the detailed predicted pixel generation process to the two leftmost vertical pixel lines in the current block 1815. In this case, the predicted pixel generation process is, for example, represented by the following Equation 5.

[0217] (Number 5) p′[x,y]=p[x,y]+(p[-1,y]-p[-1,-1]+(1<<x))> >(x+1),{x=0,...,1,y=0,...,7}

[0218] Here, p'[x,y] denotes the final predicted pixel value for the pixel to be predicted at (x,y), p[x,y] denotes the predicted pixel value generated by a general vertical prediction process, p[-1,y] denotes a reference pixel located on the same horizontal line as the pixel to be predicted among the left reference pixels, and p[-1,-1] denotes the upper left corner reference pixel.

[0219] Meanwhile, the process of adding the offset value described above is applied only when the current block is a luma block, and may not be applied when the current block is a chroma block. For example, when the current block is a chroma block, the encoder and decoder may determine the first reference pixel as the predicted pixel value of the pixel to be predicted without applying the offset value.

[0220] 1820 in FIG. 18 shows an example of a predicted pixel generation method when the prediction mode of the current block is the horizontal mode.

[0221] As described above, when the prediction mode of the current block is the horizontal mode, the encoder and decoder may generate a predicted block by performing intra prediction on the current block using left reference pixels. In this case, since there is little correlation between the predicted pixels located in the upper region of the predicted block and the upper reference pixels, the predicted pixels located in the upper region of the predicted block may have a large prediction error.

[0222] Therefore, the encoder and decoder can generate a predicted block and / or a predicted pixel for each of the pixels ((0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)) included in the uppermost horizontal pixel line (hereinafter referred to as the upper horizontal pixel line) in the current block 1825 as follows:

[0223] Referring to 1820 of Figure 18, pixels at positions (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), and (7,0) may exist on the upper horizontal pixel line. In 1820 of Figure 18, it is assumed that the pixel to be currently predicted is pixel (4,0) among the pixels on the upper horizontal pixel line.

[0224] Since the prediction mode of the current block 1825 is the horizontal mode, the encoder and decoder may input the pixel value of the first reference pixel (-1, 0) (e.g., the uppermost reference pixel among the left reference pixels) located on the same horizontal line as the pixel to be predicted into the position of the pixel to be predicted. That is, when the prediction mode of the current block 1825 is the horizontal mode, the pixel value of the first reference pixel may be determined as the predicted pixel value of the pixel to be predicted.

[0225] However, in this case, since the generated predicted pixel value may have a large prediction error, the encoder and decoder may derive a final predicted pixel value by adding an offset value to the first reference pixel value. Here, the process of adding the offset value may correspond to a filtering process or may correspond to a part of the predicted pixel generation process. In this case, the offset value may be derived based on a second reference pixel (4, −1) adjacent to the pixel to be predicted above and a third reference pixel (−1, −1) adjacent to the first reference pixel above. For example, the offset value may correspond to a value obtained by subtracting the pixel value of the third reference pixel from the pixel value of the second reference pixel. That is, the encoder and decoder may derive a predicted value of the pixel to be predicted by adding the difference between the second and third reference pixel values ​​to the first reference pixel value. The detailed predicted pixel generation process may be applied in the same or similar manner to pixels on an upper horizontal pixel line other than pixel (4, 0).

[0226] The detailed predicted pixel generation process is shown by the following Equation 6 as an example.

[0227] (Number 6) p′[x,y]=p[-1,y]+((p[x,-1]-p[-1,-1])>>1)),{x=0,...,nS-1,y=0}

[0228] Here, p'[x,y] denotes the final predicted pixel value for the pixel to be predicted at position (x,y), p[-1,y] denotes the first reference pixel located on the same horizontal line as the pixel to be predicted among the left reference pixels, p[x,-1] denotes the second reference pixel adjacent to the pixel to be predicted above, p[-1,-1] denotes the third reference pixel adjacent to the first reference pixel above, and nS denotes the width of the current block.

[0229] Meanwhile, when the prediction mode of the current block 1825 is the horizontal mode, the region to which the offset and / or filtering is applied is not limited to the above-described embodiment. For example, the encoder and decoder may apply the detailed predicted pixel generation process to the topmost two horizontal pixel lines in the current block 1825. In this case, the predicted pixel generation process is represented by the following Equation 7, for example.

[0230] (Number 7) p′[x,y]=p[x,y]+(p[x,-1]-p[-1,-1]+(1<<y))> >(y+1),{x=0~7, y=0~1}

[0231] Here, p'[x,y] denotes the final predicted pixel value for the pixel to be predicted at (x,y), p[x,y] denotes the predicted pixel value generated by a general horizontal prediction process, p[x,-1] denotes a reference pixel located on the same vertical line as the pixel to be predicted among the upper reference pixels, and p[-1,-1] denotes the upper left corner reference pixel.

[0232] Meanwhile, similar to 1810 of Figure 18, the process of adding the offset value described in detail may be applied only when the current block is a luma block, and may not be applied when the current block is a chroma block. For example, when the current block is a chroma block, the encoder and decoder may determine the first reference pixel as the predicted pixel value of the pixel to be predicted without applying the offset value.

[0233] FIG. 19 shows a schematic representation of another embodiment of the filter type according to the invention.

[0234] In the embodiment of Figure 19, since the encoder and decoder perform intra prediction on the current block based on the left reference pixel and / or the lower left reference pixel, there may be less correlation between the predicted pixel located in the upper region of the prediction block 1910 and the upper reference pixel. Therefore, in this case, the encoder and decoder may perform filtering on the predicted pixel included in the upper horizontal predicted pixel line (e.g., the uppermost horizontal pixel line in the prediction block 1910). Although an embodiment described below will describe a case where filtering is performed on pixels on the upper horizontal predicted pixel line, the filtering method of Figure 19 may be similarly applied to a case where filtering is performed on pixels on the left vertical predicted pixel line (e.g., the leftmost vertical pixel line in the prediction block 1910).

[0235] 19, the encoder and decoder may perform filtering on a predicted pixel in a prediction block 1910, i.e., a predicted pixel (B) 1920. The filtering may correspond to adding an appropriate offset value to the pixel value of the predicted pixel 1920.

[0236] The offset value may be derived based on a reference pixel. As an example, if the pixel to be filtered 1920 is the uppermost pixel in the prediction block 1910, the reference pixel used to derive the offset value is a reference pixel (A) 1930 adjacent to the upper side of the pixel to be filtered 1920. As another example, if the pixel to be filtered is the leftmost pixel in the prediction block 1910, the reference pixel used to derive the offset value is a reference pixel adjacent to the left side of the pixel to be filtered. An example of a process of determining the offset value based on the reference pixel 1930 will be described below.

[0237] The encoder and decoder may perform intra prediction on the reference pixels 1930 to obtain predicted values ​​of the reference pixels, i.e., predicted reference pixel values. Here, the intra prediction is directional prediction. In this case, the encoder and decoder may perform prediction on the reference pixels 1930 based on an intra prediction mode (and / or prediction direction) 1950 that is the same as the prediction mode (and / or prediction direction) 1940 of the current block. If the position of the predicted reference pixel determined based on the prediction direction of the intra prediction mode and the reference pixel is not an integer position, the encoder and decoder may perform interpolation based on the reference pixel at the integer position to obtain the predicted reference pixel value.

[0238] The encoder and decoder may derive an offset value based on a pixel value difference between a reference pixel and a predicted reference pixel. For example, the offset value may correspond to a value obtained by dividing the difference between the reference pixel value and the predicted reference pixel value by 4. Once the offset value is derived, the encoder and decoder may derive a pixel value of a filtered predicted pixel by adding the derived offset value to the pixel value of the predicted pixel 1920.

[0239] The detailed filtering process is shown by the following Equation 8 as an example.

[0240] (Number 8) Ref1=Predicted value of A Delta=(A-Ref1+2)>>2 B′=B+Delta

[0241] Here, B denotes the pixel value of the predicted pixel 1920, A denotes the pixel value of the reference pixel 1930 for the predicted pixel, Ref1 denotes the pixel value of the predicted reference pixel for A, and B′ denotes the pixel value of the filtered predicted pixel.

[0242] Although the above-described embodiments describe the steps of determining whether to perform filtering, determining a filtering region, and determining a filter type independently, the encoder and decoder may combine these steps into a single process. In this case, the encoder and decoder may determine two or more of the steps of determining whether to perform filtering, determining a filtering region, and determining a filter type based on a single table.

[0243] In one embodiment, whether filtering is performed, the filtering region, and the filter type according to the intra prediction mode are indicated by a single table. In this case, the same table is stored in the encoder and the decoder, and the encoder and the decoder can determine whether filtering is performed, the filtering region, and the filter type based on the intra prediction mode and the stored table. Table 7 below shows an example of a table indicating whether filtering is performed, the filtering region, and the filter type according to the intra prediction mode.

[0244] [Table 7]

[0245] In Table 7, if the value assigned to the filter type is 0, the filter type may indicate that no filtering is performed on the predicted block. Also, if the value assigned to the filter type is 1, 2, or 3, the filter type may indicate that filtering is performed on the predicted block.

[0246] In Table 7, when the value assigned to the filter type is 1, the filter type may indicate that the filtering execution region and filter type in the DC mode and / or the planar mode, detailed in 1610 of Fig. 16a, are applied. When the value assigned to the filter type is 2, the filter type may indicate that the filtering execution region and filter type in the vertical right mode, detailed in 1630 of Fig. 16a, are applied. When the value assigned to the filter type is 3, the filter type may indicate that the filtering execution region and filter type in the horizontal down mode, detailed in 1650 of Fig. 16b, are applied.

[0247] As another embodiment, the table shown in Table 7 may further include information on whether a filter is applied according to a block size. That is, the table including information on whether a filter is applied according to an intra prediction mode, a filter application region, and a filter type may also include information on whether a filter is applied according to a block size. In this case, the encoder and decoder store the same table, and the encoder and decoder can determine whether filtering is performed, the filtering region, and the filter type based on the intra prediction mode, the size of the current block (and / or predicted block), and the stored table.

[0248] If the size of the current block and / or the predicted block is too small or too large, it is preferable not to perform filtering on the predicted block. For example, if the current block and / or the predicted block is a large block such as a 32x32 block, there is a high correlation between pixels around and / or within the current block, and in such a case, it is meaningless to perform filtering on the predicted block. Therefore, the encoder and decoder may improve filtering efficiency by adaptively determining whether to perform filtering depending on the size of the current block and / or the predicted block. Table 8 below shows an example of a table configured taking into account not only the intra prediction mode but also the block size, as described in detail.

[0249] [Table 8]

[0250] In Table 8, the values ​​0, 1, 2, and 3 assigned to the filter type may have the same meaning as in Table 7. Referring to Table 8, the encoder and decoder may determine whether to perform filtering based on the size of the current block and / or the predicted block, and may determine whether to perform filtering, the filtering region, and the filter type based on the intra prediction mode.

[0251] In another embodiment, whether filtering is performed, the filtering execution area, and the filter type according to the intra prediction mode are shown in Table 9 below.

[0252] [Table 9]

[0253] Figure 20 is a diagram illustrating intra prediction modes and filter types applied to Table 9. Reference numeral 2010 in Figure 20 illustrates an example of prediction directions of intra prediction modes and mode values ​​assigned to each prediction direction. The above-described examples have been described mainly based on the intra prediction modes (prediction directions, mode values) shown in 410 in Figure 4a, but it is assumed that the intra prediction modes (prediction directions, mode values) shown in 2010 in Figure 20 are used only in the example of Table 9. However, the example of Table 9 is not limited to application of reference numeral 2010 in Figure 20.

[0254] Referring to Table 9, if the value assigned to the filtering execution region is 0 and / or the value assigned to the filter type is 0, the encoder and decoder do not perform filtering on the prediction block. On the other hand, if the value assigned to the filtering execution region is not 0 and the value assigned to the filter type is not 0, the encoder and decoder may perform filtering on the prediction block.

[0255] Meanwhile, Tx assigned to the filter application area may indicate the x horizontal pixel lines located at the topmost position in the prediction block, i.e., the upper horizontal predicted pixel lines, and Lx may indicate the x vertical pixel lines located at the leftmost position in the prediction block, i.e., the left vertical predicted pixel lines. Also, TxLx assigned to the filter application area may indicate an area including both the upper horizontal predicted pixel lines and the left vertical predicted pixel lines. In the embodiment of Table 9, the value of x may be 1, 2, or 4. However, in another embodiment, x may be a predetermined fixed value, for example, x may always be 1. In this case, the upper horizontal predicted pixel line may include only one horizontal pixel line, and the left vertical predicted pixel line may also include only one vertical pixel line.

[0256] Non-zero filter types in Table 9 include a, b, c, d, and e. When the value assigned to the filter type in Table 9 is a, the encoder and decoder may perform filtering based on the filtering execution region and filter type detailed in 1610 of FIG. 16a. In this case, the encoder and decoder may perform filtering on predicted pixels included in the upper horizontal predicted pixel line (one pixel line) and the left vertical predicted pixel line (one pixel line) based on the filter coefficients detailed in 1610 of FIG. 16a. When the value assigned to the filter type in Table 9 is b, the encoder and decoder may perform filtering based on the filtering execution region and filter type detailed in FIG. 18. When the prediction mode of the current block is a vertical mode (e.g., a prediction mode with a mode value of 1), the encoder and decoder may perform filtering on predicted pixels included in the left vertical predicted pixel line (e.g., two pixel lines) as shown in 1810 of FIG. 18. Also, if the prediction mode of the current block is a horizontal mode (e.g., a prediction mode with a mode value of 2), the encoder and decoder can perform filtering on the predicted pixels included in the upper horizontal predicted pixel line (e.g., two pixel lines) as shown in 1820 of Figure 18.

[0257] On the other hand, if the value assigned to the filter type in Table 9 is c and the filter application region is assigned to Tx, the encoder and decoder may perform filtering based on the filtering execution region and filter type detailed in 1650 of FIG. 16b. In this case, the encoder and decoder may apply a [1,3] diagonal filter to predicted pixels included in the upper horizontal predicted pixel line. Also, if the value assigned to the filter type in Table 9 is b and the filter application region is assigned to Lx, the encoder and decoder may perform filtering based on the filtering execution region and filter type detailed in 1630 of FIG. 16a. In this case, the encoder and decoder may apply a [1,3] diagonal filter to predicted pixels included in the left vertical predicted pixel line.

[0258] In Table 9, if the intra prediction mode of the current block is 7 or 10, the value assigned to the filter type is d. Referring to 2020 in FIG. 20, block 2023 indicates a predicted block, and the prediction direction when the intra prediction mode of the current block is 10 is indicated as 2025. In this case, the filtered predicted pixel value is expressed by the following Equation 9.

[0259] (Number 9) p′[x,y]=((16-k)*p[x,y]+k*p[x,-1]+8)>>4, k=1<<(3-y), {x=0,...,7, y=0,...,3}

[0260] Here, p'[x,y] may represent a filtered predicted pixel value, and p[x,y] may represent a predicted pixel value at position (x,y) before filtering. Also, p[x,-1] may represent a reference pixel located on the same vertical line as the predicted pixel among the above reference pixels. Referring to Equation 9, when the intra prediction mode of the current block is 10, the encoder and decoder may perform filtering on the topmost four horizontal pixel lines in the prediction block 2023. When the intra prediction mode of the current block is 7, the encoder and decoder may also perform filtering on the leftmost four vertical pixel lines in the prediction block 2023 in a manner similar to Equation 9.

[0261] Also, referring to 2020 in FIG. 2, if the intra prediction mode of the current block is 24, the prediction direction is represented as 2027. In Table 9, if the intra prediction mode of the current block is 24, the value assigned to the filter type is e. If the intra prediction mode of the current block is 24, the filtered predicted pixel value is represented by the following Equation 10.

[0262] (Number 10) p′[x,y]=p[x,y]+(p[-1,y]-Rp[-1,y]+2)>>2, {x=0, y=0,...,7}

[0263] Here, p'[x,y] may indicate a filtered predicted pixel value, and p[x,y] may indicate a predicted pixel value at position (x,y) before filtering. Also, p[-1,y] may indicate a reference pixel located on the same horizontal line as the predicted pixel among left reference pixels. Rp[-1,y] may indicate a predicted value for the reference pixel of p[-1,y], i.e., a predicted reference pixel value. To derive the predicted reference pixel value, the encoder and decoder may perform prediction on the reference pixel of p[-1,y] based on the same intra prediction mode as the prediction mode of the current block.

[0264] In Table 9, the value assigned to the filter type is e even when the intra prediction mode of the current block is 13, 17, 23, 31, or 32. Therefore, in this case, the encoder and decoder can also perform filtering in a manner similar to that of Equation 10.

[0265] In Table 9, the filters applied according to the values ​​assigned to each filter type are not limited to the above-described embodiment. That is, the filters applied according to the values ​​assigned to each filter type may be changed according to implementation and / or need, and whether or not a filter is applied may be set differently from the above-described embodiment.

[0266] An embodiment of a filtering process for predicted pixels according to the present invention will be described in detail below. In the embodiment described below, inputs are IntraPredMode, nS, p[x,y](x,y=-1,...,nS) and predSamples[x,y](x,y=0,...,nS-1), and output is predSamplesF[x,y](x,y=0,...,nS-1). Here, IntraPredMode indicates the intra prediction mode of the current block, nS indicates the horizontal and vertical dimensions of the predicted block, and p[x,y](x,y=-1,...,nS) indicates pixel values ​​of reference pixels located around the current block. Also, predSamples[x,y](x,y=0,...,nS-1) indicates predicted pixel values, and predSamplesF[x,y](x,y=0,...,nS-1) indicates filtered predicted pixel values.

[0267] In this case, whether filtering is performed according to the intra prediction mode, the filtering execution area, and the filter type can be determined according to Table 10 below.

[0268] [Table 10]

[0269] In Table 10, intraPostFilterType indicates filter type information applied to a predicted block. In this case, the filter type information may include both information on whether filtering is performed, the filtering area, and the filter type. In addition, intraPostFilterType may be indicated as intraPostFilterType[IntraPredMode], which may mean that the value assigned to intraPostFilterType is determined by IntraPredMode.

[0270] If nS is less than 32, the encoder and decoder can derive predSamplesF[x,y] (x,y=0,...,nS-1) according to the value assigned to intraPostFilterType[IntraPredMode] by the following process.

[0271] If the value assigned to intraPostFilterType[IntraPredMode] is 1, the encoder and decoder may derive the predSamplesF[x,y] value according to Equation 11 below.

[0272] (Number 11) predSamplesF[0,0]=(p[-1,0]+2*predSamples[0,0]+p[0,-1]+2)>>2 predSamplesF[x,0]=(p[x,-1]+3*predSamples[x,0]+2)>>2(x=1,...,nS-1) predSamplesF[0,y]=(p[-1,y]+3*predSamples[0,y]+2)>>2(y=1,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x,y=1,...,nS-1)

[0273] If the value assigned to intraPostFilterType[IntraPredMode] is 2, the encoder and decoder may derive the predSamplesF[x, y] value according to Equation 12 below.

[0274] (Number 12) predSamplesF[0,y]=(p[-1,y+1]+3*predSamples[0,y]+2)>>2(y=0,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x=1,...,nS-1, y=0,...,nS-1)

[0275] If the value assigned to intraPostFilterType[IntraPredMode] is 3, the encoder and decoder may derive the predSamplesF[x,y] value according to Equation 13 below.

[0276] (Number 13) predSamplesF[x,0]=(p[x+1,-1]+3*predSamples[x,0]+2)>>2(x=0,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x=0,...,nS-1, y=1,...,nS-1)

[0277] If the value assigned to intraPostFilterType[IntraPredMode] is 0, the encoder and decoder may derive the predSamplesF[x,y] value according to Equation 14 below.

[0278] (Number 14) predSamplesF[x,y]=predSamples[x,y](x,y=0,...,nS-1)

[0279] Meanwhile, for all the detailed methods (e.g., filtering execution methods), the encoder and decoder may set the application scope differently depending on the size and / or depth of the current block (and / or prediction block). For example, the application scope of the present invention may be set differently depending on the size of the PU and / or the size of the TU, or may be set differently depending on the depth value of the CU.

[0280] In this case, the encoder and decoder may use a block size and / or a block depth value as a variable to determine the application scope of the present invention. Here, the block may correspond to a CU, PU, ​​and / or TU. For example, when a block size value is used as a variable, the encoder and decoder may apply the present invention only to blocks having a size equal to or greater than the variable, or, for another example, may apply the present invention only to blocks having a size equal to or less than the variable. Furthermore, the encoder and decoder may apply the present invention only to blocks having a size corresponding to the variable value.

[0281] Table 11 below shows an example of the applicability of the present invention when the block size value used as a variable for determining the applicability of the present invention is 16 x 16. In Table 11, O indicates that the present invention is applicable to the corresponding block size, and X indicates that the present invention is not applicable to the corresponding block size.

[0282] [Table 11]

[0283] Referring to Table 11, in the case of Method A, the encoder and decoder can apply the present invention only to blocks having a size equal to or larger than the block size (16x16) used as a variable. In the case of Method B, the encoder and decoder can apply the present invention only to blocks having a size equal to or smaller than the block size (16x16) used as a variable. In addition, in the case of Method C, the encoder and decoder can apply the present invention only to blocks having the same size as the block size (16x16) used as a variable.

[0284] Meanwhile, in one embodiment, the variable values ​​(block size value and / or block depth value) for determining the application range of the present invention may be predetermined fixed values. In this case, the variable values ​​are pre-stored in the encoder and decoder, and the encoder and decoder can determine the application range of the present invention based on the stored variable values.

[0285] In another embodiment, the variable values ​​for determining the scope of application of the present invention may vary depending on the profile or level. When the variable values ​​are determined based on the profile, the variable values ​​corresponding to each profile may be predetermined fixed values, and when the variable values ​​are determined based on the level, the variable values ​​corresponding to each level may be predetermined fixed values.

[0286] In another embodiment, variable values ​​(block size values ​​and / or block depth values) for determining the application scope of the present invention may be determined by an encoder. In this case, the encoder may encode information on the variable values ​​and transmit the encoded information to a decoder through a bitstream. The variable value information transmitted through the bitstream may be included in a sequence parameter set (SPS), a picture parameter set (PSP), a slice header, etc. The decoder may derive the variable values ​​from a received bitstream and determine the application scope of the present invention based on the derived variable values.

[0287] In this case, there are various types of indicators used to indicate variable value information. As an example, when method A in Table 11 is used and the variable value for determining the application scope of the present invention corresponds to a block size value, the indicator used to indicate the variable value information is log2_intra_prediction_filtering_enable_max_size_minus2. For example, when the variable value is 32x32, the value assigned to the indicator is 3, and when the variable value is 4x4, the value assigned to the indicator is 0. As another example, when method A in Table 11 is used and the variable value for determining the application scope of the present invention corresponds to a CU depth value, the indicator used to indicate the variable value information is intra_prediction_filtering_enable_max_cu_depth. For example, in this case, if the value assigned to the indicator is 0, the present invention can be applied to blocks having a size of 64x64 or more, if the value assigned to the indicator is 1, the present invention can be applied to blocks having a size of 32x32 or more, and if the value assigned to the indicator is 4, the present invention can be applied to blocks having a size of 4x4 or more.

[0288] Meanwhile, the encoder may determine not to apply the present invention to all block sizes. In this case, the encoder may use a predetermined indicator to transmit the determined information to the decoder. As an example, the encoder may include an indicator such as intra_prediction_filtering_enable_flag in an SPS, PPS, and / or slice header and transmit the indicator to the decoder. Here, intra_prediction_filtering_enable_flag may correspond to an indicator indicating whether the present invention is applied to all blocks in a sequence, picture, and / or slice. As another example, the encoder may transmit information that the present invention is not applied to all block sizes to the decoder using an indicator indicating detailed variable value information (e.g., intra_prediction_filtering_enable_max_cu_depth). In this case, as an example, the encoder may indicate that the present invention is not applied to all block sizes by assigning a value (e.g., 5) indicating an invalid (and / or unacceptable) block size (e.g., 2x2 size) to the indicator.

[0289] According to the above-described embodiments, the present invention can reduce prediction errors occurring during intra prediction and minimize discontinuities between blocks, thereby improving prediction efficiency and coding efficiency.

[0290] In the above-described embodiments, the method is described based on a flowchart with a series of steps or blocks, but the present invention is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Furthermore, those skilled in the art will understand that the steps shown in the flowchart are not exclusive, and other steps may be included, or one or more steps in the flowchart may be deleted without affecting the scope of the present invention.

[0291] The above-described embodiments include examples of various aspects. It is not possible to describe all possible combinations for illustrating the various aspects, but a person skilled in the art will recognize that other combinations are possible. Therefore, the present invention includes all alterations, modifications, and variations that fall within the scope of the claims.

Claims

1. 1. A method of decoding video, comprising: performing intra prediction on the current block to generate a predicted block; generating a reconstructed block based on the predicted block and a reconstructed difference block corresponding to the current block; Equipped with a predicted value of a predicted pixel of the predicted block is generated using reference pixels during the intra prediction; the predicted pixel is located on the leftmost vertical pixel line of the predicted block or the topmost horizontal pixel line of the predicted block; the reference pixel is located on a vertical reference pixel line adjacent to the left side of the prediction block, a predicted value of the predicted pixel is generated based on a product of a coefficient of the reference pixel and a pixel value of the reference pixel; if the prediction pixel is the bottommost and leftmost pixel in the prediction block, the reference pixel is diagonally adjacent to the lower left corner of the prediction block; The image decoding method, wherein the coefficient of the reference pixel is a value determined based on the size of the current block.

2. The video decoding method of claim 1 , wherein the coefficients of the reference pixels are determined based on an intra-prediction mode of the intra-prediction.

3. an intra prediction mode of the intra prediction is a planar mode; The video decoding method of claim 1 , wherein the prediction block is generated based on a filter using the reference pixels and an inter-prediction pixel of the planar mode inter-prediction block.

4. 4. The video decoding method of claim 3, wherein whether or not to use the filter is determined based on the size of the current block.

5. 4. The video decoding method of claim 3, wherein the prediction pixel and the reference pixel are located on the same horizontal line.

6. 1. A method of encoding video, comprising: performing intra prediction on the current block to generate a predicted block; generating a reconstructed block based on the predicted block and a reconstructed difference block corresponding to the current block; Equipped with a predicted value of a predicted pixel of the predictive block is generated using reference pixels during the intra prediction; the predicted pixel is located on the leftmost vertical pixel line of the predicted block or the topmost horizontal pixel line of the predicted block; the reference pixel is located on a vertical reference pixel line adjacent to the left side of the prediction block, a predicted value of the predicted pixel is generated based on a product of a coefficient of the reference pixel and a pixel value of the reference pixel; if the prediction pixel is the bottommost and leftmost pixel in the prediction block, the reference pixel is diagonally adjacent to the lower left corner of the prediction block; The image encoding method, wherein the coefficient of the reference pixel is a value determined based on the size of the current block.

7. The video encoding method of claim 6 , wherein the coefficients of the reference pixels are determined based on an intra-prediction mode of the intra-prediction.

8. an intra prediction mode of the intra prediction is a planar mode; The video encoding method of claim 6 , wherein the prediction block is generated based on a filter using the reference pixels and an inter-prediction pixel of the inter-prediction block in the planar mode.

9. The video encoding method of claim 8, wherein whether or not to use the filter is determined based on the size of the current block.

10. 9. The video encoding method of claim 8, wherein the predicted pixel and the reference pixel are located on the same horizontal line.

11. A computer-readable recording medium storing a computer-executable program using a bitstream, the computer-executable program, when executed, causing a decoding device to perform the following steps: decoding prediction mode information indicating an intra-prediction mode for a current block; generating a predicted block by performing intra prediction on the current block using the prediction mode information; generating a reconstructed block based on the predicted block and a reconstructed differential block corresponding to the current block; Execute a predicted value of a predicted pixel of the predicted block is generated using a reference pixel during the intra prediction; the predicted pixel is located on the leftmost vertical pixel line of the predicted block or the topmost horizontal pixel line of the predicted block; the reference pixel is located on a vertical reference pixel line adjacent to the left side of the prediction block, a predicted value of the predicted pixel is generated based on a product of a coefficient of the reference pixel and a pixel value of the reference pixel; if the prediction pixel is the bottommost and leftmost pixel in the prediction block, the reference pixel is diagonally adjacent to the lower left corner of the prediction block; 10. A computer-readable recording medium, wherein the coefficient of the reference pixel is a value determined based on a size of the current block.

12. The computer-readable medium of claim 11, wherein the coefficients of the reference pixels are determined based on an intra-prediction mode of the intra-prediction.

13. the intra prediction mode is a planar mode, The computer-readable storage medium of claim 11, wherein the prediction block is generated based on a filter using the reference pixels and intermediate prediction pixels of the planar mode intermediate prediction block.

14. 1. A method for transmitting a bitstream, the bitstream being generated by an image coding device, the method comprising: transmitting the bitstream; The bitstream comprises prediction mode information indicating an intra prediction mode of a current block, the prediction mode information is used to perform generation of a prediction block of the current block using intra prediction; the predicted block is used to generate a reconstructed block; a predicted value of a predicted pixel of the predicted block is generated using a reference pixel during the intra prediction; the predicted pixel is located on the leftmost vertical pixel line of the predicted block or the topmost horizontal pixel line of the predicted block; the reference pixel is located on a vertical reference pixel line adjacent to the left side of the prediction block, a predicted value of the predicted pixel is generated based on a product of a coefficient of the reference pixel and a pixel value of the reference pixel; if the prediction pixel is the bottommost and leftmost pixel in the prediction block, the reference pixel is diagonally adjacent to the lower left corner of the prediction block; 10. A method for transmitting a bitstream, wherein the coefficient of the reference pixel is a value determined based on the size of the current block.

15. The method of claim 14, wherein the coefficients of the reference pixels are determined based on an intra-prediction mode of the intra-prediction.

16. an intra prediction mode of the intra prediction is a planar mode, The method of claim 14, wherein the prediction block is generated based on a filter using the reference pixels and intermediate prediction pixels of the planar mode intermediate prediction block.

17. 17. The method of claim 16, wherein whether or not to use the filter is determined based on the size of the current block.

18. 17. The method of claim 16, wherein the predicted pixel and the reference pixel are located on one horizontal line.

Citation Information

Patent Citations

  • Method and apparatus for encoding and decoding image by using filtered prediction block

    WO2009110741A2

  • Dynamic image encoding device, dynamic image decoding device, dynamic image encoding method, and dynamic image decoding method

    WO2012096150A1

  • Method for decoding image in intra prediction mode

    WO2012134085A2

  • Intra-prediction method, and encoder and decoder using same

    WO2012148138A2

  • Method and apparatus of directional intra prediction

    WO2012175017A1