Video encoding / decoding method and device

The video decoding method addresses inefficiencies in video coding by performing intra prediction and filtering on prediction blocks based on the intra prediction mode, resulting in improved coding/decoding efficiency and compression performance.

JP2025081630AActive Publication Date: 2025-05-27ELECTRONICS & TELECOMM RES INST
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in improving video coding/decoding efficiency, particularly in generating prediction blocks and performing intra prediction effectively.

Method used

A video decoding method that performs intra prediction on a current block to generate a prediction block, followed by filtering based on the intra prediction mode to produce a final prediction block, which is then used to generate a restored block.

Benefits of technology

The proposed method enhances video coding/decoding efficiency by improving the accuracy of prediction blocks and reducing prediction errors, leading to better compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025081630000001_ABST
    Figure 2025081630000001_ABST
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 therefor.

Background Art

[0002] Recently, as broadcast services with HD (High Definition) resolution have expanded not only in Korea but also worldwide, many users have become accustomed to high-resolution and high-quality video. As a result, many institutions are accelerating the development of next-generation video devices. In addition, interest in UHD (Ultra High Definition) with a resolution more than four times that of HDTV has increased along with HDTV, and compression techniques for higher-resolution and high-quality video are required.

[0003] For video compression, an inter prediction technique that predicts pixel values included in the current picture from pictures before and / or after in time, an intra prediction technique that predicts pixel values included in the current picture using pixel information within the current picture, an entropy coding technique that assigns short codes to symbols with high occurrence frequencies and long codes to symbols with low occurrence frequencies, etc. can be used.

Summary of the Invention

Problems to be Solved by the Invention

[0004] A technical problem of the present invention is to provide a video coding method and apparatus capable of improving video coding / decoding efficiency.

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

[0006] Another technical problem of the present invention is to provide a prediction block generation method and apparatus capable of improving video coding / decoding efficiency.

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

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

Means for Solving the Problems

[0009] One embodiment of the present invention is a video decoding method. The method includes: performing intra prediction on a current block to generate a prediction block; based on the intra prediction mode of the current block, performing filtering on filtering target pixels in the prediction block to generate a final prediction block; and generating a restored block based on the restored difference block corresponding to the current block (hereinafter, the difference block can be used interchangeably with the residual block) and the final prediction block. The filtering target pixels are prediction pixels included in a filtering target region in the prediction block, and the filter type applied to the filtering target pixels and the filtering target region are determined based on the intra prediction mode of the current block.

[0010] When the intra prediction mode of the current block is the DC mode, the filtering target region includes a left vertical prediction pixel line which is the leftmost 1 vertical pixel line in the prediction block and an upper horizontal prediction pixel line which is the uppermost 1 horizontal pixel line in the prediction block.

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

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

[0013] When the pixel to be filtered is the upper-left prediction pixel located at the uppermost left within the prediction block, in the final prediction block generation step, filtering for the pixel to be filtered is performed by applying a 3-tap filter based on the pixel to be filtered, the upper reference pixel adjacent above the pixel to be filtered, and the left reference pixel adjacent to the left of the pixel to be filtered. The upper reference pixel and the left reference pixel are each a restored reference pixel adjacent to the current block. In the 3-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 2 / 4, the filter coefficient assigned to the filter tap corresponding to the upper reference pixel is 1 / 4, and the filter coefficient assigned to the 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 prediction pixel line and is not the upper left prediction pixel, in the final prediction block generation step, filtering for the pixel to be filtered is performed by applying a horizontal 2-tap filter based on the pixel to be filtered and a left reference pixel adjacent to the left of the pixel to be filtered. The left reference pixel is a restored reference pixel adjacent to the current block. In the horizontal 2-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 3 / 4, and the filter coefficient assigned to the 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 prediction pixel line and is not the upper left prediction pixel, in the final prediction block generation step, filtering for the pixel to be filtered is performed by applying a vertical 2-tap filter based on the pixel to be filtered and an upper reference pixel adjacent to the upper of the pixel to be filtered. The upper reference pixel is a restored reference pixel adjacent to the current block. In the vertical 2-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 3 / 4, and the filter coefficient assigned to the 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 includes a step of generating a prediction block by performing a prediction on a pixel to be predicted within the current block based on the intra prediction mode of the current block, and a step of generating a restored block based on the restored difference block corresponding to the current block and the final prediction block. In the prediction block generation step, when the intra prediction mode of the current block is the vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, a prediction on the pixel to be predicted is performed based on a first offset. When the intra prediction mode of the current block is the horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, a prediction on the pixel to be predicted is performed based on a second offset. The left vertical pixel line is the leftmost one vertical pixel line within the current block, and the upper horizontal pixel line is the uppermost one horizontal pixel line within the current block.

[0017] In the prediction block generation step, when the intra prediction mode of the current block is the vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, the pixel value of the first reference pixel that exists on the same vertical line as the pixel to be predicted among the restored reference pixels adjacent to the upper side of the current block is added with the first offset value to derive the predicted value of the pixel to be predicted. The first offset value is determined based on the difference value between the pixel value of the second reference pixel adjacent to the left side of the pixel to be predicted and the pixel value of the third reference pixel adjacent to the left side of the first reference pixel.

[0018] In the prediction block generation step, when the current block is a chroma component block, the pixel value of the first reference pixel is determined as the predicted value of the pixel to be predicted.

[0019] In the prediction block generation step, when the intra prediction mode of the current block is the horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, among the restored reference pixels adjacent to the left side of the current block, the pixel value of the first reference pixel existing on the same horizontal line as the pixel to be predicted is added with the second offset value to derive the predicted value of the pixel to be predicted, and the second offset value is determined based on the difference value 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 prediction block generation step, when the current block is a chroma component block, the pixel value of the first reference pixel is determined as the predicted value of the pixel to be predicted.

[0021] Another embodiment of the present invention is a video decoding apparatus. The apparatus includes a prediction block generation unit that performs intra prediction on a current block to generate a prediction block, a filtering unit that performs filtering on pixels to be filtered in the prediction block based on the intra prediction mode of the current block to generate a final prediction block, and a restored block generation unit that generates a restored block based on the restored difference block corresponding to the current block and the final prediction block. The pixels to be filtered are prediction pixels included in a filtering target region in the prediction block, and the filter type applied to the pixels to be filtered and the filtering target region are determined based on the intra prediction mode of the current block.

[0022] When the intra prediction mode of the current block is the DC mode, the filtering target region includes a left vertical prediction pixel line which is one vertical pixel line located at the leftmost side within the prediction block and an upper horizontal prediction pixel line which is one horizontal pixel line located at the uppermost side within the prediction block.

[0023] When the pixel to be filtered is the upper left prediction pixel located at the upper leftmost side within the prediction 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 upper side of the pixel to be filtered, and a left reference pixel adjacent to the left side of the pixel to be filtered. The upper reference pixel and the left reference pixel are respectively restored reference pixels adjacent to the current block. In the 3-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 2 / 4, the filter coefficient assigned to the filter tap corresponding to the upper reference pixel is 1 / 4, and the filter coefficient assigned to the filter tap corresponding to the left reference pixel is 1 / 4.

[0024] When the pixel to be filtered is a prediction pixel included in the left vertical prediction pixel line and is not the upper left prediction 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 is a restored reference pixel adjacent to the current block. In the horizontal 2-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 3 / 4, and the filter coefficient assigned to the filter tap corresponding to the left reference pixel is 1 / 4.

[0025] When the pixel to be filtered is a predicted pixel included in the upper horizontal prediction pixel line and is not the upper left 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 is a restored reference pixel adjacent to the current block. In the vertical 2-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 3 / 4, and the filter coefficient assigned to the 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 includes a prediction block generation unit that performs prediction on a pixel to be predicted in the current block based on the intra prediction mode of the current block to generate a prediction block, and a restored block generation unit that generates a restored block based on the restored difference block corresponding to the current block and the final prediction block. When the intra prediction mode of the current block is the vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, the prediction block generation unit performs prediction on the pixel to be predicted based on a first offset. When the intra prediction mode of the current block is the horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, the prediction block generation unit performs prediction on the pixel to be predicted based on a second offset. The left vertical pixel line is the leftmost one vertical pixel line in the current block, and the upper horizontal pixel line is the uppermost one horizontal pixel line in the current block.

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

[0028] When the intra prediction mode of the current block is the horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, the prediction block generation unit adds the second offset value to the pixel value of the first reference pixel that exists on the same horizontal line as the pixel to be predicted among the restored reference pixels adjacent to the left side of the current block, and derives the predicted value of the pixel to be predicted. The second offset value is determined based on the difference value 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.

Advantages of the Invention

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

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

[0031] According to the prediction block generation method of the present invention, the video encoding / decoding efficiency can be improved.

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

[0033] According to the filtering execution method according to the present invention, the video encoding / decoding efficiency can be improved.

Brief Description of the Drawings

[0034]

Figure 1

Figure 2

Figure 3

Figure 4a

Figure 4b

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16a

Figure 16b

Figure 17

Figure 18

Figure 19

Figure 20

Embodiments for Carrying Out the Invention

[0035] Hereinafter, embodiments of the present invention will be specifically described with reference to the drawings. When it is determined that a detailed description of a related known configuration or function will obscure the gist of the present specification in explaining the examples of the present specification, the detailed description thereof will be omitted.

[0036] When a component is referred to as "connected" or "coupled" to another component, it should be understood that it may be directly connected or coupled to the other component in question, or there may be other components in between. Also, in the present invention, the description of including a specific configuration does not exclude configurations other than the corresponding configuration, meaning that additional configurations can be included within the scope of the implementation of the present invention or the technical idea of the present invention.

[0037] Terms such as first, second, etc. can be used to describe various components, but the components should not be limited by these terms. These terms are only used for the purpose of distinguishing one component from another. For example, unless it goes beyond the scope of the rights of the present invention, the first component can be named the second component, and similarly, the second component can also be named the first component.

[0038] Also, the components shown in the embodiments of the present invention are independently illustrated to show different characteristic functions from each other, and it does not mean that each component is configured as separate hardware or a single software configuration unit. That is, for the sake of convenience of explanation, each component is listed and included as each component, and at least two of the components can be integrated to form one component, or one component can be divided into multiple components to perform functions. Such integrated embodiments and separated embodiments of each component are also included within the scope of the rights of the present invention unless they deviate from the essence of the present invention.

[0039] Also, some components are not essential components for performing the essential functions of the present invention, but are merely optional components for improving performance. The present invention can be implemented by including only the essential components that embody the essence of the present invention excluding the components used merely for improving performance, and a structure including only the essential components excluding the optional components used merely for improving performance is also included within the scope of the rights of the present invention.

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

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

[0042] The video encoding apparatus 100 can perform encoding on an input video in an intra mode or an inter mode and output a bitstream. Intra prediction means in-picture prediction, and inter prediction means inter-picture prediction. In the case of the intra mode, the switch 115 can be switched to intra, and in the case of the inter mode, the switch 115 can be switched to inter. After generating a prediction block for an input block of the input video, the video encoding apparatus 100 can encode the difference (residual) between the input block and the prediction block.

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

[0044] In the case of the inter mode, the motion prediction unit 111 can find a region in the reference video stored in the reference picture buffer 190 that best matches the input block in the motion prediction process and obtain a motion vector. The motion compensation unit 112 can generate a prediction block by performing motion compensation using the motion vector. Here, the motion vector is a two-dimensional vector used for inter prediction and can indicate the offset between the currently encoded / decoded target video and the reference video.

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

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

[0047] When entropy encoding is applied, symbols with a high occurrence probability are assigned a small number of bits, and symbols with a low occurrence probability are assigned a large number of bits to represent the symbols, so that the size of the bit sequence for the symbol to be encoded can be reduced. Therefore, the compression performance of video encoding can be improved through entropy encoding. The entropy encoding unit 150 can use encoding methods such as exponential golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) for entropy encoding.

[0048] The video encoding apparatus according to the embodiment of FIG. 1 performs inter-prediction encoding, that is, inter-picture prediction encoding. Therefore, the currently encoded video needs to be decoded and stored for use as a reference video. Therefore, the quantized coefficients are inverse quantized by the inverse quantization unit 160 and inverse transformed by the inverse transformation unit 170. The inverse quantized and inverse transformed coefficients are added to the prediction block via the adder 175 to generate a restored block.

[0049] The restoration block passes through the filter unit 180, and the filter unit 180 can apply at least one or more of a deblocking filter, SAO (Sample Adaptive Offset), and ALF (Adaptive Loop Filter) to the restoration block or the restored picture. The filter unit 180 may also be called an adaptive in-loop filter. The deblocking filter can remove block distortion generated at the boundary between blocks. SAO can add an appropriate offset value to the pixel value to compensate for coding errors. ALF can perform filtering based on a value obtained by comparing the restored video with the original video. The restoration 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 a configuration according to an embodiment of a video decoding apparatus 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 can receive an input of a bitstream output from an encoder and perform decoding in an intra mode or an inter mode to output a reconstructed video, that is, a restored video. In the case of the intra mode, the switch can be switched to intra, and in the case of the inter mode, the switch can be switched to inter. The video decoding apparatus 200 can obtain a residual block from the received bitstream, generate a prediction block, and then add the residual block and the prediction block to generate a reconstructed block, that is, a restored block.

[0053] The entropy decoding unit 210 can perform entropy decoding on the input bit stream according to a probability distribution and generate symbols including symbols in the form of quantized coefficients. The entropy decoding method is similar to the entropy encoding method described above.

[0054] When the entropy decoding method is applied, a small number of bits are assigned to symbols with a high occurrence probability, and a large number of bits are assigned to symbols with a low occurrence probability, and the symbols are represented, so that the size of the bit string for each symbol can be reduced. Therefore, the compression performance of video decoding can be improved through the entropy decoding method.

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

[0056] In the case of the intra mode, the intra prediction unit 240 can generate a prediction block by performing spatial prediction using the pixel values of the already encoded blocks around the current block. In the case of the inter mode, the motion compensation unit 250 can generate a prediction block by performing motion compensation using the motion vector and the reference video stored in the reference picture buffer 270.

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

[0058] Hereinafter, "unit" means a unit of video encoding and decoding. Since the encoding or decoding unit during video encoding and decoding means the divided unit when dividing the video for encoding or decoding, it may also be called a coding unit (CU), a prediction unit (PU), a transform unit (TU), etc. Also, the unit in the embodiments described later may also be called a block. One unit can be divided into lower-level units with smaller sizes.

[0059] FIG. 3 is a conceptual diagram schematically showing an embodiment in which one unit is divided into a plurality of lower-level units.

[0060] One unit can be hierarchically divided under a tree structure with depth information. Each divided lower-level unit can have depth information. Since the depth information indicates the number of times and / or degree to which the unit is divided, it can also include information regarding the size of the lower-level unit.

[0061] Referring to 310 in FIG. 3, the topmost node may also be called a root node and can have the smallest depth value. At this time, the topmost node can have a depth of level 0 and can represent the first unit that is not divided.

[0062] The lower-level node with a depth of level 1 can represent the unit obtained by dividing the first unit once, and the lower-level node with a depth of level 2 can represent the unit obtained by dividing the first unit twice. For example, in 320 of FIG. 3, the unit a corresponding to node a is the unit obtained by dividing the first unit once and can have a depth of level 1.

[0063] The leaf nodes at level 3 can indicate the units obtained by dividing the first unit three times. For example, in 320 of FIG. 3, the unit d corresponding to node d is a unit obtained by dividing the first unit three times and can have a depth of level 3. Therefore, the leaf nodes at level 3, which are the lowest-level nodes, can have the deepest depth.

[0064] Hereinafter, in the embodiments described later, the block to be encoded / decoded may sometimes be referred to as the current block. Also, when intra prediction is performed on the block to be encoded / decoded, the block to be encoded / decoded may sometimes be referred to as the prediction target block.

[0065] On the other hand, a video signal can generally include three color signals indicating the three primary color components of light. The three color signals indicating the three primary color components of light are R (Red), G (Green), and B (Blue). The R, G, and B signals can be converted into one luma signal and two chroma signals in order to reduce the frequency band used for video processing. At this time, one video signal can include one luma signal and two chroma signals. Here, the luma signal is a component indicating the brightness of the screen and corresponds to Y, and the chroma signal is a component indicating the color of the screen and can correspond to U, V or Cb, Cr. Since the human eye is sensitive to the luma signal and insensitive to the chroma signal, when the R, G, and B signals are converted into the luma signal and the chroma signals using such characteristics, the frequency band used for video processing can be reduced. Hereinafter, in the embodiments described later, 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] FIG. 4A and FIG. 4B are diagrams for explaining an example of an intra prediction process. 410 and 420 in FIG. 4A show an example of a prediction direction of an intra prediction mode and mode values assigned to each prediction direction. Also, 430 in FIG. 4B shows positions of reference pixels used for intra prediction of an encoding / decoding target block. A pixel can have the same meaning as a sample, and in the examples described below, a pixel may sometimes be called a sample.

[0067] As detailed in the examples of FIGS. 1 and 2, an encoder and a decoder can 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 can perform directional prediction and / or non-directional prediction based on at least one restored reference pixel. Here, the prediction block means a block generated as a result of intra prediction execution. The prediction block can correspond to at least one of an encoding unit (CU), a prediction unit (PU), and a transform unit (TU). Also, 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, 8×16.

[0068] On the other hand, intra prediction can be executed according to an intra prediction mode of a current block. The number of intra prediction modes that a current block can have may be a predetermined fixed value, or may be a value determined to be different depending on the size of a prediction block. For example, the number of intra prediction modes that a current block can have is 3, 5, 9, 17, 34, 35, or 36, etc.

[0069] 410 in FIG. 4A shows an example of a prediction direction of an intra prediction mode and mode values assigned to each prediction direction. In 410 of FIG. 4A, numbers assigned to respective intra prediction modes can indicate mode values.

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

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

[0072] The number of intra prediction modes and / or the mode values assigned to each intra prediction mode are not limited to the above-described embodiments, and may be determined to be different according to implementation and / or necessity. For example, the prediction direction of the intra prediction mode and the mode values assigned to each prediction mode can be determined to be different from 410 in FIG. 4a, as in 420 of FIG. 4a. Hereinafter, in the embodiments described later, for the sake of convenience of explanation, it is assumed that intra prediction is performed based on the intra prediction mode such as 410 in FIG. 4a unless otherwise mentioned.

[0073] Also, hereinafter, the intra prediction mode located on the right side of the vertical mode is referred to as the vertical - right mode, and the intra prediction mode located below the horizontal mode is referred to as the horizontal - below mode. For example, in 410 of FIG. 4a, the intra prediction modes with mode values of 5, 6, 12, 13, 22, 23, 24, and 25 can correspond to the vertical - right mode 413, and the intra prediction modes with mode values of 8, 9, 16, 17, 30, 31, 32, and 33 can correspond to the horizontal - below mode 416.

[0074] On the other hand, referring to 430 of FIG. 4b, the restored reference pixels used for intra prediction of the current block include, for example, the below - left reference pixel 431, the left reference pixel 433, the above - left corner reference pixel 435, the above reference pixel 437, and the above - right reference pixel 439. Here, the left reference pixel 433 means the restored reference pixel adjacent to the left side outside the current block, the above reference pixel 437 means the restored reference pixel adjacent to the above side outside the current block, and the above - left corner reference pixel 435 means the restored reference pixel located at the above - left corner outside the current block. Also, the below - left reference pixel 431 means the reference pixel located below the left pixel line composed of the left reference pixel 433 among the pixels located on the same line as the left pixel line, and the above - right reference pixel 439 means the reference pixel located on the right side of the above pixel line among the pixels located on the same line as the above pixel line composed of the above reference pixel 437. The names of the reference pixels detailed in this specification can also be applied identically to other embodiments described later.

[0075] The reference pixels currently used for intra prediction of a block can be changed according to the intra prediction mode of the current block. For example, when the intra prediction mode of the current block is the vertical mode (in 410 of FIG. 4a, the intra prediction mode with a mode value of 0), the upper reference pixel 437 can be used for intra prediction. When the intra prediction mode of the current block is the horizontal mode (in 410 of FIG. 4a, the intra prediction mode with a mode value of 1), the left reference pixel 433 can be used for intra prediction. Also, when the intra prediction mode with a mode value of 13 is used, the upper right reference pixel 439 can be used for intra prediction. When the intra prediction mode with a mode value of 7 is used, the lower left reference pixel 431 can be used for intra prediction.

[0076] When the position of the reference pixel determined based on the prediction direction and the predicted pixel of the intra prediction mode is an integer position, the encoder and the decoder can determine the reference pixel value at the corresponding position as the predicted pixel value for the predicted pixel. When the position of the reference pixel determined based on the prediction direction and the predicted pixel of the intra prediction mode is not an integer position, the encoder and the decoder can 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 the predicted pixel value.

[0077] According to the foregoing embodiments, the encoder and the decoder can perform intra prediction on the block to be encoded / decoded based on the restored or generated reference pixels. However, as described above, the reference pixels used for intra prediction can vary depending on the intra prediction mode of the current block, and discontinuities can occur between the generated prediction block and the surrounding blocks. For example, in the case of directional intra prediction, among the prediction pixels in the prediction block, the pixels farther from the reference pixels can have a larger prediction error. In this case, discontinuities can occur due to the prediction error, and there is a limit to improving the encoding efficiency.

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

[0079] FIG. 5 schematically shows an embodiment of an intra prediction method in the planar mode.

[0080] 510 in FIG. 5 shows an embodiment of an intra prediction method in the planar mode, and 530 in FIG. 5 shows another embodiment of an intra prediction method in the planar mode. 515 and 535 in FIG. 5 show the blocks to be encoded / decoded (hereinafter having the same meaning as the current block), and the sizes of block 515 and block 535 are each nS×nS.

[0081] In FIG. 5, the positions of the pixels within the current block are indicated by predetermined coordinates. For convenience, the uppermost leftmost coordinates within the current block are set to (0, 0). At this time, on the coordinate axes, the y value can increase as going downward, and the x value can increase as going rightward. Hereinafter, in the embodiments described later, the coordinates of the pixels are indicated by the same coordinate axes as those used in FIG. 5.

[0082] As an example, referring to 510 in FIG. 5, the encoder and decoder can derive the pixel value of the predicted pixel for the pixel (nS - 1, nS - 1) located at the lowermost rightmost within the current block, that is, the lowermost right - hand predicted pixel 520. The encoder and decoder can, based on the reference pixel 523 located at the rightmost (nS - 1, - 1) among the upper reference pixels and the lowermost right - hand predicted pixel 520, derive the pixel value of the predicted pixel for the pixels on the rightmost vertical line within the current block, that is, the right - hand vertical line predicted pixel. Also, based on the reference pixel 526 located at the lowermost (- 1, nS - 1) among the left - hand reference pixels and the lowermost right - hand predicted pixel 520, the encoder and decoder can derive the pixel value of the predicted pixel for the pixels on the lowermost horizontal line within the current block, that is, the lowermost horizontal line predicted pixel.

[0083] At this time, for the pixels within the current block excluding the pixels on the right - hand vertical line and the pixels on the lowermost horizontal line, the predicted values can be obtained by applying weighted values based on the upper reference pixels, the left - hand reference pixels, the right - hand vertical line predicted pixels, and the lowermost horizontal line predicted pixels.

[0084] As another example, the encoder and decoder can also derive a prediction value for the pixel to be predicted 540 within the current block 535 by a method such as 530 in FIG. 5. In 530 of FIG. 5, the coordinates of the pixel to be predicted 540 are assumed to be (x, y). Referring to 530 of FIG. 5, the encoder and decoder can perform an average and / or weighted average based on the reference pixel (-1, nS) 541 located most upward among the lower left reference pixels, the reference pixel (-1, y) 543 located on the same horizontal line as the pixel to be predicted 540 among the left reference pixels, the reference pixel (x, -1) 545 located on the same vertical line as the pixel to be predicted 540 among the upper reference pixels, and the reference pixel (nS, -1) located most leftward among the upper right reference pixels, thereby deriving a prediction value for the pixel to be predicted 540.

[0085] FIG. 6 is a flowchart schematically showing an embodiment of the video encoding method according to the present invention.

[0086] Referring to FIG. 6, the encoder can generate a prediction block by performing intra prediction on the block to be encoded (S610). Specific examples of the prediction block generation method are described in detail in FIGS. 4a and 4b, and thus are omitted here.

[0087] Also, referring to FIG. 6, the encoder can perform filtering on the prediction block based on the encoding parameters of the block to be encoded and / or the surrounding blocks adjacent to the block to be encoded (S620). Here, the encoding parameters can include not only the information encoded by the encoder and transmitted to the decoder, such as syntax elements, but also the information that can be inferred during the encoding or decoding process, and it means the necessary information when encoding or decoding video. The encoding parameters can 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, and block partition information, etc.

[0088] As an example, the encoder can 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 encoding parameters of the surrounding blocks adjacent to the block to be encoded (e.g., the encoding mode of the surrounding blocks), and / or the presence or absence of the surrounding blocks (and / or whether the surrounding blocks are available blocks).

[0089] In the detailed filtering execution process described above, it is described that the encoder always performs filtering, but the encoder may not perform filtering on the prediction block. For example, the encoder can determine whether to perform filtering based on the encoding parameters of the block to be encoded and / or the surrounding blocks adjacent to the block to be encoded, and if it is determined not to perform filtering, it does not perform filtering on the prediction block.

[0090] On the other hand, although the detailed filtering process is a separate process independent of the prediction block generation process, it may be combined with the prediction block generation process and executed as one process. That is, the encoder can also generate a prediction block by applying together the processes corresponding to the filtering execution process based on the encoding parameters of the block to be encoded and / or the surrounding blocks in the prediction block generation process. Specific embodiments of the filtering execution method will be described later.

[0091] Also, referring to FIG. 6, the encoder can generate a difference block based on the original block and the prediction block corresponding to the position of the block to be encoded (S630). Here, the prediction block may be a prediction block on which filtering has been performed, or a prediction block on which filtering has not been performed.

[0092] FIG. 7 schematically shows an embodiment of the detailed difference block generation process. 710 in FIG. 7 shows an embodiment of a process of generating a difference block based on the original block and the prediction block on which filtering has been performed. In 710 of FIG. 7, block 713 is the original block, block 716 is the prediction block on which filtering has been performed, and block 719 is the difference block. Referring to 710 of FIG. 7, the encoder and the decoder can generate a difference block by subtracting the prediction block on which filtering has been performed from the original block. 720 in FIG. 7 shows an embodiment of a process of generating a difference block based on the original block and the prediction block on which filtering has not been performed. In 720 of FIG. 7, block 723 is the original block, block 726 is the prediction block on which filtering has not been performed, and block 729 is the difference block. Referring to 720 of FIG. 7, the encoder and the decoder can generate a difference block by subtracting the prediction block on which filtering has not been performed from the original block.

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

[0094] FIG. 8 is a flowchart schematically showing an embodiment of the video decoding method according to the present invention.

[0095] Referring to FIG. 8, the decoder can generate a prediction block by performing intra prediction on a block to be decoded (S810). Specific examples of the prediction block generation method are described in detail in FIGS. 4A and 4B, and thus are omitted here.

[0096] Also, referring to FIG. 8, the decoder can perform filtering on the prediction block based on the coding parameters of the block to be decoded and / or the surrounding blocks adjacent to the block to be decoded (S820). Here, the coding parameters can include not only information encoded by the encoder and transmitted to the decoder like syntax elements, but also information that can be inferred during the encoding or decoding process, and mean the necessary information when encoding or decoding a video. The coding parameters can include, for example, intra / inter prediction mode, motion vector, reference picture index, coded block pattern (CBP), presence or absence of a residual signal, quantization parameter, block size, and block partition information.

[0097] As an example, the decoder can 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 the surrounding blocks adjacent to the block to be decoded (e.g., the coding mode of the surrounding blocks), and / or the presence or absence of the surrounding blocks (and / or whether the surrounding blocks are available blocks).

[0098] In the detailed filtering execution process described above, although the decoder is described as always performing filtering, the decoder does not necessarily have to perform filtering on the prediction block. For example, the decoder can determine whether to perform filtering based on the decoding parameters of the block to be decoded and / or the surrounding blocks adjacent to the block to be decoded. If it is determined that filtering is not performed, filtering is not performed on the prediction block.

[0099] On the other hand, although the detailed filtering process is a separate process independent of the prediction block generation process, it may be combined with the prediction block generation process and executed as one process. That is, the decoder can also generate a prediction block by applying a process corresponding to the filtering execution process based on the encoding parameters of the block to be decoded and / or the surrounding 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 of performing filtering in the decoder is the same as that in the encoder. Specific embodiments of the method of performing filtering will be described later.

[0101] Also, referring to FIG. 8, the decoder can generate a restored block based on the restored difference block and the prediction block corresponding to the position of the block to be decoded (S830). Here, the prediction block may be a prediction block on which filtering has been performed or a prediction block on which filtering has not been performed.

[0102] FIG. 9 schematically shows an embodiment of the detailed differential block generation process. 910 in FIG. 9 shows an embodiment of the process of generating a restored block based on the restored differential block and the predicted block on which filtering has been performed. In 910 of FIG. 9, block 913 is the restored differential block, block 916 is the predicted block on which filtering has been performed, and block 919 is the restored block. Referring to 910 of FIG. 9, the encoder and decoder can generate a restored block by adding the restored differential block and the predicted block on which filtering has been performed. 920 in FIG. 9 shows an embodiment of the process of generating a restored block based on the restored differential block and the predicted block on which no filtering has been performed. In 920 of FIG. 9, block 923 is the restored differential block, block 926 is the predicted block on which no filtering has been performed, and block 929 is the restored block. Referring to 920 of FIG. 9, the encoder and decoder can generate a restored block by adding the restored differential block and the predicted block on which no filtering has been performed.

[0103] FIG. 10 is a flowchart schematically showing an embodiment of the filtering execution method according to the present invention.

[0104] Referring to FIG. 10, the encoder and decoder can determine whether filtering can be performed on the predicted block (and / or predicted pixel) (S1010).

[0105] As described in detail, the encoder and decoder can perform intra prediction on the block to be encoded / decoded based on the previously restored reference pixels. At this time, the reference pixels used for intra prediction and / or the predicted pixel values within the predicted block generated by intra prediction can vary depending on the intra prediction mode of the current block. Therefore, in this case, the encoder and decoder can reduce the prediction error by performing filtering on the predicted pixels with low correlation with the reference pixels used for intra prediction. On the other hand, it is more efficient not to perform filtering on the predicted pixels with high correlation with the reference pixels used for intra prediction.

[0106] Therefore, the encoder and decoder can determine whether to perform filtering on the predicted block (and / or predicted pixels) based on at least one or more of the following information: the intra prediction mode of the block to be encoded / decoded, whether the block to be encoded / decoded is a luma block or a chroma block, the size (and / or depth) of the block to be encoded / decoded, the encoding parameters of the surrounding blocks adjacent to the block to be encoded / decoded (e.g., the size of the surrounding blocks and / or the encoding mode of the surrounding blocks, etc.), and the presence or absence of surrounding blocks (and / or whether the surrounding blocks are available blocks). Whether to perform filtering can be determined during the encoding / decoding process, or it may be determined in advance according to each condition. Hereinafter, specific embodiments of the method for determining whether to perform filtering will be described.

[0107] As an example, the encoder and decoder can determine whether to perform filtering on the predicted block based on the intra prediction mode of the block to be encoded / decoded. As described in detail, the reference pixels and prediction direction used for intra prediction can be determined to vary depending on the intra prediction mode of the block to be encoded / decoded. Therefore, it is efficient to determine whether to perform filtering based on the intra prediction mode of the block to be encoded / decoded.

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

[0109] [Table 1]

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

[0111] As an example, when the prediction mode of the current block is the DC mode (for example, the prediction mode with a mode value of 2), since the prediction block is generated by averaging the pixel values of a plurality of reference pixels, the correlation between the prediction pixel and the reference pixel becomes small. Therefore, in this case, the encoder and the decoder can perform filtering on the prediction pixels in the prediction block. As another example, when the prediction mode of the current block is the planar mode (for example, the prediction mode with a mode value of 34), the encoder and the decoder can derive the right vertical line prediction pixel and the lower horizontal line prediction pixel as detailed in FIG. 5, and then apply a weighting value based on the derived prediction pixels and the reference pixels to derive a prediction value for each pixel in the current block. Therefore, in this case, since the correlation between the prediction pixel and the reference pixel becomes small, the encoder and the decoder can perform filtering on the prediction pixels in the prediction block.

[0112] As another example, when the intra prediction mode of the current block is the vertical right mode (for example, the prediction modes with mode values of 5, 6, 12, 13, 22, 23, 24, 25), since the encoder and decoder use the upper reference pixel and / or the upper right reference pixel to perform intra prediction on the current block, the correlation between the predicted pixel located in the left region within the prediction block and the left reference pixel can be reduced. Therefore, in such a case, filtering can be performed on the pixels located in the left region within the prediction block. As another example, when the intra prediction mode of the current block is the horizontal lower mode (for example, the prediction modes with mode values of 8, 9, 16, 17, 30, 31, 32, 33), since the encoder and decoder use the left reference pixel and / or the lower left reference pixel to perform intra prediction on the current block, the correlation between the predicted pixel located in the upper region within the prediction block and the upper reference pixel can be reduced. Therefore, in such a case, filtering can be performed on the pixels located in the upper region within the prediction block.

[0113] Also, unlike the embodiments in Table 1, the encoder and decoder can also perform filtering for the vertical mode (e.g., the prediction mode with a mode value of 0) and the horizontal mode (e.g., the prediction mode with a mode value of 1). When the intra prediction mode of the current block is the vertical mode, since the encoder and decoder perform intra prediction for the current block using the upper reference pixels, the correlation between the prediction pixels located in the left region within the prediction block and the left reference pixels can be reduced. Therefore, in such a case, filtering can be performed on the pixels located in the left region within the prediction block. As another example, when the intra prediction mode of the current block is the horizontal mode (e.g., the prediction mode with a mode value of 1), since the encoder and decoder perform intra prediction for the current block using the left reference pixels, the correlation between the prediction pixels located in the upper region within the prediction block and the upper reference pixels can be reduced. Therefore, in such a case, filtering can be performed on the pixels located in the upper region within the prediction block.

[0114] On the other hand, when the intra prediction mode of the current block corresponds to one of the remaining prediction modes (e.g., the prediction modes with mode values of 3, 4, 7, 10, 11, 14, 15, 18, 19, 20, 21, 26, 27, 28, 29) excluding the prediction modes detailed above, the encoder and decoder can use at least one of the upper reference pixels and the upper right reference pixels for intra prediction, and can use at least one of the left reference pixels and the lower left reference pixels for intra prediction. Therefore, in this case, since all the prediction pixels located in the left region and the upper region within the prediction block can maintain the correlation with the reference pixels, the encoder and decoder do not perform filtering on the prediction block.

[0115] Examples of regions where filtering is performed within the current block and / or the prediction block, and / or pixel positions where filtering is performed within the current block, for each case where filtering is executed, will be described later.

[0116] As another example, the encoder and decoder can determine whether to perform filtering on the prediction block based on the size and / or depth of the current block (and / or the block to be predicted). At this time, the current block can 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 Table 2 and Table 3, the current block can correspond to a TU, and the size of the TU can be, for example, 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, etc. However, the present invention is not limited thereto, and the current block can also correspond to a CU and / or a PU that is not a TU.

[0118]

Table 2

[0119]

Table 3

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

[0121] The symbolizer and the decoder can also determine whether filtering can be performed on the current block and / or the predicted block by considering both the intra prediction mode of the current block and the size of the current block. That is, the symbolizer and the decoder can determine whether filtering can be performed based on the size of the current block for each intra prediction mode. In this case, it can be determined such that whether filtering can be performed varies depending on the size of the current block for each intra prediction mode. Table 4 below shows an example of a method for determining whether filtering can be performed 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 can indicate that filtering is not performed, and 1 can indicate that filtering is performed.

[0124] As another example, the symbolizer and the decoder can determine whether filtering can be performed on the predicted block based on information indicating whether the current block corresponds to a luma block or a chroma block, that is, based on the color component information of the current block. For example, the symbolizer and the decoder perform filtering on the predicted block only when the current block corresponds to a luma block, and do not perform filtering when the current block corresponds to a chroma block.

[0125] As another example, the encoder and decoder can determine whether to perform filtering based on, for example, the encoding parameters of neighboring blocks adjacent to the current block, whether CIP (Constrained Intra Prediction) is applied to the current block, and / or information regarding the presence or absence of neighboring blocks (and / or whether the neighboring blocks are available blocks). Specific examples of the method for determining whether to perform filtering for each will be described later.

[0126] Also, referring to FIG. 10, when it is determined that filtering is to be performed on the current block and / or the prediction block, the encoder and decoder can determine the area in the current block and / or the prediction block where filtering is to be performed (S1020). Here, the area where the filtering is to be performed can correspond to one or more samples within the current block and / or the prediction block.

[0127] As described in detail, the encoder and decoder can reduce the prediction error by performing filtering on prediction pixels having low correlation with the reference pixels used in intra prediction. That is, the encoder and decoder can determine, as the filtering execution area, an area within the current block and / or the prediction block where the prediction error is relatively large. At this time, the encoder and decoder can determine the filtering execution area 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 encoding mode of neighboring blocks adjacent to the current block. Here, the encoding mode of the neighboring block can indicate whether the neighboring block is encoded / decoded in the inter mode or the intra mode. Specific examples of the method for determining the filtering execution area will be described later.

[0128] Also, the encoder and decoder can determine the filter type to be applied to each prediction pixel within the filtering execution area (S1030).

[0129] At this time, the filter type may include information on a filter shape, a filter tap, a filter coefficient, etc. A plurality of intra prediction modes may have different prediction directions, and the method of using reference pixels restored according to the position of pixels to be filtered may change. Therefore, an encoder and a decoder can improve filtering efficiency by adaptively determining the filter type. For example, the encoder and the decoder can determine the filter type 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. The filter shape includes a horizontal shape, a vertical shape, a diagonal shape, etc., and the filter tap includes a 2-tap, a 3-tap, a 4-tap, etc.

[0130] Also, the encoder and the decoder can determine a filter coefficient based on the size of the prediction block and / or the position of the pixel to be filtered, etc. That is, the encoder and the decoder can make the filter coefficients applied to the pixels to be filtered different according to the size of the prediction block and / or the position of the pixel to be filtered, etc. Therefore, the filter strength for the pixels to be filtered can be adaptively determined. As an example, when a 2-tap filter is used, the filter coefficient can be [1:3], [1:7], [3:5], etc. As another example, when a 3-tap filter is used, the filter coefficient can be [1:2:1], [1:4:1], [1:6:1], etc.

[0131] On the other hand, the filter determined by the filter type may not be a filter defined by a filter shape, filter taps, filter coefficients, etc. For example, an encoder and a decoder can also execute a filtering process by adding an offset value determined by a predetermined process to the pixel values of reference pixels. At this time, the filtering process may be combined with the prediction block generation process and executed as one process. That is, the filtered predicted pixel values of each pixel in the current block can be derived only by the detailed filtering process, and at this time, the detailed filtering process can correspond to one process including both the predicted pixel generation process and the filtering process for the generated predicted pixels.

[0132] Specific embodiments of the filter type determination method will be described later.

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

[0134] FIG. 11 schematically shows an embodiment of a method for determining whether to execute filtering based on the coding parameters of peripheral blocks adjacent to the current block.

[0135] In FIG. 11, the coding parameters of the peripheral blocks include an intra prediction mode, an inter prediction mode, a coding mode, and the like. Here, the coding mode of the peripheral block can indicate whether the peripheral block is coded / decoded in the inter mode or the intra mode.

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

[0137] However, similar to 1110 in FIG. 11, when the prediction directions of the left neighboring 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 directions of the neighboring 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 the decoder do not perform filtering on the filtering target region 1119. On the contrary, when the prediction directions of the neighboring 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 (for example, when the prediction angle difference value is less than or equal to a predetermined threshold), the prediction error can be reduced by performing filtering on the filtering target region 1119.

[0138] 1120 in FIG. 11 shows an example of a method for determining whether filtering can be performed based on the coding mode of peripheral blocks adjacent to a current block when CIP (Constrained Intra Prediction) is applied to the current block. 1123 in FIG. 11 shows the current block (C), and 1126 in FIG. 11 shows the left peripheral block (A) adjacent to the left side of the current block. In 1120 of FIG. 11, it is assumed that the intra prediction mode of the current block corresponds to the vertical right mode. At this time, since the encoder and decoder perform intra prediction on the current block using the upper reference pixel and / or the upper right reference pixel, filtering can be performed on the pixels located in the left region 1129 within 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 the pixels in the peripheral block coded in the inter mode as reference pixels when performing intra prediction on the current block 1123. For example, in 1120 of FIG. 11, when the left peripheral block (A) 1126 is coded in the inter mode, the reference pixels in the left peripheral block 1126, that is, the left reference pixels, are not used for the inter prediction of the current block 1123. In this case, after the encoder and decoder put the pixel values of the reference pixels in the block coded in the intra mode at the positions of the left reference pixels, intra prediction can be performed. That is, the encoder and decoder can enhance error tolerance by not using the pixels to which the inter mode is applied for intra prediction.

[0141] Therefore, similar to 1120 in FIG. 11, when CIP is applied to the current block 1123 and the coding mode of the left peripheral block 1126 adjacent to the filtering target area 1129 is the inter mode, the encoder and decoder do not perform filtering on the filtering target area 1129.

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

[0143] 1210 in FIG. 12 indicates the current block (C), and 1220 in FIG. 12 indicates the peripheral block (A) adjacent to the left side of the current block. In FIG. 12, it is assumed that the intra prediction mode of the current block 1210 corresponds to the vertical right mode. At this time, since the encoder and decoder perform intra prediction on the current block by using the upper reference pixel and / or the upper right reference pixel, filtering can be performed on the pixels located in the left area 1230 within the prediction block.

[0144] However, when there is no peripheral block adjacent to the filtering target area or the peripheral block is not available, the encoder and decoder do not perform filtering on the filtering target area. Here, when there is no peripheral block adjacent to the filtering target area or the peripheral block is not available, there are cases such as when the current block exists at the boundary of the current picture and when the peripheral block adjacent to the current block exists outside the slice boundary to which the current block belongs.

[0145] When there is no neighboring block adjacent to the filtering target region or the neighboring block is not available, the encoder and decoder can generate a reference pixel value at a position adjacent to the filtering target region using available reference pixels and then perform intra prediction. However, in this case, the generated multiple reference pixels can have similar values to each other, and the values of the generated reference pixels are not similar to the pixel values within the current block. Therefore, performing filtering on the current block based on the generated reference pixels can reduce the coding efficiency. Thus, the encoder and decoder do not perform filtering on the filtering target region.

[0146] Referring to FIG. 12, there is a restored block (B) D around the current block (C) 1210. Also, the left neighboring block (A) 1220 adjacent to the filtering target region 1230 within the current block 1210 is outside the boundary 1240 of the slice to which the current block 1210 belongs. At this time, since the left neighboring 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 schematically shows an example of a method for determining a filtering execution region based on the intra prediction mode of the current block.

[0148] As described in detail, the encoder and decoder can perform intra prediction on an encoding / decoding target block based on previously restored reference pixels. At this time, since the reference pixels and / or prediction directions used for intra prediction can vary depending on the intra prediction mode of the current block, it is efficient to determine a region with a relatively large prediction error as the 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 within the prediction block may have a low correlation with the reference pixels and can have a large prediction error. Therefore, the encoder and decoder can reduce the prediction error and improve the prediction efficiency by performing filtering on the prediction pixels within the region adjacent to the reference pixels not used for intra prediction among the prediction pixels in the prediction block.

[0149] 1310 in FIG. 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 of FIG. 13, 1313 indicates the prediction block, and 1316 can indicate the filtering execution region.

[0150] As described in detail, when the prediction mode of the current block is the DC mode, the predicted block 1313 is generated by averaging the pixel values of a plurality of reference pixels. Therefore, the correlation between the predicted pixel and the reference pixels is reduced. Thus, in this case, the encoder and the decoder can determine one or more horizontal pixel lines located at the uppermost position within the predicted block 1313 (hereinafter referred to as the upper horizontal predicted pixel line) and one or more vertical pixel lines located at the leftmost position within the predicted block 1313 (hereinafter referred to as the left vertical predicted pixel line) as the filtering execution region 1316. At this time, 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 can each include one pixel line. Also, similar to the embodiment of FIG. 14 described later, 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 can be determined based on the size of the current block and / or the predicted 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 can 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 can be 1, 2, 4, etc., respectively.

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

[0152] 1320 in FIG. 13 shows an example of a filtering execution region when the intra prediction mode of the current block is the vertical right mode (for example, the prediction modes with mode values of 5, 6, 12, 13, 22, 23, 24, 25). In 1320 of FIG. 13, 1323 indicates the prediction block, and 1326 can indicate the filtering execution region.

[0153] When the prediction mode of the current block is the vertical right mode, since the encoder and decoder perform intra prediction on the current block based on the upper reference pixel and / or the upper right reference pixel, the correlation between the prediction pixels located in the left region within the prediction block 1323 and the left reference pixels can be reduced. Therefore, in this case, the encoder and decoder can determine one or more vertical pixel lines located on the leftmost side within the prediction block 1323, that is, the left vertical prediction pixel line, as the filtering execution region 1326, and improve the prediction efficiency by performing filtering. At this time, the number of vertical pixel lines included in the left vertical prediction pixel line is a predetermined fixed number. For example, the left vertical prediction pixel line can include 1 vertical pixel line. Also, similar to the embodiment of FIG. 14 described later, the number of vertical pixel lines included in the left vertical prediction pixel line can also 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 prediction pixel line can have a variable value depending on the size of the current block and / or the prediction block 1323, and can be, for example, 1, 2, or 4, etc.

[0154] On the other hand, when the prediction mode of the current block is the vertical mode, since the encoder and decoder perform intra prediction on the current block using the upper reference pixel, the correlation between the prediction pixels located in the left region within the prediction block and the left reference pixels can be reduced. Therefore, also in this case, the encoder and decoder can determine the left vertical prediction pixel line as the filtering execution region and perform filtering.

[0155] 1330 in FIG. 13 shows an example of a filtering execution area when the intra prediction mode of the current block is the horizontal downward mode (for example, the prediction modes with mode values of 8, 9, 16, 17, 30, 31, 32, 33). In 1330 of FIG. 13, 1333 indicates a prediction block, and 1336 can indicate a filtering execution area.

[0156] When the prediction mode of the current block is the horizontal downward mode, since the encoder and decoder perform intra prediction on the current block using the left reference pixel and / or the lower left reference pixel, the correlation between the prediction pixels located in the upper region within the prediction block 1333 and the upper reference pixel can be reduced. Therefore, in this case, the encoder and decoder can determine the uppermost one or more horizontal pixel lines within the prediction block 1333, that is, the upper horizontal prediction pixel line, as the filtering execution area 1336, and improve the prediction efficiency by performing filtering. At this time, the number of horizontal pixel lines included in the upper horizontal prediction pixel line is a predetermined fixed number. For example, the upper horizontal prediction pixel line can include 1 pixel line. Also, similar to the embodiment of FIG. 14 described later, the number of horizontal pixel lines included in the upper horizontal prediction pixel line can also 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 prediction pixel line can have a variable value depending on the size of the current block and / or the prediction block 1333, and can be, for example, 1, 2, or 4, etc.

[0157] On the one hand, when the prediction mode of the current block is the horizontal mode, the encoder and decoder use the left reference pixels to perform intra prediction on the current block. Therefore, the correlation between the prediction pixels located in the upper region within the prediction block and the upper reference pixels can be reduced. Thus, also in this case, the encoder and decoder can determine the upper horizontal prediction pixel line as the filtering execution region and perform filtering.

[0158] FIG. 14 schematically shows 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 the region having a large prediction error within the current block is also large. When the size of the current block (and / or the block to be predicted) is small, the size of the region having a large prediction error within the current block is also small. Therefore, the encoder and decoder can improve the encoding efficiency by determining the filtering execution region based on the size (and / or depth) of the current block (and / or the block to be predicted). At this time, the encoder and decoder can determine the region having a relatively large prediction error as the filtering execution region.

[0160] 1410 in FIG. 14 shows an example of a filtering execution area when the size of the current block is 8×8. In 1410 of FIG. 14, 1413 indicates the current block, and 1416 indicates the area to be filtered. In 1410 of FIG. 14, it is assumed that the intra prediction mode of the current block 1413 corresponds to the vertical right mode (for example, the prediction mode with a mode value of 6). At this time, since the encoder and decoder perform intra prediction on the current block by using the upper reference pixel and / or the upper right reference pixel, the prediction error of the left area far from the upper reference pixel and the upper right reference pixel in the prediction block is large. Therefore, in this case, the encoder and decoder can determine one or more vertical pixel lines located on the leftmost side in the prediction block, that is, the left vertical prediction pixel line, as the filtering execution area 1416.

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

[0162] In 1410 and 1420 of FIG. 14 described in detail, the number of vertical pixel lines constituting the left vertical prediction pixel line can be determined based on the current blocks 1413 and 1423 and / or the size of the prediction block. In 1410 of FIG. 14, since the size of the current block 1413 is 8×8, it has a relatively small value. Therefore, in this case, since the size of the region with a large prediction error is relatively small, the encoder and the decoder can determine two vertical pixel lines in order from the leftmost position in the prediction block as the filtering execution region. On the contrary, in 1420 of FIG. 14, since the size of the current block 1423 is 32×32, it has a relatively large value. Therefore, in this case, since the size of the region with a large prediction error is relatively large, the encoder and the decoder can determine four vertical pixel lines in order from the leftmost position in the prediction block as the filtering execution region.

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

[0164]

Table 5

[0165]

Table 6

[0166] Here, the current block can correspond to a TU, and the size of the TU can be, for example, 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, etc. However, the present invention is not limited thereto, and the current block can also correspond to a CU and / or a PU that is not a TU.

[0167] The size and / or position of the filtering execution area determined by the current block size and / or depth are not limited to the above-described embodiments, and can also be determined to have a size and / or position different from the above-described embodiments. Further, in the above-described embodiments, the method for determining the filtering execution area is described centering on the vertical right mode, but this is merely for convenience of explanation, and the method can also be applied to the same or similar methods when the prediction mode of the current block corresponds to a mode other than the vertical right mode.

[0168] FIG. 15 schematically shows an embodiment of a method for determining a filtering execution area based on the coding mode of peripheral blocks adjacent to a current block.

[0169] In FIG. 15, it is assumed that the intra prediction mode of the current block (C) 1510 corresponds to the vertical right mode. At this time, since the encoder and decoder perform intra prediction on the current block 1510 using the upper reference pixel and / or the upper right reference pixel, the left area in the prediction block can be determined as the filtering target area.

[0170] However, when the coding mode of a peripheral block adjacent to the current block is an inter mode, the restored pixel values in that peripheral block are likely not to be reliable due to errors generated in the network or the like, and performing filtering based on the restored pixel values in a peripheral block whose coding mode is an inter mode can reduce the coding efficiency. Therefore, the encoder and decoder do not perform filtering on the area adjacent to a peripheral block whose coding mode is an inter mode. That is, the encoder and decoder can determine the filtering execution area based on the coding mode of the peripheral blocks adjacent to the current block.

[0171] Referring to FIG. 15, among the peripheral blocks currently adjacent to the left side of block 1510, there are a restored peripheral block (A) 1520 and a restored peripheral block (B) 1530. Here, it is assumed that the encoding mode of the peripheral block (A) 1520 is the intra mode, and the encoding mode of the peripheral block (B) 1530 is the inter mode. At this time, the encoder and decoder can determine only the region 1540 adjacent to the peripheral block (B) 1530 encoded in the intra mode among the left side regions in the prediction block as the filtering target region.

[0172] FIGS. 16a and 16b show examples of a method for determining a filter type according to the intra prediction mode of the current block.

[0173] 1610 in FIG. 16a shows an example of a method for determining a filter type when the prediction mode of the current block is the DC mode and / or the planar mode. In 1610 of FIG. 16a, 1615 indicates the prediction block, and 1620 indicates the filter taps applied to the filtering target pixels.

[0174] As described in detail, when the prediction mode of the current block is the DC mode, the predicted block 1615 is generated by averaging the pixel values of a plurality of reference pixels. Therefore, the correlation between the predicted pixel and the reference pixel is reduced. Thus, in this case, the encoder and the decoder can determine the prediction pixels (for example, (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 (for example, the uppermost horizontal pixel line in the predicted block 1615) and the left vertical prediction pixel line (for example, the leftmost vertical pixel line in the predicted block 1615) as the filtering execution area. Also, when the prediction mode of the current block is the planar mode, the correlation between the predicted pixel and the reference pixel is small. Therefore, in this case, the encoder and the decoder can determine the prediction pixels included in the upper horizontal prediction pixel line and the left vertical prediction pixel line as the filtering execution area in the same manner as in the DC mode.

[0175] When the prediction mode of the current block is the DC mode and / or the planar mode, the encoder and the decoder can apply a 3-tap filter 1629 of [1 / 4, 2 / 4, 1 / 4] to the upper left prediction pixel (0,0) located at the upper leftmost in the predicted block. At this time, the encoder and the decoder can perform filtering on the pixel to be filtered based on the pixel to be filtered (0,0), the reference pixel (0, -1) adjacent above the pixel to be filtered, and the reference pixel (-1,0) adjacent to the left of the pixel to be filtered. 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 above the pixel to be filtered and the reference pixel adjacent to the left of the pixel to be filtered are 1 / 4.

[0176] Also, when the prediction mode of the current block is the DC mode and / or the planar mode, the encoder and the decoder can apply a horizontal 2-tap filter 1623 of [1 / 4, 3 / 4] to each of the prediction pixels included in the left vertical prediction pixel line, excluding the upper left prediction pixel (e.g., (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)). At this time, assuming that the position of the pixel to be filtered is (0,y), the encoder and the decoder can perform filtering on the pixel to be filtered based on the pixel to be filtered (0,y) and the reference pixel (-1,y) adjacent to the left 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 of the pixel to be filtered is 1 / 4.

[0177] Also, when the prediction mode of the current block is the DC mode and / or the planar mode, the encoder and the decoder can apply a vertical 2-tap filter 1625 of [1 / 4, 3 / 4] to each of the prediction pixels included in the upper horizontal prediction pixel line, excluding the upper left prediction pixel (e.g., (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)). At this time, assuming that the position of the pixel to be filtered is (x,0), the encoder and the decoder can perform filtering on the pixel to be filtered based on the pixel to be filtered (x,0) and the 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 foregoing embodiments, the encoder and the decoder can use different filter types (e.g., filter shape, filter taps, and / or filter coefficients, etc.) depending on the size of the current block. In this case, the encoder and the decoder can adaptively determine the filter type based on the size of the current block. However, the encoder and the decoder can also always use a predetermined fixed filter type (e.g., filter shape, filter taps, and / or filter coefficients, etc.) regardless of the size of the current block and / or the prediction block, similar to the foregoing embodiments.

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

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

[0181] On one hand, when the prediction mode of the current block is the vertical mode (for example, the prediction mode with a mode value of 0), the encoder and decoder use the upper reference pixels to perform intra prediction on the current block. Therefore, the correlation between the prediction pixels located in the left region within the prediction block and the left reference pixels can be reduced. Thus, also in this case, the encoder and decoder can determine the prediction pixels 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 can apply the diagonal 2 - tap filter 1640 of [1 / 4, 3 / 4] to each of the prediction pixels (for example, (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) included in the left vertical prediction pixel line. At this time, assuming that the position of the pixel to be filtered is (0,y), the encoder and decoder can perform filtering on the pixel to be filtered (0,y) based on the pixel to be filtered (0,y) and the reference pixel (-1,y + 1) adjacent below the reference pixel adjacent to the left 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 below the reference pixel adjacent to the left of the pixel to be filtered is 1 / 4.

[0183] 1650 in FIG. 16b shows an example of a method for determining a filter type when the prediction mode of the current block is the horizontal downward mode (for example, the prediction mode with mode values of 8, 9, 16, 17, 30, 31, 32, 33). In 1650 of FIG. 16b, 1655 indicates the prediction block, and 1660 indicates the filter taps applied to the pixels to be filtered.

[0184] As described in detail, when the prediction mode of the current block is the horizontal downward mode, since the encoder and the decoder perform intra prediction on the current block by using the left reference pixel and / or the lower left reference pixel, the correlation between the prediction pixels located in the upper region within the prediction block 1655 and the upper reference pixel can be reduced. Therefore, in this case, the encoder and the decoder can determine the prediction pixels (for example, (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)) included in the upper horizontal prediction pixel line (for example, the uppermost one vertical pixel line within the prediction block 1655) as the filtering execution region.

[0185] On the other hand, when the prediction mode of the current block is the horizontal mode (for example, the prediction mode with a mode value of 1), since the encoder and the decoder perform intra prediction on the current block by using the left reference pixel, the correlation between the prediction pixels located in the upper region within the prediction block 1655 and the upper reference pixel can be reduced. Therefore, also in this case, the encoder and the decoder can determine the prediction pixels included in the upper horizontal prediction 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 downward mode.

[0186] When the prediction mode of the current block is the horizontal downward mode, the encoder and decoder can apply the diagonal 2-tap filter 1660 of [1 / 4, 3 / 4] to each of the prediction pixels (e.g., (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)) included in the upper horizontal prediction pixel line. At this time, assuming that the position of the pixel to be filtered is (x,0), the encoder and decoder can perform filtering on the pixel to be filtered based on the pixel to be filtered (x,0) and the reference pixel (x + 1, -1) adjacent to the right side of the reference pixel 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 right side of the reference pixel adjacent to the upper side of the pixel to be filtered is 1 / 4.

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

[0188] Similar to the embodiments of 1630 and 1650 described in detail, the encoder and decoder can apply a predetermined fixed filter type to each of the vertical right mode and / or horizontal downward mode. However, the encoder and decoder can also apply various filter types according to the intra prediction mode in addition to the filter types described in detail. At this time, the encoder and decoder can adaptively determine the filter type based on the intra prediction mode of the current block.

[0189] As an example, the encoder and decoder can use a 3-tap filter 1681 that performs filtering based on the pixel (x, y) to be filtered, the reference pixel (x + 2, y - 1), and the reference pixel (x + 3, y - 1). At this time, the filter coefficient applied to the pixel (x, y) to be filtered 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 can use 3-tap filters 1683, 1685, 1687 that perform filtering based on the pixel (x, y) to be filtered, the reference pixel (x + 1, y - 1), and the reference pixel (x + 2, y - 1). In this case, the filter coefficient applied to the pixel (x, y) to be filtered 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 (x, y) to be filtered 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 (x, y) to be filtered 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 can also use a 2-tap filter 1689 that performs filtering based on the pixel (x, y) to be filtered and the reference pixel (x + 1, y - 1). At this time, the filter coefficient applied to the pixel (x, y) to be filtered is 8, and the filter coefficient applied to the reference pixel (x + 1, y - 1) is 8.

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

[0191] Also, as detailed in the embodiment of FIG. 10, since the encoder and decoder can determine whether to perform filtering on the prediction block based on the color component information of the current block, the encoder and decoder can also perform the filtering process detailed in FIGS. 16a and 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 schematically shows a method for determining a filter type according to the embodiments of FIGS. 16a and 16b.

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

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

[0195] (Equation 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 represents the filtered prediction pixel value generated by performing filtering on the prediction pixel value at the x position.

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

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

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

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

[0201] 1750 in FIG. 17 shows an example of the filter type when the prediction mode of the current block is the horizontal downward mode (e.g., the prediction modes where the mode values are 8, 9, 16, 17, 30, 31, 32, 33). 1750 in FIG. 17 shows the same filter type as the filter type shown at 1650 in FIG. 16b.

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

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

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

[0205] FIG. 18 schematically shows an example of a filter type 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 the first reference pixel, the second reference pixel, and the third reference pixel are each independently used in 1810 of FIG. 18 and 1820 of FIG. 18. For example, the first reference pixel used in 1810 of FIG. 18 is not the same as the first reference pixel used in 1820 of FIG. 18, and the second reference pixel and the third reference pixel can also each have independent meanings in 1810 of FIG. 18 and 1820 of FIG. 18.

[0207] As described in detail, the filter determined by the filter type may not be a filter defined by a filter shape, filter taps, filter coefficients, etc. For example, the encoder and the decoder can also execute the filtering process by adding an offset value determined by a predetermined process to the pixel value of the reference pixel. At this time, the filtering process may be combined with the predicted block generation process and executed in one process. That is, the filtered predicted pixel value of each pixel in the current block can be derived only by the filtering process described in detail. At this time, the filtering process described in detail can correspond to one process including both the predicted pixel generation process and the filtering process for the generated predicted pixel. The filtering process in such a case can also be regarded as a process of generating the final predicted pixel (and / or the filtered predicted pixel) using the reference pixel. Therefore, in FIG. 18, the embodiments are described from the viewpoint of predicted pixel generation.

[0208] 1810 in FIG. 18 shows an example of a method for generating predicted pixels when the prediction mode of the current block is the vertical mode.

[0209] As described in detail, when the prediction mode of the current block is the vertical mode, the encoder and the decoder can generate a prediction block by performing intra prediction on the current block using the upper reference pixels. At this time, since the correlation between the predicted pixels located in the left region within the prediction block and the left reference pixels is small, the predicted pixels located in the left region within the prediction block can have a large prediction error. Therefore, 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 (hereinafter referred to as the left vertical pixel line) located on the leftmost side within the current block 1815, a prediction block can be generated as follows.

[0210] Referring to 1810 in FIG. 18, pixels at positions (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7) can exist on the left vertical pixel line. In 1810 of FIG. 18, it is assumed that the current pixel to be predicted is the 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 the decoder can put the pixel value of the first reference pixel (0, -1) (for example, the leftmost reference pixel among the upper reference pixels) located on the same vertical line as the pixel to be predicted among the upper reference pixels at 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 can be determined as the predicted pixel value of the pixel to be predicted.

[0212] However, in this case, since the generated predicted pixel values can have a large prediction error, the encoder and decoder can derive the final predicted pixel values by adding an offset value to the first reference pixel value. Here, the process of adding the offset value can also correspond to a filtering process and can also correspond to a part of the predicted pixel generation process. At this time, the offset value can be derived based on a second reference pixel (-1, 4) adjacent to the left side of the pixel to be predicted and a third reference pixel (-1, -1) adjacent to the left side of the first reference pixel. For example, the offset value can 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 can derive the predicted value of the pixel to be predicted by adding the difference value between the second reference pixel value and the third reference pixel value to the first reference pixel value. The detailed predicted pixel generation process described above can be applied in the same or similar manner to pixels other than pixel (0, 4) among the pixels on the left vertical pixel line.

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

[0214] (Equation 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] represents the final predicted pixel value for the pixel to be predicted at the (x,y) position, p[x,-1] represents the first reference pixel located on the same vertical line as the pixel to be predicted among the upper reference pixels. Also, p[-1,y] represents the second reference pixel adjacent to the left side of the pixel to be predicted, and p[-1,-1] represents the third reference pixel adjacent to the left side of the first reference pixel. Also, nS represents the height of the current block.

[0216] On the other hand, when the prediction mode of the current block 1815 is the vertical mode, the area to which offset and / or filtering is applied is not limited to the above-described embodiments. For example, the encoder and decoder can also apply the detailed prediction pixel generation process to the two leftmost vertical pixel lines within the current block 1815. In this case, the prediction pixel generation process is represented by, for example, the following Equation 5.

[0217] (Equation 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] represents the final prediction pixel value for the pixel to be predicted at the (x,y) position, and p[x,y] represents the prediction pixel value generated by a general vertical prediction process. Also, p[-1,y] represents the reference pixel located on the same horizontal line as the pixel to be predicted among the left reference pixels, and p[-1,-1] represents the upper left corner reference pixel.

[0219] On the other hand, the process of adding the detailed offset value 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 can also determine the first reference pixel as the prediction pixel value of the pixel to be predicted without applying the offset value.

[0220] 1820 in FIG. 18 shows an embodiment of a method for generating prediction pixels when the prediction mode of the current block is the horizontal mode.

[0221] As described in detail, when the prediction mode of the current block is the horizontal mode, the encoder and decoder can generate a prediction block by performing intra prediction on the current block using the left reference pixels. At this time, since the correlation between the prediction pixels located in the upper region within the prediction block and the upper reference pixels is small, the prediction pixels located in the upper region within the prediction block can have a large prediction error.

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

[0223] Referring to 1820 in FIG. 18, pixels at positions (0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0) can exist on the upper horizontal pixel line. In 1820 of FIG. 18, assume that the current pixel to be predicted is the 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 can put the pixel value of the first reference pixel (-1, 0) located on the same horizontal line as the pixel to be predicted (for example, the uppermost reference pixel among the left reference pixels) among the left reference pixels at 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 can be determined as the prediction pixel value of the pixel to be predicted.

[0225] However, in this case, since the generated predicted pixel values can have a large prediction error, the encoder and decoder can derive the final predicted pixel values by adding an offset value to the first reference pixel value. Here, the process of adding the offset value can also correspond to a filtering process and can also correspond to a part of the predicted pixel generation process. At this time, the offset value can be derived based on a second reference pixel (4, -1) adjacent above the pixel to be predicted and a third reference pixel (-1, -1) adjacent above the first reference pixel. For example, the offset value can correspond to the 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 can derive the predicted value of the pixel to be predicted by adding the difference value between the second reference pixel value and the third reference pixel value to the first reference pixel value. The detailed predicted pixel generation process described above can be applied in the same or similar manner to pixels other than pixel (4, 0) among the pixels on the upper horizontal pixel line.

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

[0227] (Equation 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] represents the final predicted pixel value for the pixel to be predicted at the (x, y) position, p[-1,y] represents the first reference pixel located on the same horizontal line as the pixel to be predicted among the left reference pixels. Also, p[x, -1] represents the second reference pixel adjacent above the pixel to be predicted, and p[-1, -1] represents the third reference pixel adjacent above the first reference pixel. Also, nS represents the width of the current block.

[0229] On the one hand, when the prediction mode of the current block 1825 is the horizontal mode, the area to which offset and / or filtering is applied is not limited to the foregoing embodiments. For example, the encoder and decoder can also apply the detailed prediction pixel generation process to the two uppermost horizontal pixel lines within the current block 1825. In this case, the prediction pixel generation process is represented by, for example, the following Equation 7.

[0230] (Equation 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] represents the final prediction pixel value for the pixel to be predicted at the (x, y) position, and p[x,y] represents the prediction pixel value generated by the general horizontal prediction process. Also, p[x,-1] represents the reference pixel located on the same vertical line as the pixel to be predicted among the upper reference pixels, and p[-1,-1] represents the upper left corner reference pixel.

[0232] On the other hand, similar to 1810 in FIG. 18, the process of adding the detailed offset value 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 can also determine the first reference pixel as the prediction pixel value of the pixel to be predicted without applying the offset value.

[0233] FIG. 19 schematically shows another embodiment of the filter type according to the present invention.

[0234] In the embodiment of FIG. 19, since the encoder and the decoder perform intra prediction on the current block based on the left reference pixel and / or the lower left reference pixel, the correlation between the predicted pixel located in the upper region within the prediction block 1910 and the upper reference pixel can be reduced. Therefore, in this case, the encoder and the decoder can perform filtering on the predicted pixels included in the upper horizontal predicted pixel line (for example, the one horizontal pixel line located at the uppermost position within the prediction block 1910). Although the embodiments where filtering is performed on the pixels on the upper horizontal predicted pixel line are described in the embodiments described later, the filtering method according to FIG. 19 can also be applied to a similar method when filtering is performed on the pixels on the left vertical predicted pixel line (for example, the one vertical pixel line located at the leftmost position within the prediction block 1910).

[0235] Referring to FIG. 19, the encoder and the decoder can perform filtering on the predicted pixels within the prediction block 1910, that is, the predicted pixel (B) 1920. The process of performing the filtering can correspond to the process of adding an appropriate offset value to the pixel value of the predicted pixel 1920.

[0236] The offset value can be derived based on the reference pixel. As an example, when the pixel 1920 to be filtered is the pixel located at the uppermost position within the prediction block 1910, the reference pixel used for deriving the offset value is the reference pixel (A) 1930 adjacent to the upper side of the pixel 1920 to be filtered. As another example, when the pixel to be filtered is the pixel located at the leftmost position within the prediction block 1910, the reference pixel used for deriving the offset value is the reference pixel adjacent to the left side of the pixel to be filtered. Hereinafter, an embodiment of the process of obtaining the offset value based on the reference pixel 1930 is described.

[0237] The symbolizer and the decoder can perform intra prediction on the reference pixel 1930 to obtain a predicted value of the reference pixel, that is, a predicted reference pixel value. Here, the intra prediction is a directional prediction. At this time, the symbolizer and the decoder can perform prediction on the reference pixel 1930 based on the same intra prediction mode (and / or prediction direction) 1950 as the prediction mode (and / or prediction direction) 1940 of the current block. When the position of the predicted reference pixel determined based on the prediction direction and the reference pixel of the intra prediction mode is not an integer position, the symbolizer and the decoder can perform interpolation based on the reference pixel at the integer position to obtain the predicted reference pixel value.

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

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

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

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

[0242] In the foregoing embodiments, the processes of determining whether to perform filtering, determining the filtering execution area, and determining the filter type are each described independently. However, the encoder and decoder can also combine the foregoing processes and process them in one process. At this time, the encoder and decoder can determine two or more of the processes of determining whether to perform filtering, determining the filtering execution area, and determining the filter type based on one table.

[0243] As an example, whether to perform filtering, the filtering execution area, and the filter type in the intra prediction mode are indicated by one table. At this time, the same table is stored in the encoder and decoder, and the encoder and decoder can determine whether to perform filtering, the filtering execution area, 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 to perform filtering, the filtering execution area, and the filter type in the intra prediction mode.

[0244]

Table 7

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

[0246] Also, in Table 7, when the value assigned to the filter type is 1, the filter type can indicate that the filtering execution area and the filter type in the DC mode and / or the planar mode, detailed in 1610 of FIG. 16a, are applicable. And when the value assigned to the filter type is 2, the filter type can indicate that the filtering execution area and the filter type in the vertical right mode, detailed in 1630 of FIG. 16a, are applicable. Also, when the value assigned to the filter type is 3, the filter type can indicate that the filtering execution area and the filter type in the horizontal downward mode, detailed in 1650 of FIG. 16b, are applicable.

[0247] As another example, the table shown in the detailed Table 7 can additionally include information on whether a filter can be applied depending on the block size. That is, a table including information on whether a filter can be applied in the intra prediction mode, the filter application area, and the filter type can also include information on whether a filter can be applied depending on the block size. At this time, the same table is stored in the encoder and the decoder, and the encoder and the decoder can determine whether filtering can be executed, the filtering execution area, and the filter type based on the intra prediction mode, the size of the current block (and / or the predicted block), and the stored table.

[0248] When the size of the current block and / or the predicted block is too small or too large, it is preferably not to perform filtering on the predicted block. For example, when the current block and / or the predicted block corresponds to a large block such as a 32×32 block, the correlation between pixels around and / or inside the current block is large, and in such a case, it is particularly meaningless to perform filtering on the predicted block. Therefore, the encoder and the decoder can improve the filtering efficiency by adaptively determining whether to perform filtering according to the size of the current block and / or the predicted block. Table 8 below shows an example of a table configured considering 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 can have the same meaning as in Table 7. Referring to Table 8, the encoder and the decoder can determine whether to perform filtering based on the size of the current block and / or the predicted block, and can determine whether to perform filtering, the filtering execution area, the filter type, etc. based on the intra prediction mode.

[0251] As another example, whether to perform filtering, the filtering execution area, and the filter type in the intra prediction mode are shown as in Table 9 below.

[0252] [Table 9]

[0253] FIG. 20 is a drawing for explaining the intra prediction mode and filter type applied to Table 9. 2010 in FIG. 20 shows an example of the prediction direction of the intra prediction mode and the mode values assigned to each prediction direction. The above-described example was mainly described based on the intra prediction mode (prediction direction, mode value) shown in 410 of FIG. 4a, but it is assumed that the intra prediction mode (prediction direction, mode value) shown in 2010 of FIG. 20 is used only for the example of Table 9. However, the example of Table 9 is not limited to and applied to 2010 of FIG. 20.

[0254] Referring to Table 9, when the value assigned to the filtering execution area 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 contrary, when the value assigned to the filtering execution area is not 0 and the value assigned to the filter type is not 0, the encoder and decoder can perform filtering on the prediction block.

[0255] On the other hand, Tx assigned to the filter application area indicates the x horizontal pixel lines located at the uppermost in the prediction block, that is, the upper horizontal prediction pixel lines, and Lx can indicate the x vertical pixel lines located at the leftmost in the prediction block, that is, the left vertical prediction pixel lines. Also, TxLx assigned to the filter application area can indicate an area including both the upper horizontal prediction pixel lines and the left vertical prediction pixel lines. In the example of Table 9, the value of x can be 1, 2, or 4. However, as another example, x may be a predetermined fixed value, and as an example, x may always be 1. At this time, the upper horizontal prediction pixel line may include only one horizontal pixel line, and the left vertical prediction pixel line may also include only one vertical pixel line.

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

[0257] On the one hand, in Table 9, when the value assigned to the filter type is c and Tx is assigned to the filter application area, the encoder and decoder can perform filtering based on the filtering execution area and filter type detailed in 1650 of FIG. 16b. At this time, the encoder and decoder can apply a diagonal filter of [1, 3] to the prediction pixels included in the upper horizontal prediction pixel line. Also, in Table 9, when the value assigned to the filter type is b and Lx is assigned to the filter application area, the encoder and decoder can perform filtering based on the filtering execution area and filter type detailed in 1630 of FIG. 16a. At this time, the encoder and decoder can apply a diagonal filter of [1, 3] to the prediction pixels included in the left vertical prediction pixel line.

[0258] In Table 9, when the intra prediction mode of the current block is 7 or 10, the value assigned to the filter type is d. Referring to 2020 of FIG. 20, block 2023 shows the prediction block, and the prediction direction when the intra prediction mode of the current block is 10 is shown as 2025. At this time, the filtered prediction pixel value is represented by the following Equation 9.

[0259] (Equation 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] represents the filtered predicted pixel value, and p[x, y] can represent the predicted pixel value before filtering at the (x, y) position. Also, p[x, -1] can represent the reference pixel located on the same vertical line as the predicted pixel among the upper reference pixels. Referring to Equation 9, when the intra prediction mode of the current block is 10, the encoder and decoder can perform filtering on the four uppermost horizontal pixel lines within the prediction block 2023. Even when the intra prediction mode of the current block is 7, the encoder and decoder can perform filtering on the four leftmost vertical pixel lines within the prediction block 2023 in a manner similar to Equation 9.

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

[0262] (Equation 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] represents the filtered predicted pixel value, and p[x, y] can represent the predicted pixel value before filtering at the (x, y) position. Also, p[-1, y] can represent the reference pixel located on the same horizontal line as the predicted pixel among the left reference pixels. Rp[-1, y] can represent the predicted value for the reference pixel of p[-1, y], that is, the predicted reference pixel value. The encoder and decoder can perform prediction based on the same intra prediction mode as the prediction mode of the current block for the reference pixel of p[-1, y] to derive the predicted reference pixel value.

[0264] In Table 9, when the intra prediction mode of the current block is 13, 17, 23, 31, or 32, the value assigned to the filter type is also e. Therefore, in this case as well, the encoder and decoder can perform filtering in a manner similar to 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 embodiments. That is, the filters applied according to the values assigned to each filter type can be changed according to implementation and / or necessity, and the applicability of the filter can also be set to be different from that of the above-described embodiments.

[0266] Hereinafter, an embodiment of the process of performing filtering on predicted pixels according to the present invention will be specifically described. In the embodiment described below, the input is IntraPredMode, nS, p[x,y] (x, y = -1,..., nS), and predSamples[x,y] (x, y = 0,..., nS - 1), and the 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 sizes of the prediction block, p[x,y] (x, y = -1,..., nS) indicates the pixel values of the reference pixels located around the current block. Also, predSamples[x,y] (x, y = 0,..., nS - 1) indicates the predicted pixel values, and predSamplesF[x,y] (x, y = 0,..., nS - 1) indicates the filtered predicted pixel values.

[0267] At this time, whether filtering can be 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 the filter type information applied to the prediction block. At this time, the filter type information can also include both information on whether filtering can be performed, the filtering execution area, and the filter type. Also, intraPostFilterType may be indicated as intraPostFilterType[IntraPredMode], which can mean that the value assigned to intraPostFilterType is determined by IntraPredMode.

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

[0271] If the value assigned to intraPostFilterType[IntraPredMode] is 1, the encoder and decoder can derive the predSamplesF[x,y] value by the following Equation 11.

[0272] (Equation 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] When the value assigned to intraPostFilterType[IntraPredMode] is 2, the encoder and decoder can derive the predSamplesF[x, y] value according to the following Equation 12.

[0274] (Equation 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] When the value assigned to intraPostFilterType[IntraPredMode] is 3, the encoder and decoder can derive the predSamplesF[x, y] value according to the following Equation 13.

[0276] (Equation 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] When the value assigned to intraPostFilterType[IntraPredMode] is 0, the encoder and decoder can derive the predSamplesF[x, y] value according to the following Equation 14.

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

[0279] For all the methods described in detail (e.g., the method of performing filtering), the encoder and decoder can be set to have different application ranges according to the size and / or depth of the current block (and / or the prediction block). For example, the application range of the present invention may be set to be different according to the size of the PU and / or the size of the TU, or may be set to be different according to the depth value of the CU.

[0280] At this time, the encoder and decoder can use the size of the block and / or the depth value of the block as variables to determine the application range of the present invention. Here, the block can correspond to a CU, a PU, and / or a TU. As an example, when the size value of the block is used as a variable, the encoder and decoder can also apply the present invention only to blocks having a size greater than the variable, and as another example, the present invention can also be applied only to blocks having a size less than the variable. Also, the encoder and decoder can apply the present invention only to blocks having a size corresponding to the variable value.

[0281] Table 11 below shows an example of the application range of the present invention when the size value of the block used as a variable for determining the application range of the present invention is 16×16. In Table 11, O indicates that the present invention is applied to the corresponding block size, and X can indicate that the present invention is not applied 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 greater than or equal to the block size (16×16) 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 less than or equal to the block size (16×16) used as a variable. Also, 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 (16×16) used as a variable.

[0284] On the other hand, as an example, the variable value (block size value and / or block depth value) for determining the application range of the present invention may be a predetermined fixed value. At this time, the variable value is 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 value.

[0285] As another example, the variable value for determining the application range of the present invention can also vary depending on the profile or level. When the variable value is determined based on the profile, the variable value corresponding to each profile may be a predetermined fixed value, and when the variable value is determined based on the level, the variable value corresponding to each level may be a predetermined fixed value.

[0286] As another example, the variable values (block size value and / or block depth value) for determining the scope of application of the present invention can be determined by an encoder. At this time, the encoder can encode information on the variable values and transmit it to a decoder via a bitstream. The variable value information transmitted via the bitstream can be included in a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, etc. The decoder can derive the variable values from the received bitstream and determine the scope of application of the present invention based on the derived variable values.

[0287] At this time, 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 scope of application of the present invention corresponds to the 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 32×32, the value assigned to the indicator is 3, and when the variable value is 4×4, 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 scope of application of the present invention corresponds to the 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, when the value assigned to the indicator is 0, the present invention can be applied to blocks having a size of 64×64 or more, when the value assigned to the indicator is 1, the present invention can be applied to blocks having a size of 32×32 or more, and when the value assigned to the indicator is 4, the present invention can be applied to blocks having a size of 4×4 or more.

[0288] On the other hand, the encoder can also decide not to apply the present invention to all block sizes. At this time, the encoder can use a predetermined indicator to send the determined information to the decoder. As an example, the encoder can include an indicator such as intra_prediction_filtering_enable_flag in the SPS, PPS, and / or slice header and send it to the decoder. Here, intra_prediction_filtering_enable_flag can correspond to an indicator that indicates whether the present invention is applied to all blocks within a sequence, picture, and / or slice. As another example, the encoder can use an indicator (e.g., intra_prediction_filtering_enable_max_cu_depth) that indicates the variable value information described in detail and also send information indicating that the present invention is not applied to all block sizes to the decoder. At this time, as an example, the encoder can show that the present invention is not applied to all block sizes by assigning a value (e.g., 5) that indicates a block size (e.g., 2×2 size) that is not valid (and / or not allowed) for the indicator.

[0289] According to the above-described embodiments, the present invention can reduce the prediction error that occurs during intra prediction, minimize the discontinuity between blocks, and improve the prediction efficiency and coding efficiency.

[0290] In the above-described embodiments, the method is described based on a sequence diagram in a series of steps or blocks, but the present invention is not limited to the order of the steps, and a certain step can occur in a different order or simultaneously with a step different from the above. Also, those with ordinary knowledge in the art can understand that the steps shown in the sequence diagram are not exclusive, other steps are included, or one or more steps in the sequence diagram can be deleted without affecting the scope of the present invention.

[0291] The foregoing embodiments include examples of various aspects. Although it is not possible to describe all possible combinations for showing the various aspects, those having ordinary knowledge in the relevant technical field can recognize that other combinations are possible. Therefore, the present invention includes all alternatives, modifications, and variations that fall within the scope of the claims.

Claims

1. 1. A method of decoding a 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 differential block corresponding to the current block; Equipped with A prediction value of a prediction pixel of the prediction block is generated using reference pixels during the intra prediction; the prediction pixel is located in a left vertical pixel line of the prediction block or a topmost horizontal pixel line of the prediction block; The method of claim 1, wherein the reference pixel is located in a vertical reference pixel line adjacent to a left side of the prediction block.

2. The method of claim 1, wherein the coefficients of the reference pixels are determined based on a size of the current block.

3. 3. The method of claim 2, wherein if the prediction pixel is the bottommost and leftmost pixel in the prediction block, the reference pixel diagonally adjacent to the lower left corner of the prediction block is used for the intra prediction.

4. 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 inter-prediction block in the planar mode.

5. The method of claim 4, wherein the use of the filter is determined based on a size of the current block.

6. 5. The method of claim 4, wherein the prediction pixel and the reference pixel are located on one horizontal line.

7. 1. A method of encoding video, comprising the steps of: performing intra prediction on the current block to generate a predicted block; generating a reconstructed block based on the predicted block and a reconstructed differential block corresponding to the current block; Equipped with A prediction value of a prediction pixel of the prediction block is generated using reference pixels during the intra prediction; the prediction pixel is located in a left vertical pixel line of the prediction block or a topmost horizontal pixel line of the prediction block; The image encoding method, wherein the reference pixel is located in a vertical reference pixel line adjacent to the left side of the prediction block.

8. The image encoding method of claim 7, wherein the coefficients of the reference pixels are determined based on a size of the current block.

9. 9. The video encoding method of claim 8, wherein if the prediction pixel is the bottommost and leftmost pixel in the prediction block, the reference pixel diagonally adjacent to the lower left corner of the prediction block is used for the intra prediction.

10. an intra-prediction mode of the intra-prediction is a planar mode; The video encoding method of claim 7 , 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.

11. The image encoding method of claim 10, wherein the use of the filter is determined based on a size of the current block.

12. The image encoding method of claim 10, wherein the prediction pixel and the reference pixel are located on one horizontal line.

13. A computer-readable recording medium storing a bitstream, the bitstream comprising: Prediction mode information indicating an intra-prediction mode of a current block is provided, a prediction block is generated by performing intra prediction on the current block using the prediction mode information; a reconstructed block is generated based on the predicted block and a reconstructed difference block corresponding to the current block; A prediction value of a prediction pixel of the prediction block is generated using reference pixels during the intra prediction; the prediction pixel is located in a left vertical pixel line of the prediction block or a topmost horizontal pixel line of the prediction block; The computer-readable storage medium according to claim 1, wherein the reference pixel is located in a vertical reference pixel line adjacent to a left side of the prediction block.

14. The computer-readable medium of claim 13, wherein the coefficients of the reference pixels are determined based on a size of the current block.

15. the intra prediction mode is a planar mode, The computer-readable storage medium of claim 13, 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 planar mode.

16. A computer-readable recording medium storing a bitstream generated by a video encoding device that executes a video encoding method, the video encoding method 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 differential block corresponding to the current block; storing a bitstream including prediction mode information indicating an intra-prediction mode for the current block; Equipped with During the intra prediction, a prediction value of a predicted pixel of the prediction block is generated using a reference pixel; the prediction pixel is located in a left vertical pixel line of the prediction block or a topmost horizontal pixel line of the prediction block; The computer-readable storage medium according to claim 1, wherein the reference pixel is located in a vertical reference pixel line adjacent to a left side of the prediction block.

17. The computer-readable medium of claim 16, wherein the coefficients of the reference pixels are determined based on a size of the current block.

18. the intra prediction mode is a planar mode, The computer-readable medium of claim 16, wherein the prediction block is generated based on a filter that uses the reference pixels and inter-predicted pixels of the inter-predicted block of the planar mode.

19. 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; Run the command, A prediction value of a prediction pixel of the prediction block is generated using a reference pixel during the intra prediction; the prediction pixel is located in a left vertical pixel line of the prediction block or a topmost horizontal pixel line of the prediction block; The computer-readable storage medium according to claim 1, wherein the reference pixel is located in a vertical reference pixel line adjacent to a left side of the prediction block.

20. The computer-readable medium of claim 19, wherein the coefficients of the reference pixels are determined based on a size of the current block.

21. the intra prediction mode is a planar mode, 20. The computer-readable storage medium of claim 19, wherein the prediction block is generated based on a filter using the reference pixels and an inter-predicted pixel of the inter-predicted block in planar mode.

22. 1. A method for transmitting a bitstream, the bitstream being generated by an image coding device, the method comprising the steps of: 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 prediction value of a prediction pixel of the prediction block is generated using a reference pixel during the intra prediction; the prediction pixel is located in a left vertical pixel line of the prediction block or a topmost horizontal pixel line of the prediction block; 11. A method for transmitting a bitstream, wherein the reference pixels are located in a vertical reference pixel line adjacent to the left side of the prediction block.

23. The method of claim 22, wherein the coefficients of the reference pixels are determined based on a size of the current block.

24. 24. The method of transmitting a bitstream as claimed in claim 23, characterized in that if the predicted pixel is the bottommost and leftmost pixel in the predicted block, the reference pixel diagonally adjacent to the lower left corner of the predicted block is used for the intra prediction.

25. an intra prediction mode of the intra prediction is a planar mode; The method of claim 22, wherein the prediction block is generated based on a filter using the reference pixels and inter-predicted pixels of the inter-predicted block of the planar mode.

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

27. 26. The method of claim 25, wherein the prediction 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