Video encoding / decoding method and apparatus therefor
The proposed video encoding and decoding method addresses inefficiencies in high-resolution video processing by using intra-prediction and adaptive filtering based on intra-prediction modes, reducing errors and enhancing encoding/decoding efficiency.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- ELECTRONICS & TELECOMM RES INST
- Filing Date
- 2026-02-06
- Publication Date
- 2026-04-28
AI Technical Summary
Existing video encoding and decoding technologies face challenges in improving efficiency, particularly in handling high-resolution and high-quality video formats like UHD, where intra-prediction and filtering methods do not adequately address prediction errors and discontinuities, limiting encoding/decoding performance.
A method and apparatus for video encoding and decoding that includes intra-prediction and filtering processes, where the filtering area and filter type are determined by the intra-prediction mode of the current block, using specific coefficients for different filter taps and offsets based on pixel positions and modes, thereby generating a final prediction block and restored block.
This approach enhances video encoding/decoding efficiency by reducing prediction errors and discontinuities, leading to improved compression performance and quality in high-resolution video processing.
Smart Images

Figure 2026071358000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to video processing, and more particularly, to an intra prediction method and apparatus therefor.
Background Art
[0002] Recently, as broadcast services with HD (High Definition) resolution have expanded not only in Korea but also worldwide, many users have become accustomed to high-resolution and high-quality videos. As a result, many institutions are accelerating the development of next-generation video devices. In addition, interest in UHD (Ultra High Definition) with a resolution more than four times that of HDTV has increased, and compression techniques for higher-resolution and high-quality videos are being demanded.
[0003] For video compression, an inter prediction technique for predicting pixel values included in a current picture from pictures before and / or after in time, an intra prediction technique for predicting pixel values included in a current picture using pixel information within the current picture, an entropy coding technique for assigning short codes to symbols with high occurrence frequencies and long codes to symbols with low occurrence frequencies, and the like can be used.
Summary of the Invention
Problems to be Solved by the Invention
[0004] A technical problem of the present invention is to provide a video encoding method and apparatus capable of improving video encoding / decoding efficiency.
[0005] Another technical problem of the present invention is to provide a video decoding method and apparatus capable of improving video encoding / decoding efficiency.
[0006] Another technical problem of the present invention is to provide a prediction block generation method and apparatus capable of improving video encoding / decoding efficiency.
[0007] Another technical objective of the present invention is to provide an intra-prediction method and apparatus that can improve video coding / decoding efficiency.
[0008] Another technical objective of the present invention is to provide a filtering method and apparatus that can improve video encoding / decoding efficiency. [Means for solving the problem]
[0009] One embodiment of the present invention is a video decoding method. The method includes the steps of: performing intra-prediction on a current block to generate a prediction block; performing filtering on the pixels to be filtered within the prediction block based on the intra-prediction mode of the current block to generate a final prediction block; and generating a restored block based on a restored difference block (hereinafter, difference blocks can be used interchangeably with residual blocks) corresponding to the current block and the final prediction block, wherein the pixels to be filtered are prediction pixels included in the filtering area within the prediction block, and the filter type and the filtering area applied to the pixels 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 area includes the left vertical prediction pixel line, which is the leftmost vertical pixel line in the prediction block, and the upper horizontal prediction pixel line, which is the uppermost horizontal pixel line in the prediction block.
[0011] In the final predicted block generation step, filtering is performed if the current block is a luma component block, and filtering is not performed if the current block is a chroma component block.
[0012] The filter type includes information on the filter shape, filter taps, and multiple filter coefficients, and in the final prediction block generation step, filtering is performed based on a predetermined fixed filter type, regardless of the size of the current block.
[0013] If the pixel to be filtered is the upper left predicted pixel located in the upper leftmost position within the prediction block, the final prediction block generation step performs filtering on the pixel to be filtered by applying a 3-tap filter based on the pixel to be filtered, the upper reference pixel adjacent to the pixel to be filtered, and the left reference pixel adjacent to the left of the pixel to be filtered, wherein the upper reference pixel and the left reference pixel are restored reference pixels adjacent to the current block, and in the 3-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 2 / 4, the filter coefficient assigned to the filter tap corresponding to the upper reference pixel is 1 / 4, and the filter coefficient assigned to the filter tap corresponding to the left reference pixel is 1 / 4.
[0014] If the pixel to be filtered is a predicted pixel included in the left vertical predicted pixel line and is not the left upper predicted pixel, the final predicted block generation step performs filtering on the pixel to be filtered by applying a horizontal 2-tap filter based on the pixel to be filtered and the left reference pixel adjacent to the left of the pixel to be filtered, wherein the left reference pixel is a restored reference pixel adjacent to the current block, and in the horizontal 2-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 3 / 4, and the filter coefficient assigned to the filter tap corresponding to the left reference pixel is 1 / 4.
[0015] If the pixel to be filtered is a predicted pixel included in the upper horizontal predicted pixel line and is not the upper left predicted pixel, the final predicted block generation step performs filtering on the pixel to be filtered by applying a vertical 2-tap filter based on the pixel to be filtered and the upper reference pixel adjacent to the pixel to be filtered, wherein the upper reference pixel is a restored reference pixel adjacent to the current block, and in the vertical 2-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 3 / 4, and the filter coefficient assigned to the filter tap corresponding to the upper reference pixel is 1 / 4.
[0016] Another embodiment of the present invention is a video decoding method. The method includes the steps of generating a prediction block by performing a prediction for a target pixel in the current block based on the intra-prediction mode of the current block, and generating a restored block based on a restored difference block corresponding to the current block and the final prediction block, wherein the prediction block generation step involves performing a prediction for the target pixel based on a first offset if the intra-prediction mode of the current block is vertical and the target pixel is a pixel on the left vertical pixel line, and performing a prediction for the target pixel based on a second offset if the intra-prediction mode of the current block is horizontal and the target pixel is a pixel on the upper horizontal pixel line, wherein the left vertical pixel line is the leftmost vertical pixel line in the current block, and the upper horizontal pixel line is the uppermost horizontal pixel line in the current block.
[0017] In the prediction block generation step, if the intra-prediction mode of the current block is vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, the predicted value of the pixel to be predicted is derived by adding the first offset value to the pixel value of a first reference pixel that lies on the same vertical line as the pixel to be predicted, among the restored reference pixels adjacent to the top of the current block. The first offset value is determined based on the difference between the pixel value of a second reference pixel adjacent to the left of the pixel to be predicted and the pixel value of a third reference pixel adjacent to the left of the first reference pixel.
[0018] In the prediction block generation step, if the current block is a chroma component block, the pixel value of the first reference pixel is determined as the predicted value of the pixel to be predicted.
[0019] In the prediction block generation step, if the intra-prediction mode of the current block is horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, the predicted value of the pixel to be predicted is derived by adding the second offset value to the pixel value of a first reference pixel that lies 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. The second offset value is determined based on the difference between the pixel value of a second reference pixel adjacent above the pixel to be predicted and the pixel value of a third reference pixel adjacent above the first reference pixel.
[0020] In the prediction block generation step, if the current block is a chroma component block, the pixel value of the first reference pixel is determined as the predicted value of the pixel to be predicted.
[0021] Another embodiment of the present invention is a video decoding device. The device includes a prediction block generation unit that performs intra-prediction on a current block to generate a prediction block, a filter unit that performs filtering on the pixels to be filtered within the prediction block based on the intra-prediction mode of the current block to generate a final prediction block, and a restoration block generation unit that generates a restoration block based on the restored difference block corresponding to the current block and the final prediction block, wherein the pixels to be filtered are prediction pixels included in the filtering area within the prediction block, and the filter type and the filtering area applied to the pixels to be filtered 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 area includes the left vertical prediction pixel line, which is the leftmost vertical pixel line in the prediction block, and the upper horizontal prediction pixel line, which is the uppermost horizontal pixel line in the prediction block.
[0023] If the pixel to be filtered is the upper left predicted pixel located in the upper leftmost position within the prediction block, the filter unit performs filtering on the pixel to be filtered by applying a 3-tap filter based on the pixel to be filtered, the upper reference pixel adjacent to the pixel to be filtered, and the left reference pixel adjacent to the left of the pixel to be filtered, wherein the upper reference pixel and the left reference pixel are restored reference pixels adjacent to the current block, and in the 3-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 2 / 4, the filter coefficient assigned to the filter tap corresponding to the upper reference pixel is 1 / 4, and the filter coefficient assigned to the filter tap corresponding to the left reference pixel is 1 / 4.
[0024] 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 the left reference pixel adjacent to the left of the pixel to be filtered, wherein the left reference pixel is a restored reference pixel adjacent to the current block, and in the horizontal 2-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 3 / 4, and the filter coefficient assigned to the filter tap corresponding to the left reference pixel is 1 / 4.
[0025] When the pixel to be filtered is a predicted pixel included in the upper horizontal predicted pixel line and is not the upper left predicted pixel, the filter unit performs filtering on the pixel to be filtered by applying a vertical 2-tap filter based on the pixel to be filtered and an upper reference pixel adjacent above the pixel to be filtered. The upper reference pixel is a restored reference pixel adjacent to the current block. In the vertical 2-tap filter, the filter coefficient assigned to the filter tap corresponding to the pixel to be filtered is 3 / 4, and the filter coefficient assigned to the filter tap corresponding to the upper reference pixel is 1 / 4.
[0026] Another embodiment of the present invention is a video decoding device. The device includes a prediction block generation unit that performs prediction on a pixel to be predicted in the current block based on the intra prediction mode of the current block to generate a prediction block, and a restored block generation unit that generates a restored block based on the restored difference block corresponding to the current block and the final prediction block. When the intra prediction mode of the current block is the vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, the prediction block generation unit performs prediction on the pixel to be predicted based on a first offset. When the intra prediction mode of the current block is the horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, the prediction block generation unit performs prediction on the pixel to be predicted based on a second offset. The left vertical pixel line is the leftmost one vertical pixel line in the current block, and the upper horizontal pixel line is the uppermost one horizontal pixel line in the current block.
[0027] When the intra prediction mode of the current block is the vertical mode and the pixel to be predicted is a pixel on the left vertical pixel line, the prediction block generation unit adds the first offset value to the pixel value of the first reference pixel that exists on the same vertical line as the pixel to be predicted among the restored reference pixels adjacent to the upper side of the current block, and derives the predicted value of the pixel to be predicted. The first offset value is determined based on the difference value between the pixel value of the second reference pixel adjacent to the left side of the pixel to be predicted and the pixel value of the third reference pixel adjacent to the left side of the first reference pixel.
[0028] When the intra prediction mode of the current block is the horizontal mode and the pixel to be predicted is a pixel on the upper horizontal pixel line, the prediction block generation unit adds the second offset value to the pixel value of the first reference pixel that exists on the same horizontal line as the pixel to be predicted among the restored reference pixels adjacent to the left side of the current block, and derives the predicted value of the pixel to be predicted. The second offset value is determined based on the difference value between the pixel value of the second reference pixel adjacent to the upper side of the pixel to be predicted and the pixel value of the third reference pixel adjacent to the upper side of the first reference pixel.
Advantages of the Invention
[0029] According to the video encoding method of the present invention, the video encoding / decoding efficiency can be improved.
[0030] According to the video decoding method of the present invention, the video encoding / decoding efficiency can be improved.
[0031] According to the prediction block generation method of the present invention, the video encoding / decoding efficiency can be improved.
[0032] According to the intra prediction method of the present invention, the video encoding / decoding efficiency can be improved.
[0033] According to the filtering method of the present invention, the efficiency of video encoding / decoding can be improved. [Brief explanation of the drawing]
[0034] [Figure 1] This is a block diagram showing the configuration of one embodiment of a video encoding device to which the present invention is applied. [Figure 2] This is a block diagram showing the configuration of one embodiment of a video decoding device to which the present invention is applied. [Figure 3] This is a conceptual diagram illustrating an example in which one unit is divided into multiple sub-units. [Figure 4a] This is a diagram illustrating an example of the intra-prediction process. [Figure 4b] This is a diagram illustrating an example of the intra-prediction process. [Figure 5] An example of an intra-prediction method in planar mode is outlined below. [Figure 6] This flowchart schematically shows one embodiment of the video encoding method according to the present invention. [Figure 7] An example of the detailed difference block generation process is shown in a schematic manner. [Figure 8] This is a flowchart illustrating a schematic embodiment of the video decoding method according to the present invention. [Figure 9] An example of the detailed difference block generation process is shown in a schematic manner. [Figure 10] This flowchart schematically shows one embodiment of the filtering execution method according to the present invention. [Figure 11] An example of a method for determining whether filtering can be performed based on the encoding parameters of adjacent blocks to the current block is schematically shown. [Figure 12] An example of a method for determining whether filtering can be performed based on information regarding the existence of adjacent blocks (and / or whether the adjacent blocks are available) of a block is schematically shown below. [Figure 13]A schematic example of a method for determining the filtering execution area based on the intra-prediction mode of the current block is shown. [Figure 14] A schematic example of a method for determining the filtering execution area based on the size and / or depth of a block is shown below. [Figure 15] A schematic example of a method for determining the filtering execution area based on the encoding mode of the surrounding blocks adjacent to the current block is shown. [Figure 16a] This document presents an example of a method for determining the filter type using the current block's intra-prediction mode. [Figure 16b] This document presents an example of a method for determining the filter type using the current block's intra-prediction mode. [Figure 17] A simplified explanation of the filter type determination method for the embodiments shown in Figures 16a and 16b is provided. [Figure 18] A schematic example of a filter type that is applied when the current block's prediction mode is vertical mode and / or horizontal mode is shown below. [Figure 19] Another schematic embodiment of the filter type according to the present invention is shown below. [Figure 20] This diagram illustrates the intra-prediction modes and filter types applicable to Table 9. [Modes for carrying out the invention]
[0035] Embodiments of the present invention will be described in detail below with reference to the drawings. In describing the embodiments of this specification, if a detailed description of a related known configuration or function is deemed to obscure the gist of this specification, such detailed description will be omitted.
[0036] When one component is described as being "linked" or "connected" to another component, it should be understood that it may be directly linked to or connected to the other component, but there may also be other components in between. Furthermore, in this invention, the description of a particular configuration "including" does not exclude configurations other than the one described, but rather means that additional configurations may be included within the scope of the implementation of this invention or the technical idea of this invention.
[0037] Terms such as "first," "second," etc., can be used to describe various components, but the components should not be limited by such terms. The terms are used solely for the purpose of distinguishing one component from another. For example, as long as it does not fall outside the scope of the present invention, the first component may be named the second component, and similarly, the second component may be named the first component.
[0038] Furthermore, the components shown in the embodiments of the present invention are illustrated independently to demonstrate distinct and characteristic functions, and this does not mean that each component constitutes separate hardware or a single software component. That is, each component is listed and included for the convenience of explanation, and at least two of these components may be integrated to form a single component, or a single component may be divided into multiple components to perform its function. Such integrated and separated embodiments of each component are also included within the scope of the present invention as long as they do not deviate from the essence of the present invention.
[0039] Furthermore, some components are not essential components for performing the essential functions of the present invention, but are merely optional components for improving performance. The present invention can be embodied by including only the components essential for realizing the essence of the invention, excluding components used solely for performance improvement, and a structure including only the essential components, excluding optional components used solely for performance improvement, is also included within the scope of the rights of the present invention.
[0040] Figure 1 is a block diagram showing the configuration of one embodiment of a video encoding device to which the present invention is applied.
[0041] Referring to Figure 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 conversion unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse conversion unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.
[0042] The video encoding device 100 can encode the input video in intra mode or inter mode and output a bitstream. Intra prediction means prediction within a screen, and inter prediction means prediction between screens. In intra mode, switch 115 can be switched to intra, and in inter mode, switch 115 can be switched to inter. After generating prediction blocks for the input blocks of the input video, the video encoding device 100 can encode the difference (residual) between the input blocks and the prediction blocks.
[0043] In intra mode, the intra prediction unit 120 can generate predicted blocks by performing spatial prediction using the pixel values of already encoded blocks surrounding the current block.
[0044] In intermode, the motion prediction unit 111 can find the region in the reference image stored in the reference picture buffer 190 that best matches the input block during the motion prediction process and obtain a motion vector. The motion compensation unit 112 can generate a predicted block by performing motion compensation using the motion vector. Here, the motion vector is a two-dimensional vector used for interpretation and can indicate the offset between the image currently being encoded / decoded and the reference image.
[0045] The subtractor 125 can generate a residual block by the difference between the input block and the generated prediction block. The transformer 130 can output a transform coefficient by performing a transform on the residual block. The quantization unit 140 can then quantize the input transform coefficient using quantization parameters 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, symbols with a high probability of occurrence are assigned fewer bits, and symbols with a low probability of occurrence are assigned more bits, thereby reducing the size of the bit sequence for the symbols to be coded. Therefore, the compression performance of video coding can be improved through entropy coding. The entropy coding unit 150 can use coding methods such as exponential golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) for entropy coding.
[0048] The video encoding device according to the embodiment shown in Figure 1 performs inter-predictive encoding, i.e., inter-frame predictive encoding. Therefore, the currently encoded video needs to be decoded and stored so that it can be used as a reference video. Accordingly, the quantized coefficients are dequantized in the dequantization unit 160 and inversely transformed in the inverse transformation unit 170. The dequantized and inversely transformed coefficients are added to the prediction block via the adder 175 to generate the restored block.
[0049] The restored block passes through the filter unit 180, which can apply at least one of the following filters to the restored block or restored picture: a deblocking filter, SAO (Sample Adaptive Offset), or ALF (Adaptive Loop Filter). The filter unit 180 is sometimes called an adaptive in-loop filter. The deblocking filter can remove block distortion that occurs at the boundaries between blocks. SAO can add an appropriate offset value to the pixel value to compensate for coding errors. ALF can perform filtering based on a comparison of the restored image with the original image. The restored block that has passed through the filter unit 180 can be stored in the reference picture buffer 190.
[0050] Figure 2 is a block diagram showing the configuration of one embodiment of a video decoding device to which the present invention is applied.
[0051] Referring to Figure 2, the video decoding device 200 includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transformation 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 device 200 can output a reconstructed video, i.e., a restored video, by receiving the bitstream output from the encoder and performing decoding in intra-mode or inter-mode. In intra-mode, the switch can be switched to intra, and in inter-mode, the switch can be switched to inter. The video decoding device 200 can obtain a residual block from the input bitstream, generate a prediction block, and then add the residual block and the prediction block to generate a reconstructed block, i.e., a restored block.
[0053] The entropy decoding unit 210 can entropy-decode the input bitstream using a probability distribution and generate symbols that include 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, symbols with a high probability of occurrence are assigned fewer bits, and symbols with a low probability of occurrence are assigned more bits, thereby reducing the size of the bit sequence for each symbol. Consequently, the compression performance of video decoding can be improved through the entropy decoding method.
[0055] The quantized coefficients are inversely quantized in the inverse quantization unit 220 and inversely transformed in the inverse transformation unit 230. As a result of the inverse quantization / inverse transformation of the quantized coefficients, a residual block can be generated.
[0056] In intra-mode, the intra-prediction unit 240 can generate predicted blocks by performing spatial prediction using the pixel values of already encoded blocks surrounding the current block. In inter-mode, the motion compensation unit 250 can generate predicted blocks by performing motion compensation using motion vectors and reference images stored in the reference picture buffer 270.
[0057] The residual block and the prediction block are added via the adder 255, and the added block can pass through the filter unit 260. The filter unit 260 can apply at least one of the following filters to the reconstructed block or reconstructed picture: deblocking filter, SAO, or ALF. The filter unit 260 can output the reconstructed image, i.e., the reconstructed image. The reconstructed image can be stored in the reference picture buffer 270 and used for interpretation.
[0058] Hereinafter, "unit" refers to a unit of video encoding and decoding. The encoding or decoding unit during video encoding and decoding refers to the divided unit when video is divided and encoded or decoded; therefore, it is sometimes called a coding unit (CU), prediction unit (PU), or transform unit (TU). Furthermore, in the embodiments described later, the unit may also be called a block. A single unit can be divided into smaller subunits.
[0059] Figure 3 is a conceptual diagram illustrating an example in which one unit is divided into multiple subunits.
[0060] A single unit can be hierarchically divided under a tree structure, each having depth information. Each divided subunit can also have depth information. This depth information may include information about the size of the subunit, as it indicates the number and / or extent to which the unit has been divided.
[0061] Referring to 310 in Figure 3, the highest-level node is sometimes called the root node and can have the smallest depth value. In this case, the highest-level node can have a depth of level 0 and can represent the first unit that is not divided.
[0062] A subnode with a depth of level 1 can represent a unit that has been divided once by the initial unit, and a subnode with a depth of level 2 can represent a unit that has been divided twice by the initial unit. For example, in 320 of Figure 3, unit a, which corresponds to node a, is a unit that has been divided once by the initial unit and can have a depth of level 1.
[0063] A level 3 leaf node can represent a unit that has been divided three times from the initial unit. For example, in Figure 3, unit d, which corresponds to node d, is a unit that has been divided three times from the initial unit and can have a level 3 depth. Therefore, the lowest level node, the level 3 leaf node, can have the deepest depth.
[0064] In the embodiments described below, the block to be encoded / decoded may sometimes be referred to as the current block. Furthermore, when intra-prediction is performed on the block to be encoded / decoded, the said block may also be referred to as the predicted block.
[0065] On the other hand, video signals generally contain three color signals representing the three primary color components of light. These three color signals are R (Red), G (Green), and B (Blue). The R, G, and B signals can be converted into one luma signal and two chroma signals to reduce the frequency bandwidth used for video processing. In this case, a video signal can contain one luma signal and two chroma signals. Here, the luma signal is a component that indicates the brightness of the screen and corresponds to Y, while the chroma signal is a component that indicates the color of the screen and can correspond to U, V, Cb, or Cr. The human eye is sensitive to luma signals and insensitive to chroma signals, so by utilizing this characteristic, when R, G, and B signals are converted into luma and chroma signals, the frequency bandwidth used for video processing can be reduced. In the embodiments described below, a block having a luma component is called a luma block, and a block having a chroma component is called a chroma block.
[0066] Figures 4a and 4b are diagrams illustrating an example of the intra-prediction process. Figures 4a, 410 and 420 show examples of the prediction direction of the intra-prediction mode and the mode values assigned to each prediction direction. Figure 4b, 430, shows the position of the reference pixel used for intra-prediction of the block to be encoded / decoded. The term "pixel" can have the same meaning as "sample," and in the examples described later, pixels may sometimes be referred to as samples.
[0067] As detailed in the embodiments of Figures 1 and 2, the encoder and decoder can generate prediction blocks by performing intra-prediction based on the pixel information in the picture. That is, during intra-prediction, the encoder and decoder can perform directional and / or non-directional prediction based on at least one recovered reference pixel. Here, a prediction block means a block generated as a result of the intra-prediction. The prediction block can correspond to at least one of the coding unit (CU), prediction unit (PU), and transformation unit (TU). The prediction block may also be a square block with dimensions such as 2x2, 4x4, 8x8, 16x16, 32x32, or 64x64, or a rectangular block with dimensions such as 2x8, 4x8, 2x16, 4x16, or 8x16.
[0068] On the other hand, intra-prediction can be performed by the intra-prediction mode of the current block. The number of intra-prediction modes that the current block can have may be a predetermined fixed value, or it may be a value determined differently depending on the size of the prediction block. For example, the number of intra-prediction modes that the current block can have may be 3, 5, 9, 17, 34, 35, or 36, etc.
[0069] Figure 4a, number 410, shows one example of the prediction direction of the intra-prediction mode and the mode value assigned to each prediction direction. In Figure 4a, number 410 can represent the mode value assigned to each intra-prediction mode.
[0070] Referring to 410 in Figure 4a, for example, in the vertical mode where the mode value is 0, predictions can be made vertically based on the pixel value of the reference pixel, and in the horizontal mode where the mode value is 1, predictions can be made horizontally based on the pixel value of the reference pixel. In the case of directional modes other than those described in detail, the encoder and decoder can also perform intra-predictions using the reference pixel according to the angle.
[0071] In Figure 4a, at 410, the intra-prediction mode with a mode value of 2 is sometimes called the DC mode, and the intra-prediction mode with a mode value of 34 is sometimes called the planar mode. The DC mode and planar mode can be non-directional modes. For example, in the DC mode, a prediction block can be generated by averaging the pixel values of multiple reference pixels. An example of a method for generating each prediction pixel within a prediction block in planar mode will be described later in Figure 5.
[0072] The number of intra-prediction modes and / or the mode values assigned to each intra-prediction mode are not limited to the embodiments described above and may be determined differently as required and / or applicable. For example, the prediction direction of the intra-prediction modes and the mode values assigned to each prediction mode may be determined differently from 410 in Figure 4a, as shown in 420 in Figure 4a. In the embodiments described below, for the sake of explanation, unless otherwise specified, it will be assumed that intra-prediction is performed based on intra-prediction modes like 410 in Figure 4a.
[0073] Furthermore, an intra-prediction mode located to the right of the vertical mode is called the vertical-right mode, and an intra-prediction mode located below the horizontal mode is called the horizontal-below mode. For example, in Figure 4a, at 410, intra-prediction modes with mode values 5, 6, 12, 13, 22, 23, 24, and 25 can be considered vertical-right mode 413, and intra-prediction modes with mode values 8, 9, 16, 17, 30, 31, 32, and 33 can be considered horizontal-below mode 416.
[0074] On the other hand, referring to 430 in Figure 4b, the reconstructed reference pixels currently used for intra-prediction of the block include, for example, the below-left reference pixel 431, the left reference pixel 433, the above-left corner reference pixel 435, the above reference pixel 437, and the above-right reference pixel 439. Here, the left reference pixel 433 represents the reconstructed reference pixel adjacent to the left outside the block, the above reference pixel 437 represents the reconstructed reference pixel adjacent to the top outside the block, and the above-left corner reference pixel 435 represents the reconstructed reference pixel located in the upper-left corner outside the block. Furthermore, the lower left reference pixel 431 refers to a reference pixel located below the left pixel line, which is collinear with the left reference pixel 433, and the upper right reference pixel 439 refers to a reference pixel located to the right of the upper pixel line, which is collinear with the upper reference pixel 437. The names of the reference pixels detailed herein can also be applied identically to other embodiments described later.
[0075] The reference pixel used for intraprediction of the current block can change depending on the current block's intraprediction mode. For example, if the current block's intraprediction mode is vertical mode (an intraprediction mode with a mode value of 0 in 410 of Figure 4a), the upper reference pixel 437 can be used for intraprediction. If the current block's intraprediction mode is horizontal mode (an intraprediction mode with a mode value of 1 in 410 of Figure 4a), the left reference pixel 433 can be used for intraprediction. Furthermore, if an intraprediction mode with a mode value of 13 is used, the upper right reference pixel 439 can be used for intraprediction, and if an intraprediction mode with a mode value of 7 is used, the lower left reference pixel 431 can be used for intraprediction.
[0076] If the position of the reference pixel determined based on the prediction direction and the target pixel in the intra-prediction mode is an integer position, the encoder and decoder can determine the reference pixel value at that position as the predicted pixel value for the target pixel. If the position of the reference pixel determined based on the prediction direction and the target pixel in the intra-prediction mode is not an integer position, the encoder and decoder can generate an interpolated reference pixel based on the reference pixel at an integer position and determine the pixel value of the interpolated reference pixel as the predicted pixel value.
[0077] According to the embodiment described above, the encoder and decoder can perform intra-prediction on the block to be encoded / decoded based on the recovered or generated reference pixels. However, as mentioned above, the reference pixels used for intra-prediction can vary depending on the intra-prediction mode of the current block, and discontinuities can occur between the generated predicted block and surrounding blocks. For example, in the case of directional intra-prediction, the further away a predicted pixel is from the reference pixel within the predicted block, the larger the prediction error can be. In this case, discontinuities can occur due to the prediction error, limiting the improvement of encoding efficiency.
[0078] Therefore, to solve the problems described in detail, an encoding / decoding method can be provided that performs filtering on prediction blocks generated by intra-prediction. For example, within prediction blocks generated based on reference pixels, a filter can be adaptively applied to regions with large prediction errors. In this case, the prediction error is reduced, discontinuities between blocks are minimized, and encoding / decoding efficiency can be improved.
[0079] Figure 5 schematically shows an example of an intra-prediction method in planar mode.
[0080] Figure 510 shows one embodiment of the intra prediction method in planar mode, and Figure 530 shows another embodiment of the intra prediction method in planar mode. Figures 515 and 535 show the blocks to be encoded / decoded (hereinafter, the same meaning as "current block"), and the size of block 515 and block 535 is nS × nS, respectively.
[0081] In Figure 5, the position of a pixel within the current block is indicated by predetermined coordinates. For convenience, the coordinates of the upper leftmost point within the current block are assumed to be (0,0). In this case, the y-value can increase as you move downwards on the coordinate axis, and the x-value can increase as you move to the right. In the embodiments described later, the coordinates of pixels are indicated by the same coordinate axes used in Figure 5.
[0082] As an example, referring to 510 in Figure 5, the encoder and decoder can derive the pixel value of the predicted pixel for the pixel currently located in the lower right corner of the block (nS-1, nS-1), i.e., the lower right predicted pixel 520. Based on the upper reference pixels, the encoder and decoder can derive the pixel value of the predicted pixel for the pixel currently located in the rightmost vertical line of the block, i.e., the right vertical line predicted pixel, based on the upper reference pixels, the rightmost reference pixel 523 (nS-1, -1) and the lower right predicted pixel 520. Based on the left reference pixels, the lowermost reference pixel 526 (-1, nS-1) and the lower right predicted pixel 520, the encoder and decoder can derive the pixel value of the predicted pixel for the pixel currently located in the lowermost horizontal line of the block, i.e., the lower horizontal line predicted pixel.
[0083] At this time, 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 weighted values based on the upper reference pixels, left reference pixels, right vertical line predicted pixels, and lower horizontal line predicted pixels.
[0084] In another embodiment, the encoder and decoder can also derive a predicted value for the target pixel 540 in block 535 by the method shown in 530 of Figure 5. In 530 of Figure 5, the coordinates of the target pixel 540 are (x,y). Referring to 530 of Figure 5, the encoder and decoder can derive a predicted value for the target pixel 540 by performing an average and / or weighted average based on the uppermost reference pixel (-1,nS)541 among the lower left reference pixels, the reference pixel (-1,y)543 among the left reference pixels located on the same horizontal line as the target pixel 540, the reference pixel (x,-1)545 among the upper reference pixels located on the same vertical line as the target pixel 540, and the leftmost reference pixel (nS,-1) among the upper right reference pixels.
[0085] Figure 6 is a flowchart illustrating a schematic embodiment of the video encoding method according to the present invention.
[0086] Referring to Figure 6, the encoder can generate predicted blocks by performing intra-prediction on the blocks to be encoded (S610). Specific examples of the prediction block generation method are detailed in Figures 4a and 4b and are therefore omitted here.
[0087] Referring to Figure 6, the encoder can perform filtering on the prediction block based on the encoding parameters of the block to be encoded and / or the surrounding blocks adjacent to the block to be encoded (S620). Here, the encoding parameters can include not only information encoded by the encoder and transmitted to the decoder, such as syntax elements, but also information that can be inferred during the encoding or decoding process, and represent the information necessary when encoding or decoding the video. The encoding parameters can include, for example, intra / inter prediction mode, motion vector, reference picture index, coded block pattern (CBP), presence or absence of residual signal, quantization parameters, block size, and block partition information.
[0088] For example, an encoder can perform filtering on predicted blocks based on information such as the intra-prediction mode of the block to be encoded, whether the block to be encoded is a luma block or a chroma block, the size (and / or depth) of the block to be encoded, the encoding parameters of neighboring blocks adjacent to the block to be encoded (e.g., the encoding mode of the neighboring blocks) and / or the existence of the neighboring blocks (and / or whether the neighboring blocks are available blocks).
[0089] In the detailed filtering process, it is stated that the encoder always performs filtering; however, the encoder does not have to perform filtering on the prediction block. For example, the encoder can decide whether or not to perform filtering based on the encoding parameters of the block to be encoded and / or the surrounding blocks adjacent to the block to be encoded. If it decides not to perform filtering, it will not perform filtering on the prediction block.
[0090] On the other hand, the detailed filtering process is a separate process independent of the prediction block generation process, but it may be combined with the prediction block generation process and executed as a single process. That is, the encoder can also generate prediction blocks by applying a process corresponding to the filtering execution process based on the encoding parameters of the block to be encoded and / or surrounding blocks during the prediction block generation process. Specific examples of the filtering execution method will be described later.
[0091] Referring to Figure 6, the encoder can generate a difference block based on the original block and the predicted block corresponding to the position of the block to be encoded (S630). Here, the predicted block may be a predicted block that has been filtered, or a predicted block that has not been filtered.
[0092] Figure 7 schematically shows an example of the detailed difference block generation process. Figure 7, 710 shows an example of the process of generating a difference block based on an original block and a filtered predicted block. In Figure 7, 710, block 713 is the original block, block 716 is the filtered predicted block, and block 719 is the difference block. Referring to Figure 7, 710, the encoder and decoder can generate a difference block by subtracting the filtered predicted block from the original block. Figure 7, 720 shows an example of the process of generating a difference block based on an original block and a predicted block that has not been filtered. In Figure 7, 720, block 723 is the original block, block 726 is the unfiltered predicted block, and block 729 is the difference block. Referring to Figure 7, 720, the encoder and decoder can generate a difference block by subtracting the unfiltered predicted block from the original block.
[0093] The generated difference blocks can be sent to a decoder after undergoing processes such as transformation, quantization, and entropy coding.
[0094] Figure 8 is a flowchart illustrating a schematic embodiment of the video decoding method according to the present invention.
[0095] Referring to Figure 8, the decoder can generate predicted blocks by performing intra-prediction on the blocks to be decoded (S810). Specific examples of the prediction block generation method are described in detail in Figures 4a and 4b, and are therefore omitted here.
[0096] Referring to Figure 8, the decoder can perform filtering on the prediction block based on the coding parameters of the block to be decoded and / or the surrounding blocks adjacent to the block to be decoded (S820). Here, the coding parameters can include not only information encoded by the encoder and transmitted to the decoder, such as syntax elements, but also information that can be inferred during the coding or decoding process, and represent the information necessary when coding or decoding video. The coding parameters can include, for example, intra / inter prediction mode, motion vector, reference picture index, coded block pattern (CBP), presence or absence of residual signal, quantization parameters, block size, and block partition information.
[0097] For example, a decoder can perform filtering on predicted blocks based on information such as the intra-prediction mode of the block to be decoded, whether the block to be decoded is a luma block or a chroma block, the size (and / or depth) of the block to be decoded, the encoding parameters of neighboring blocks adjacent to the block to be decoded (e.g., the encoding mode of the neighboring blocks) and / or the existence of the neighboring blocks (and / or whether the neighboring blocks are available blocks).
[0098] In the detailed filtering process, it is stated that the decoder always performs filtering; however, the decoder does not have to perform filtering on the prediction block. For example, the decoder can decide whether or not to perform filtering based on the decoding parameters of the block to be decoded and / or the surrounding blocks adjacent to the block to be decoded. If it decides not to perform filtering, it will not perform filtering on the prediction block.
[0099] On the other hand, the detailed filtering process is a separate process independent of the prediction block generation process, but it may be combined with the prediction block generation process and executed as a single process. That is, the decoder can also generate prediction blocks by applying a process corresponding to the filtering execution process based on the coding parameters of the block to be decoded and / or surrounding blocks during the prediction block generation process. In this case, the decoder does not perform a separate filtering process on the prediction blocks.
[0100] The filtering method in the decoder is the same as in the encoder. Specific examples of the filtering method will be described later.
[0101] Furthermore, referring to Figure 8, the decoder can generate a restored block based on the restored differential block and the predicted block corresponding to the position of the block to be decoded (S830). Here, the predicted block may be a predicted block that has been filtered, or a predicted block that has not been filtered.
[0102] Figure 9 schematically shows an example of the detailed difference block generation process. Figure 9, 910 shows an example of the process of generating a restored block based on the restored difference block and the filtered predicted block. In Figure 9, 910, block 913 is the restored difference block, block 916 is the filtered predicted block, and block 919 is the restored block. Referring to Figure 9, 910, the encoder and decoder can generate the restored block by adding the restored difference block and the filtered predicted block. Figure 9, 920 shows an example of the process of generating a restored block based on the restored difference block and the unfiltered predicted block. In Figure 9, 920, block 923 is the restored difference block, block 926 is the unfiltered predicted block, and block 929 is the restored block. Referring to Figure 9, 920, the encoder and decoder can generate the restored block by adding the restored difference block and the unfiltered predicted block.
[0103] Figure 10 is a flowchart schematically showing one embodiment of the filtering execution method according to the present invention.
[0104] Referring to Figure 10, the encoder and decoder can determine whether or not to perform filtering on the prediction block (and / or prediction pixel) (S1010).
[0105] As detailed, the encoder and decoder can perform intra-prediction on the block to be encoded / decoded based on previously recovered reference pixels. In this case, the reference pixels used for intra-prediction and / or the predicted pixel values within the predicted block generated by the intra-prediction can vary depending on the intra-prediction mode of the current block. Therefore, in this case, the encoder and decoder can reduce the prediction error by filtering predicted pixels that have little correlation with the reference pixels used for intra-prediction. Conversely, it is more efficient not to filter predicted pixels that have a strong correlation with the reference pixels used for intra-prediction.
[0106] Therefore, the encoder and decoder can determine whether or not to perform filtering on the predicted block (and / or predicted pixel) based on at least one of the following pieces of information: the intra-prediction mode of the block to be encoded / decoded, whether the block to be encoded / decoded is a luminous block or a chroma block, the size (and / or depth) of the block to be encoded / decoded, the encoding parameters of the surrounding blocks adjacent to the block to be encoded / decoded (e.g., the size and / or encoding mode of the surrounding blocks), and whether or not the surrounding blocks exist (and / or whether the surrounding blocks are available). Whether or not filtering can be performed can be determined during the encoding / decoding process, but it may also be determined in advance by each condition. A specific example of the method for determining whether or not filtering can be performed is described below.
[0107] In one embodiment, the encoder and decoder can determine whether or not to perform filtering on a prediction block based on the intra-prediction mode of the block to be encoded / decoded. As detailed, the reference pixels and prediction direction used for intra-prediction can be determined differently depending on the intra-prediction mode of the block to be encoded / decoded. Therefore, it is efficient to determine whether or not to perform filtering based on the intra-prediction mode of the block to be encoded / decoded.
[0108] Table 1 below shows one example of a method for determining whether filtering can be performed using the intra-prediction mode. In Table 1, it is assumed that the prediction direction of the intra-prediction mode and the mode value assigned to each prediction mode are determined in the same way as 410 in Figure 4a, which is described in detail.
[0109] [Table 1]
[0110] Here, among the values assigned to the intra-prediction mode, 0 indicates that filtering will not be performed, and 1 indicates that filtering will be performed.
[0111] For example, if the prediction mode of the current block is DC mode (for example, a prediction mode with a mode value of 2), the prediction block is generated by averaging the pixel values of multiple reference pixels, resulting in less correlation between the prediction pixels and reference pixels. Therefore, in this case, the encoder and decoder can perform filtering on the prediction pixels within the prediction block. As another example, if the prediction mode of the current block is planar mode (for example, a prediction mode with a mode value of 34), the encoder and decoder can derive the prediction values for each pixel in the current block by first deriving the prediction pixels for the right vertical line and the prediction pixels for the lower horizontal line, as detailed in Figure 5, and then applying weighted values based on the derived prediction pixels and reference pixels. Therefore, in this case, there is less correlation between the prediction pixels and reference pixels, and the encoder and decoder can perform filtering on the prediction pixels within the prediction block.
[0112] As another example, if the intra-prediction mode of the current block is vertical right mode (for example, prediction modes with mode values 5, 6, 12, 13, 22, 23, 24, 25), the encoder and decoder perform intra-prediction for the current block using the upper reference pixels and / or upper right reference pixels, so that the correlation between prediction pixels located in the left region of the prediction block and the left reference pixels can be reduced. Therefore, in such cases, filtering can be performed on pixels located in the left region of the prediction block. As yet another example, if the intra-prediction mode of the current block is horizontal down mode (for example, prediction modes with mode values 8, 9, 16, 17, 30, 31, 32, 33), the encoder and decoder perform intra-prediction for the current block using the left reference pixels and / or lower left reference pixels, so that the correlation between prediction pixels located in the upper region of the prediction block and the upper reference pixels can be reduced. Therefore, in such cases, filtering can be performed on pixels located in the upper region of the prediction block.
[0113] Furthermore, unlike the examples in Table 1, the encoder and decoder can also perform filtering for vertical mode (e.g., prediction mode with a mode value of 0) and horizontal mode (e.g., prediction mode with a mode value of 1). When the intra-prediction mode of the current block is vertical mode, the encoder and decoder perform intra-prediction for the current block using the upper reference pixel, which can reduce the correlation between prediction pixels located in the left region of the prediction block and the left reference pixel. Therefore, in such cases, filtering can be performed on pixels located in the left region of the prediction block. As another example, when the intra-prediction mode of the current block is horizontal mode (e.g., prediction mode with a mode value of 1), the encoder and decoder perform intra-prediction for the current block using the left reference pixel, which can reduce the correlation between prediction pixels located in the upper region of the prediction block and the upper reference pixel. Therefore, in such cases, filtering can be performed on pixels located in the upper region of the prediction block.
[0114] On the other hand, if the current block's intra-prediction mode is one of the remaining prediction modes excluding the detailed prediction modes (for example, prediction modes with mode values 3, 4, 7, 10, 11, 14, 15, 18, 19, 20, 21, 26, 27, 28, 29), then the encoder and decoder can use at least one reference pixel from the upper reference pixel and upper right reference pixel for intra-prediction, and at least one reference pixel from the left reference pixel and lower left reference pixel for intra-prediction. Therefore, in this case, all prediction pixels located in the left and upper regions within the prediction block can maintain their association with the reference pixels, and the encoder and decoder do not perform filtering on the prediction block.
[0115] Examples of the regions where filtering is performed within the current block and / or prediction block, and / or the pixel locations where filtering is performed within the current block, for each case in which filtering is performed, are described below.
[0116] In another embodiment, the encoder and decoder may determine whether filtering can be performed on the prediction block based on the size and / or depth of the current block (and / or the prediction block). In this case, the current block may be at least one of CU, PU, or TU.
[0117] Table 2 below shows one example of a method for determining whether filtering can be performed based on block size, and Table 3 below shows one example of a method for determining whether filtering can be performed based on the depth value of the current block. In the examples in Tables 2 and 3, the current block can be a TU, and the size of the TU can be, for example, 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, etc. However, the present invention is not limited thereto, and the current block can also be a CU and / or PU, etc., that is not a TU.
[0118] [Table 2]
[0119] [Table 3]
[0120] Here, among the values assigned to the intra-prediction mode, 0 indicates that filtering will not be performed, and 1 indicates that filtering will be performed.
[0121] The encoder and decoder can also determine whether filtering can be performed 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 can determine whether filtering can be performed for each intra-prediction mode based on the size of the current block. In this case, the determination of whether filtering can be performed can be made differently for each intra-prediction mode depending on the size of the current block. Table 4 below shows one embodiment of a method for determining whether filtering can be performed based on the intra-prediction mode of the current block and the size of the current block.
[0122] [Table 4]
[0123] Here, among the values assigned to each intra-prediction mode, 0 indicates that filtering will not be performed, and 1 indicates that filtering will be performed.
[0124] In another embodiment, the encoder and decoder can determine whether or not to perform filtering on the predicted block based on information indicating whether the current block is a luma block or a chroma block, i.e., the color component information of the current block. For example, the encoder and decoder may perform filtering on the predicted block only if the current block is a luma block, and not perform filtering if the current block is a chroma block.
[0125] In other embodiments, the encoder and decoder may also determine whether filtering can be performed based on information such as the encoding parameters of the surrounding blocks adjacent to the current block, whether CIP (Constrained Intra Prediction) is applied to the current block, and / or whether the surrounding blocks exist (and / or whether the surrounding blocks are available). Specific examples of methods for determining whether filtering can be performed for each of these will be described later.
[0126] Referring to Figure 10, if it is determined that filtering is performed on the current block and / or the predicted block, the encoder and decoder can determine the region in the current block and / or the predicted block in which filtering will be performed (S1020). Here, the region in which filtering is performed may correspond to one or more samples in the current block and / or the predicted block.
[0127] As detailed, the encoder and decoder can reduce prediction errors by performing filtering on prediction pixels that have little correlation with the reference pixels used for intra-prediction. That is, the encoder and decoder can determine regions within the current block and / or prediction block where the prediction error is relatively large as filtering execution regions. In this case, the encoder and decoder can determine the filtering execution region based on at least one of the following: the intra-prediction mode of the current block, the size (and / or depth) of the current block, and the encoding mode of the surrounding block adjacent to the current block. Here, the encoding mode of the surrounding block can indicate whether the surrounding block was encoded / decoded in inter-mode or intra-mode. A specific example of the filtering execution region determination method will be described later.
[0128] Furthermore, the encoder and decoder can determine the type of filter to apply to each predicted pixel within the filtering execution area (S1030).
[0129] In this case, the filter type may include information about the filter shape, filter taps, and filter coefficients. Multiple intra-prediction modes may have different prediction directions, and the way in which the recovered reference pixels are used may vary depending on the position of the filtered pixel. Therefore, the encoder and decoder can improve filtering efficiency by adaptively determining the filter type. For example, the encoder and decoder can determine the filter type to be applied to each filtered pixel 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 filtered pixel. Filter shapes include horizontal, vertical, and diagonal shapes, and filter taps include 2-tap, 3-tap, and 4-tap.
[0130] Furthermore, the encoder and decoder can 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 decoder can apply different filter coefficients to the pixel to be filtered depending on the size of the prediction block and / or the position of the pixel to be filtered. Therefore, the filter strength for the pixel to be filtered can be determined adaptively. For example, when a 2-tap filter is used, the filter coefficients can be [1:3], [1:7], [3:5], etc. As another example, when a 3-tap filter is used, the filter coefficients can be [1:2:1], [1:4:1], [1:6:1], etc.
[0131] On the other hand, the filter determined by the filter type does not have to be a filter defined by the filter shape, filter taps, filter coefficients, etc. For example, the encoder and decoder can also perform a 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 prediction block generation process and executed in a single process. That is, the filtered predicted pixel value of each pixel in the current block can be derived solely by the filtering process described in detail, and in this case, the filtering process described in detail can correspond to a single process that includes both the prediction pixel generation process and the filtering process for the generated predicted pixels.
[0132] A specific example of the filter type determination method will be described later.
[0133] Once the filter application area and filter type are determined, the encoder and decoder can perform filtering on each predicted pixel within the prediction block based on the determined filter application area and filter type (S1040). If it is determined that filtering should not be performed on the prediction block, the encoder and decoder do not perform filtering on the prediction block (and / or each predicted pixel within the prediction block) (S1050).
[0134] Figure 11 schematically shows an example of a method for determining whether filtering can be performed based on the coding parameters of the surrounding blocks adjacent to the current block.
[0135] In Figure 11, the encoding parameters of the peripheral block include intra prediction mode, inter prediction mode, and coding mode. Here, the encoding mode of the peripheral block indicates whether the peripheral block was encoded / decoded in inter mode or intra mode.
[0136] Figure 11, 1110 shows an example of a method for determining whether filtering can be performed based on the intra-prediction mode of a surrounding block adjacent to the current block. Figure 1113 shows the current block (C), and Figure 1116 shows the left-side surrounding block (A) adjacent to the left of the current block. In Figure 11, 1110, it is assumed that the intra-prediction mode of the current block corresponds to the vertical right mode. In this case, the encoder and decoder perform intra-prediction for the current block using the upper reference pixels and / or upper right reference pixels, so filtering can be performed on pixels located in the left-side region 1119 within the prediction block.
[0137] However, similar to 1110 in Figure 11, if the predicted direction of the left surrounding block (A) 1116 adjacent to the filtering target area 1119 and the predicted direction of the current block (C) 1113 are different from each other, it is more efficient not to perform filtering on the filtering target area 1119. Therefore, the encoder and decoder do not perform filtering on the filtering target area 1119 if the predicted direction of the surrounding block 1116 adjacent to the filtering target area 1119 and the predicted direction of the current block 1113 are different from each other. Conversely, if the predicted direction of the surrounding block 1116 adjacent to the filtering target area 1119 and the predicted direction of the current block 1113 are the same or similar (for example, if the predicted angle difference value is less than or equal to a predetermined threshold), the prediction error can be reduced by performing filtering on the filtering target area 1119.
[0138] Figure 11, part 1120, shows one embodiment of a method for determining whether filtering can be performed based on the encoding mode of the adjacent surrounding block when CIP (Constrained Intra Prediction) is applied to the current block. Figure 11, part 1123 shows the current block (C), and Figure 11, part 1126 shows the left-side surrounding block (A) adjacent to the left of the current block. In Figure 11, part 1120, it is assumed that the intra prediction mode of the current block corresponds to the vertical right mode. In this case, the encoder and decoder perform intra prediction for the current block using the upper reference pixels and / or upper right reference pixels, and therefore filtering can be performed on pixels located in the left-side region 1129 within the prediction block.
[0139] However, if CIP is currently applied to block (C) 1123, the encoder and decoder will not perform filtering on the filtering target area 1129 by the encoding mode of the left peripheral block (A) 1126 adjacent to the filtering target area 1129.
[0140] When CIP is applied to block 1123, the encoder and decoder do not use pixels in the intermode-encoded surrounding blocks as reference pixels when performing intra-prediction for block 1123. For example, in 1120 of Figure 11, if the left surrounding block (A) 1126 is intermode-encoded, the reference pixels in the left surrounding block 1126, i.e., the left reference pixels, are not used for inter-prediction of block 1123. In this case, the encoder and decoder can perform intra-prediction after placing the pixel values of the reference pixels in the intramode-encoded blocks into the positions of the left reference pixels. That is, the encoder and decoder can enhance error tolerance by not using pixels to which intermode is applied for intra-prediction.
[0141] Therefore, similar to 1120 in Figure 11, if CIP is currently applied to block 1123 and the encoding mode of the left peripheral block 1126 adjacent to the filtering target area 1129 is intermode, the encoder and decoder will not perform filtering on the filtering target area 1129.
[0142] Figure 12 schematically shows an example of a method for determining whether filtering can be performed based on information about the existence of adjacent blocks to the current block (and / or whether the adjacent blocks are available blocks).
[0143] In Figure 12, 1210 represents the current block (C), and 1220 represents the surrounding block (A) adjacent to the left of the current block. In Figure 12, it is assumed that the intra-prediction mode of the current block 1210 corresponds to the vertical right mode. In this case, the encoder and decoder perform intra-prediction for the current block using the upper reference pixels and / or upper right reference pixels, and filtering can be performed on pixels located in the left region 1230 within the prediction block.
[0144] However, if there are no adjacent surrounding blocks to the region to be filtered, or if they are not available, the encoder and decoder will not perform filtering on the region to be filtered. Cases where there are no adjacent surrounding blocks to the region to be filtered, or if they are not available, include cases where the current block is on the boundary of the current picture, or where the adjacent surrounding blocks to the current block are outside the slice boundary to which the current block belongs.
[0145] If no adjacent blocks exist or are unavailable to the region to be filtered, the encoder and decoder can generate reference pixel values at positions adjacent to the region to be filtered using available reference pixels, and then perform intra-prediction. However, in this case, the generated reference pixels may have similar values to each other, and the values of the generated reference pixels are not similar to the pixel values in the current block. Therefore, performing filtering on the current block based on the generated reference pixels can reduce encoding efficiency. Consequently, the encoder and decoder do not perform filtering on the region to be filtered.
[0146] Referring to Figure 12, the restored block (B)D is located around the current block (C)1210. Also, the left-side surrounding block (A)1220, which is adjacent to the filtering target region 1230 within the current block 1210, is located outside the slice boundary 1240 to which the current block 1210 belongs. In this case, the left-side surrounding block (A)1220 adjacent to the filtering target region 1230 is an unused block, so the encoder and decoder do not perform filtering on the filtering target region 1230.
[0147] Figure 13 schematically illustrates an example of a method for determining the filtering execution area based on the intra-prediction mode of the current block.
[0148] As detailed, the encoder and decoder can perform intra-prediction on the block to be encoded / decoded based on previously recovered reference pixels. In this case, the reference pixels and / or prediction direction used for intra-prediction can change depending on the intra-prediction mode of the current block. Therefore, it is efficient to determine the filtering execution area as the region where the prediction error is relatively large, taking into account the intra-prediction mode of the current block. More specifically, prediction pixels located in regions adjacent to reference pixels not used for intra-prediction within the prediction block have a low correlation with the reference pixels and may have a large prediction error. Therefore, the encoder and decoder can reduce the prediction error and improve prediction efficiency by performing filtering on prediction pixels in regions adjacent to reference pixels not used for intra-prediction within the prediction block.
[0149] Figure 13, 1310 shows an example of a filtering execution area when the prediction mode of the current block is DC mode and / or planar mode. In Figure 13, 1313 may represent a prediction block and 1316 may represent a filtering execution area.
[0150] As detailed, when the prediction mode of the current block is DC mode, the prediction block 1313 is generated by averaging the pixel values of multiple reference pixels, resulting in less correlation between the prediction pixels and the reference pixels. Therefore, in this case, the encoder and decoder can determine one or more horizontal pixel lines located at the top of the prediction block 1313 (hereinafter referred to as the upper horizontal prediction pixel line) and one or more vertical pixel lines located at the leftmost position of the prediction block 1313 (hereinafter referred to as the left vertical prediction pixel line) as the filtering execution area 1316. At this time, the number of horizontal pixel lines included in the upper horizontal prediction pixel line and the number of vertical pixel lines included in the left vertical prediction pixel line are predetermined fixed numbers, and for example, the upper horizontal prediction pixel line and the left vertical prediction pixel line can each contain one pixel line. Also, as in the embodiment shown in Figure 14 described later, the number of pixel lines included in the upper horizontal prediction pixel line and the number of pixel lines included in the left vertical prediction pixel line can also be determined based on the size of the current block and / or prediction block 1313. That is, the number of pixel lines included in the upper horizontal prediction pixel line and the number of pixel lines included in the left vertical prediction pixel line can have variable values depending on the size of the current block and / or prediction block 1313. For example, the number of pixel lines included in the upper horizontal prediction pixel line and the number of pixel lines included in the left vertical prediction pixel line may be 1, 2, or 4, respectively.
[0151] On the other hand, even when the prediction mode of the current block is planar mode (for example, a prediction mode with a mode value of 34), the correlation between the predicted pixels and the reference pixels is small. Therefore, in this case, the encoder and decoder can determine the upper horizontal predicted pixel line and the left vertical predicted pixel line as the filtering execution region 1316, similar to the DC mode.
[0152] Figure 13, 1320 shows an example of a filtering execution area when the current block's intra-prediction mode is the vertical right-hand mode (for example, a prediction mode where the mode values are 5, 6, 12, 13, 22, 23, 24, 25). In Figure 13, 1323 may represent the prediction block and 1326 may represent the filtering execution area.
[0153] When the prediction mode of the current block is the vertical right mode, the encoder and decoder perform intra-prediction for the current block based on the upper reference pixels and / or upper right reference pixels, which can reduce the correlation between prediction pixels located in the left region of the prediction block 1323 and the left reference pixels. Therefore, in this case, the encoder and decoder can improve prediction efficiency by determining one or more vertical pixel lines located on the far left of the prediction block 1323, i.e., the left vertical prediction pixel line, as the filtering execution region 1326 and performing filtering. In this case, the number of vertical pixel lines included in the left vertical prediction pixel line is a predetermined fixed number; for example, the left vertical prediction pixel line may contain one vertical pixel line. Alternatively, as in the embodiment shown in Figure 14 described later, the number of vertical pixel lines included in the left vertical prediction pixel line can also be determined based on the size of the current block and / or prediction block 1323. That is, the number of vertical pixel lines included in the left vertical prediction pixel line can have a variable value depending on the size of the current block and / or prediction block 1323, for example, 1, 2, or 4.
[0154] On the other hand, when the prediction mode of the current block is vertical mode, the encoder and decoder perform intra-prediction for the current block using the upper reference pixels, which can reduce the correlation between the prediction pixels located in the left region of the prediction block and the left reference pixels. Therefore, even in this case, the encoder and decoder can determine the left vertical prediction pixel line as the filtering execution region and perform filtering.
[0155] Figure 13, 1330 shows an example of a filtering execution area when the current block's intra-prediction mode is a horizontal downward mode (for example, a prediction mode where the mode values are 8, 9, 16, 17, 30, 31, 32, 33). In Figure 13, 1333 can represent a prediction block and 1336 can represent a filtering execution area.
[0156] When the prediction mode of the current block is horizontal downward mode, the encoder and decoder perform intra-prediction for the current block using the left reference pixel and / or lower left reference pixel, thus reducing the correlation between prediction pixels located in the upper region of the prediction block 1333 and the upper reference pixel. Therefore, in this case, the encoder and decoder can improve prediction efficiency by determining one or more horizontal pixel lines located at the very top of the prediction block 1333, i.e., the upper horizontal prediction pixel line, as the filtering execution region 1336 and performing filtering. At this time, the number of horizontal pixel lines included in the upper horizontal prediction pixel line is a predetermined fixed number; for example, the upper horizontal prediction pixel line may contain one pixel line. Alternatively, as in the embodiment shown in Figure 14 described later, the number of horizontal pixel lines included in the upper horizontal prediction pixel line can also be determined based on the size of the current block and / or prediction block 1333. In other words, the number of horizontal pixel lines included in the upper horizontal prediction pixel line can have a variable value depending on the size of the current block and / or prediction block 1333, for example, 1, 2, or 4.
[0157] On the other hand, when the prediction mode of the current block is horizontal mode, the encoder and decoder perform intra-prediction for the current block using the left reference pixel, which can reduce the correlation between the prediction pixel located in the upper region of the prediction block and the upper reference pixel. Therefore, even in this case, the encoder and decoder can determine the upper horizontal prediction pixel line as the filtering execution region and perform filtering.
[0158] Figure 14 schematically illustrates an example of a method for determining the filtering execution area based on the size and / or depth of the current block.
[0159] When the current block (and / or the block to be predicted) is large, the area within the current block with a large prediction error is also large, and when the current block (and / or the block to be predicted) is small, the area within the current block with a large prediction error is also small. Therefore, the encoder and decoder can improve 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 decoder can determine the area with a relatively large prediction error as the filtering execution area.
[0160] Figure 14, 1410 shows an example of a filtering execution area when the current block size is 8x8. In Figure 14, 1413 represents the current block and 1416 represents the filtering target area. In Figure 14, 1410, it is assumed that the intra-prediction mode of the current block 1413 corresponds to the vertical right mode (for example, a prediction mode with a mode value of 6). In this case, the encoder and decoder perform intra-prediction for the current block using the upper reference pixel and / or upper right reference pixel, so the prediction error is large in the left-hand region within the prediction block that is farther from the upper reference pixel and the upper right reference pixel. Therefore, in this case, the encoder and decoder can determine one or more vertical pixel lines located on the leftmost side within the prediction block, i.e., the left vertical prediction pixel lines, as the filtering execution area 1416.
[0161] Figure 14, 1420 shows an example of a filtering execution area when the current block size is 32 × 32. In Figure 14, 1423 represents the current block and 1426 represents the filtering target area. In Figure 14, 1420, it is assumed that the intra-prediction mode of the current block 1423 corresponds to the vertical right mode (for example, a prediction mode with a mode value of 6). In this case, the encoder and decoder perform intra-prediction for the current block using the upper reference pixel and / or upper right reference pixel, so the prediction error is large in the left-hand region within the prediction block that is farther from the upper reference pixel and the upper right reference pixel. Therefore, in this case, the encoder and decoder can determine one or more vertical pixel lines located on the leftmost side within the prediction block, i.e., the left vertical prediction pixel lines, as the filtering execution area 1426.
[0162] In Figures 14 and 1420, detailed above, the number of vertical pixel lines constituting the left vertical prediction pixel line can be determined based on the size of the current blocks 1413, 1423, and / or the prediction block. In Figure 14 and 1410, the size of the current block 1413 is 8x8, which is 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 as the filtering execution area in the order they are located furthest to the left within the prediction block. On the other hand, in Figure 14 and 1420, the size of the current block 1423 is 32x32, which is 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 as the filtering execution area in the order they are located furthest to the left within the prediction block.
[0163] Table 5 below shows an example of a filtering execution area based on block size, and Table 6 below shows an example of a filtering execution area based on the current block depth value. The encoder and decoder can determine the filtering execution area based on the current block size and / or depth, as shown in Tables 5 and 6 below.
[0164] [Table 5]
[0165] [Table 6]
[0166] Here, the current block can correspond to a TU, and the size of the TU can be, for example, 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, etc. However, the present invention is not limited thereto, and the current block can also correspond to a CU and / or PU, etc., that are not TUs.
[0167] The size and / or position of the filtering execution area, currently determined by the size and / or depth of the block, is not limited to the embodiments described above and can be determined to a different size and / or position than those described above. Furthermore, although the filtering execution area determination method is described in the embodiments described above mainly in the vertical right mode, this is merely for the sake of explanation, and the method can be applied to the same or a similar method when the prediction mode of the block currently falls under a mode other than the vertical right mode.
[0168] Figure 15 schematically shows an example of a method for determining the filtering execution area based on the encoding mode of the surrounding blocks adjacent to the current block.
[0169] In Figure 15, we assume that the current intra-prediction mode for block (C) 1510 corresponds to the vertical right-hand mode. In this case, the encoder and decoder perform intra-prediction for the current block 1510 using the upper reference pixel and / or upper right-hand reference pixel, and can therefore determine the left-hand region within the prediction block as the region to be filtered.
[0170] However, if the encoding mode of a neighboring block adjacent to the current block is intermode, the recovered pixel values within that neighboring block are highly likely to be unreliable due to network errors or other reasons. Performing filtering based on recovered pixel values within a neighboring block whose encoding mode is intermode can reduce encoding efficiency. Therefore, the encoder and decoder do not perform filtering on regions adjacent to neighboring blocks whose encoding mode is intermode. In other words, the encoder and decoder can determine the filtering region based on the encoding mode of the neighboring block adjacent to the current block.
[0171] Referring to Figure 15, the surrounding blocks adjacent to the left of block 1510 currently include the reconstructed surrounding block (A) 1520 and the reconstructed surrounding block (B) 1530. Here, we assume that the encoding mode of surrounding block (A) 1520 is intra-mode and the encoding mode of surrounding block (B) 1530 is inter-mode. In this case, the encoder and decoder can determine that only the region 1540 adjacent to the surrounding block (B) 1530, which is encoded in intra-mode, is the region to be filtered from the left-hand region of the prediction block.
[0172] Figures 16a and 16b show an example of a method for determining the filter type using the intra-prediction mode of the current block.
[0173] Figure 16a, 1610 shows an example of a method for determining the filter type when the prediction mode of the current block is DC mode and / or planar mode. In Figure 16a, 1615 shows the prediction block and 1620 shows the filter tap applied to the pixels to be filtered.
[0174] As detailed, when the current block's prediction mode is DC mode, the prediction block 1615 is generated by averaging the pixel values of multiple reference pixels, resulting in less correlation between prediction pixels and reference pixels. Therefore, in this case, the encoder and decoder can 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)) contained in the upper horizontal prediction pixel line (e.g., the uppermost horizontal pixel line in the prediction block 1615) as the filtering execution area. Similarly, when the current block's prediction mode is planar mode, there is also less correlation between prediction pixels and reference pixels. Therefore, in this case, the encoder and decoder can determine the predicted pixels included in the upper horizontal prediction pixel line and the left vertical prediction pixel line as the filtering execution area, similar to the DC mode.
[0175] If the current prediction mode of a block is DC mode and / or planar mode, the encoder and decoder can apply a [1 / 4, 2 / 4, 1 / 4] 3-tap filter 1629 to the left-upper prediction pixel (0,0) located in the upper leftmost position within the prediction block. In this case, the encoder and decoder can perform filtering on the target pixel (0,0) based on the target pixel, the reference pixel adjacent to the target pixel above (0,-1), and the reference pixel adjacent to the target pixel to the left (-1,0). In this case, the filter coefficient applied to the target pixel is 2 / 4, and the filter coefficient applied to the reference pixel adjacent to the target pixel above and the reference pixel adjacent to the target pixel to the left is 1 / 4.
[0176] Furthermore, if the current prediction mode of the block is DC mode and / or planar mode, the encoder and decoder can apply a [1 / 4,3 / 4] horizontal 2-tap filter 1623 to each of the predicted pixels in the left vertical prediction pixel line, excluding the upper left prediction pixels (e.g., (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)). In this case, assuming the position of the pixel to be filtered is (0,y), the encoder and decoder can perform filtering on the pixel to be filtered based on the pixel to be filtered (0,y) and the reference pixel adjacent to the left of the pixel to be filtered (-1,y). In this case, the filter coefficient applied to the pixel to be filtered is 3 / 4, and the filter coefficient applied to the reference pixel adjacent to the left of the pixel to be filtered is 1 / 4.
[0177] Furthermore, if the current prediction mode of a block is DC mode and / or planar mode, the encoder and decoder can apply a [1 / 4,3 / 4] vertical 2-tap filter 1625 to each of the predicted pixels included in the upper horizontal prediction pixel line, excluding the upper left prediction pixel (e.g., (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)). In this case, assuming the position of the pixel to be filtered is (x,0), the encoder and decoder can perform filtering on the pixel to be filtered (x,0) and the reference pixel (x,-1) adjacent to the pixel to be filtered above it. 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 pixel to be filtered is 1 / 4.
[0178] In the embodiments described above, the encoder and decoder can use different filter types (e.g., filter shape, filter taps, and / or filter coefficients, etc.) depending on the size of the current block. In this case, the encoder and decoder can adaptively determine the filter type based on the size of the current block. However, the encoder and decoder can also always use a predetermined fixed filter type (e.g., filter shape, filter taps, and / or filter coefficients, etc.) regardless of the size of the current block and / or predicted block, as in the embodiments described above.
[0179] Figure 16a, 1630 shows an example of a method for determining the filter type when the current block's prediction mode is the vertical right mode (for example, a prediction mode where the mode values are 5, 6, 12, 13, 22, 23, 24, 25). In Figure 16a, 1635 shows the prediction block and 1640 shows the filter tap applied to the pixels to be filtered.
[0180] As detailed, when the prediction mode of the current block is the vertical right mode, the encoder and decoder perform intra-prediction for the current block based on the upper reference pixels and / or upper right reference pixels, so that the correlation between prediction pixels located in the left region of prediction block 1635 and the left reference pixels can be reduced. Therefore, in this case, the encoder and decoder can determine the prediction pixels (e.g., (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) contained in the left vertical prediction pixel line (e.g., the leftmost vertical pixel line in prediction block 1635) as the filtering execution region.
[0181] On the other hand, when the prediction mode of the current block is vertical mode (for example, a prediction mode with a mode value of 0), the encoder and decoder perform intra-prediction for the current block using the upper reference pixels, which can reduce the correlation between prediction pixels located in the left region of the prediction block and the left reference pixels. Therefore, even in this case, the encoder and decoder can determine the prediction pixels contained in the left vertical prediction pixel line as the filtering execution region. However, the filter type applied to vertical mode is different from the filter type applied to vertical right mode.
[0182] If the current prediction mode for a block is the vertical right mode, the encoder and decoder can apply a diagonal 2-tap filter 1640 of [1 / 4, 3 / 4] to each of the prediction pixels included in the left vertical prediction pixel line (e.g., (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)). Assuming the position of the pixel to be filtered is (0,y), the encoder and decoder can perform filtering on the pixel to be filtered based on the pixel to be filtered (0,y) and the reference pixel adjacent below the reference pixel adjacent to the left of the pixel to be filtered (-1,y+1). In this case, the filter coefficient applied to the pixel to be filtered is 3 / 4, and the filter coefficient applied to the reference pixel adjacent below the reference pixel adjacent to the left of the pixel to be filtered is 1 / 4.
[0183] Figure 16b, 1650 shows an example of a method for determining the filter type when the current block's prediction mode is a horizontal downward mode (for example, a prediction mode where the mode values are 8, 9, 16, 17, 30, 31, 32, 33). In Figure 16b, 1655 shows the prediction block, and 1660 shows the filter tap applied to the pixels to be filtered.
[0184] As detailed, when the prediction mode of the current block is horizontal downward mode, the encoder and decoder perform intra-prediction for the current block using the left reference pixel and / or lower left reference pixel, so that the correlation between prediction pixels located in the upper region of prediction block 1655 and the upper reference pixel can be reduced. Therefore, in this case, the encoder and decoder can determine the prediction pixels (e.g., (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)) contained in the upper horizontal prediction pixel line (e.g., the uppermost vertical pixel line in prediction block 1655) as the filtering execution region.
[0185] On the other hand, if the prediction mode of the current block is horizontal mode (for example, a prediction mode with a mode value of 1), the encoder and decoder perform intra-prediction for the current block using the left reference pixel, which can reduce the correlation between prediction pixels located in the upper region of prediction block 1655 and the upper reference pixel. Therefore, even in this case, the encoder and decoder can determine the prediction pixels included in the upper horizontal prediction pixel line as the filtering execution region. However, the filter type applied to horizontal mode may differ from the filter type applied to horizontal downward mode.
[0186] If the current block prediction mode is horizontal downward mode, the encoder and decoder can apply a [1 / 4,3 / 4] diagonal 2-tap filter 1660 to each of the prediction pixels included in the upper horizontal prediction pixel line (e.g., (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)). Assuming the position of the pixel to be filtered is (x,0), the encoder and decoder can perform filtering 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 part 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 part of the pixel to be filtered is 1 / 4.
[0187] Figure 16b, 1670 shows an example of a method for adaptively determining the filter type (e.g., filter shape, filter coefficients, filter taps, etc.) based on the intra-prediction mode (particularly the directional prediction mode) of the current block. In Figure 16b, 1675 shows the prediction block and 1680 shows the filter taps applied to the pixels to be filtered.
[0188] Similar to the embodiments described in detail in 1630 and 1650, the encoder and decoder can apply predetermined fixed filter types to each of the vertical right-hand mode and / or horizontal down-hand mode. However, the encoder and decoder can also apply a variety of filter types beyond those described in detail, depending on the intra-prediction mode. In this case, the encoder and decoder can adaptively determine the filter type based on the intra-prediction mode of the current block.
[0189] As an example, the encoder and decoder can use a 3-tap filter 1681 that performs filtering based on the target pixel (x,y), the reference pixel (x+2,y-1), and the reference pixel (x+3,y-1). In this case, the filter coefficient applied to the target pixel (x,y) is 12, the filter coefficient applied to the reference pixel (x+2,y-1) is 3, and the filter coefficient applied to the reference pixel (x+3,y-1) is 1. As another example, the encoder and decoder can use 3-tap filters 1683, 1685, and 1687 that perform filtering based on the target pixel (x,y), the reference pixel (x+1,y-1), and the reference pixel (x+2,y-1). In this case, the filter coefficient applied to the target pixel (x,y) is 12, the filter coefficient applied to the reference pixel (x+1,y-1) is 1, and the filter coefficient applied to the reference pixel (x+2,y-1) is 3 (1683). Furthermore, 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 can also 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] On the other hand, if the current block's intra-prediction mode is one of the remaining prediction modes excluding the detailed prediction modes (for example, prediction modes with mode values 3, 4, 7, 10, 11, 14, 15, 18, 19, 20, 21, 26, 27, 28, 29), then the encoder and decoder can use at least one reference pixel from the upper reference pixel and upper right reference pixel for intra-prediction, and at least one reference pixel from the left reference pixel and lower left reference pixel for intra-prediction. Therefore, in this case, all prediction pixels located in the left and upper regions within the prediction block can maintain their association with the reference pixels, and the encoder and decoder do not perform filtering on the prediction block.
[0191] Furthermore, as detailed in the embodiment shown in Figure 10, the encoder and decoder can determine whether or not to perform filtering on the predicted block based on the color component information of the current block. Therefore, the encoder and decoder can also perform the filtering process detailed in Figures 16a and 16b only when the current block is a luma block. In other words, the filtering process according to the embodiment described above is applied only when the current block is a luma block, and not when the current block is a chroma block.
[0192] Figure 17 shows a simplified method for determining the filter type according to the embodiments of Figures 16a and 16b.
[0193] Figure 17, item 1710 shows an example of a filter type when the current block's prediction mode is DC mode and / or planar mode. Figure 17, item 1710 shows the same filter type as shown in Figure 16a, item 1610.
[0194] As detailed in Figure 16a at 1610, when the current block's prediction mode is DC mode (e.g., a prediction mode with a mode value of 2) and / or planar mode (e.g., a prediction mode with a mode value of 34), the encoder and decoder can apply a 3-tap filter to the upper left prediction pixel located in the upper leftmost part of the prediction block (e.g., pixel c in Figure 17 at 1710). The encoder and decoder can also apply a horizontal 2-tap filter to each of the prediction pixels in the left vertical prediction pixel line, excluding the upper left prediction pixel (e.g., pixel g in Figure 17 at 1710). Furthermore, the encoder and decoder can apply a vertical 2-tap filter to each of the prediction pixels in the upper horizontal prediction pixel line, excluding the upper left prediction pixel (e.g., pixel e in Figure 17 at 1710). In one embodiment, this is represented by the following equation 1.
[0195] (Math 1) F_g=(f+3*g+2)>>2 F_e=(d+3*e+2)>>2 F_c=(a+2*c+b+2)>>2
[0196] Here, F_x represents the filtered predicted pixel value, which is generated by performing filtering on the predicted pixel value at the x-position.
[0197] Figure 17, 1730 shows an example of the filter type when the current block's prediction mode is the vertical right mode (for example, the prediction mode where the mode values are 5, 6, 12, 13, 22, 23, 24, 25). Figure 17, 1730 shows the same filter type as shown in Figure 16a, 1630.
[0198] As detailed in Figure 16a at 1630, when the current block prediction mode is the vertical right mode, the encoder and decoder can apply a 2-tap filter to each of the prediction pixels included in the left vertical prediction pixel line (for example, pixels i and k in Figure 17 at 1730). Since the prediction direction is diagonal in the vertical right mode, the encoder and decoder can determine the shape of the filter to be diagonal. In one embodiment, this is shown by the following equation 2.
[0199] (Math 2) F_i=(h+3*i+2)>>2 F_k=(j+3*k+2)>>2
[0200] Here, F_x represents the filtered predicted pixel value, which is generated by performing filtering on the predicted pixel value at the x-position.
[0201] Figure 17, 1750 shows an example of the filter type when the current block's prediction mode is a horizontal downward mode (for example, a prediction mode where the mode values are 8, 9, 16, 17, 30, 31, 32, 33). Figure 17, 1750 shows the same filter type as shown in Figure 16b, 1650.
[0202] As detailed in Figure 16b at 1650, when the current block prediction mode is the horizontal downward mode, the encoder and decoder can apply a 2-tap filter to each of the prediction pixels included in the upper horizontal prediction pixel line (for example, pixels m and o in Figure 17 at 1750). Since the prediction direction is diagonal in the horizontal downward mode, the encoder and decoder can determine the diagonal shape of the filter. In one embodiment, this is shown by the following equation 3.
[0203] (Math 3) F_m=(l+3*m+2)>>2 F_o=(n+3*o+2)>>2
[0204] Here, F_x represents the filtered predicted pixel value, which is generated by performing filtering on the predicted pixel value at the x-position.
[0205] Figure 18 schematically shows an example of a filter type that is applied when the current block's prediction mode is vertical mode and / or horizontal mode.
[0206] In the embodiments described later, terms such as the first reference pixel, the second reference pixel, and the third reference pixel are used independently in Figure 18-1810 and Figure 18-1820, respectively. For example, the first reference pixel used in Figure 18-1810 is not the same as the first reference pixel used in Figure 18-1820, and the second and third reference pixels can also have independent meanings in Figure 18-1810 and Figure 18-1820, respectively.
[0207] As detailed, the filter determined by the filter type does not have to be a filter defined by filter shape, filter taps, filter coefficients, etc. For example, the encoder and decoder can also perform a 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 prediction block generation process and executed in a single process. That is, the filtered predicted pixel value of each pixel in the current block can be derived solely by the filtering process described in detail, in which case the filtering process described in detail can correspond to a single process that includes both the prediction pixel generation process and the filtering process for the generated predicted pixels. In such a case, the filtering process can also be considered as the process of generating the final predicted pixel (and / or filtered predicted pixel) using the reference pixel. Therefore, Figure 18 describes an embodiment from the perspective of prediction pixel generation.
[0208] Figure 18, part 1810, shows an example of a method for generating predicted pixels when the current block's prediction mode is vertical mode.
[0209] As detailed, when the prediction mode of the current block is vertical mode, the encoder and decoder can generate a predicted block by performing an intra-prediction for the current block using the upper reference pixels. In this case, because there is little correlation between the predicted pixels located in the left region of the predicted block and the left reference pixels, the predicted pixels located in the left region of the predicted block can have a large prediction error. Therefore, the encoder and decoder can generate a predicted block for each of the pixels ((0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7)) contained in the leftmost vertical pixel line in the current block 1815 (hereinafter referred to as the left vertical pixel line) as follows.
[0210] Referring to 1810 in Figure 18, pixels at positions (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), and (0,7) can exist on the left vertical pixel line. In 1810 in Figure 18, we assume that the pixel currently being predicted is pixel (0,4) among the pixels on the left vertical pixel line.
[0211] Since the prediction mode for block 1815 is currently vertical mode, the encoder and decoder can place the pixel value of a first reference pixel (0,-1) among the upper reference pixels that is located on the same vertical line as the pixel to be predicted (for example, the leftmost reference pixel among the upper reference pixels) into the position of the pixel to be predicted. That is, when the prediction mode for block 1815 is currently vertical mode, the pixel value of the first reference pixel can be determined as the predicted pixel value of the pixel to be predicted.
[0212] However, in this case, the generated predicted pixel value may have a large prediction error, so the encoder and decoder can derive the 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 to a part of the predicted pixel generation process. In this case, the offset value can be derived based on a second reference pixel (-1,4) adjacent to the left of the pixel to be predicted and a third reference pixel (-1,-1) adjacent to the left of the first reference pixel. For example, the offset value may correspond to the value obtained by subtracting the pixel value of the third reference pixel from the pixel value of the second reference pixel. That is, the encoder and decoder can derive the predicted value of the pixel to be predicted by adding the difference between the second reference pixel value and the third reference pixel value to the first reference pixel value. The detailed predicted pixel generation process can be applied in the same or similar way to pixels on the left vertical pixel line other than pixel (0,4).
[0213] The detailed prediction pixel generation process is shown, as an example, by the following equation 4.
[0214] (Math 4) p′[x,y]=p[x,-1]+((p[-1,y]-p[-1,-1])>>1)),{x=0, y=0,...,nS-1}
[0215] Here, p'[x,y] represents the final predicted pixel value for the target pixel at position (x,y), and p[x,-1] represents the first reference pixel among the upper reference pixels that is located on the same vertical line as the target pixel. Also, p[-1,y] represents the second reference pixel adjacent to the left of the target pixel, and p[-1,-1] represents the third reference pixel adjacent to the left of the first reference pixel. Furthermore, nS represents the current block height.
[0216] On the other hand, if the prediction mode of block 1815 is currently vertical mode, the region to which offset and / or filtering is applied is not limited to the embodiments described above. For example, the encoder and decoder can also apply the detailed prediction pixel generation process to the two leftmost vertical pixel lines in block 1815. In this case, the prediction pixel generation process is shown, for example, by Equation 5 below.
[0217] (Math 5) p′[x,y]=p[x,y]+(p[-1,y]-p[-1,-1]+(1<<x))> >(x+1),{x=0,...,1,y=0,...,7}
[0218] Here, p'[x,y] represents the final predicted pixel value for the target pixel at position (x,y), and p[x,y] represents the predicted pixel value generated by a general vertical prediction process. Additionally, p[-1,y] represents the left-side reference pixels located on the same horizontal line as the target pixel, and p[-1,-1] represents the upper left corner reference pixel.
[0219] On the other hand, the process of adding the detailed offset value is only applied when the current block is a luma block, and does not have to be applied when the current block is a chroma block. For example, when the current block is a chroma block, the encoder and decoder can determine the first reference pixel as the predicted pixel value of the target pixel without applying the offset value.
[0220] Figure 18, part 1820, shows an example of a method for generating predicted pixels when the current block's prediction mode is horizontal mode.
[0221] As detailed, when the prediction mode of the current block is horizontal mode, the encoder and decoder can generate a predicted block by performing an intra-prediction for the current block using the left reference pixel. In this case, because there is little correlation between the predicted pixels located in the upper region of the predicted block and the upper reference pixel, the predicted pixels located in the upper region of the predicted block may have a large prediction error.
[0222] Therefore, the encoder and decoder can generate a predicted block and / or predicted pixel for each of the pixels ((0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0)) currently contained in the uppermost horizontal pixel line within block 1825 (hereinafter referred to as the upper horizontal pixel line), as follows:
[0223] Referring to 1820 in Figure 18, pixels at positions (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), and (7,0) can exist on the upper horizontal pixel line. In 1820 in Figure 18, we assume that the pixel currently being predicted is pixel (4,0) among the pixels on the upper horizontal pixel line.
[0224] Since the prediction mode of block 1825 is currently horizontal mode, the encoder and decoder can place the pixel value of a first reference pixel (-1,0) located on the same horizontal line as the target pixel among the left-hand reference pixels (for example, the uppermost reference pixel among the left-hand reference pixels) into the position of the target pixel. That is, when the prediction mode of block 1825 is currently horizontal mode, the pixel value of the first reference pixel can be determined as the predicted pixel value of the target pixel.
[0225] However, in this case, the generated predicted pixel value may have a large prediction error, so the encoder and decoder can derive the 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 to a part of the predicted pixel generation process. In this case, the offset value can be derived based on a second reference pixel (4,-1) adjacent above the pixel to be predicted and a third reference pixel (-1,-1) adjacent above the first reference pixel. For example, the offset value may correspond to the value obtained by subtracting the pixel value of the third reference pixel from the pixel value of the second reference pixel. That is, the encoder and decoder can derive the predicted value of the pixel to be predicted by adding the difference between the second reference pixel value and the third reference pixel value to the first reference pixel value. The detailed predicted pixel generation process can be applied in the same or similar way to pixels on the upper horizontal pixel line that are not pixel (4,0).
[0226] The detailed prediction pixel generation process is shown, as an example, by the following equation 6.
[0227] (Math 6) p′[x,y]=p[-1,y]+((p[x,-1]-p[-1,-1])>>1)),{x=0,...,nS-1,y=0}
[0228] Here, p'[x,y] represents the final predicted pixel value for the target pixel at position (x,y), and p[-1,y] represents the first reference pixel on the left side that lies on the same horizontal line as the target pixel. Additionally, p[x,-1] represents the second reference pixel adjacent to the target pixel above, and p[-1,-1] represents the third reference pixel adjacent to the first reference pixel above. Furthermore, nS represents the current block width.
[0229] On the other hand, if the prediction mode of block 1825 is currently horizontal mode, the region to which offset and / or filtering is applied is not limited to the embodiments described above. For example, the encoder and decoder can also apply the detailed prediction pixel generation process to the two uppermost horizontal pixel lines in block 1825. In this case, the prediction pixel generation process is shown, for example, by Equation 7 below.
[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] represents the final predicted pixel value for the target pixel at position (x,y), and p[x,y] represents the predicted pixel value generated by a general horizontal prediction process. Additionally, p[x,-1] represents a reference pixel among the upper reference pixels that lies on the same vertical line as the target pixel, and p[-1,-1] represents the upper left corner reference pixel.
[0232] On the other hand, similar to 1810 in Figure 18, the process of adding the detailed offset value is applied only when the current block is a luma block, and does not have to be applied when the current block is a chroma block. For example, when the current block is a chroma block, the encoder and decoder can determine the first reference pixel as the predicted pixel value of the target pixel without applying the offset value.
[0233] Figure 19 schematically shows another embodiment of the filter type according to the present invention.
[0234] In the embodiment shown in Figure 19, the encoder and decoder perform intra-prediction for the current block based on the left reference pixel and / or lower left reference pixel, so that the correlation between predictive pixels located in the upper region of the predictive block 1910 and the upper reference pixel can be reduced. Therefore, in this case, the encoder and decoder can perform filtering on predictive pixels contained in the upper horizontal predictive pixel line (e.g., the uppermost horizontal pixel line in the predictive block 1910). While embodiments described later describe an embodiment in which filtering is performed on pixels on the upper horizontal predictive pixel line, the filtering method according to Figure 19 can be applied in a similar manner to when filtering is performed on pixels on the left vertical predictive pixel line (e.g., the leftmost vertical pixel line in the predictive block 1910).
[0235] Referring to Figure 19, the encoder and decoder can perform filtering on the predicted pixels in the prediction block 1910, i.e., the predicted pixel (B) 1920. This filtering process can correspond to the process of adding an appropriate offset value to the pixel value of the predicted pixel 1920.
[0236] The offset value can be derived based on a reference pixel. For example, if the pixel to be filtered 1920 is the uppermost pixel in the prediction block 1910, the reference pixel used to derive the offset value is reference pixel (A) 1930, which is adjacent to the uppermost pixel of the pixel to be filtered 1920. As another example, if the pixel to be filtered is the leftmost pixel in the prediction block 1910, the reference pixel used to derive the offset value is the reference pixel adjacent to the left of the pixel to be filtered. Below, an example of the process of determining the offset value based on reference pixel 1930 is described.
[0237] The encoder and decoder can perform an intra-prediction on the reference pixel 1930 to obtain a predicted value for the reference pixel, i.e., a predicted reference pixel value. Here, the intra-prediction is a directional prediction. At this time, the encoder and decoder can perform a prediction on the reference pixel 1930 based on the same intra-prediction mode (and / or prediction direction) 1950 as the prediction mode (and / or prediction direction) 1940 of the current block. 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 can perform interpolation based on the reference pixel at an integer position to obtain a predicted reference pixel value.
[0238] The encoder and decoder can derive an offset value based on the difference in pixel values between a reference pixel and a predicted reference pixel. For example, the offset value may be the difference between the reference pixel value and the predicted reference pixel value divided by 4. Once the offset value is derived, the encoder and decoder can add the derived offset value to the pixel value of the predicted pixel 1920 to derive the pixel value of the filtered predicted pixel.
[0239] The detailed filtering process is shown, as an example, by the following equation 8.
[0240] (Math 8) Ref1 = Predicted value of A Delta = (A - Ref1 + 2) >> 2 B' = B + Delta
[0241] Here, B represents the pixel value of the predicted pixel 1920, A represents the pixel value of the reference pixel 1930 for the predicted pixel, and Ref1 represents the pixel value of the predicted reference pixel for A. Also, B' represents the pixel value of the filtered predicted pixel.
[0242] In the embodiments described above, the filtering feasibility determination process, the filtering execution area determination process, and the filter type determination process are each described independently. However, the encoder and decoder can combine these processes and process them in a single process. In this case, the encoder and decoder can determine two or more of the filtering feasibility determination process, the filtering execution area determination process, and the filter type determination process based on a single table.
[0243] In one embodiment, the feasibility of filtering by intra-prediction mode, the filtering execution area, and the filter type are shown in a single table. In this case, the encoder and decoder store the same table, and the encoder and decoder can determine the feasibility of filtering, the filtering execution area, and the filter type based on the intra-prediction mode and the stored table. Table 7 below shows one embodiment of a table indicating the feasibility of filtering by intra-prediction mode, the filtering execution area, and the filter type.
[0244] [Table 7]
[0245] In Table 7, if the value assigned to the filter type is 0, the filter type can indicate that no filtering will be performed on the prediction block. If the value assigned to the filter type is 1, 2, or 3, the filter type can indicate that filtering will be performed on the prediction block.
[0246] Furthermore, in Table 7, if the value assigned to the filter type is 1, it indicates that the filtering execution area and filter type in DC mode and / or planar mode, as detailed in 1610 of Figure 16a, will be applied. If the value assigned to the filter type is 2, it indicates that the filtering execution area and filter type in vertical right mode, as detailed in 1630 of Figure 16a, will be applied. If the value assigned to the filter type is 3, it indicates that the filtering execution area and filter type in horizontal downward mode, as detailed in 1650 of Figure 16b, will be applied.
[0247] In another embodiment, the table shown in detail in Table 7 may additionally include information regarding the applicability of filtering based on block size. That is, a table containing information on the applicability of filtering based on intra-prediction mode, the filtering area, and the filter type may also contain information on the applicability of filtering based on block size. In this case, the encoder and decoder store the same table, and the encoder and decoder can determine whether filtering can be performed, the filtering area, and the filter type based on the intra-prediction mode, the size of the current block (and / or predicted block), and the stored table.
[0248] If the size of the current block and / or the predicted block is too small or too large, it is preferable not to perform filtering on the predicted block. For example, if the current block and / or the predicted block is a large block, such as a 32x32 block, the correlation between pixels around and / or inside the current block is large, and in such cases, performing filtering on the predicted block is not particularly meaningful. Therefore, the encoder and decoder can improve filtering efficiency by adaptively deciding whether or not to perform filtering based on the size of the current block and / or the predicted block. Table 8 below shows one embodiment of a table that takes into account not only the intra-prediction mode but also the block size, as detailed above.
[0249] [Table 8]
[0250] In Table 8, the values 0, 1, 2, and 3 assigned to the filter type can have the same meaning as in Table 7. Referring to Table 8, the encoder and decoder can determine whether filtering can be performed based on the size of the current block and / or predicted block, and can determine whether filtering can be performed, the filtering execution area, and the filter type based on the intra-prediction mode.
[0251] As another example, the feasibility of filtering by intra-prediction mode, the filtering execution area, and the filter type are shown in Table 9 below.
[0252] [Table 9]
[0253] Figure 20 is a diagram illustrating the intra-prediction modes and filter types applicable to Table 9. Figure 20, 2010 shows an example of the prediction direction of the intra-prediction mode and the mode values assigned to each prediction direction. The examples described above were mainly based on the intra-prediction mode (prediction direction, mode value) shown in Figure 4a, 410, but it is assumed that only the examples in Table 9 use the intra-prediction mode (prediction direction, mode value) shown in Figure 20, 2010. However, the examples in Table 9 are not limited to Figure 20, 2010.
[0254] Referring to Table 9, if the value assigned to the filtering execution area is 0 and / or the value assigned to the filter type is 0, the encoder and decoder do not perform filtering on the prediction block. On the other hand, if the value assigned to the filtering execution area is not 0 and the value assigned to the filter type is not 0, the encoder and decoder can perform filtering on the prediction block.
[0255] On the other hand, Tx assigned to the filter application area can indicate the x horizontal pixel lines located at the top of the prediction block, i.e., the upper horizontal prediction pixel lines, and Lx can indicate the x vertical pixel lines located at the leftmost position of the prediction block, i.e., the left vertical prediction pixel lines. Furthermore, TxLx assigned to the filter application area can indicate a region that includes both the upper horizontal prediction pixel lines and the left vertical prediction pixel lines. In the embodiments of Table 9, the value of x can be 1, 2, or 4. However, in other embodiments, x may be a predetermined fixed value, for example, x may always be 1. In this case, the upper horizontal prediction pixel lines may include only one horizontal pixel line, and the left vertical prediction pixel lines may also include only one vertical pixel line.
[0256] The non-zero filter types in Table 9 are a, b, c, d, and e. In Table 9, if the value assigned to the filter type is a, the encoder and decoder can perform filtering based on the filtering execution area and filter type detailed in 1610 of Figure 16a. In this case, the encoder and decoder can perform filtering on the predicted pixels contained in the upper horizontal prediction pixel line (one pixel line) and the left vertical prediction pixel line (one pixel line) based on the filter coefficients detailed in 1610 of Figure 16a. In Table 9, if the value assigned to the filter type is b, the encoder and decoder can perform filtering based on the filtering execution area and filter type detailed in Figure 18. If the prediction mode of the current block is the vertical mode (for example, the prediction mode with a mode value of 1), the encoder and decoder can perform filtering on the predicted pixels contained in the left vertical prediction pixel line (for example, two pixel lines) as shown in 1810 of Figure 18. Furthermore, if the current prediction mode of a block is horizontal mode (for example, a prediction mode with a mode value of 2), the encoder and decoder can perform filtering on the prediction pixels contained in the upper horizontal prediction pixel line (for example, two pixel lines), as shown in 1820 of Figure 18.
[0257] On the other hand, in Table 9, if the value assigned to the filter type is c and Tx is assigned to the filter application area, the encoder and decoder can perform filtering based on the filtering execution area and filter type detailed in 1650 of Figure 16b. In this case, the encoder and decoder can apply the [1,3] diagonal filter to the predicted pixels included in the upper horizontal predicted pixel line. Also, in Table 9, if the value assigned to the filter type is b and Lx is assigned to the filter application area, the encoder and decoder can perform filtering based on the filtering execution area and filter type detailed in 1630 of Figure 16a. In this case, the encoder and decoder can apply the [1,3] diagonal filter to the predicted pixels included in the left vertical predicted pixel line.
[0258] In Table 9, when the current block's intra-prediction mode is 7 or 10, the value assigned to the filter type is d. Referring to 2020 in Figure 20, block 2023 represents the prediction block, and the prediction direction when the current block's intra-prediction mode is 10 is shown as 2025. In this case, the filtered prediction pixel value is given by the following equation 9.
[0259] (Math 9) p′[x,y]=((16-k)*p[x,y]+k*p[x,-1]+8)>>4, k=1<<(3-y), {x=0,...,7, y=0,...,3}
[0260] Here, p′[x, y] represents the filtered predicted pixel value, and p[x, y] can represent the predicted pixel value before filtering at the (x, y) position. Also, p[x, -1] can represent the reference pixel located on the same vertical line as the predicted pixel among the upper reference pixels. Referring to Equation 9, when the intra prediction mode of the current block is 10, the encoder and decoder can perform filtering on the four horizontal pixel lines located at the uppermost position within the prediction block 2023. When the intra prediction mode of the current block is 7, the encoder and decoder can also perform filtering on the four vertical pixel lines located at the leftmost position within the prediction block 2023 in a manner similar to Equation 9.
[0261] Also, referring to 2020 in FIG. 2, when the intra prediction mode of the current block is 24, the prediction direction is shown as 2027. In Table 9, when the intra prediction mode of the current block is 24, the value assigned to the filter type is e. When the intra prediction mode of the current block is 24, the filtered predicted pixel value is represented by the following Equation 10.
[0262] (Equation 10) p′[x, y]=p[x, y]+(p[-1, y]-Rp[-1, y]+2)>>2, {x = 0, y = 0,..., 7}
[0263] Here, p′[x, y] represents the filtered predicted pixel value, and p[x, y] can represent the predicted pixel value before filtering at the (x, y) position. Also, p[-1, y] can represent the reference pixel located on the same horizontal line as the predicted pixel among the left reference pixels. Rp[-1, y] can represent the predicted value for the reference pixel of p[-1, y], that is, the predicted reference pixel value. The encoder and decoder can perform prediction based on the same intra prediction mode as the prediction mode of the current block for the reference pixel of p[-1, y] to derive the predicted reference pixel value.
[0264] In Table 9, when the intra prediction mode of the current block is 13, 17, 23, 31, or 32, the value assigned to the filter type is also e. Therefore, in this case as well, the encoder and decoder can perform filtering in a manner similar to Equation 10.
[0265] In Table 9, the filter applied according to the value assigned to each filter type is not limited to the foregoing embodiments. That is, the filter applied according to the value assigned to each filter type can vary according to implementation and / or necessity, and the applicability of the filter can also be set to be different from the foregoing embodiments.
[0266] Hereinafter, an embodiment of the process of performing filtering on predicted pixels according to the present invention will be specifically described. In the embodiment described hereinafter, 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 prediction block, p[x,y] (x, y = -1,..., nS) indicates the pixel values of the reference pixels located around the current block. Also, predSamples[x,y] (x, y = 0,..., nS - 1) indicates the predicted pixel values, and predSamplesF[x,y] (x, y = 0,..., nS - 1) indicates the filtered predicted pixel values.
[0267] At this time, whether filtering can be performed according to the intra prediction mode, the filtering execution area, and the filter type can be determined according to Table 10 below.
[0268]
Table 10
[0269] In Table 10, intraPostFilterType indicates the filter type information applied to the prediction block. This filter type information may include information on whether filtering is possible, the filtering execution area, and the filter type itself. Furthermore, intraPostFilterType may also be represented as intraPostFilterType[IntraPredMode], which means that the value assigned to intraPostFilterType is determined by IntraPredMode.
[0270] If nS is less than 32, the encoder and decoder can induce predSamplesF[x,y](x,y=0,...,nS-1) through 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 can derive the predSamplesF[x,y] value using the following formula 11.
[0272] (Math 11) predSamplesF[0,0]=(p[-1,0]+2*predSamples[0,0]+p[0,-1]+2)>>2 predSamplesF[x,0]=(p[x,-1]+3*predSamples[x,0]+2)>>2(x=1,...,nS-1) predSamplesF[0,y]=(p[-1,y]+3*predSamples[0,y]+2)>>2(y=1,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x,y=1,...,nS-1)
[0273] If the value assigned to intraPostFilterType[IntraPredMode] is 2, the encoder and decoder can derive the predSamplesF[x, y] value using the following formula 12.
[0274] (Math 12) predSamplesF[0,y]=(p[-1,y+1]+3*predSamples[0,y]+2)>>2(y=0,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x=1,...,nS-1, y=0,...,nS-1)
[0275] If the value assigned to intraPostFilterType[IntraPredMode] is 3, the encoder and decoder can derive the predSamplesF[x,y] value using the following formula 13.
[0276] (Math 13) predSamplesF[x,0]=(p[x+1,-1]+3*predSamples[x,0]+2)>>2(x=0,...,nS-1) predSamplesF[x,y]=predSamples[x,y](x=0,...,nS-1, y=1,...,nS-1)
[0277] If the value assigned to intraPostFilterType[IntraPredMode] is 0, the encoder and decoder can derive the predSamplesF[x,y] value using the following formula 14.
[0278] (Number 14) predSamplesF[x,y]=predSamples[x,y](x,y=0,...,nS-1)
[0279] On the other hand, for all the methods described in detail (e.g., the method of performing filtering), the encoder and the decoder can be set such that the applicable range varies depending on the size and / or depth of the current block (and / or the prediction block). For example, the applicable range of the present invention may be set to vary depending on the size of the PU and / or the size of the TU, or may be set to vary depending on the depth value of the CU.
[0280] At this time, the encoder and the decoder can use the size of the block and / or the depth value of the block as variables to determine the applicable range of the present invention. Here, the block can correspond to a CU, a PU, and / or a TU. As an example, when the size value of the block is used as a variable, the encoder and the decoder can also apply the present invention only to blocks having a size greater than the variable, and as another example, the present invention can also be applied only to blocks having a size less than the variable. Also, the encoder and the decoder can apply the present invention only to blocks having a size corresponding to the variable value.
[0281] Table 11 below shows an example of the applicable range of the present invention when the size value of the block used as a variable for determining the applicable range of the present invention is 16×16. In Table 11, O indicates that the present invention is applied to the corresponding block size, and X can indicate that the present invention is not applied to the corresponding block size.
[0282]
Table 11
[0283] Referring to Table 11, in Method A, the encoder and decoder can only be applied to blocks having a size equal to or greater than the block size (16×16) used as a variable. In Method B, the encoder and decoder can only be applied to blocks having a size equal to or less than the block size (16×16) used as a variable. Furthermore, in Method C, the encoder and decoder can only be applied to blocks having the same size as the block size (16×16) used as a variable.
[0284] On the other hand, in one embodiment, the variable values (block size value and / or block depth value) for determining the scope of application of the present invention may be predetermined fixed values. In this case, the variable values are stored in advance in the encoder and decoder, and the encoder and decoder can determine the scope of application of the present invention based on the stored variable values.
[0285] In another embodiment, the variable values for determining the scope of application of the present invention may vary depending on the profile or the level. When the variable values are determined based on the profile, the variable values corresponding to each profile may be predetermined fixed values, and when the variable values are determined based on the level, the variable values corresponding to each level may be predetermined fixed values.
[0286] In another embodiment, variable values (block size and / or block depth) for determining the scope of application of the present invention can be determined by an encoder. In this case, the encoder can encode information about the variable values and transmit it to the decoder via a bitstream. The variable value information transmitted via the bitstream may be included in a Sequence Parameter Set (SPS), a Picture Parameter Set (PSP), and a slice header, etc. The decoder can derive the variable values from the received bitstream and determine the scope of application of the present invention based on the derived variable values.
[0287] In this case, there are various types of indicators used to indicate variable value information. As one example, when Method A is used in Table 11 to determine the scope of application of the present invention and the variable value corresponds to the block size value, the indicator used to indicate the variable value information is log2_intra_prediction_filtering_enable_max_size_minus2. For example, if the variable value is 32×32, the value assigned to the indicator is 3, and if the variable value is 4×4, the value assigned to the indicator is 0. As another example, when Method A is used in Table 11 to determine the scope of application of the present invention and the variable value corresponds to the CU depth value, the indicator used to indicate the variable value information is intra_prediction_filtering_enable_max_cu_depth. For example, in this case, if the value assigned to the indicator is 0, the present invention can be applied to a block having a size of 64 × 64 or larger; if the value assigned to the indicator is 1, the present invention can be applied to a block having a size of 32 × 32 or larger; and if the value assigned to the indicator is 4, the present invention can be applied to a block having a size of 4 × 4 or larger.
[0288] On the other hand, the encoder may also decide not to apply the present invention to all block sizes. In this case, the encoder may use a predetermined indicator to transmit the decided information to the decoder. In one embodiment, the encoder may transmit an indicator such as intra_prediction_filtering_enable_flag to the decoder by including it in the SPS, PPS and / or slice header, etc. Here, intra_prediction_filtering_enable_flag can be an indicator that indicates whether the present invention applies to all blocks in the sequence, picture and / or slice. In another embodiment, the encoder may also transmit to the decoder information that the present invention does not apply to all block sizes by using an indicator that shows the variable value information described in detail (e.g., intra_prediction_filtering_enable_max_cu_depth). In this case, as an example, the encoder may indicate that the present invention does not apply to all block sizes by assigning a value (e.g., 5) that indicates an invalid (and / or unacceptable) block size (e.g., 2x2 size) to the indicator.
[0289] According to the embodiments described above, the present invention can reduce prediction errors that occur during intra-prediction, minimize discontinuities between blocks, and improve prediction efficiency and coding efficiency.
[0290] In the embodiments described above, the method is explained based on a sequence diagram in a series of steps or blocks, but the present invention is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Furthermore, a person with ordinary skill in the art will understand that the steps shown in the sequence diagram are not exclusive, other steps may be included, or one or more steps in the sequence diagram may be deleted without affecting the scope of the present invention.
[0291] The embodiments described above include examples of various modes. It is not possible to describe all possible combinations for demonstrating various modes, but a person with ordinary skill in the art will recognize that other combinations are possible. Therefore, the present invention includes all substitutions, modifications, and changes that fall within the scope of the claims.
Claims
1. A method for decoding video, The steps include: currently performing an intra prediction on a block to generate a predicted block, The steps include generating a restored block based on the predicted block, Equipped with, The predicted values of the predicted pixels in the prediction block are generated using the reference pixels during the intra prediction. The prediction pixels are located on the leftmost vertical pixel line or the uppermost horizontal pixel line of the prediction block. A video decoding method characterized in that the reference pixel is located in a vertical reference pixel line adjacent to the left side of the prediction block.
2. The video decoding method according to claim 1, characterized in that the coefficient of the reference pixel is determined based on the size of the current block.
3. The video decoding method according to claim 2, characterized in that, if the predicted pixel is the lowest and leftmost pixel in the prediction block, the reference pixel is adjacent to the lower left corner of the prediction block in an oblique diagonal direction and is used for intra-prediction.
4. The intra-prediction mode of the aforementioned intra-prediction is planar mode. The video decoding method according to claim 1, characterized in that the prediction block is generated based on a filter using the reference pixel and the intermediate prediction pixel of the intermediate prediction block in planar mode.
5. The video decoding method according to claim 4, characterized in that whether or not to use the filter is determined based on the size of the current block.
6. The video decoding method according to claim 4, characterized in that the predicted pixel and the reference pixel are located on a single horizontal line.
7. A method of encoding video, The steps include: currently performing an intra prediction on the block to generate a predicted block, The steps include generating a restored block based on the predicted block, Equipped with, The predicted values of the predicted pixels in the prediction block are generated using the reference pixels during the intra prediction. The prediction pixels are located on the leftmost vertical pixel line or the uppermost horizontal pixel line of the prediction block. A video encoding method characterized in that the reference pixel is located in a vertical reference pixel line adjacent to the left side of the prediction block.
8. The video encoding method according to claim 7, characterized in that the coefficient of the reference pixel is determined based on the size of the current block.
9. The video coding method according to claim 8, characterized in that, if the predicted pixel is the lowest and leftmost pixel in the prediction block, the reference pixel is diagonally adjacent to the lower left corner of the prediction block and is used for intra-prediction.
10. The intra-prediction mode of the aforementioned intra-prediction is planar mode. The video coding method according to claim 7, characterized in that the prediction block is generated based on a filter using the reference pixel and the intermediate prediction pixel of the intermediate prediction block in planar mode.
11. The video encoding method according to claim 10, characterized in that whether or not to use the filter is determined based on the size of the current block.
12. The video encoding method according to claim 10, characterized in that the prediction pixel and the reference pixel are located on a single horizontal line.
13. A computer-readable recording medium that stores a bitstream, wherein the bitstream is Prediction mode information showing the intra-prediction mode for the current block, Equipped with, The prediction block is generated by performing an intra-prediction on the current block using the prediction mode information, Based on the predicted block, a restoration block is generated. The predicted values of the predicted pixels in the prediction block are generated during the intra-prediction using the reference pixels. The prediction pixels are located on the leftmost vertical pixel line or the uppermost horizontal pixel line of the prediction block. A computer-readable recording medium characterized in that the reference pixel is located in a vertical reference pixel line adjacent to the left side of the prediction block.
14. The computer-readable recording medium according to claim 13, characterized in that the coefficient of the reference pixel is determined based on the size of the current block.
15. The aforementioned intra-prediction mode is a planar mode, The computer-readable recording medium according to claim 13, characterized in that the prediction block is generated based on a filter using the reference pixel and the intermediate prediction pixel of the intermediate prediction block in planar mode.
16. A computer-readable recording medium for storing a bitstream generated by a video encoding device that performs a method for encoding video, wherein the method for encoding video is: The steps include: currently performing an intra prediction on the block to generate a predicted block, The steps include generating a restored block based on the predicted block, The steps include storing the bitstream which includes prediction mode information indicating the intra prediction mode of the current block, Equipped with, The predicted values of the predicted pixels in the prediction block are generated using the reference pixels during the intra prediction. The prediction pixels are located on the leftmost vertical pixel line or the uppermost horizontal pixel line of the prediction block. A computer-readable recording medium characterized in that the reference pixel is located in a vertical reference pixel line adjacent to the left side of the prediction block.
17. The computer-readable recording medium according to claim 16, characterized in that the coefficient of the reference pixel is determined based on the size of the current block.
18. The aforementioned intra-prediction mode is a planar mode, The computer-readable recording medium according to claim 16, characterized in that the prediction block is generated based on a filter using the reference pixel and the intermediate prediction pixel of the intermediate prediction block in planar mode.
19. A computer-readable recording medium that stores a computer-executable program using a bitstream, wherein, when the computer-executable program is executed, the following steps are performed on the decoding device: The steps include decoding prediction mode information that indicates the intra-prediction mode for the current block, The steps include: using the prediction mode information, performing an intra prediction on the current block to generate a prediction block; A step of generating a restored block based on the predicted block and the restored differential block corresponding to the current block, Make it run, The predicted values of the predicted pixels in the prediction block are generated using the reference pixels during the intra prediction. The prediction pixels are located on the leftmost vertical pixel line or the uppermost horizontal pixel line of the prediction block. A computer-readable recording medium characterized in that the reference pixel is located in a vertical reference pixel line adjacent to the left side of the prediction block.
20. The computer-readable recording medium according to claim 19, characterized in that the coefficient of the reference pixel is determined based on the size of the current block.
21. The aforementioned intra-prediction mode is a planar mode, The computer-readable recording medium according to claim 19, characterized in that the prediction block is generated based on a filter using the reference pixel and the intermediate prediction pixel of the intermediate prediction block in planar mode.
22. A method for transmitting a bitstream, wherein the bitstream is generated by an image encoding device, and the method is The steps include transmitting the bitstream, The bitstream includes prediction mode information indicating the intra-prediction mode of the current block, The aforementioned prediction mode information is used to generate the prediction block of the current block using intra-prediction. The aforementioned prediction block is used to generate the restoration block. The predicted values of the predicted pixels in the prediction block are generated during the intra-prediction using the reference pixels. The prediction pixels are located on the leftmost vertical pixel line or the uppermost horizontal pixel line of the prediction block. A method for transmitting a bitstream, characterized in that the reference pixel is located in a vertical reference pixel line adjacent to the left of the prediction block.
23. The method for transmitting a bitstream according to claim 22, characterized in that the coefficient of the reference pixel is determined based on the size of the current block.
24. A method for transmitting a bitstream according to claim 23, characterized in that, if the prediction pixel is the lowest and leftmost pixel in the prediction block, the reference pixel is diagonally adjacent to the lower left corner of the prediction block and is used for intraprediction.
25. The intra-prediction mode of the aforementioned intra-prediction is planar mode. The method for transmitting a bitstream according to claim 22, characterized in that the prediction block is generated based on a filter using the reference pixel and the intermediate prediction pixel of the intermediate prediction block in planar mode.
26. The method for transmitting a bitstream according to claim 25, characterized in that whether or not to use the filter is determined based on the size of the current block.
27. The method for transmitting a bitstream according to claim 25, characterized in that the prediction pixel and the reference pixel are located on a single horizontal line.