Video encoding / decoding method and device
Patent Information
- Application Number
- JP2023033845
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2012-06-20
- Filing Date
- 2023-03-06
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2032-06-20
AI Technical Summary
【0029】 本発明による映像符号化方法によると、映像符号化/復号化効率が向上することができる。
Smart Images

Figure 0007642003000012 
Figure 0007642003000013 
Figure 0007642003000014
Abstract
Description
[Technical field]
[0001] The present invention relates to video processing, and more particularly to an intra prediction method and apparatus thereof. [Background technology]
[0002] Recently, as broadcasting services with HD (High Definition) resolution are expanding not only in Korea but also around the world, many users are becoming accustomed to high-resolution, high-quality images, and as a result, many organizations are spurring the development of next-generation imaging devices. In addition, interest in UHD (Ultra High Definition), which has a resolution four times that of HDTV, is growing along with HDTV, and compression techniques for higher resolution, higher quality images are being demanded.
[0003] For video compression, techniques such as inter prediction, which predicts pixel values contained in a current picture from previous and / or subsequent pictures, intra prediction, which predicts pixel values contained in a current picture using pixel information within the current picture, and entropy coding, which assigns short codes to symbols that occur frequently and long codes to symbols that occur less frequently, can be used. Summary of the Invention [Problem to be solved by the invention]
[0004] An object of the present invention is to provide a video encoding method and apparatus capable of improving video encoding / decoding efficiency.
[0005] Another technical object of the present invention is to provide a video decoding method and apparatus capable of improving video encoding / decoding efficiency.
[0006] Another technical object of the present invention is to provide a method and apparatus for generating a predicted block capable of improving video encoding / decoding efficiency.
[0007] Another technical object of the present invention is to provide an intra prediction method and apparatus capable of improving video encoding / decoding efficiency.
[0008] Another technical object of the present invention is to provide a filtering method and apparatus capable of improving video encoding / decoding efficiency. [Means for solving the problem]
[0009] An embodiment of the present invention is a video decoding method, comprising the steps of: performing intra prediction on a current block to generate a predicted block; performing filtering on a pixel to be filtered in the predicted block based on an intra prediction mode of the current block to generate a final predicted block; and generating a reconstructed block based on a reconstructed differential block (hereinafter, the differential block may be used interchangeably with a residual block) corresponding to the current block and the final predicted block, the pixel to be filtered is a predicted pixel included in a region to be filtered in the predicted block, and a filter type applied to the pixel to be filtered and the region to be filtered are determined based on the intra prediction mode of the current block.
[0010] When the intra prediction mode of the current block is DC mode, the filtering target area includes a left vertical predicted pixel line, which is a vertical pixel line located at the leftmost position in the prediction block, and an upper horizontal predicted pixel line, which is a horizontal pixel line located at the topmost position in the prediction block.
[0011] In the final predicted block generating step, if the current block is a luma component block, filtering is performed, and if the current block is a chroma component block, filtering is not performed.
[0012] The filter type includes information on a filter shape, a filter tap, and a number of filter coefficients, and in the final predicted 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 a left-side upper predicted pixel located at the uppermost left side in the predicted block, in the final predicted block generation step, filtering is performed 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, wherein the upper reference pixel and the left reference pixel are reconstructed reference pixels adjacent to the current block, respectively, and in the 3-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 2 / 4, a filter coefficient assigned to a filter tap corresponding to the upper reference pixel is 1 / 4, and a filter coefficient assigned to a filter tap corresponding to the left reference pixel is 1 / 4.
[0014] If the pixel to be filtered is a predicted pixel included in the left vertical predicted pixel line and is not the left upper predicted pixel, in the final predicted block generation step, filtering is performed on the pixel to be filtered by applying a horizontal 2-tap filter based on the pixel to be filtered and a left reference pixel adjacent to the left side of the pixel to be filtered, the left reference pixel being a reconstructed reference pixel adjacent to the current block, and in the horizontal 2-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 3 / 4, and a filter coefficient assigned to a filter tap corresponding to the left reference pixel is 1 / 4.
[0015] If the pixel to be filtered is a predicted pixel included in the upper horizontal predicted pixel line and is not the left upper predicted pixel, in the final predicted block generation step, filtering is performed on the pixel to be filtered by applying a vertical 2-tap filter based on the pixel to be filtered and an upper reference pixel adjacent to the upper side of the pixel to be filtered, the upper reference pixel being a reconstructed reference pixel adjacent to the current block, and in the vertical 2-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 3 / 4, and a filter coefficient assigned to a filter tap corresponding to the upper reference pixel is 1 / 4.
[0016] Another embodiment of the present invention is a video decoding method, comprising: generating a predicted block by performing a prediction on a pixel to be predicted in a current block based on an intra prediction mode of the current block; and generating a reconstructed block based on a reconstructed differential block corresponding to the current block and the final predicted block, wherein the predicted block generating step performs a prediction on the pixel to be predicted based on a first offset if the intra prediction mode of the current block is a vertical mode and the pixel to be predicted is a pixel on a left vertical pixel line, and performs a prediction on the pixel to be predicted based on a second offset if the intra prediction mode of the current block is a horizontal mode and the pixel to be predicted is a pixel on an upper horizontal pixel line, the left vertical pixel line being a vertical pixel line located at the leftmost position in the current block, and the upper horizontal pixel line being a horizontal pixel line located at the topmost position in the current block.
[0017] In the prediction block generation step, when the intra prediction mode of the current block is a vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, a predicted value of the pixel to be predicted is derived by adding the first offset value to a pixel value of a first reference pixel that is on the same vertical line as the pixel to be predicted among the restored reference pixels adjacent to the upper side of the current block, and the first offset value is determined based on a difference value between a pixel value of a second reference pixel adjacent to the left side of the pixel to be predicted and a pixel value of a third reference pixel adjacent to the left side of the first reference pixel.
[0018] In the prediction block generating step, if the current block is a chroma component block, a pixel value of the first reference pixel is determined as a prediction value of the pixel to be predicted.
[0019] In the prediction block generation step, when the intra prediction mode of the current block is a horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, a prediction value of the pixel to be predicted is derived by adding the second offset value to a pixel value of a first reference pixel that is on the same horizontal line as the pixel to be predicted among the restored reference pixels adjacent to the left side of the current block, and the second offset value is determined based on a difference value between a pixel value of a second reference pixel adjacent to the upper side of the pixel to be predicted and a pixel value of a third reference pixel adjacent to the upper side of the first reference pixel.
[0020] In the prediction block generating step, if the current block is a chroma component block, a pixel value of the first reference pixel is determined as a prediction value of the pixel to be predicted.
[0021] Another embodiment of the present invention is a video decoding apparatus, comprising: a prediction block generator for generating a prediction block by performing intra prediction on a current block, a filter unit for generating a final prediction block by performing filtering on a filtering target pixel in the prediction block based on an intra prediction mode of the current block, and a reconstructed block generator for generating a reconstructed block based on a reconstructed difference block corresponding to the current block and the final prediction block, the filtering target pixel is a prediction pixel included in a filtering target area in the prediction block, and a filter type applied to the filtering target pixel and the filtering target area are determined based on the intra prediction mode of the current block.
[0022] When the intra prediction mode of the current block is DC mode, the filtering target area includes a left vertical predicted pixel line, which is a vertical pixel line located at the leftmost position in the prediction block, and an upper horizontal predicted pixel line, which is a horizontal pixel line located at the topmost position in the prediction block.
[0023] When the pixel to be filtered is a left-side upper predicted pixel located at the uppermost left side in the predicted block, the filter unit performs filtering on the pixel to be filtered by applying a 3-tap filter based on the pixel to be filtered, an upper reference pixel adjacent to the upper side of the pixel to be filtered, and a left reference pixel adjacent to the left side of the pixel to be filtered, wherein the upper reference pixel and the left reference pixel are reconstructed reference pixels adjacent to the current block, respectively, and in the 3-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 2 / 4, a filter coefficient assigned to a filter tap corresponding to the upper reference pixel is 1 / 4, and a filter coefficient assigned to a filter tap corresponding to the left reference pixel is 1 / 4.
[0024] If the pixel to be filtered is a predicted pixel included in the left vertical predicted pixel line and is not the left upper predicted pixel, the filter unit performs filtering on the pixel to be filtered by applying a horizontal 2-tap filter based on the pixel to be filtered and a left reference pixel adjacent to the left side of the pixel to be filtered, the left reference pixel being a reconstructed reference pixel adjacent to the current block, and in the horizontal 2-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 3 / 4, and a filter coefficient assigned to a filter tap corresponding to the left reference pixel is 1 / 4.
[0025] When the pixel to be filtered is a predicted pixel included in the upper horizontal predicted pixel line and is not the left upper predicted pixel, the filter unit performs filtering on the pixel to be filtered by applying a vertical 2-tap filter based on the pixel to be filtered and an upper reference pixel adjacent to the upper side of the pixel to be filtered, the upper reference pixel being a reconstructed reference pixel adjacent to the current block, and in the vertical 2-tap filter, a filter coefficient assigned to a filter tap corresponding to the pixel to be filtered is 3 / 4, and a filter coefficient assigned to a filter tap corresponding to the upper reference pixel is 1 / 4.
[0026] Another embodiment of the present invention is a video decoding apparatus, comprising: a prediction block generator configured to generate a prediction block by performing prediction on a pixel to be predicted in a current block based on an intra prediction mode of the current block, and a reconstructed block generator configured to generate a reconstructed block based on a reconstructed difference block corresponding to the current block and the final prediction block, the prediction block generator configured to perform prediction on the pixel to be predicted based on a first offset when an intra prediction mode of the current block is a vertical mode and the pixel to be predicted is a pixel on a left vertical pixel line, and to perform prediction on the pixel to be predicted based on a second offset when an intra prediction mode of the current block is a horizontal mode and the pixel to be predicted is a pixel on an upper horizontal pixel line, the left vertical pixel line being a vertical pixel line located at the leftmost position in the current block, and the upper horizontal pixel line being a horizontal pixel line located at the topmost position in the current block.
[0027] When the intra prediction mode of the current block is a vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, the prediction block generation unit derives a prediction value of the pixel to be predicted by adding the first offset value to a pixel value of a first reference pixel that is on the same vertical line as the pixel to be predicted among the restored reference pixels adjacent to the upper side of the current block, and the first offset value is determined based on a difference value between a pixel value of a second reference pixel adjacent to the left side of the pixel to be predicted and a pixel value of a third reference pixel adjacent to the left side of the first reference pixel.
[0028] When the intra prediction mode of the current block is a horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, the prediction block generation unit derives a prediction value of the pixel to be predicted by adding the second offset value to a pixel value of a first reference pixel that is on the same horizontal line as the pixel to be predicted among reconstructed reference pixels adjacent to the left side of the current block, and the second offset value is determined based on a difference value between a pixel value of a second reference pixel adjacent to the upper side of the pixel to be predicted and a pixel value of a third reference pixel adjacent to the upper side of the first reference pixel. Effect of the Invention
[0029] According to the video encoding method of the present invention, video encoding / decoding efficiency can be improved.
[0030] According to the video decoding method according to the present invention, video encoding / decoding efficiency can be improved.
[0031] According to the method for generating a predicted block according to the present invention, video encoding / decoding efficiency can be improved.
[0032] According to the intra prediction method according to the present invention, video encoding / decoding efficiency can be improved.
[0033] According to the filtering method according to the present invention, video encoding / decoding efficiency can be improved. [Brief description of the drawings]
[0034] [Figure 1] 1 is a block diagram showing a configuration of an embodiment of a video encoding device to which the present invention is applied; [Diagram 2] 1 is a block diagram showing a configuration of an embodiment of a video decoding device to which the present invention is applied; [Diagram 3] FIG. 1 is a conceptual diagram illustrating an embodiment in which one unit is divided into multiple sub-units; [Figure 4a] 1 is a diagram illustrating an embodiment of an intra prediction process; [Figure 4b] 1 is a diagram illustrating an embodiment of an intra prediction process; [Diagram 5] 1 illustrates a schematic diagram of an embodiment of an intra prediction method in planar mode. [Figure 6] 1 is a flowchart illustrating an example of a video encoding method according to the present invention. [Figure 7] 13 shows a schematic diagram of an embodiment of the detailed difference block generation process. [Figure 8] 2 is a flowchart illustrating an example of a video decoding method according to the present invention. [Figure 9] 13 shows a schematic diagram of an embodiment of the detailed difference block generation process. [Figure 10] 2 is a flow chart illustrating an example of a method for performing filtering according to the present invention; [Figure 11] 10 illustrates an example of a method for determining whether to perform filtering based on coding parameters of neighboring blocks of a current block. [Figure 12] 10A and 10B illustrate an embodiment of a method for determining whether to perform filtering based on information on whether neighboring blocks adjacent to a current block exist (and / or whether the neighboring blocks are available). [Figure 13]4 illustrates an example of a method for determining a filtering execution region based on an intra-prediction mode of a current block; [Figure 14] 1 illustrates a schematic diagram of an embodiment of a method for determining a filtering execution region based on a size and / or depth of a current block; [Figure 15] 1 illustrates an example of a method for determining a filtering execution region based on coding modes of neighboring blocks adjacent to a current block; [Figure 16a] 13 illustrates an embodiment of a method for determining a filter type according to an intra-prediction mode of a current block. [Figure 16b] 13 illustrates an embodiment of a method for determining a filter type according to an intra-prediction mode of a current block. [Figure 17] A simplified method for determining a filter type according to the embodiment of Figs. 16a and 16b is shown. [Figure 18] 10A and 10B illustrate schematic examples of filter types that may be applied when the prediction mode of the current block is a vertical mode and / or a horizontal mode. [Figure 19] 3 shows diagrammatically another embodiment of a filter type according to the invention; [Figure 20] 13 is a diagram for explaining intra prediction modes and filter types applied to Table 9. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0035] Hereinafter, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing the embodiments of the present invention, if a detailed description of related known configurations or functions is determined to obscure the gist of the present specification, the detailed description will be omitted.
[0036] When a component is described as being "coupled" or "connected" to another component, it should be understood that the component may be directly coupled or connected to the other component, but there may be other components in between. In addition, in the present invention, the content of the description "including" a specific component does not exclude components other than the component, but means that additional components may be included in the implementation of the present invention or within the scope of the technical idea of the present invention.
[0037] Terms such as "first" and "second" may be used to describe various components, but the components should not be limited by the terms. The terms are used only to distinguish one component from another. For example, a first component may be named a second component, and similarly, a second component may be named a first component, without departing from the scope of the present invention.
[0038] In addition, components shown in the embodiments of the present invention are illustrated independently to show different characteristic functions, and do not mean that each component is configured as a separate hardware or software unit. That is, each component is included as a list of components for convenience of explanation, and at least two components among each component may be integrated to form one component, or one component may be divided into a plurality of components to perform a function, and such integrated and separated embodiments of each component are included in the scope of the present invention as long as they do not deviate from the essence of the present invention.
[0039] In addition, some components are not essential components for performing essential functions in the present invention, but are optional components merely for improving performance. The present invention may be embodied including only components essential for embodying the essence of the present invention, excluding components merely used for improving performance, and a structure including only essential components, excluding optional components merely used for improving performance, is also included in the scope of the present invention.
[0040] FIG. 1 is a block diagram showing a configuration according to an embodiment of a video encoding device to which the present invention is applied.
[0041] Referring to FIG. 1, the video encoding device 100 includes a motion prediction unit 111, a motion compensation unit 112, an intra prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.
[0042] The video encoding device 100 may perform encoding in an intra mode or an inter mode on an input image and output a bitstream. Intra prediction means prediction within a frame, and inter prediction means prediction between frames. In the case of an intra mode, the switch 115 may be switched to intra, and in the case of an inter mode, the switch 115 may be switched to inter. The video encoding device 100 may generate a prediction block for an input block of an input image, and then encode a residual between the input block and the prediction block.
[0043] In the case of the intra mode, the intra prediction unit 120 may generate a prediction block by performing spatial prediction using pixel values of already-encoded blocks surrounding the current block.
[0044] In the case of an inter mode, the motion prediction unit 111 may obtain a motion vector by searching for an area that best matches an input block in a reference image stored in the reference picture buffer 190 during the motion prediction process. The motion compensation unit 112 may generate a prediction block by performing motion compensation using the motion vector. Here, the motion vector is a two-dimensional vector used in inter prediction and may indicate an offset between a current image to be encoded / decoded and a reference image.
[0045] The subtractor 125 may generate a residual block based on the difference between the input block and the generated prediction block. The transform unit 130 may output a transform coefficient by performing a transform on the residual block. The quantization unit 140 may quantize the input transform coefficient based on a quantization parameter and output a quantized coefficient.
[0046] The entropy coding unit 150 can output a bit stream by performing entropy coding based on the value calculated by the quantization unit 140 or the coding parameter value calculated during the coding process.
[0047] When entropy coding is applied, a smaller number of bits are assigned to symbols having a higher occurrence probability, and a larger number of bits are assigned to symbols having a lower occurrence probability to represent the symbols, thereby reducing the size of the bit string for the symbol to be coded. Therefore, the compression performance of the video coding can be improved through the entropy coding. The entropy coding unit 150 can use coding methods such as exponential golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) for the entropy coding.
[0048] Since the video encoding apparatus according to the embodiment of Fig. 1 performs inter-prediction encoding, i.e., inter-frame predictive encoding, a currently encoded image needs to be decoded and stored to be used as a reference image. Therefore, the quantized coefficients are inverse quantized by the inverse quantization unit 160 and inverse transformed by the inverse transform unit 170. The inverse quantized and inverse transformed coefficients are added to the predicted block via the adder 175 to generate a reconstructed block.
[0049] The reconstructed block passes through a filter unit 180, which may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or the reconstructed picture. The filter unit 180 may also be called an adaptive in-loop filter. The deblocking filter may remove block distortion that occurs at the boundary between blocks. The SAO may add an appropriate offset value to pixel values to compensate for coding errors. The ALF may perform filtering based on a value obtained by comparing a reconstructed image with an original image. The reconstructed block that has passed through the filter unit 180 may be stored in a reference picture buffer 190.
[0050] FIG. 2 is a block diagram showing a configuration according to an embodiment of a video decoding device to which the present invention is applied.
[0051] 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 may receive a bitstream output from an encoder and perform decoding in an intra mode or an inter mode to output a reconstructed image, i.e., a restored image. In the intra mode, a switch may be converted to intra, and in the inter mode, a switch may be converted to inter. The video decoding apparatus 200 may obtain a residual block from the input bitstream to generate a prediction block, and may then generate a reconstructed block, i.e., a restored block, by adding the residual block and the prediction block.
[0053] The entropy decoding unit 210 may entropy decode an input bit stream according to a probability distribution to generate symbols including symbols in the form of quantized coefficients. The entropy decoding method is similar to the entropy coding method described above.
[0054] When the entropy decoding method is applied, a smaller number of bits are assigned to symbols having a higher occurrence probability, and a larger number of bits are assigned to symbols having a lower occurrence probability to represent the symbols, thereby reducing the size of the bit string for each symbol. Therefore, the compression performance of the image decoding can be improved through the entropy decoding method.
[0055] The quantized coefficients are inverse quantized in the inverse quantization unit 220 and inverse transformed in the inverse transform unit 230, and a residual block may be generated as a result of the inverse quantization / inverse transformation of the quantized coefficients.
[0056] In the case of the intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values of already-encoded blocks surrounding the current block. In the case of the inter mode, the motion compensation unit 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270.
[0057] The residual block and the prediction block are added via an adder 255, and the added block may pass through a filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, SAO, and ALF to the reconstructed block or the reconstructed picture. The filter unit 260 may output a reconstructed image, i.e., a reconstructed image. The reconstructed image may be stored in a reference picture buffer 270 and used for inter prediction.
[0058] Hereinafter, a unit refers to a unit of video encoding and decoding. A unit of encoding or decoding during video encoding and decoding refers to a divided unit when an image is divided and encoded or decoded, and may be called a coding unit (CU), a prediction unit (PU), a transform unit (TU), etc. Also, a unit in the embodiment described below may be called a block. One unit may be divided into smaller subunits.
[0059] FIG. 3 is a conceptual diagram illustrating an embodiment in which one unit is divided into multiple sub-units.
[0060] A unit may be hierarchically divided with depth information under a tree structure. Each divided subunit may have depth information. The depth information may include information on the size of the subunit to indicate the number and / or degree to which the unit is divided.
[0061] Referring to 310 in Figure 3, the most upper node may be called a root node and may have the smallest depth value, in which case the most upper node may have a depth of level 0 and may indicate the first unit that is not divided.
[0062] A lower node having a depth of level 1 may indicate a unit in which the original unit is divided once, and a lower node having a depth of level 2 may indicate a unit in which the original unit is divided twice. For example, in 320 of FIG. 3, unit a corresponding to node a is a unit in which the original unit is divided once, and may have a depth of level 1.
[0063] A leaf node at level 3 may indicate a unit that is a result of dividing the first unit three times. For example, in 320 of FIG. 3, unit d corresponding to node d is a unit that is a result of dividing the first unit three times, and may have a depth of level 3. Therefore, the leaf node at level 3, which is the lowest node, may have the deepest depth.
[0064] In the following embodiments, a current block to be coded / decoded may be referred to as a current block, and when intra prediction is performed on a current block to be coded / decoded, the current block to be coded / decoded may be referred to as a predicted block.
[0065] Meanwhile, an image signal may generally include three color signals representing three primary color components of light. The three color signals representing the three primary color components of light are R (Red), G (Green), and B (Blue). The R, G, and B signals may be converted into one luma signal and two chroma signals in order to reduce a frequency band used for image processing. In this case, one image signal may include one luma signal and two chroma signals. Here, the luma signal is a component representing the brightness of a screen and corresponds to Y, and the chroma signal is a component representing the color of a screen and may 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 signal by using this characteristic, the frequency band used for image processing may be reduced. In the following embodiment, a block having a luma component is called a luma block, and a block having a chroma component is called a chroma block.
[0066] 4a and 4b are diagrams for explaining an embodiment of an intra prediction process. 410 and 420 in FIG. 4a show an embodiment of prediction directions of intra prediction modes and mode values assigned to each prediction direction. Also, 430 in FIG. 4b shows the positions of reference pixels used in intra prediction of a block to be encoded / decoded. A pixel may have the same meaning as a sample, and in the embodiments described below, a pixel may be called a sample in some cases.
[0067] As described in detail in the embodiments of FIG. 1 and FIG. 2, the encoder and decoder may generate a prediction block by performing intra prediction based on pixel information in a current picture. That is, when performing intra prediction, the encoder and decoder may perform directional prediction and / or non-directional prediction based on at least one restored reference pixel. Here, the prediction block refers to a block generated as a result of performing intra prediction. The prediction block may correspond to at least one of a coding unit (CU), a prediction unit (PU), and a transform unit (TU). In addition, the prediction block may be a square block having a size of 2×2, 4×4, 8×8, 16×16, 32×32, or 64×64, or may be a rectangular block having a size of 2×8, 4×8, 2×16, 4×16, or 8×16.
[0068] Meanwhile, intra prediction may be performed according to the intra prediction mode of the current block. The number of intra prediction modes that the current block may have may be a predetermined fixed value, or may be a value that is determined differently according to the size of the prediction block. For example, the number of intra prediction modes that the current block may have may be 3, 5, 9, 17, 34, 35, 36, etc.
[0069] 4A shows an example of prediction directions of intra-prediction modes and mode values assigned to each prediction direction. In FIG. 4A, 410, the numbers assigned to each intra-prediction mode may indicate the mode value.
[0070] Referring to 410 of Fig. 4a, for example, in a vertical mode where the mode value is 0, prediction may be performed vertically based on a pixel value of a reference pixel, and in a horizontal mode where the mode value is 1, prediction may be performed horizontally based on a pixel value of a reference pixel. Even in the case of a directional mode other than the detailed modes, the encoder and decoder may perform intra prediction using a reference pixel according to a corresponding angle.
[0071] In 410 of FIG. 4a, an intra prediction mode having a mode value of 2 may be referred to as a DC mode, and an intra prediction mode having a mode value of 34 may be referred to as a planar mode. The DC mode and the planar mode may correspond to non-directional modes. For example, in the case of the DC mode, a prediction block may be generated by averaging pixel values of a plurality of reference pixels. An example of a method for generating each prediction pixel in a prediction block in the planar mode will be described later with reference to FIG. 5.
[0072] The number of intra prediction modes and / or mode values assigned to each intra prediction mode are not limited to the above-mentioned embodiment, and may be determined differently according to implementation and / or need. For example, the prediction direction of the intra prediction mode and the mode value assigned to each prediction mode may be determined as 420 in Fig. 4a, which is different from 410 in Fig. 4a. In the following embodiment, for 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 specified.
[0073] In addition, hereinafter, an intra prediction mode located to the right of a vertical mode is referred to as a vertical-right mode, and an intra prediction mode located below a horizontal mode is referred to as a horizontal-below mode. For example, in 410 of FIG. 4a, intra prediction modes having mode values of 5, 6, 12, 13, 22, 23, 24, and 25 may correspond to a vertical-right mode 413, and intra prediction modes having mode values of 8, 9, 16, 17, 30, 31, 32, and 33 may correspond to a horizontal-below mode 416.
[0074] Meanwhile, referring to 430 in FIG. 4b, reconstructed reference pixels used for intra prediction of the current block include, for example, a below-left reference pixel 431, a left reference pixel 433, an above-left corner reference pixel 435, an above reference pixel 437, and an above-right reference pixel 439. Here, the left reference pixel 433 refers to a reconstructed reference pixel adjacent to the left outside the current block, the above reference pixel 437 refers to a reconstructed reference pixel adjacent to the upper side outside the current block, and the upper-left corner reference pixel 435 refers to a reconstructed reference pixel located at the upper left corner outside the current block. In addition, the lower left reference pixel 431 refers to a reference pixel located below the left pixel line composed of the left reference pixels 433 among pixels located on the same line as the left pixel line, and the upper right reference pixel 439 refers to a reference pixel located to the right of the upper pixel line among pixels located on the same line as the upper pixel line composed of the upper reference pixels 437. The names of the reference pixels detailed in this specification may be equally applied to other embodiments described later.
[0075] The reference pixels used for intra prediction of the current block may vary depending on the intra prediction mode of the current block. For example, when the intra prediction mode of the current block is a vertical mode (intra prediction mode with a mode value of 0 in 410 of FIG. 4a), the upper reference pixel 437 may be used for intra prediction, and when the intra prediction mode of the current block is a horizontal mode (intra prediction mode with a mode value of 1 in 410 of FIG. 4a), the left reference pixel 433 may be used for intra prediction. Also, when an intra prediction mode with a mode value of 13 is used, the upper right reference pixel 439 may be used for intra prediction, and when an intra prediction mode with a mode value of 7 is used, the lower left reference pixel 431 may be used for intra prediction.
[0076] When the position of a reference pixel determined based on the prediction direction of an intra prediction mode and a pixel to be predicted is an integer position, the encoder and decoder may determine the reference pixel value of the corresponding position as a predicted pixel value for the pixel to be predicted. When the position of a reference pixel determined based on the prediction direction of an intra prediction mode and a pixel to be predicted is not an integer position, the encoder and decoder may generate an interpolated reference pixel based on the reference pixel at the integer position and determine the pixel value of the interpolated reference pixel as a predicted pixel value.
[0077] According to the above-mentioned embodiment, the encoder and decoder can perform intra prediction on the block to be encoded / decoded based on the restored or generated reference pixels. However, as mentioned above, the reference pixels used for intra prediction can change depending on the intra prediction mode of the current block, and discontinuity can occur between the generated predicted block and the neighboring blocks. For example, in the case of directional intra prediction, the farther the predicted pixel in the predicted block is from the reference pixel, the larger the prediction error can be. In this case, discontinuity can occur due to the prediction error, and there is a limit to improving the encoding efficiency.
[0078] Therefore, in order to solve the above-described problems, an encoding / decoding method may be provided that performs filtering on a predicted block generated by intra prediction. For example, a filter may be adaptively applied to a region having a large prediction error within a predicted block generated based on reference pixels. In this case, the prediction error may be reduced, discontinuity between blocks may be minimized, and encoding / decoding efficiency may be improved.
[0079] FIG. 5 illustrates a schematic example of an embodiment of an intra prediction method in planar mode.
[0080] 510 in Fig. 5 shows one embodiment of an intra prediction method in planar mode, and 530 in Fig. 5 shows another embodiment of an intra prediction method in planar mode. 515 and 535 in Fig. 5 show blocks to be coded / decoded (hereinafter, having the same meaning as a current block), and the sizes of the blocks 515 and 535 are each called nS × nS.
[0081] In Fig. 5, the position of a pixel in a current block is indicated by a predetermined coordinate. For convenience, the coordinates of the uppermost left side in the current block are (0,0). In this case, the y value may increase downward on the coordinate axis, and the x value may increase rightward on the coordinate axis. In the embodiment described below, the coordinates of a pixel are indicated by the same coordinate axis as that used in Fig. 5.
[0082] As an example, referring to 510 of FIG. 5, the encoder and decoder may derive a pixel value of a predicted pixel for a pixel (nS-1, nS-1) located at the lower rightmost position in the current block, i.e., a lower right predicted pixel 520. The encoder and decoder may derive a pixel value of a predicted pixel for a pixel on a vertical line located at the rightmost position in the current block, i.e., a right vertical line predicted pixel, based on a reference pixel 523 located at the rightmost position (nS-1, -1) among the upper reference pixels and the lower right predicted pixel 520, and may derive a pixel value of a predicted pixel for a pixel on a horizontal line located at the lowermost position in the current block, i.e., a lower horizontal line predicted pixel, based on a reference pixel 526 located at the lowermost position (-1, nS-1) among the left reference pixels and the lower right predicted pixel 520.
[0083] In this case, the predicted values for the remaining pixels in the current block, excluding the pixels on the right vertical line and the pixels on the lower horizontal line, can be obtained by applying weights based on the upper reference pixels, the left reference pixels, the right vertical line predicted pixels, and the lower horizontal line predicted pixels.
[0084] In another embodiment, the encoder and decoder may derive a predicted value for a pixel to be predicted 540 in a current block 535 by a method such as 530 in FIG. 5. In 530 in FIG. 5, the coordinates of the pixel to be predicted 540 are (x, y). Referring to 530 in FIG. 5, the encoder and decoder may derive a predicted value of the pixel to be predicted 540 by performing averaging and / or weighted averaging based on a reference pixel (-1, nS) 541 located at the top of the lower left reference pixels, a reference pixel (-1, y) 543 located on the same horizontal line as the pixel to be predicted 540 among the left reference pixels, a reference pixel (x, -1) 545 located on the same vertical line as the pixel to be predicted 540 among the upper reference pixels, and a reference pixel (nS, -1) located at the leftmost position among the upper right reference pixels.
[0085] FIG. 6 is a flowchart illustrating an example of a video encoding method according to the present invention.
[0086] 6, the encoder may generate a predicted block by performing intra prediction on a current block (S610). A detailed example of the predicted block generation method has been described in detail with reference to FIGS. 4a and 4b, and will not be described here.
[0087] Also, referring to FIG. 6, the encoder may perform filtering on the prediction block based on encoding parameters of the encoding target block and / or neighboring blocks adjacent to the encoding target block (S620). Here, the encoding parameters may include information that can be inferred during encoding or decoding, as well as information that is encoded by the encoder and transmitted to the decoder, such as syntax elements, and refer to information required when encoding or decoding an image. The encoding parameters may include, for example, intra / inter prediction mode, motion vector, reference picture index, coded block pattern (CBP), presence or absence of residual signal, quantization parameter, block size, block partition information, etc.
[0088] As an example, the encoder may perform filtering on the prediction block based on information regarding 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 neighboring blocks adjacent to the block to be encoded (e.g., the encoding mode of the neighboring blocks), and / or the presence or absence of neighboring blocks (and / or whether the neighboring blocks are available blocks).
[0089] In the detailed filtering process, the encoder is described as always performing filtering, but the encoder may not perform filtering on the predicted block. For example, the encoder may determine whether to perform filtering based on the encoding parameters of the encoding target block and / or the neighboring blocks adjacent to the encoding target block, and if it is determined that filtering is not to be performed, the encoder does not perform filtering on the predicted block.
[0090] Meanwhile, the filtering process described in detail is a separate process independent of the predicted block generating process, but may be combined with the predicted block generating process and executed as one process. That is, the encoder may generate a predicted block by simultaneously applying a process corresponding to the filtering execution process based on the coding parameters of the encoding target block and / or the neighboring blocks in the predicted block generating process. A specific example of the filtering execution method will be described later.
[0091] 6, the encoder may generate a difference block based on an original block corresponding to a position of a current block to be encoded and a predicted block (S630). Here, the predicted block may be a predicted block that has been filtered or that has not been filtered.
[0092] FIG. 7 shows an example of the detailed differential block generation process. 710 of FIG. 7 shows an example of the process of generating a differential block based on an original block and a filtered predicted block. In 710 of FIG. 7, block 713 shows an original block, block 716 shows a filtered predicted block, and block 719 shows a differential block. Referring to 710 of FIG. 7, the encoder and decoder can generate a differential block by subtracting the filtered predicted block from the original block. 720 of FIG. 7 shows an example of the process of generating a differential block based on an original block and a non-filtered predicted block. In 720 of FIG. 7, block 723 shows an original block, block 726 shows a non-filtered predicted block, and block 729 shows a differential block. Referring to 720 of FIG. 7, the encoder and decoder can generate a differential block by subtracting the non-filtered predicted block from the original block.
[0093] The generated difference block can be transmitted to a decoder through processes such as transformation, quantization, and entropy coding.
[0094] FIG. 8 is a flow chart illustrating an example of a video decoding method according to the present invention.
[0095] 8, the decoder may generate a predicted block by performing intra prediction on a block to be decoded (S810). A detailed example of the predicted block generating method has been described in detail with reference to FIGS. 4a and 4b, and will not be described here.
[0096] Also, referring to FIG. 8, the decoder may perform filtering on the prediction block based on the coding parameters of the block to be decoded and / or the neighboring blocks adjacent to the block to be decoded (S820). Here, the coding parameters may include information that can be inferred during the coding or decoding process as well as information that is coded by the encoder and transmitted to the decoder, such as a syntax element, and refer to information required when coding or decoding an image. The coding parameters may include, for example, intra / inter prediction mode, motion vector, reference picture index, coded block pattern (CBP), presence or absence of residual signal, quantization parameter, block size, block partition information, etc.
[0097] As an example, the decoder may perform filtering on the prediction block based on information regarding 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 encoding parameters of neighboring blocks adjacent to the block to be decoded (e.g., the encoding modes of the neighboring blocks), and / or the presence or absence of neighboring blocks (and / or whether the neighboring blocks are available blocks).
[0098] In the detailed filtering process, the decoder is described as always performing filtering, but the decoder may not perform filtering on the predicted block. For example, the decoder may determine whether to perform filtering based on the decoding parameters of the block to be decoded and / or the neighboring blocks adjacent to the block to be decoded, and if it is determined that filtering is not to be performed, the decoder does not perform filtering on the predicted block.
[0099] Meanwhile, the detailed filtering process is a separate process independent of the prediction block generation process, but may be combined with the prediction block generation process and executed as one process. That is, the decoder may generate a prediction block by applying a process corresponding to the filtering execution process based on the coding parameters of the block to be decoded and / or the neighboring blocks in the prediction block generation process. In this case, the decoder does not execute a separate filtering process for the prediction block.
[0100] The method of performing filtering in the decoder is similar to that in the encoder, and a specific example of the method of performing filtering will be described later.
[0101] 8, the decoder may generate a reconstructed block based on a reconstructed differential block corresponding to a position of a block to be decoded and a prediction block (S830). Here, the prediction block may be a prediction block on which filtering is performed or a prediction block on which filtering is not performed.
[0102] FIG. 9 shows an example of the detailed differential block generation process. 910 of FIG. 9 shows an example of the process of generating a reconstructed block based on a reconstructed differential block and a filtered predicted block. In 910 of FIG. 9, block 913 shows a reconstructed differential block, block 916 shows a filtered predicted block, and block 919 shows a reconstructed block. Referring to 910 of FIG. 9, the encoder and decoder can generate a reconstructed block by adding the reconstructed differential block and the filtered predicted block. 920 of FIG. 9 shows an example of the process of generating a reconstructed block based on a reconstructed differential block and a non-filtered predicted block. In 920 of FIG. 9, block 923 shows a reconstructed differential block, block 926 shows a non-filtered predicted block, and block 929 shows a reconstructed block. Referring to 920 of FIG. 9, the encoder and decoder can generate a reconstructed block by adding the reconstructed differential block and the non-filtered predicted block.
[0103] FIG. 10 is a flow chart that outlines one embodiment of a method for performing filtering in accordance with the present invention.
[0104] Referring to FIG. 10, the encoder and decoder may determine whether to perform filtering on a prediction block (and / or a prediction pixel) (S1010).
[0105] As described in detail, the encoder and decoder may perform intra prediction on a block to be encoded / decoded based on previously restored reference pixels. At this time, the reference pixels used in the intra prediction and / or the predicted pixel values in the predicted block generated by the intra prediction may vary depending on the intra prediction mode of the current block. Therefore, in this case, the encoder and decoder may reduce prediction errors by performing filtering on predicted pixels that are less correlated with the reference pixels used in the intra prediction. On the other hand, it is more efficient not to perform filtering on predicted pixels that are more correlated with the reference pixels used in the intra prediction.
[0106] Therefore, the encoder and decoder may determine whether to perform filtering on the prediction block (and / or prediction pixels) based on at least one of the following: an intra prediction mode of a block to be coded / decoded, whether the block to be coded / decoded is a luma block or a chroma block, the size (and / or depth) of the block to be coded / decoded, coding parameters of neighboring blocks adjacent to the block to be coded / decoded (e.g., the size of the neighboring blocks and / or the coding mode of the neighboring blocks, etc.), and information on the presence or absence of the neighboring blocks (and / or whether the neighboring blocks are available blocks). Whether to perform filtering may be determined during the coding / decoding process, or may be determined in advance according to each condition. Hereinafter, a specific embodiment of a method for determining whether to perform filtering will be described.
[0107] In one embodiment, the encoder and decoder may determine whether to perform filtering on a prediction block based on an intra-prediction mode of a block to be encoded / decoded. As described above, reference pixels and prediction directions used in intra-prediction may be determined differently depending on the intra-prediction mode of a block to be encoded / decoded. Therefore, it is efficient to determine whether to perform filtering based on the intra-prediction mode of a block to be encoded / decoded.
[0108] Table 1 below shows an embodiment of a method for determining whether to perform filtering according to an intra-prediction mode. In Table 1, it is assumed that the prediction directions of the intra-prediction modes and the mode values assigned to each prediction mode are determined in the same manner as in 410 of FIG. 4a described in detail.
[0109] [Table 1]
[0110] Here, among the values assigned to the intra prediction modes, 0 may indicate that filtering is not performed, and 1 may indicate that filtering is performed.
[0111] As an example, when the prediction mode of the current block is a DC mode (e.g., a prediction mode with a mode value of 2), the predicted block is generated by averaging pixel values of a plurality of reference pixels, so that the correlation between the predicted pixel and the reference pixel is reduced. Therefore, in this case, the encoder and decoder may perform filtering on the predicted pixel in the predicted block. As another example, when the prediction mode of the current block is a planar mode (e.g., a prediction mode with a mode value of 34), the encoder and decoder may derive a right vertical line predicted pixel and a lower horizontal line predicted pixel as described in detail in FIG. 5, and then derive a predicted value for each pixel in the current block by applying a weight based on the derived predicted pixel and the reference pixel. Therefore, in this case, the correlation between the predicted pixel and the reference pixel is reduced, so that the encoder and decoder may perform filtering on the predicted pixel in the predicted block.
[0112] As another example, when the intra prediction mode of the current block is a vertical right mode (e.g., a prediction mode with a mode value of 5, 6, 12, 13, 22, 23, 24, or 25), the encoder and decoder perform intra prediction on the current block using the upper reference pixel and / or the upper right reference pixel, so that the correlation between the prediction pixel located in the left region of the prediction block and the left reference pixel may be reduced. Therefore, in such a case, filtering may be performed on the pixel located in the left region of the prediction block. As another example, when the intra prediction mode of the current block is a horizontal down mode (e.g., a prediction mode with a mode value of 8, 9, 16, 17, 30, 31, 32, or 33), the encoder and decoder perform intra prediction on the current block using the left reference pixel and / or the lower left reference pixel, so that the correlation between the prediction pixel located in the upper region of the prediction block and the upper reference pixel may be reduced. Therefore, in such a case, filtering may be performed on the pixel located in the upper region of the prediction block.
[0113] Also, unlike the embodiment of Table 1, the encoder and decoder may perform filtering for vertical mode (e.g., prediction mode with mode value 0) and horizontal mode (e.g., prediction mode with mode value 1). When the intra prediction mode of the current block is a vertical mode, the encoder and decoder perform intra prediction for the current block using the upper reference pixel, so that the correlation between the prediction pixel located in the left region of the prediction block and the left reference pixel may be weak. Therefore, in such a case, filtering may be performed for the pixel located in the left region of the prediction block. As another example, when the intra prediction mode of the current block is a horizontal mode (e.g., prediction mode with mode value 1), the encoder and decoder perform intra prediction for the current block using the left reference pixel, so that the correlation between the prediction pixel located in the upper region of the prediction block and the upper reference pixel may be weak. Therefore, in such a case, filtering may be performed for the pixel located in the upper region of the prediction block.
[0114] Meanwhile, if the intra prediction mode of the current block corresponds to one of the remaining prediction modes excluding the detailed prediction modes (for example, prediction modes with mode values of 3, 4, 7, 10, 11, 14, 15, 18, 19, 20, 21, 26, 27, 28, and 29), the encoder and decoder can use at least one reference pixel 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 of the prediction pixels located in the left and upper regions in the prediction block can maintain association with the reference pixels, the encoder and decoder do not perform filtering on the prediction block.
[0115] Examples of regions in the current block and / or predicted block where filtering is performed and / or pixel locations in the current block where filtering is performed for each case where filtering is performed are described below.
[0116] In another embodiment, the encoder and decoder may determine whether to perform filtering on a prediction block based on the size and / or depth of a current block (and / or a block to be predicted), where the current block may correspond to at least one of a CU, a PU, or a TU.
[0117] Table 2 below shows an example of a method for determining whether to perform filtering based on a block size, and Table 3 below shows an example of a method for determining whether to perform filtering based on a depth value of a current block. In the examples of Tables 2 and 3, the current block may correspond to a TU, and the size of the TU may be, for example, 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 may correspond to a CU and / or PU, etc., other than a TU.
[0118] [Table 2]
[0119] [Table 3]
[0120] Here, among the values assigned to the intra prediction modes, 0 may indicate that filtering is not performed, and 1 may indicate that filtering is performed.
[0121] The encoder and decoder may also determine whether to perform filtering on the current block and / or predicted block by considering both the intra prediction mode of the current block and the size of the current block. That is, the encoder and decoder may determine whether to perform filtering based on the size of the current block for each intra prediction mode. In this case, whether to perform filtering may be determined differently depending on the size of the current block for each intra prediction mode. Table 4 below shows an embodiment of a method for determining whether to perform filtering depending on the intra prediction mode of the current block and the size of the current block.
[0122] [Table 4]
[0123] Here, among the values assigned to each intra prediction mode, 0 may indicate that filtering is not performed, and 1 may indicate that filtering is performed.
[0124] In another embodiment, the encoder and decoder may determine whether to perform filtering on the prediction block based on information indicating whether the current block corresponds to a luma block or a chroma block, i.e., color component information of the current block. For example, the encoder and decoder may perform filtering on the prediction block only when the current block corresponds to a luma block, and may not perform filtering when the current block corresponds to a chroma block.
[0125] In another embodiment, the encoder and decoder may determine whether to perform filtering based on coding parameters of neighboring blocks adjacent to the current block, whether Constrained Intra Prediction (CIP) is applied to the current block, and / or information on the presence or absence of neighboring blocks (and / or whether the neighboring blocks are available blocks), etc. Specific examples of a method for determining whether to perform filtering for each will be described later.
[0126] 10, if it is determined that filtering is to be performed on the current block and / or the predicted block, the encoder and decoder may determine an area in the current block and / or the predicted block where filtering is to be performed (S1020). Here, the area in which filtering is to be performed may correspond to one or more samples in the current block and / or the predicted block.
[0127] As described in detail, the encoder and decoder may reduce prediction errors by filtering prediction pixels that have little correlation with reference pixels used in intra prediction. That is, the encoder and decoder may determine an area in the current block and / or the predicted block in which the prediction error is relatively large as a filtering execution area. In this case, the encoder and decoder may 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 coding mode of a neighboring block adjacent to the current block. Here, the coding mode of the neighboring block may indicate whether the neighboring block is coded / decoded in an inter mode or an intra mode. A specific example of a filtering execution area determination method will be described later.
[0128] The encoder and decoder may also determine a filter type to be applied to each predicted pixel in the filtering execution region (S1030).
[0129] At this time, the filter type may include information on a filter shape, a filter tap, and a filter coefficient. A plurality of intra prediction modes may have different prediction directions, and a method of using a restored reference pixel may vary depending on the position of a pixel to be filtered. Therefore, the encoder and decoder may improve filtering efficiency by adaptively determining a filter type. For example, the encoder and decoder may determine a filter type to be applied to each pixel to be filtered based on the intra prediction mode of the current block, the size (and / or depth) of the current block, and / or the position of the pixel to be filtered. The filter shape may be a horizontal shape, a vertical shape, a diagonal shape, etc., and the filter tap may be a 2-tap, a 3-tap, a 4-tap, etc.
[0130] Also, the encoder and the decoder may determine the filter coefficients based on the size of the prediction block and / or the position of the pixel to be filtered. That is, the encoder and the decoder may vary the filter coefficients applied to the pixel to be filtered according to the size of the prediction block and / or the position of the pixel to be filtered. Thus, the filter strength for the pixel to be filtered may be adaptively determined. As an example, when a 2-tap filter is used, the filter coefficients may be [1:3], [1:7], [3:5], etc. As another example, when a 3-tap filter is used, the filter coefficients may be [1:2:1], [1:4:1], [1:6:1], etc.
[0131] Meanwhile, the filter determined by the filter type may not be a filter defined by a filter shape, a filter tap, a filter coefficient, etc. For example, the encoder and the decoder may perform the filtering process by adding an offset value determined by a predetermined process to the pixel value of the reference pixel. In this case, the filtering process may be combined with the predicted block generating process and performed as one process. That is, the filtered predicted pixel value of each pixel in the current block may be derived only by the filtering process described in detail, and in this case, the filtering process described in detail may correspond to one process including both the predicted pixel generating process and the filtering process for the generated predicted pixel.
[0132] A specific example of the filter type determination method will be described later.
[0133] Once the filter application region and the filter type are determined, the encoder and the decoder may perform filtering on each predicted pixel in the prediction block based on the determined filter application region and filter type (S1040). If it is determined that filtering is not to be performed on the prediction block, the encoder and the decoder do not perform filtering on the prediction block (and / or each predicted pixel in the prediction block) (S1050).
[0134] FIG. 11 illustrates an example of a method for determining whether to perform filtering based on coding parameters of neighboring blocks of a current block.
[0135] In FIG. 11, the coding parameters of the surrounding blocks include an intra prediction mode, an inter prediction mode, a coding mode, etc. Here, the coding mode of the surrounding blocks may indicate whether the surrounding blocks are coded / decoded in an inter mode or an intra mode.
[0136] 1110 of Figure 11 illustrates an embodiment of a method for determining whether to perform filtering based on the intra prediction mode of a neighboring block adjacent to a current block. 1113 of Figure 11 illustrates a current block (C), and 1116 of Figure 11 illustrates a left neighboring block (A) adjacent to the left side of the current block. In 1110 of Figure 11, it is assumed that the intra prediction mode of the current block corresponds to a vertical right mode. In this case, 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 pixels located in a left region 1119 of the prediction block.
[0137] However, as in 1110 of FIG. 11, when the prediction direction of the left peripheral block (A) 1116 adjacent to the filtering target region 1119 and the prediction direction of the current block (C) 1113 are different from each other, it is more efficient not to perform filtering on the filtering target region 1119. Therefore, the encoder and decoder do not perform filtering on the filtering target region 1119 when the prediction direction of the peripheral block 1116 adjacent to the filtering target region 1119 and the prediction direction of the current block 1113 are different from each other. On the contrary, when the prediction direction of the peripheral block 1116 adjacent to the filtering target region 1119 and the prediction direction of the current block 1113 are the same or similar to each other (for example, when the prediction angle difference value is equal to or less than a predetermined threshold), the prediction error can be reduced by performing filtering on the filtering target region 1119.
[0138] 1120 of FIG. 11 shows an embodiment of a method for determining whether to perform filtering based on the coding mode of a neighboring block of a current block when CIP (Constrained Intra Prediction) is applied to a current block. 1123 of FIG. 11 shows a current block (C), and 1126 of FIG. 11 shows a left neighboring 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 a vertical right mode. In this case, 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 pixels located in a left region 1129 of the prediction block.
[0139] However, when CIP is applied to the current block (C) 1123 , the encoder and decoder do not perform filtering on the filtering target region 1129 according to the coding mode of the left peripheral block (A) 1126 adjacent to the filtering target region 1129 .
[0140] When CIP is applied to the current block 1123, the encoder and decoder do not use pixels in a neighboring block coded in inter mode as reference pixels when performing intra prediction on the current block 1123. For example, in 1120 of FIG. 11, when a left neighboring block (A) 1126 is coded in inter mode, a reference pixel in the left neighboring block 1126, i.e., a left reference pixel, is not used for inter prediction of the current block 1123. In this case, the encoder and decoder may perform intra prediction after inputting a pixel value of a reference pixel in a block coded in intra mode into the position of the left reference pixel. That is, the encoder and decoder may enhance error resilience by not using pixels to which inter mode is applied for intra prediction.
[0141] Therefore, similar to 1120 in FIG. 11, if CIP is applied to a current block 1123 and the coding mode of a left surrounding block 1126 adjacent to the filtered region 1129 is inter mode, the encoder and decoder do not perform filtering on the filtered region 1129.
[0142] FIG. 12 illustrates an example of a method for determining whether to perform filtering based on information on the presence or absence of neighboring blocks adjacent to a current block (and / or whether the neighboring blocks are available blocks).
[0143] 1210 in Figure 12 indicates a current block (C), and 1220 in Figure 12 indicates a neighboring neighboring block (A) on the left side of the current block. In Figure 12, it is assumed that the intra prediction mode of the current block 1210 corresponds to a vertical right mode. In this case, since the encoder and decoder perform intra prediction on the current block using the upper reference pixels and / or the upper right reference pixels, filtering may be performed on pixels located in a left region 1230 in the prediction block.
[0144] However, if there are no neighboring blocks adjacent to the filtering target region or if they are not available, the encoder and decoder do not perform filtering on the filtering target region. Here, if there are no neighboring blocks adjacent to the filtering target region or if they are not available, the current block may be located on the boundary of the current picture, or the neighboring blocks adjacent to the current block may be located outside the boundary of the slice to which the current block belongs.
[0145] When there is no neighboring block adjacent to the filtering target region or when it is not available, the encoder and decoder may perform intra prediction after generating reference pixel values at positions adjacent to the filtering target region using available reference pixels. However, in this case, the generated reference pixels may have similar values to each other, and the values of the generated reference pixels are not similar to pixel values in the current block, so performing filtering on the current block based on the generated reference pixels may reduce coding efficiency. Therefore, the encoder and decoder do not perform filtering on the filtering target region.
[0146] 12, a reconstructed block (B) D exists around a current block (C) 1210. In addition, a left peripheral block (A) 1220 adjacent to a filtering target region 1230 in the current block 1210 exists outside a boundary 1240 of a slice to which the current block 1210 belongs. In this case, since the left peripheral block (A) 1220 adjacent to the filtering target region 1230 corresponds to an unavailable block, the encoder and decoder do not perform filtering on the filtering target region 1230.
[0147] FIG. 13 illustrates an example of a method for determining a filtering execution region based on an intra-prediction mode of a current block.
[0148] As described in detail, the encoder and decoder may perform intra prediction on a block to be encoded / decoded based on previously restored reference pixels. At this time, since the reference pixels and / or prediction direction used in intra prediction may vary depending on the intra prediction mode of the current block, it is efficient to determine an area with a relatively large prediction error as a filtering execution area in consideration of the intra prediction mode of the current block. More specifically, a prediction pixel located in an area adjacent to a reference pixel not used in intra prediction in a prediction block may have a low correlation with the reference pixel and may have a large prediction error. Therefore, the encoder and decoder may reduce prediction errors and improve prediction efficiency by performing filtering on prediction pixels in an area adjacent to a reference pixel not used in intra prediction among prediction pixels in a prediction block.
[0149] 1310 in Fig. 13 illustrates an example of a filtering execution region when the prediction mode of the current block is the DC mode and / or the planar mode. In 1310 in Fig. 13, 1313 may indicate a prediction block, and 1316 may indicate a filtering execution region.
[0150] As described above, when the prediction mode of the current block is the DC mode, the prediction block 1313 is generated by averaging pixel values of a plurality of reference pixels, so that the correlation between the prediction pixel and the reference pixel is reduced. Therefore, in this case, the encoder and decoder may determine one or more horizontal pixel lines located at the top of the prediction block 1313 (hereinafter referred to as upper horizontal predicted pixel lines) and one or more vertical pixel lines located at the leftmost side of the prediction block 1313 (hereinafter referred to as left vertical predicted pixel lines) as the filtering execution region 1316. 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 a predetermined fixed number, for example, the upper horizontal predicted pixel line and the left vertical predicted pixel line may 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 may be determined based on the size of the current block and / or the prediction block 1313. That is, the number of pixel lines included in the upper horizontal predicted pixel line and the number of pixel lines included in the left vertical predicted pixel line may have a variable value depending on the size of the current block and / or the predicted block 1313. For example, the number of pixel lines included in the upper horizontal predicted pixel line and the number of pixel lines included in the left vertical predicted pixel line may be 1, 2, or 4, respectively.
[0151] On the other hand, even when the prediction mode of the current block is a planar mode (e.g., a prediction mode with a mode value of 34), there is little correlation between the predicted pixels and the reference pixels. Therefore, in this case, the encoder and decoder may determine the upper horizontal predicted pixel line and the left vertical predicted pixel line as the filtering execution region 1316, as in the DC mode.
[0152] 1320 in Figure 13 illustrates an example of a filtering execution region when the intra prediction mode of the current block is a vertical right mode (e.g., a prediction mode with a mode value of 5, 6, 12, 13, 22, 23, 24, or 25). In 1320 in Figure 13, 1323 may indicate a prediction block, and 1326 may indicate a filtering execution region.
[0153] When the prediction mode of the current block is the vertical right mode, the encoder and decoder perform intra prediction on the current block based on the upper reference pixel and / or the upper right reference pixel, so that the correlation between the prediction pixel located in the left region in the prediction block 1323 and the left reference pixel may be reduced. Therefore, in this case, the encoder and decoder may determine one or more vertical pixel lines located at the leftmost side in the prediction block 1323, i.e., the left vertical predicted pixel line, as the filtering execution region 1326 and perform filtering, thereby improving prediction efficiency. At this time, the number of vertical pixel lines included in the left vertical predicted pixel line is a predetermined fixed number, and for example, the left vertical predicted pixel line may include one vertical pixel line. Also, as in the embodiment of FIG. 14 described below, the number of vertical pixel lines included in the left vertical predicted pixel line may be determined based on the size of the current block and / or the prediction block 1323. That is, the number of vertical pixel lines included in the left vertical predicted pixel line may have a variable value according to the size of the current block and / or the predicted block 1323, for example, 1, 2, or 4.
[0154] On the other hand, when the prediction mode of the current block is the vertical mode, the encoder and decoder perform intra prediction on the current block using the upper reference pixel, so that the correlation between the prediction pixel located in the left region in the prediction block and the left reference pixel may be reduced. Therefore, even in this case, the encoder and decoder may determine the left vertical prediction pixel line as the filtering execution region and perform filtering.
[0155] 1330 in FIG. 13 illustrates an example of a filtering execution region when the intra prediction mode of the current block is a horizontal-down mode (e.g., a prediction mode with mode values of 8, 9, 16, 17, 30, 31, 32, and 33). In 1330 in FIG. 13, 1333 may indicate a prediction block, and 1336 may indicate a filtering execution region.
[0156] When the prediction mode of the current block is the horizontal-down mode, the encoder and decoder perform intra prediction on the current block using the left reference pixel and / or the lower left reference pixel, so that the correlation between the predicted pixel located in the upper region of the prediction block 1333 and the upper reference pixel may be reduced. Therefore, in this case, the encoder and decoder may determine one or more horizontal pixel lines located at the topmost position in the prediction block 1333, i.e., the upper horizontal predicted pixel line, as the filtering execution region 1336 and perform filtering, thereby improving prediction efficiency. At this time, the number of horizontal pixel lines included in the upper horizontal predicted pixel line is a predetermined fixed number, and for example, the upper horizontal predicted pixel line may include one pixel line. Also, as in the embodiment of FIG. 14 described below, the number of horizontal pixel lines included in the upper horizontal predicted pixel line may be determined based on the size of the current block and / or the prediction block 1333. That is, the number of horizontal pixel lines included in the upper horizontal predicted pixel line may have a variable value according to the size of the current block and / or the predicted block 1333, for example, 1, 2, or 4.
[0157] On the other hand, when the prediction mode of the current block is a horizontal mode, the encoder and decoder perform intra prediction on the current block using the left reference pixel, so that the correlation between the prediction pixel located in the upper region of the prediction block and the upper reference pixel may be reduced. Therefore, even in this case, the encoder and decoder may determine the upper horizontal prediction pixel line as the filtering execution region and perform filtering.
[0158] FIG. 14 illustrates a schematic example of a method for determining a filtering execution region based on the size and / or depth of a current block.
[0159] When the size of the current block (and / or the block to be predicted) is large, the size of the area having a large prediction error in the current block is also large, and when the size of the current block (and / or the block to be predicted) is small, the size of the area having a large prediction error in the current block is also small. Therefore, the encoder and the decoder can improve the encoding efficiency by determining the filtering execution area based on the size (and / or depth) of the current block (and / or the block to be predicted). In this case, the encoder and the decoder can determine the area having a relatively large prediction error as the filtering execution area.
[0160] 1410 of FIG. 14 illustrates an example of a filtering execution region when the size of a current block is 8×8. In 1410 of FIG. 14, 1413 indicates a current block, and 1416 indicates a filtering target region. In 1410 of FIG. 14, it is assumed that the intra prediction mode of the current block 1413 corresponds to a vertical right mode (for example, a prediction mode with a mode value of 6). In this case, since the encoder and decoder perform intra prediction on the current block using the upper reference pixel and / or the upper right reference pixel, a prediction error is large in a left region in a prediction block that is far from the upper reference pixel and the upper right reference pixel. Therefore, in this case, the encoder and decoder may determine one or more vertical pixel lines located at the leftmost position in the prediction block, i.e., a left vertical prediction pixel line, as a filtering execution region 1416.
[0161] 1420 of FIG. 14 illustrates an example of a filtering execution region when the size of the current block is 32×32. In 1420 of FIG. 14, 1423 indicates a current block, and 1426 indicates a filtering target region. In 1420 of FIG. 14, it is assumed that the intra prediction mode of the current block 1423 corresponds to a vertical right mode (for example, a prediction mode with a mode value of 6). In this case, since the encoder and decoder perform intra prediction on the current block using the upper reference pixel and / or the upper right reference pixel, the prediction error of the left region in the prediction block that is far from the upper reference pixel and the upper right reference pixel is large. Therefore, in this case, the encoder and decoder may determine one or more vertical pixel lines located at the leftmost position in the prediction block, i.e., the left vertical prediction pixel line, as the filtering execution region 1426.
[0162] In 1410 and 1420 of FIG. 14 described in detail, the number of vertical pixel lines constituting the left vertical predicted pixel line may be determined based on the size of the current block 1413 and 1423 and / or the predicted block. In 1410 of FIG. 14, the size of the current block 1413 is 8×8, so it has a relatively small value. Therefore, in this case, the size of the region with a large prediction error is relatively small, so the encoder and decoder can determine two vertical pixel lines in the order of the leftmost position in the predicted block as the filtering execution region. On the other hand, in 1420 of FIG. 14, the size of the current block 1423 is 32×32, so it has a relatively large value. Therefore, in this case, the size of the region with a large prediction error is relatively large, so the encoder and decoder can determine four vertical pixel lines in the order of the leftmost position in the predicted block as the filtering execution region.
[0163] Table 5 below shows an example of a filtering execution area according to a block size, and Table 6 below shows an example of a filtering execution area according to a depth value of a current block. The encoder and decoder may determine a filtering execution area based on the size and / or depth of the current block as shown in Tables 5 and 6 below.
[0164] [Table 5]
[0165] [Table 6]
[0166] Here, the current block may correspond to a TU, and the size of the TU may be, for example, 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 may correspond to a CU and / or a PU, which is not a TU.
[0167] The size and / or position of the filtering execution region determined according to the size and / or depth of the current block is not limited to the above-mentioned embodiment, and may be determined to a size and / or position different from the above-mentioned embodiment. In addition, in the above-mentioned embodiment, the filtering execution region determination method is described mainly for the vertical right mode, but this is only for convenience of explanation, and the above method may be applied in the same or similar manner when the prediction mode of the current block corresponds to a mode other than the vertical right mode.
[0168] FIG. 15 illustrates an example of a method for determining a filtering execution region based on the coding modes of neighboring blocks of a current block.
[0169] In FIG 15, it is assumed that the intra prediction mode of a current block (C) 1510 corresponds to a vertical right mode. In this case, the encoder and decoder perform intra prediction on the current block 1510 using upper reference pixels and / or upper right reference pixels, and therefore may determine a left region in the prediction block as a region to be filtered.
[0170] However, when the coding mode of a neighboring block adjacent to the current block is an inter mode, the restored pixel values in the neighboring block are likely to be unreliable due to errors generated in the network, and performing filtering based on the restored pixel values in the neighboring block whose coding mode is an inter mode may reduce coding efficiency. Therefore, the encoder and decoder do not perform filtering on the area adjacent to the neighboring block whose coding mode is an inter mode. That is, the encoder and decoder may determine the filtering execution area based on the coding mode of the neighboring block adjacent to the current block.
[0171] 15, neighboring blocks adjacent to the left side of a current block 1510 include a reconstructed neighboring block (A) 1520 and a reconstructed neighboring block (B) 1530. Here, it is assumed that the coding mode of the neighboring block (A) 1520 is an intra mode and the coding mode of the neighboring block (B) 1530 is an inter mode. In this case, the encoder and decoder may determine only a region 1540 adjacent to the neighboring block (B) 1530 coded in the intra mode among the left regions in the prediction block as a region to be filtered.
[0172] 16a and 16b show an embodiment of a method for determining a filter type according to an intra-prediction mode of a current block.
[0173] FIG 16a 1610 shows an embodiment of a method for determining a filter type when the prediction mode of the current block is DC mode and / or planar mode. In FIG 16a 1610, 1615 shows a prediction block, and 1620 shows a filter tap applied to the pixel to be filtered.
[0174] As described above, when the prediction mode of the current block is the DC mode, the prediction block 1615 is generated by averaging pixel values of a plurality of reference pixels, so that the correlation between the prediction pixel and the reference pixel is low. Therefore, in this case, the encoder and decoder may determine the prediction pixels (e.g., (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) included in the upper horizontal prediction pixel line (e.g., one horizontal pixel line located at the top of the prediction block 1615) and the left vertical prediction pixel line (e.g., one vertical pixel line located at the leftmost of the prediction block 1615) as the filtering execution region. Also, when the prediction mode of the current block is the planar mode, the correlation between the prediction pixel and the reference pixel is low. Therefore, in this case, the encoder and decoder can determine the predicted pixels included in the upper horizontal predicted pixel line and the left vertical predicted pixel line as the filtering execution region, similarly to the DC mode.
[0175] When the prediction mode of the current block is DC mode and / or planar mode, the encoder and decoder may apply a 3-tap filter 1629 of [1 / 4, 2 / 4, 1 / 4] to the left upper predicted pixel (0,0) located at the leftmost upper position in the prediction block. In this case, the encoder and decoder may perform filtering on the pixel to be filtered based on the pixel to be filtered (0,0), the reference pixel (0,-1) adjacent to the upper side of the pixel to be filtered, and the reference pixel (-1,0) adjacent to the left side of the pixel to be filtered. In this case, the filter coefficient applied to the pixel to be filtered is 2 / 4, and the filter coefficient applied to the reference pixel adjacent to the upper side of the pixel to be filtered and the reference pixel adjacent to the left side of the pixel to be filtered is 1 / 4.
[0176] In addition, when the prediction mode of the current block is the DC mode and / or the planar mode, the encoder and decoder may apply a horizontal 2-tap filter 1623 of [1 / 4, 3 / 4] to each of the pixels (e.g., (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) excluding the left upper predicted pixel among the predicted pixels included in the left vertical predicted pixel line. In this case, assuming that the position of the pixel to be filtered is (0,y), the encoder and decoder may perform filtering on the pixel to be filtered based on the pixel to be filtered (0,y) and the reference pixel (-1,y) adjacent to the left side of the pixel to be filtered. In this case, the filter coefficient applied to the pixel to be filtered is 3 / 4, and the filter coefficient applied to the reference pixel adjacent to the left side of the pixel to be filtered is 1 / 4.
[0177] In addition, when the prediction mode of the current block is the DC mode and / or the planar mode, the encoder and decoder may apply a [1 / 4, 3 / 4] vertical 2-tap filter 1625 to each of the predicted pixels included in the upper horizontal predicted pixel line, excluding the left upper predicted pixel (e.g., (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)). In this case, assuming that the position of the pixel to be filtered is (x,0), the encoder and decoder may perform filtering on the pixel to be filtered based on the pixel to be filtered (x,0) and 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 above-described embodiment, the encoder and decoder may use different filter types (e.g., filter shapes, filter taps, and / or filter coefficients, etc.) depending on the size of the current block. In this case, the encoder and decoder may adaptively determine the filter type based on the size of the current block. However, the encoder and decoder may always use a predetermined fixed filter type (e.g., filter shapes, filter taps, and / or filter coefficients, etc.) regardless of the size of the current block and / or the predicted block, as in the above-described embodiment.
[0179] 1630 in Figure 16a illustrates an example of a method for determining a filter type when the prediction mode of the current block is a vertical right mode (e.g., a prediction mode with mode values of 5, 6, 12, 13, 22, 23, 24, 25). In 1630 in Figure 16a, 1635 illustrates a prediction block, and 1640 illustrates a filter tap to be applied to the pixel to be filtered.
[0180] As described above, when the prediction mode of the current block is the vertical right mode, the encoder and decoder perform intra prediction on the current block based on the upper reference pixel and / or the upper right reference pixel, so that there may be less correlation between the prediction pixel located in the left region in the prediction block 1635 and the left reference pixel. Therefore, in this case, the encoder and decoder may 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., one vertical pixel line located at the leftmost position in the prediction block 1635) as the filtering execution region.
[0181] On the other hand, when the prediction mode of the current block is a vertical mode (e.g., a prediction mode with a mode value of 0), the encoder and decoder perform intra prediction on the current block using upper reference pixels, so that the correlation between the prediction pixel located in the left region of the prediction block and the left reference pixel may be weak. Therefore, even in this case, the encoder and decoder may determine the prediction pixel included in the left vertical prediction pixel line as the filtering execution region. However, the filter type applied to the vertical mode is different from the filter type applied to the vertical right mode.
[0182] When the prediction mode of the current block is the vertical right mode, the encoder and decoder may apply a diagonal 2-tap filter 1640 of [1 / 4, 3 / 4] to each of 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 predicted pixel line. In this case, assuming that the position of the pixel to be filtered is (0,y), the encoder and decoder may perform filtering on the pixel to be filtered based on the pixel to be filtered (0,y) and the reference pixel (-1,y+1) adjacent to the lower side of the reference pixel adjacent to the left side of the pixel to be filtered. In this case, the filter coefficient applied to the pixel to be filtered is 3 / 4, and the filter coefficient applied to the reference pixel adjacent to the lower side of the reference pixel adjacent to the left side of the pixel to be filtered is 1 / 4.
[0183] 1650 in FIG. 16b illustrates an embodiment of a filter type determination method when the prediction mode of the current block is a horizontal-down mode (e.g., a prediction mode with mode values of 8, 9, 16, 17, 30, 31, 32, 33). In 1650 in FIG. 16b, 1655 indicates a prediction block, and 1660 indicates a filter tap to be applied to the pixel to be filtered.
[0184] As described above, when the prediction mode of the current block is the horizontal-down mode, the encoder and decoder perform intra prediction on the current block using the left reference pixel and / or the lower left reference pixel, so that there may be less correlation between the prediction pixel and the upper reference pixel located in the upper region in the prediction block 1655. Therefore, in this case, the encoder and decoder may determine the prediction pixel (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 (e.g., one vertical pixel line located at the top in the prediction block 1655) as the filtering execution region.
[0185] On the other hand, when the prediction mode of the current block is a horizontal mode (e.g., a prediction mode with a mode value of 1), the encoder and decoder perform intra prediction on the current block using the left reference pixel, so that the correlation between the prediction pixel located in the upper region of the prediction block 1655 and the upper reference pixel may be weak. Therefore, even in this case, the encoder and decoder may determine the prediction pixel 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-down mode, the encoder and decoder may apply a 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. In this case, assuming that the position of the pixel to be filtered is (x,0), the encoder and decoder may perform filtering on the pixel to be filtered based on the pixel to be filtered (x,0) and the reference pixel (x+1,-1) adjacent to the right 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 of the reference pixel adjacent to the upper side of the pixel to be filtered is 1 / 4.
[0187] 1670 in FIG. 16b illustrates an embodiment of a method for adaptively determining a filter type (e.g., a filter shape, a filter coefficient, a filter tap, etc.) according to an intra prediction mode (particularly, a directional prediction mode) of a current block. In 1670 in FIG. 16b, 1675 indicates a prediction block, and 1680 indicates a filter tap to be applied to a pixel to be filtered.
[0188] As in the detailed embodiments 1630 and 1650, the encoder and decoder may apply a predetermined fixed filter type for each of the vertical right mode and / or horizontal down mode. However, the encoder and decoder may apply various filter types according to the intra prediction mode in addition to the detailed filter types. In this case, the encoder and decoder may adaptively determine the filter type based on the intra prediction mode of the current block.
[0189] As an example, the encoder and decoder may use a 3-tap filter 1681 that performs filtering based on a pixel to be filtered (x, y), a reference pixel (x+2, y-1), and a reference pixel (x+3, y-1). In this case, a filter coefficient applied to the pixel to be filtered (x, y) is 12, a filter coefficient applied to the reference pixel (x+2, y-1) is 3, and a filter coefficient applied to the reference pixel (x+3, y-1) is 1. As another example, the encoder and decoder may use 3-tap filters 1683, 1685, and 1687 that perform filtering based on a pixel to be filtered (x, y), a reference pixel (x+1, y-1), and a reference pixel (x+2, y-1). In this case, a filter coefficient applied to the pixel to be filtered (x, y) is 12, a filter coefficient applied to the reference pixel (x+1, y-1) is 1, and a filter coefficient applied to the reference pixel (x+2, y-1) is 3 (1683). Also, the filter coefficient applied to the pixel to be filtered (x, y) is 12, the filter coefficient applied to the reference pixel (x+1, y-1) is 2, and the filter coefficient applied to the reference pixel (x+2, y-1) is 2 (1685). Also, the filter coefficient applied to the pixel to be filtered (x, y) is 8, the filter coefficient applied to the reference pixel (x+1, y-1) is 6, and the filter coefficient applied to the reference pixel (x+2, y-1) is 2 (1687). As another example, the encoder and decoder may use a 2-tap filter 1689 that performs filtering based on the pixel to be filtered (x, y) and the reference pixel (x+1, y-1). In this case, the filter coefficient applied to the pixel to be filtered (x, y) is 8, and the filter coefficient applied to the reference pixel (x+1, y-1) is 8.
[0190] Meanwhile, if the intra prediction mode of the current block corresponds to one of the remaining prediction modes excluding the detailed prediction modes (for example, prediction modes with mode values of 3, 4, 7, 10, 11, 14, 15, 18, 19, 20, 21, 26, 27, 28, and 29), the encoder and decoder can use at least one reference pixel 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 of the prediction pixels located in the left and upper regions in the prediction block can maintain association with the reference pixels, the encoder and decoder do not perform filtering on the prediction block.
[0191] Also, as described in detail in the embodiment of Figure 10, since the encoder and decoder can determine whether to perform filtering on the prediction block based on color component information of the current block, the encoder and decoder can also perform the filtering process described in detail in Figures 16a and 16b only when the current block corresponds to a luma block. That is, the filtering process according to the above embodiment is applied only when the current block corresponds to a luma block, and is not applied when the current block corresponds to a chroma block.
[0192] FIG. 17 shows a simplified diagram of a filter type determination method according to the embodiment of FIGS. 16a and 16b.
[0193] 1710 in Figure 17 shows examples of filter types when the prediction mode of the current block is DC mode and / or planar mode, which are the same filter types as those shown in 1610 in Figure 16a.
[0194] As detailed in 1610 of FIG. 16a, when the prediction mode of the current block is a DC mode (e.g., a prediction mode with a mode value of 2) and / or a planar mode (e.g., a prediction mode with a mode value of 34), the encoder and decoder may apply a 3-tap filter to a left upper predicted pixel (e.g., pixel c in 1710 of FIG. 17) located at the top leftmost position in the prediction block. Also, the encoder and decoder may apply a horizontal 2-tap filter to each pixel (e.g., pixel g in 1710 of FIG. 17) excluding the left upper predicted pixel among the predicted pixels included in the left vertical predicted pixel line. Also, the encoder and decoder may apply a vertical 2-tap filter to each pixel (e.g., pixel e in 1710 of FIG. 17) excluding the left upper predicted pixel among the predicted pixels included in the upper horizontal predicted pixel line. As an example, this is shown by the following Equation 1.
[0195] (Number 1) F_g=(f+3*g+2)>>2 F_e=(d+3*e+2)>>2 F_c=(a+2*c+b+2)>>2
[0196] Here, F_x denotes a filtered predicted pixel value generated by performing filtering on the predicted pixel value at the x location.
[0197] 1730 of Figure 17 illustrates an example of a filter type when the prediction mode of the current block is a vertical right mode (e.g., a prediction mode with mode values of 5, 6, 12, 13, 22, 23, 24, 25). 1730 of Figure 17 illustrates the same filter type as 1630 of Figure 16a.
[0198] As detailed in 1630 of FIG. 16a, when the prediction mode of the current block is the vertical right mode, the encoder and decoder may apply a 2-tap filter to each of the prediction pixels included in the left vertical prediction pixel line (e.g., the i pixel and the k pixel in 1730 of FIG. 17). Since the prediction direction is diagonal in the vertical right mode, the encoder and decoder may determine the shape of the filter to be a diagonal shape. As an example, this is shown by the following Equation 2.
[0199] (Number 2) F_i=(h+3*i+2)>>2 F_k=(j+3*k+2)>>2
[0200] Here, F_x denotes a filtered predicted pixel value generated by performing filtering on the predicted pixel value at the x location.
[0201] 1750 of Figure 17 illustrates an example of a filter type when the prediction mode of the current block is a horizontal-down mode (e.g., a prediction mode with mode values of 8, 9, 16, 17, 30, 31, 32, 33). 1750 of Figure 17 illustrates the same filter type as 1650 of Figure 16b.
[0202] As detailed in 1650 of FIG. 16b, when the prediction mode of the current block is the horizontal-down mode, the encoder and decoder may apply a 2-tap filter to each of the prediction pixels included in the upper horizontal predicted pixel line (e.g., m pixel and o pixel in 1750 of FIG. 17). Since the prediction direction is diagonal in the horizontal-down mode, the encoder and decoder may determine the diagonal shape of the filter. As an example, this is shown in Equation 3 below.
[0203] (Number 3) F_m=(l+3*m+2)>>2 F_o=(n+3*o+2)>>2
[0204] Here, F_x denotes a filtered predicted pixel value generated by performing filtering on the predicted pixel value at the x location.
[0205] FIG. 18 illustrates a schematic diagram of an embodiment of filter types that are applied when the prediction mode of the current block is a vertical mode and / or a horizontal mode.
[0206] In the embodiment described below, terms such as a first reference pixel, a second reference pixel, and a third reference pixel are used independently 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 may also 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, a filter tap, a filter coefficient, etc. For example, the encoder and the decoder may perform the filtering process by adding an offset value determined by a predetermined process to the pixel value of the reference pixel. In this case, the filtering process may be combined with the predicted block generating process and performed as one process. That is, the filtered predicted pixel value of each pixel in the current block may be derived only by the filtering process described in detail, and in this case, the filtering process described in detail may correspond to one process including both the predicted pixel generating process and the filtering process for the generated predicted pixel. In this case, the filtering process may be considered as a final predicted pixel (and / or filtered predicted pixel) generating process using the reference pixel. Therefore, in FIG. 18, an embodiment is described from the perspective of predicted pixel generation.
[0208] Reference numeral 1810 in FIG. 18 illustrates an embodiment of a method for generating predicted pixels when the prediction mode of the current block is the vertical mode.
[0209] As described above, when the prediction mode of the current block is the vertical mode, the encoder and decoder may generate a prediction block by performing intra prediction on the current block using the upper reference pixels. At this time, since the correlation between the prediction pixel located in the left region of the prediction block and the left reference pixel is small, the prediction pixel located in the left region of the prediction block may have a large prediction error. Therefore, the encoder and decoder may generate a prediction block for each of the pixels ((0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) included in one vertical pixel line located at the leftmost position in the current block 1815 (hereinafter, referred to as the left vertical pixel line) as follows:
[0210] Referring to 1810 of Figure 18, there may be pixels at positions (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), and (0,7) on the left vertical pixel line. In 1810 of Figure 18, it is assumed that the current pixel to be predicted is pixel (0,4) among the pixels on the left vertical pixel line.
[0211] Since the prediction mode of the current block 1815 is the vertical mode, the encoder and decoder may input the pixel value of the first reference pixel (0,-1) (e.g., the leftmost reference pixel among the above reference pixels) located on the same vertical line as the pixel to be predicted, into the position of the pixel to be predicted. That is, when the prediction mode of the current block 1815 is the vertical mode, the pixel value of the first reference pixel may be determined as the predicted pixel value of the pixel to be predicted.
[0212] However, in this case, since the generated predicted pixel value may have a large prediction error, the encoder and decoder may derive a final predicted pixel value by adding an offset value to the first reference pixel value. Here, the process of adding the offset value may correspond to a filtering process or may correspond to a part of a predicted pixel generating process. In this case, the offset value may 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 may correspond to a value obtained by subtracting the pixel value of the third reference pixel from the pixel value of the second reference pixel. That is, the encoder and decoder may derive a predicted value of the pixel to be predicted by adding a difference between the second reference pixel value and the third reference pixel value to the first reference pixel value. The predicted pixel generating process described in detail may be applied in the same or similar manner to pixels other than pixel (0, 4) among pixels on the left vertical pixel line.
[0213] The detailed predicted pixel generation process is shown, for example, in Equation 4 below.
[0214] (Number 4) p′[x,y]=p[x,-1]+((p[-1,y]-p[-1,-1])>>1)),{x=0,y=0,...,nS-1}
[0215] Here, p'[x,y] denotes a final predicted pixel value for a pixel to be predicted at position (x,y), p[x,-1] denotes a first reference pixel located on the same vertical line as the pixel to be predicted among the upper reference pixels, p[-1,y] denotes a second reference pixel adjacent to the left side of the pixel to be predicted, p[-1,-1] denotes a third reference pixel adjacent to the left side of the first reference pixel, and nS denotes the height of the current block.
[0216] Meanwhile, when the prediction mode of the current block 1815 is the vertical mode, the region to which the offset and / or filtering is applied is not limited to the above embodiment. For example, the encoder and decoder may apply the above-described predicted pixel generation process to the two vertical pixel lines located at the leftmost position in the current block 1815. In this case, the predicted pixel generation process is represented by the following Equation 5 as an example.
[0217] (Number 5) p′[x,y]=p[x,y]+(p[-1,y]-p[-1,-1]+(1<<x))> >(x+1),{x=0,...,1,y=0,...,7}
[0218] Here, p'[x,y] denotes the final predicted pixel value for the pixel to be predicted at (x,y), p[x,y] denotes the predicted pixel value generated by a general vertical prediction process, p[-1,y] denotes a reference pixel located on the same horizontal line as the pixel to be predicted among the left reference pixels, and p[-1,-1] denotes the upper left corner reference pixel.
[0219] Meanwhile, the above-described process of adding an 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 may determine the first reference pixel as a predicted pixel value of the pixel to be predicted without applying an offset value.
[0220] FIG. 18 1820 illustrates an embodiment of a method for generating predicted pixels when the prediction mode of the current block is the horizontal mode.
[0221] As described above, when the prediction mode of the current block is the horizontal mode, the encoder and decoder may generate a prediction block by performing intra prediction on the current block using the left reference pixel. At this time, since the correlation between the prediction pixel located in the upper region of the prediction block and the upper reference pixel is small, the prediction pixel located in the upper region of the prediction block may have a large prediction error.
[0222] Therefore, the encoder and decoder can generate a prediction block and / or a prediction pixel for each of the pixels ((0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)) included in the uppermost horizontal pixel line (hereinafter referred to as the upper horizontal pixel line) in the current block 1825 as follows:
[0223] Referring to 1820 of Figure 18, pixels at positions (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), and (7,0) may exist on the upper horizontal pixel line. In 1820 of Figure 18, it is assumed that the current pixel to be predicted is pixel (4,0) among the pixels on the upper horizontal pixel line.
[0224] Since the prediction mode of the current block 1825 is the horizontal mode, the encoder and decoder may input the pixel value of the first reference pixel (-1,0) (e.g., the uppermost reference pixel among the left reference pixels) located on the same horizontal line as the pixel to be predicted, into the position of the pixel to be predicted. That is, when the prediction mode of the current block 1825 is the horizontal mode, the pixel value of the first reference pixel may be determined as the predicted pixel value of the pixel to be predicted.
[0225] However, in this case, since the generated predicted pixel value may have a large prediction error, the encoder and decoder may derive a final predicted pixel value by adding an offset value to the first reference pixel value. Here, the process of adding the offset value may correspond to a filtering process or may correspond to a part of a predicted pixel generating process. In this case, the offset value may be derived based on a second reference pixel (4,-1) adjacent to the upper side of the pixel to be predicted and a third reference pixel (-1,-1) adjacent to the upper side of the first reference pixel. For example, the offset value may correspond to a value obtained by subtracting the pixel value of the third reference pixel from the pixel value of the second reference pixel. That is, the encoder and decoder may derive a predicted value of the pixel to be predicted by adding a difference between the second reference pixel value and the third reference pixel value to the first reference pixel value. The predicted pixel generating process described in detail may be applied in the same or similar manner to pixels other than pixel (4,0) among pixels on an upper horizontal pixel line.
[0226] The detailed predicted pixel generation process is shown, for example, in Equation 6 below.
[0227] (Number 6) p′[x,y]=p[-1,y]+((p[x,-1]-p[-1,-1])>>1)),{x=0,...,nS-1,y=0}
[0228] Here, p'[x,y] denotes a final predicted pixel value for a pixel to be predicted at position (x,y), p[-1,y] denotes a first reference pixel located on the same horizontal line as the pixel to be predicted among the left reference pixels, p[x,-1] denotes a second reference pixel adjacent to the upper side of the pixel to be predicted, p[-1,-1] denotes a third reference pixel adjacent to the upper side of the first reference pixel, and nS denotes the width of the current block.
[0229] Meanwhile, when the prediction mode of the current block 1825 is the horizontal mode, the region to which the offset and / or filtering is applied is not limited to the above embodiment. For example, the encoder and decoder may apply the detailed predicted pixel generation process to the topmost two horizontal pixel lines in the current block 1825. In this case, the predicted pixel generation process is represented by the following Equation 7 as an example.
[0230] (Number 7) p′[x,y]=p[x,y]+(p[x,-1]-p[-1,-1]+(1<<y))> >(y+1),{x=0~7,y=0~1}
[0231] Here, p'[x,y] denotes a final predicted pixel value for a pixel to be predicted at (x,y), p[x,y] denotes a predicted pixel value generated by a general horizontal prediction process, p[x,-1] denotes a reference pixel located on the same vertical line as the pixel to be predicted among the upper reference pixels, and p[-1,-1] denotes an upper left corner reference pixel.
[0232] Meanwhile, similar to 1810 of FIG 18, the process of adding the offset value described in detail is applied only when the current block is a luma block, and may not be applied when the current block is a chroma block. For example, when the current block is a chroma block, the encoder and decoder may determine the first reference pixel as the predicted pixel value of the pixel to be predicted without applying the offset value.
[0233] FIG. 19 shows diagrammatically another embodiment of a filter type according to the invention.
[0234] In the embodiment of FIG. 19, since the encoder and decoder perform intra prediction on the current block based on the left reference pixel and / or the lower left reference pixel, the correlation between the predicted pixel located in the upper region in the prediction block 1910 and the upper reference pixel may be reduced. Therefore, in this case, the encoder and decoder may perform filtering on the predicted pixel included in the upper horizontal predicted pixel line (e.g., one horizontal pixel line located at the topmost position in the prediction block 1910). In the embodiment described below, an embodiment in which filtering is performed on pixels on the upper horizontal predicted pixel line is described, but the filtering method according to FIG. 19 may be applied in a similar manner to the case in which filtering is performed on pixels on the left vertical predicted pixel line (e.g., one vertical pixel line located at the leftmost position in the prediction block 1910).
[0235] 19, the encoder and decoder may perform filtering on a predicted pixel in a prediction block 1910, i.e., a predicted pixel (B) 1920. The filtering process may correspond to a process of adding an appropriate offset value to the pixel value of the predicted pixel 1920.
[0236] The offset value may be derived based on a reference pixel. As an example, when the pixel to be filtered 1920 is the uppermost pixel in the prediction block 1910, the reference pixel used to derive the offset value is a reference pixel (A) 1930 adjacent to the upper side of the pixel to be filtered 1920. As another example, when the pixel to be filtered is the leftmost pixel in the prediction block 1910, the reference pixel used to derive the offset value is a reference pixel adjacent to the left side of the pixel to be filtered. Hereinafter, an example of a process of obtaining an offset value based on the reference pixel 1930 will be described.
[0237] The encoder and decoder may perform intra prediction on the reference pixels 1930 to obtain predicted values of the reference pixels, i.e., predicted reference pixel values. Here, the intra prediction is directional prediction. In this case, the encoder and decoder may perform prediction on the reference pixels 1930 based on an intra prediction mode (and / or prediction direction) 1950 that is the same as the prediction mode (and / or prediction direction) 1940 of the current block. If the position of the predicted reference pixel determined based on the prediction direction of the intra prediction mode and the reference pixel is not an integer position, the encoder and decoder may perform interpolation based on the reference pixel at the integer position to obtain the predicted reference pixel value.
[0238] The encoder and decoder may derive an offset value based on a pixel value difference between the reference pixel and the predicted reference pixel. For example, the offset value may correspond to a difference value between the reference pixel value and the predicted reference pixel value divided by 4. Once the offset value is derived, the encoder and decoder may derive a pixel value of the filtered predicted pixel by adding the derived offset value to a pixel value of the predicted pixel 1920.
[0239] The detailed filtering process is shown by the following Equation 8 as an example.
[0240] (Number 8) Ref1=Predicted value of A Delta = (A - Ref1 + 2) >> 2 B′=B+Delta
[0241] Here, B denotes a pixel value of a predicted pixel 1920, A denotes a pixel value of a reference pixel 1930 for the predicted pixel, Ref1 denotes a pixel value of a predicted reference pixel for A, and B′ denotes a pixel value of a filtered predicted pixel.
[0242] In the above embodiment, the filtering execution decision process, the filtering execution area decision process, and the filter type decision process are described independently, but the encoder and the decoder can combine the above processes and process them as one process. In this case, the encoder and the decoder can decide two or more of the filtering execution decision process, the filtering execution area decision process, and the filter type decision process based on one table.
[0243] In one embodiment, whether filtering can be performed, the filtering region, and the filter type according to the intra prediction mode are indicated by one table. In this case, the same table is stored in the encoder and the decoder, and the encoder and the decoder can determine whether filtering can be performed, the filtering region, and the filter type based on the intra prediction mode and the stored table. The following Table 7 shows one embodiment of a table indicating whether filtering can be performed, the filtering region, and the filter type according to the intra prediction mode.
[0244] [Table 7]
[0245] In Table 7, if the value assigned to the filter type is 0, the filter type may indicate that no filtering is performed on the predicted block, and if the value assigned to the filter type is 1, 2, or 3, the filter type may indicate that filtering is performed on the predicted block.
[0246] In addition, in Table 7, when the value assigned to the filter type is 1, the filter type may indicate that the filtering execution region and filter type in the DC mode and / or the planar mode detailed in 1610 of Fig. 16a are applied. When the value assigned to the filter type is 2, the filter type may indicate that the filtering execution region and filter type in the vertical right mode detailed in 1630 of Fig. 16a are applied. When the value assigned to the filter type is 3, the filter type may indicate that the filtering execution region and filter type in the horizontal down mode detailed in 1650 of Fig. 16b are applied.
[0247] As another embodiment, the table shown in Table 7 described in detail above may further include information on whether or not to apply a filter according to a block size. That is, the table including information on whether or not to apply a filter according to an intra prediction mode, a filter application region, and a filter type may also include information on whether or not to apply a filter according to a block size. In this case, the encoder and decoder store the same table, and the encoder and decoder may determine whether or not to perform filtering, a filtering execution region, and a filter type based on the intra prediction mode, the size of a current block (and / or a predicted block), and the stored table.
[0248] If the size of the current block and / or the predicted block is too small or large, it is preferable not to perform filtering on the predicted block. For example, if the current block and / or the predicted block corresponds to a large block such as a block of 32×32 size, the correlation between pixels around and / or within the current block is large, and in such a case, it is meaningless to perform filtering on the predicted block. Therefore, the encoder and the decoder can improve filtering efficiency by adaptively determining whether to perform filtering according to the size of the current block and / or the predicted block. The following Table 8 shows an embodiment of a table configured by considering not only the intra prediction mode but also the block size as described in detail.
[0249] [Table 8]
[0250] In Table 8, values of 0, 1, 2, and 3 assigned to the filter type may have the same meaning as in Table 7. Referring to Table 8, the encoder and decoder may determine whether to perform filtering based on the size of a current block and / or a predicted block, and may determine whether to perform filtering, a filtering region, and a filter type based on an intra prediction mode.
[0251] In another embodiment, whether filtering is performed, the filtering execution area, and the filter type according to the intra prediction mode are shown in Table 9 below.
[0252] [Table 9]
[0253] FIG. 20 is a diagram for explaining intra prediction modes and filter types applied to Table 9. 2010 of FIG. 20 illustrates an embodiment of prediction directions of intra prediction modes and mode values assigned to each prediction direction. The above embodiment has been described mainly based on the intra prediction modes (prediction directions, mode values) shown in 410 of FIG. 4a, but it is assumed that the intra prediction modes (prediction directions, mode values) shown in 2010 of FIG. 20 are used only in the embodiment of Table 9. However, the embodiment of Table 9 is not limited to application in 2010 of FIG. 20.
[0254] Referring to Table 9, if the value assigned to the filtering execution region is 0 and / or the value assigned to the filter type is 0, the encoder and decoder do not perform filtering on the prediction block. On the other hand, if the value assigned to the filtering execution region is not 0 and the value assigned to the filter type is not 0, the encoder and decoder may perform filtering on the prediction block.
[0255] Meanwhile, Tx assigned to the filter application area may indicate x horizontal pixel lines located at the topmost position in the prediction block, i.e., upper horizontal predicted pixel lines, and Lx may indicate x vertical pixel lines located at the leftmost position in the prediction block, i.e., left vertical predicted pixel lines. Also, TxLx assigned to the filter application area may indicate an area including both the upper horizontal predicted pixel line and the left vertical predicted pixel line. In the embodiment of Table 9, the value of x may be 1, 2, or 4. However, in another embodiment, x may be a predetermined fixed value, and for example, x may always be 1. In this case, the upper horizontal predicted pixel line may include only one horizontal pixel line, and the left vertical predicted pixel line may also include only one vertical pixel line.
[0256] The non-zero filter types in Table 9 include a, b, c, d, and e. In Table 9, when the value assigned to the filter type is a, the encoder and decoder may perform filtering based on the filtering execution area and filter type detailed in 1610 of FIG. 16a. In this case, the encoder and decoder may perform filtering based on the filter coefficients detailed in 1610 of FIG. 16a for predicted pixels included in the upper horizontal predicted pixel line (one pixel line) and the left vertical predicted pixel line (one pixel line). In Table 9, when the value assigned to the filter type is b, the encoder and decoder may perform filtering based on the filtering execution area and filter type detailed in FIG. 18. When the prediction mode of the current block is a vertical mode (e.g., a prediction mode with a mode value of 1), the encoder and decoder may perform filtering on predicted pixels included in the left vertical predicted pixel line (e.g., two pixel lines) as in 1810 of FIG. 18. In addition, if the prediction mode of the current block is a horizontal mode (e.g., a prediction mode with a mode value of 2), the encoder and decoder may perform filtering on predicted pixels included in an upper horizontal predicted pixel line (e.g., two pixel lines) as shown in 1820 of FIG. 18.
[0257] On the other hand, in Table 9, if the value assigned to the filter type is c and the filter application region is assigned to Tx, the encoder and decoder may perform filtering based on the filtering execution region and filter type detailed in 1650 of FIG. 16b. In this case, the encoder and decoder may apply a diagonal filter of [1,3] to the predicted pixel included in the upper horizontal predicted pixel line. In addition, in Table 9, if the value assigned to the filter type is b and the filter application region is assigned to Lx, the encoder and decoder may perform filtering based on the filtering execution region and filter type detailed in 1630 of FIG. 16a. In this case, the encoder and decoder may apply a diagonal filter of [1,3] to the predicted pixel included in the left vertical predicted pixel line.
[0258] In Table 9, if the intra prediction mode of the current block is 7 or 10, the value assigned to the filter type is d. Referring to 2020 in FIG. 20, block 2023 indicates a prediction block, and the prediction direction when the intra prediction mode of the current block is 10 is indicated as 2025. In this case, the filtered prediction pixel value is represented by the following Equation 9.
[0259] (Number 9) p′[x,y]=((16-k)*p[x,y]+k*p[x,-1]+8)>>4, k=1<<(3-y), {x=0,...,7, y=0,...,3}
[0260] Here, p'[x,y] may represent a filtered predicted pixel value, and p[x,y] may represent a predicted pixel value before filtering at a position (x,y). Also, p[x,-1] may represent a 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 may perform filtering on the topmost four horizontal pixel lines in the prediction block 2023. When the intra prediction mode of the current block is 7, the encoder and decoder may also perform filtering on the leftmost four vertical pixel lines in the prediction block 2023 in a manner similar to Equation 9.
[0261] Also, referring to 2020 in FIG. 2, when the intra prediction mode of the current block is 24, the prediction direction is represented 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] (Number 10) p′[x,y]=p[x,y]+(p[-1,y]-Rp[-1,y]+2)>>2, {x=0, y=0,...,7}
[0263] Here, p'[x,y] may indicate a filtered predicted pixel value, and p[x,y] may indicate a predicted pixel value before filtering at a position (x,y). Also, p[-1,y] may indicate a reference pixel located on the same horizontal line as the predicted pixel among the left reference pixels. Rp[-1,y] may indicate a predicted value for the reference pixel of p[-1,y], i.e., a predicted reference pixel value. In order to derive the predicted reference pixel value, the encoder and decoder may perform prediction on the reference pixel of p[-1,y] based on the same intra prediction mode as the prediction mode of the current block.
[0264] In Table 9, the value assigned to the filter type is e even when the intra prediction mode of the current block is 13, 17, 23, 31, or 32. Therefore, even in this case, the encoder and decoder can perform filtering in a similar manner 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 embodiment. That is, the filters applied according to the values assigned to each filter type may be changed according to the implementation and / or need, and the applicability of the filters may be set differently from the above-described embodiment.
[0266] Hereinafter, an embodiment of the filtering process for the predicted pixel according to the present invention will be described in detail. In the embodiment described below, the inputs are 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 predicted block, and p[x,y](x,y=-1,...,nS) indicates pixel values of reference pixels located around the current block. Also, predSamples[x,y](x,y=0,...,nS-1) indicates predicted pixel values, and predSamplesF[x,y](x,y=0,...,nS-1) indicates filtered predicted pixel values.
[0267] In this case, whether filtering is performed according to the intra prediction mode, the filtering execution area, and the filter type may be determined according to Table 10 below.
[0268] [Table 10]
[0269] In Table 10, intraPostFilterType indicates filter type information applied to a predicted block. In this case, the filter type information may include both information on whether filtering is performed, the filtering execution area, and the filter type. In addition, intraPostFilterType may be indicated in intraPostFilterType[IntraPredMode], which may mean that the value assigned to intraPostFilterType is determined by IntraPredMode.
[0270] If nS is less than 32, the encoder and decoder can derive predSamplesF[x,y] (x,y=0,...,nS-1) according to the following process depending on the value assigned to intraPostFilterType[IntraPredMode].
[0271] If the value assigned to intraPostFilterType[IntraPredMode] is 1, the encoder and decoder may derive the predSamplesF[x,y] value according to Equation 11 below.
[0272] (Number 11) predSamplesF[0,0]=(p[-1,0]+2*predSamples[0,0]+p[0,-1]+2)>>2 predSamplesF[x,0]=(p[x,-1]+3*predSamples[x,0]+2)>>2(x=1,...,nS-1) predSamplesF[0,y]=(p[-1,y]+3*predSamples[0,y]+2)>>2(y=1,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x,y=1,...,nS-1)
[0273] When the value assigned to intraPostFilterType[IntraPredMode] is 2, the encoder and decoder may derive the predSamplesF[x, y] value according to Equation 12 below.
[0274] (Number 12) predSamplesF[0,y]=(p[-1,y+1]+3*predSamples[0,y]+2)>>2(y=0,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x=1,...,nS-1, y=0,...,nS-1)
[0275] When the value assigned to intraPostFilterType[IntraPredMode] is 3, the encoder and decoder may derive the predSamplesF[x,y] value according to Equation 13 below.
[0276] (Number 13) predSamplesF[x,0]=(p[x+1,-1]+3*predSamples[x,0]+2)>>2(x=0,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x=0,...,nS-1, y=1,...,nS-1)
[0277] When the value assigned to intraPostFilterType[IntraPredMode] is 0, the encoder and decoder may derive the predSamplesF[x,y] value according to Equation 14 below.
[0278] (Number 14) predSamplesF[x,y]=predSamples[x,y](x,y=0,...,nS-1)
[0279] Meanwhile, for all the methods described in detail (e.g., filtering execution methods), the encoder and decoder may set the application scope differently depending on the size and / or depth of the current block (and / or prediction block). For example, the application scope of the present invention may be set differently depending on the size of the PU and / or the size of the TU, or may be set differently depending on the depth value of the CU.
[0280] In this case, the encoder and decoder may use a block size and / or a block depth value as a variable to determine the application range of the present invention. Here, the block may correspond to a CU, a PU, and / or a TU. As an example, when a block size value is used as a variable, the encoder and decoder may apply the present invention only to blocks having a size equal to or larger than the variable, or as another example, may apply the present invention only to blocks having a size equal to or smaller than the variable. The encoder and decoder may also apply the present invention only to blocks having a size corresponding to the variable value.
[0281] The following Table 11 shows an example of the scope of application of the present invention when the block size value used as a variable for determining the scope of application of the present invention is 16 x 16. In Table 11, O may indicate that the present invention is applicable to the corresponding block size, and X may indicate that the present invention is not applicable to the corresponding block size.
[0282] [Table 11]
[0283] Referring to Table 11, in the case of method A, the encoder and decoder can apply the present invention only to blocks having a size equal to or larger than the block size (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 equal to or smaller than the block size (16×16) used as a variable. 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] Meanwhile, in one embodiment, the variable values (block size value and / or block depth value) for determining the application range of the present invention may be predetermined fixed values. In this case, the variable values are pre-stored in the encoder and the decoder, and the encoder and the decoder can determine the application range of the present invention based on the stored variable values.
[0285] In another embodiment, the variable value for determining the scope of application of the present invention may 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] In another embodiment, a variable value (a block size value and / or a block depth value) for determining the application scope of the present invention may be determined by an encoder. In this case, the encoder may encode information on the variable value and transmit the encoded information to the decoder through a bitstream. The variable value information transmitted through the bitstream may be included in a sequence parameter set (SPS), a picture parameter set (PSP), a slice header, etc. The decoder may derive the variable value from a received bitstream and determine the application scope of the present invention based on the derived variable value.
[0287] At this time, there are various types of indicators used to indicate the variable value information. As an example, when the method A in Table 11 is used and the variable value for determining the application scope of the present invention corresponds to a block size value, the indicator used to indicate the variable value information is log2_intra_prediction_filtering_enable_max_size_minus2. For example, when the variable value is 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 the method A in Table 11 is used and the variable value for determining the application scope of the present invention corresponds to a CU depth value, the indicator used to indicate the variable value information is intra_prediction_filtering_enable_max_cu_depth. For example, in this case, if the value assigned to the indicator is 0, the present invention can be applied to a block having a size of 64x64 or more, if the value assigned to the indicator is 1, the present invention can be applied to a block having a size of 32x32 or more, and if the value assigned to the indicator is 4, the present invention can be applied to a block having a size of 4x4 or more.
[0288] Meanwhile, the encoder may determine that the present invention is not applied to all block sizes. In this case, the encoder may use a predetermined indicator to transmit the determined information to the decoder. As an example, the encoder may transmit an indicator such as intra_prediction_filtering_enable_flag to the decoder by including the indicator in an SPS, PPS, and / or slice header. Here, intra_prediction_filtering_enable_flag may correspond to an indicator indicating whether the present invention is applied to all blocks in a sequence, a picture, and / or a slice. As another example, the encoder may transmit information that the present invention is not applied to all block sizes to the decoder by using an indicator indicating detailed variable value information (e.g., intra_prediction_filtering_enable_max_cu_depth). In this case, as an example, the encoder may indicate that the present invention is not applied to all block sizes by assigning a value (e.g., 5) indicating an invalid (and / or unacceptable) block size (e.g., 2×2 size) to the indicator.
[0289] According to the above-described embodiments, the present invention can reduce prediction errors generated during intra prediction and minimize discontinuities between blocks, thereby improving prediction efficiency and encoding efficiency.
[0290] In the above embodiments, the method is described based on a flow chart with a series of steps or blocks, but the present invention is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Also, a person skilled in the art can understand that the steps shown in the flow chart are not exclusive, and other steps may be included, or one or more steps in the flow chart may be deleted without affecting the scope of the present invention.
[0291] The above-described embodiments include examples of various aspects. It is not possible to describe all possible combinations for illustrating various aspects, but a person skilled in the art can recognize that other combinations are possible. Therefore, the present invention includes all alterations, modifications, and variations that fall within the scope of the claims.
Claims
1. 1. A method of decoding a video, comprising: performing, based on an intra-prediction mode of a current block, generation of a predicted block of the current block using directional intra-prediction; generating a reconstructed block based on the predicted block; Equipped with A selected filtering is performed to generate the predicted block; The selected filtering is determined based on an intra-prediction mode of the current block; the selected filtering is one of a plurality of filterings including a first filtering and a second filtering; If the selected filtering is the first filtering, the first filtering is performed to generate the prediction block based on an intra-prediction mode of a block neighboring the current block; the first filtering is applied to a leftmost vertical line of pixels in the prediction block based on a first value; the second filtering is applied to a topmost horizontal line of pixels in the prediction block based on a second value; the first value is determined based on a vertical reference pixel line adjacent a left portion of the leftmost vertical pixel line; the second value is determined based on a horizontal reference pixel line adjacent to an upper portion of the topmost horizontal pixel line; when the first filtering is performed, a predicted value of a first pixel in the leftmost vertical pixel line is derived by adding the first value to a pixel value of a first reference pixel adjacent to an upper portion of the leftmost vertical pixel line.
2. 2. The video decoding method of claim 1, wherein the first value is determined based on a difference value between a pixel value of a second reference pixel adjacent to a left portion of the first pixel and a pixel value of a third reference pixel adjacent to a left portion of the first reference pixel.
3. 2. The video decoding method of claim 1, wherein when the second filtering is performed, a predicted value of a second pixel of the topmost horizontal pixel line is derived by adding the second value to a pixel value of a fourth reference pixel adjacent to a left portion of the topmost horizontal pixel line.
4. 4. The video decoding method of claim 3, wherein the second value is determined based on a difference between a pixel value of a fifth reference pixel adjacent to an upper part of the second pixel and a pixel value of a sixth reference pixel adjacent to an upper part of the fourth reference pixel.
5. 1. A method of encoding video, comprising the steps of: performing, based on an intra-prediction mode of a current block, generation of a predicted block of the current block using directional intra-prediction; generating a reconstructed block based on the predicted block; Equipped with A selected filtering is performed to generate the predicted block; The selected filtering is determined based on an intra-prediction mode of the current block; the selected filtering is one of a plurality of filterings including a first filtering and a second filtering; If the selected filtering is the first filtering, the first filtering is performed to generate the prediction block based on an intra-prediction mode of a block neighboring the current block; the first filtering is applied to a leftmost vertical line of pixels in the prediction block based on a first value; the second filtering is applied to a topmost horizontal line of pixels in the prediction block based on a second value; the first value is determined based on a vertical reference pixel line adjacent a left portion of the leftmost vertical pixel line; the second value is determined based on a horizontal reference pixel line adjacent to an upper portion of the topmost horizontal pixel line; when the first filtering is performed, a predicted value of a first pixel in the leftmost vertical pixel line is derived by adding the first value to a pixel value of a first reference pixel adjacent to an upper portion of the leftmost vertical pixel line.
6. 6. The video encoding method of claim 5, wherein the first value is determined based on a difference value between a pixel value of a second reference pixel adjacent to a left portion of the first pixel and a pixel value of a third reference pixel adjacent to a left portion of the first reference pixel.
7. 6. The video encoding method of claim 5, wherein when the second filtering is performed, a predicted value of a second pixel of the topmost horizontal pixel line is derived by adding the second value to a pixel value of a fourth reference pixel adjacent to a left portion of the topmost horizontal pixel line.
8. 8. The video encoding method of claim 7, wherein the second value is determined based on a difference between a pixel value of a fifth reference pixel adjacent to an upper portion of the second pixel and a pixel value of a sixth reference pixel adjacent to an upper portion of the fourth reference pixel.
9. 1. A method for transmitting a bitstream, the bitstream being generated by an image coding device, the method comprising: Transmitting the bitstream; The bitstream includes information of an intra-prediction mode of a current block, the intra prediction mode of the current block is used to perform generation of a predicted block of the current block using directional intra prediction; the predicted block is used to generate a reconstructed block; A selected filtering is performed to generate the predicted block; The selected filtering is determined based on an intra-prediction mode of the current block; the selected filtering is one of a plurality of filterings including a first filtering and a second filtering; If the selected filtering is the first filtering, the first filtering is performed to generate the prediction block based on an intra-prediction mode of a block neighboring the current block; the first filtering is applied to a leftmost vertical line of pixels in the prediction block based on a first value; the second filtering is applied to a topmost horizontal line of pixels in the prediction block based on a second value; the first value is determined based on a vertical reference pixel line adjacent a left portion of the leftmost vertical pixel line; the second value is determined based on a horizontal reference pixel line adjacent to an upper portion of the topmost horizontal pixel line; 11. A method for transmitting a bitstream, wherein when the first filtering is performed, a predicted value of a first pixel of the leftmost vertical pixel line is derived by adding the first value to a pixel value of a first reference pixel adjacent to an upper portion of the leftmost vertical pixel line.
10. 10. The method for transmitting a bitstream according to claim 9, characterized in that the first value is determined based on a difference value between a pixel value of a second reference pixel adjacent to a left portion of the first pixel and a pixel value of a third reference pixel adjacent to a left portion of the first reference pixel.
11. 10. The method for transmitting a bitstream as claimed in claim 9, characterized in that when the second filtering is performed, a predicted value of a second pixel of the topmost horizontal pixel line is derived by adding the second value to a pixel value of a fourth reference pixel adjacent to a left portion of the topmost horizontal pixel line.
12. 12. The method for transmitting a bitstream according to claim 11, wherein the second value is determined based on a difference value between a pixel value of a fifth reference pixel adjacent to an upper part of the second pixel and a pixel value of a sixth reference pixel adjacent to an upper part of the fourth reference pixel.
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