Video information encoding / decoding method and apparatus
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- LG ELECTRONICS INC
- Filing Date
- 2024-05-16
- Publication Date
- 2026-08-06
AI Technical Summary
【0024】 本発明によれば、ブロック歪み除去フィルタを適用するに当たって、ブロック歪みを効果的に除去して原映像に近く映像を復元することができる。
Smart Images

Figure 0007901629000004 
Figure 0007901629000005 
Figure 0007901629000006
Abstract
Description
[Technical Field]
[0001] The present invention relates to video information compression technology, and more specifically, to a method for applying a deblocking filter as an in-loop filter. [Background technology]
[0002] Recently, the demand for high-resolution, high-quality video has been increasing in various application fields. However, as video resolution and quality increase, so does the amount of information contained within that video.
[0003] Therefore, when transferring video information using existing wired or wireless broadband lines, or when storing video information using existing storage media, the costs of transferring and storing the information will increase.
[0004] High-efficiency video compression technology can be used to effectively transfer, store, and play back high-resolution, high-quality video information.
[0005] Inter-prediction and intra-prediction can be used to improve the efficiency of video compression. Inter-prediction predicts the pixel values of the current picture by referring to information from other pictures, while intra-prediction predicts pixel values using the relationships between pixels within the same picture.
[0006] For each predicted processing unit of the video, such as a block, various methods can be applied to make the video identical to the original video. Through this, the decoding device can decode the video more accurately (to match the original video more closely), and the encoding device can encode the video in a way that allows for more accurate restoration. [Overview of the Initiative] [Problems that the invention aims to solve]
[0007] The present invention aims to provide a method and apparatus for effectively removing block distortion (blocking artifact) and restoring an image to be close to the original image when applying a block distortion removal filter.
[0008] The present invention aims to provide a method and apparatus for applying a block strain removal filter that can reduce complexity and increase compression efficiency.
[0009] The present invention aims to provide a method and apparatus for applying a block strain removal filter that can effectively set the unit block for determining the boundary strength (bS) and reduce complexity.
[0010] The present invention aims to provide a method and apparatus for reducing complexity when applying a block strain removal filter by effectively setting the bS value. [Means for solving the problem]
[0011] One embodiment of the present invention provides a method for deriving bS, which includes the steps of: deriving the boundary of a block strain removal filter unit block, which is a unit block to which a block strain removal filter is applied; and setting bS for each bS setting unit block within the block strain removal filter unit block. In the bS setting step, a bS value can be set for a target boundary that corresponds to the boundary of the block strain removal filter unit block, as the boundary of the bS setting unit block.
[0012] In the bS setting step, when at least one of the two blocks having the target boundary as the boundary is intra-coded, the bS value of the target boundary is set to bS2. When at least one of the two blocks having the target boundary as the boundary is not intra-coded and the target boundary is an application target of the block distortion removal filter, the bS value of the target boundary is set to bS1. When the target boundary is not an application target of the block distortion removal filter, the bS value of the target boundary can be set to bS0, and bS0, bS1, and bS2 can have the relationship of bS0 < bS1 < bS2.
[0013] When bS is set to bS1, it can include the case where at least one of the two blocks having the target boundary as the boundary is not intra-coded and at least one of the two blocks having the target boundary as the boundary includes a non-zero transform coefficient, and the case where the two blocks having the target boundary as the boundary have different reference pictures or different motion vectors.
[0014] The step of deriving the boundary of the block distortion removal filter unit block and the step of setting bS can be applied to the vertical edges in the picture including the block distortion removal filter unit block and then applied to the horizontal edges in the picture including the block distortion removal filter unit block.
[0015] The block distortion removal filter unit block can be any one of an encoded block, a transform block, a prediction block, and an 8×8 pixel block. Also, the bS determination unit block can be a 4×4 pixel block.
[0016] Another embodiment of the present invention is a block distortion removal filter method, including a step of setting bS for each bS setting unit block with respect to a target boundary, and a step of applying a block distortion removal filter for each application unit block with respect to the target boundary. In the step of setting bS, as the boundary of the bS setting unit block, a bS value can be set for the target boundary corresponding to the boundary of the block distortion removal filter unit block.
[0017] In the bS setting step, when at least one of the two blocks having the target boundary as the boundary is intra-coded, the bS value of the target boundary is set to bS2. When at least one of the two blocks having the target boundary as the boundary is not intra-coded and the target boundary is an application target of the block distortion removal filter, the bS value of the target boundary is set to bS1. When the target boundary is not an application target of the block distortion removal filter, the bS value of the target boundary can be set to bS0, and bS0, bS1, and bS2 can have a relationship of bS0 < bS1 < bS2.
[0018] When bS is set to bS1, it can include the case where at least one of the two blocks having the target boundary as the boundary is not intra-coded and at least one of the two blocks having the target boundary as the boundary includes a non-zero transform coefficient, and the case where the two blocks having the target boundary as the boundary have different reference pictures or different motion vectors.
[0019] The step of setting bS and the step of applying the block distortion removal filter can be applied to the vertical edges in the picture including the block distortion removal filter unit block first, and then applied to the horizontal edges in the picture including the block distortion removal filter unit block.
[0020] When the bS value set for the target boundary is greater than bS0 and the block distortion removal filter is applied, it is possible to determine whether to apply strong filter processing or weak filter processing.
[0021] Whether to apply strong or weak filtering can be determined based on samples from two blocks bounded by the target boundary. If the target boundary is a vertical edge, the decision can be made based on the samples in the sample row bounded by the target boundary that are subject to block distortion removal filtering. If the target boundary is a horizontal edge, the decision can be made based on the samples in the sample column bounded by the target boundary that are subject to block distortion removal filtering.
[0022] If it is decided to apply weak filtering, the filtering can be applied only to specific samples among the samples that are subject to the block distortion removal filter.
[0023] The block distortion removal filter unit block may be any one of the following: an encoding block, a transformation block, a prediction block, or an 8x8 pixel block. The bS decision unit block may be a 4x4 pixel block. [Effects of the Invention]
[0024] According to the present invention, when applying a block distortion removal filter, block distortion can be effectively removed and the image can be restored to be close to the original image.
[0025] According to the present invention, when applying a block distortion removal filter, the complexity can be reduced and the compression efficiency can be increased.
[0026] For example, according to the present invention, when applying a block strain removal filter, the complexity can be reduced by effectively setting the unit block that determines bS. Furthermore, according to the present invention, the complexity can be reduced by effectively setting the bS value when applying a block strain removal filter. [Brief explanation of the drawing]
[0027] [Figure 1] This is a schematic block diagram showing an encoding device (video encoding device) according to one embodiment of the present invention. [Figure 2] This is a schematic block diagram showing an image decoding device according to one embodiment of the present invention. [Figure 3] This is a schematic diagram illustrating a method for applying the block removal filter according to the present invention. [Figure 4] This figure schematically illustrates the execution method of the block strain removal filter according to the present invention. [Figure 5] This is a schematic diagram illustrating one example of a method for calculating bS. [Figure 6] This diagram schematically illustrates one example of a method for determining the bS value. [Figure 7] This diagram schematically illustrates another example of a method for determining the bS value. [Figure 8] This diagram schematically illustrates another example of a method for determining the bS value. [Figure 9] This diagram schematically illustrates an example of a method for determining bS when the boundary of the block removal application unit block coincides with the boundary of the bS determination unit block. [Figure 10] This diagram schematically illustrates another example of a method for determining a representative bS value in a unit block on which a block distortion removal filter is applied. [Figure 11] This is a schematic diagram illustrating other examples of methods for determining the bS. [Figure 12] This is a schematic diagram illustrating an example of a method for determining the bS value to one of three different values. [Figure 13] This is a schematic diagram illustrating an example of a method for determining the bS value to one of three different values. [Figure 14] This is a schematic diagram illustrating an example of a method for determining the bS value to one of three different values. [Figure 15] This is an example of a bS decision tree applied when OMBC is used, and it is a sequence diagram that schematically explains the method for determining bS. [Figure 16] This is an example of a bS decision tree applied when OMBC is used, and it is a sequence diagram that schematically explains the method for determining bS. [Figure 17] This diagram schematically illustrates an example of a method for determining bS and applying a block distortion removal filter. [Figure 18] This diagram schematically illustrates an example of a method for determining bS and applying a block distortion removal filter. [Figure 19] This is a schematic diagram illustrating one example of a method for determining the representative bS. [Figure 20] This is a step-by-step diagram illustrating other examples of methods for determining the representative bS. [Figure 21] This is a schematic diagram illustrating a method for simplifying bS decision trees. [Figure 22] This is a schematic diagram illustrating the method for encoding video according to the present invention. [Figure 23] This is a schematic diagram illustrating the method for decoding video according to the present invention. [Figure 24] This is a schematic diagram illustrating an example of a method for deriving bS according to the present invention. [Modes for carrying out the invention]
[0028] The present invention can be modified in various ways and may have various embodiments. Specific embodiments are illustrated in the drawings and described in detail. However, this is not intended to limit the present invention to any particular embodiment. The terms used herein are used solely to describe specific embodiments and are not intended to limit the technical idea of the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this specification, terms such as “includes” or “has” are intended to indicate the existence of features, figures, steps, actions, components, parts, or combinations thereof described in the specification, and should be understood not to preemptively exclude the possibility of the existence or addition of one or more other features, figures, steps, actions, components, parts, or combinations thereof.
[0029] On the other hand, each component shown in the drawings described in this invention is illustrated independently for the convenience of explaining the different characteristic functions of the video encoding / decoding device, and does not mean that each component is embodied in separate hardware or separate software. For example, two or more components can be combined into one component, or one component can be divided into multiple components. Embodiments in which each component is integrated and / or separated are also included within the scope of the invention, as long as they do not deviate from the essence of the invention.
[0030] Preferred embodiments of the present invention will be described in more detail below with reference to the attached drawings. Hereafter, the same reference numerals will be used for identical components in the drawings, and redundant descriptions of identical components will be omitted.
[0031] Figure 1 is a schematic block diagram showing an encoding device (video encoding device) according to one embodiment of the present invention. Referring to Figure 1, the encoding device 100 includes a picture division unit 105, a prediction unit 110, a conversion unit 115, a quantization unit 120, a realignment unit 125, an entropy encoding unit 130, an inverse quantization unit 135, an inverse conversion unit 140, a filter unit 145, and a memory 150.
[0032] The picture splitting unit 105 can split the input picture into at least one processing unit block. In this case, the block as a processing unit may be a prediction unit (hereinafter referred to as 'PU'), a conversion unit (hereinafter referred to as 'TU'), or an encoding unit (hereinafter referred to as 'CU').
[0033] As described later, the prediction unit 110 includes an inter-prediction unit that performs inter-prediction and an intra-prediction unit that performs intra-prediction. The prediction unit 110 performs predictions on the processing units of the picture divided by the picture division unit 105 and generates prediction blocks. In the prediction unit 110, the processing unit of the picture may be a CU, TU, or PU. The prediction unit 110 can also determine whether the prediction performed on the processing unit is an inter-prediction or an intra-prediction, and can define the specific details of each prediction method (e.g., prediction mode). In this case, the processing unit on which the prediction is performed may be different from the processing unit on which the prediction method and the specific details of the prediction method are determined. For example, the prediction method and prediction mode may be determined at the PU level, and the prediction may be performed at the TU level.
[0034] Through interpretation, predictions can be made based on information from at least one picture among the preceding and / or succeeding pictures of the current picture, and prediction blocks can be generated. Furthermore, through intrapretation, predictions can be made based on pixel information within the current picture, and prediction blocks can be generated.
[0035] Interpretation methods include skip mode, merge mode, and motion vector prediction (MVP) mode. Interpretation allows selecting a reference picture for the PU and a reference block of the same size as the PU. Reference blocks can be selected in integer pixel units. Subsequently, a prediction block is generated that minimizes the residual signal with the current PU and also minimizes the motion vector size.
[0036] Prediction blocks can be generated in integer sample units, or in units of less than an integer pixel, such as 1 / 2 pixel or 1 / 4 pixel units. In this case, the motion vector can also be represented in units of less than an integer pixel. For example, luminance samples can be represented in 1 / 4 pixel units, and chrominance samples in 1 / 8 pixel units.
[0037] Information such as the index of the selected reference picture, motion vectors (e.g., motion vector predictors), and residual signals, obtained through interface prediction, is entropi-encoded and transmitted to the decoder. When skip mode is applied, prediction blocks can be reconstructed blocks, so residuals may not be generated, transformed, quantized, or transmitted.
[0038] When performing intra-prediction, the prediction mode is determined per PU (Processing Unit), and prediction can be performed on a per-PU basis. Alternatively, the prediction mode can be determined per PU, and intra-prediction can be performed on a per-TU (Terminal Unit) basis.
[0039] In intra-prediction, the prediction mode can have 33 directional prediction modes and at least two non-directional modes. The non-directional modes can include DC prediction modes and planar modes.
[0040] In intra-prediction, a prediction block can be generated after applying a filter to the reference sample. Whether or not to apply a filter to the reference sample can be determined by the intra-prediction mode and / or size of the current block.
[0041] PUs are blocks of various sizes and shapes. For example, in the case of interpretation, PUs may be 2N×2N blocks, 2N×N blocks, N×2N blocks, or N×N blocks (where N is an integer). In the case of intraprediction, PUs may be 2N×2N blocks, or N×N blocks (where N is an integer). In this case, N×N block-sized PUs can be configured to be applied only in specific cases. For example, it can be set to use N×N block-sized PUs only for the smallest size CU, or to use them only for intraprediction. In addition to the sizes of PUs mentioned above, it is also possible to define and use PUs of N×mN blocks, mN×N blocks, 2N×mN blocks, or mN×2N blocks (m<1).
[0042] The residual values (residual blocks or residual signals) between the generated prediction blocks and the original video blocks are input to the conversion unit 115. In addition, prediction mode information, motion vector information, etc., used for prediction are encoded together with the residual values in the entropy encoding unit 130 and transmitted to the decoding device.
[0043] The transformation unit 115 performs a transformation on the residual block in transformation units and generates transformation coefficients. The transformation unit in the transformation unit 115 may be a TU and may have a quad tree structure. In this case, the size of the transformation unit can be set within a predetermined range of maximum and minimum sizes. The transformation unit 115 can transform the residual block using the discrete cosine transform (DCT) and / or discrete sine transform (DST).
[0044] The quantization unit 120 can generate quantization coefficients by quantizing the residual values converted by the conversion unit 115. The values calculated by the quantization unit 120 are provided to the inverse quantization unit 135 and the realignment unit 125.
[0045] The re-arrangement unit 125 re-arranges the quantization coefficients provided by the quantization unit 120. By re-arranging the quantization coefficients, the coding efficiency in the entropy coding unit 130 can be increased. The re-arrangement unit 125 can re-arrange the 2D block form of quantization coefficients into a 1D vector form through a coefficient scanning method. The re-arrangement unit 125 can also increase the entropy coding efficiency in the entropy coding unit 130 by changing the order of the coefficient scan based on the probabilistic statistics of the coefficients transferred from the quantization unit.
[0046] The entropy coding unit 130 can perform entropy coding on the quantization coefficients realigned by the realignment unit 125. Entropy coding can use coding methods such as Exponential Golomb, Context-Adaptive Variable-Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC). The entropy coding unit 130 can encode a variety of information received from the realignment unit 125 and the prediction unit 110, including quantization coefficient information and block type information of the CU, prediction mode information, division unit information, PU information and transfer unit information, motion vector information, reference picture information, block interpolation information, and filtering information.
[0047] Furthermore, the entropy encoding unit 130 can, if necessary, make certain changes to the parameter set or syntax to be transmitted.
[0048] The inverse quantization unit 135 inversely quantizes the value quantized by the quantization unit 120, and the inverse transformation unit 140 inversely transforms the value inversely quantized by the inverse quantization unit 135. The residual values generated by the inverse quantization unit 135 and the inverse transformation unit 140 can be combined with the predicted block predicted by the prediction unit 110 to generate a reconstructed block.
[0049] Figure 1 illustrates how the residual block and the predicted block are combined through an adder to generate the restored block. In this case, the adder can also be viewed as a separate unit (restored block generation unit) that generates the restored block.
[0050] The filter section 145 can apply a block removal filter, an adaptive loop filter (ALF), and a sample-adaptive offset (SAO) to the restored picture.
[0051] Block removal filters can remove distortion at the boundaries between blocks in the restored picture. ALF can perform filtering based on a comparison between the restored image and the original image after the blocks have been filtered by the block removal filter. ALF can also be performed only when high efficiency is applied. SAO restores the offset difference between the residual blocks to which the block removal filter has been applied and the original image on a pixel-by-pixel basis and applies it in the form of Band Offset, Edge Offset, etc.
[0052] On the other hand, the filter unit 145 may not apply filtering to the reconstruction block used for interface prediction.
[0053] Memory 150 can store the restored blocks or pictures calculated through the filter unit 145. The restored blocks or pictures stored in memory 150 can be provided to the prediction unit 110, which performs interface prediction.
[0054] Figure 2 is a schematic block diagram showing an image decoding device according to one embodiment of the present invention. Referring to Figure 2, the image decoding device 200 may include an entropy decoding unit 210, a realignment unit 215, an inverse quantization unit 220, an inverse transformation unit 225, a prediction unit 230, a filter unit 235, and a memory 240.
[0055] When a video bitstream is input to a video encoding device, the input bitstream can be decoded according to the procedures by which the video encoding device processes the video information.
[0056] For example, if a variable-length encoding such as CAVLC (hereinafter referred to as 'VLC') is used to perform entropy encoding in a video encoding device, the entropy decoding unit 210 can also be implemented using the same VLC table as the encoding device and perform entropy decoding. Furthermore, if CABAC is used to perform entropy encoding in a video encoding device, the entropy decoding unit 210 can correspondingly perform entropy decoding using CABAC.
[0057] Of the information decoded by the entropy decoding unit 210, the information for generating prediction blocks is provided to the prediction unit 230, and the residual values from the entropy decoding performed by the entropy decoding unit 210 are input to the re-sorting unit 215.
[0058] The re-alignment unit 215 can re-align the bitstream that has been entropi-decoded by the entropy decoding unit 210 based on the method used by the video encoding device to re-align the bitstream. The re-alignment unit 215 can also re-align coefficients expressed in one-dimensional vector form by restoring them to two-dimensional block form. The re-alignment unit 215 can receive information related to the coefficient scan performed by the encoding device and perform re-alignment by scanning in reverse based on the scan order performed by the encoding device.
[0059] The inverse quantization unit 220 can perform inverse quantization based on the quantization parameters provided by the encoding device and the coefficient values of the realigned blocks.
[0060] The inverse transform unit 225 can perform an inverse DCT and / or inverse DST on the DCT and DST performed by the transform unit of the encoding device with respect to the quantization results performed by the video encoding device. The inverse transform can be performed based on the transmission unit or video division unit determined by the encoding device. In the transform unit of the encoding device, the DCT and / or DST can be selectively performed based on multiple pieces of information, such as the prediction method, the current block size, and the prediction direction, and the inverse transform unit 225 of the decoding device can perform the inverse transform based on the transformation information performed by the transform unit of the encoding device.
[0061] The prediction unit 230 can generate predicted blocks based on the prediction block generation-related information provided by the entropy decoding unit 210 and the previously decoded block and / or picture information provided by the memory 240.
[0062] If the current prediction mode for the PU is intra-prediction mode, it can perform intra-prediction, which generates prediction blocks based on the pixel information in the current picture.
[0063] If the prediction mode for the current PU is inter-prediction mode, inter-prediction for the current PU can be performed based on information contained in at least one of the preceding or succeeding pictures of the current picture. In this case, motion information necessary for inter-prediction of the current PU, such as motion vectors and reference picture indexes, provided by the video encoding device can be derived from skip flags, merge flags, etc., received from the encoding device.
[0064] The reconstruction block can be generated using the prediction block generated by the prediction unit 230 and the residual block provided by the inverse transformation unit 225. Figure 2 illustrates how the reconstruction block is generated by combining the prediction block and the residual block in an adder. In this case, the adder can be viewed as a separate unit (reconstruction block generation unit) that generates the reconstruction block.
[0065] When skip mode is applied, the residual is not transferred, and the predicted block can be used as a restored block.
[0066] The restored blocks and / or pictures can be provided to the filter unit 235. The filter unit 235 can apply block distortion removal filters, SAO and / or ALF, etc., to the restored blocks and / or pictures.
[0067] Memory 240 can store the restored picture or block and make it available for use as a reference picture or reference block, and can also provide the restored picture to the output unit.
[0068] On the other hand, as described above, the filter section of the encoding and decoding device can apply a block-removal filter, ALF, or SAO as an in-loop filter.
[0069] A block removal filter removes inter-block distortions (artifacts) that follow block-level prediction, transformation, and quantization. The block removal filter is applied to the edges of the prediction unit or the transformation unit, and a predetermined minimum block size can be set for applying the block removal filter.
[0070] To apply a block removal filter, the first step is to determine the block boundary strength (bS) of the horizontal or vertical filter boundary. Based on the bS, a decision is made on a block-by-block basis as to whether or not to perform filtering. If filtering is to be performed, the type of filter to apply is determined. The filter to be applied can be selected from a weak filter and a strong filter. The filtering unit applies the selected filter to the boundary of that block.
[0071] ALF can also be applied after performing SAO, which will be described later. Unlike SAO, ALF compensates for coding errors using a Wiener filter and is applied globally within the slice. ALF can also be configured to be applied only in the high efficiency (HE) case.
[0072] SAO is a procedure that restores the offset difference between a pixel-by-pixel image and the original image after applying a block distortion removal filter. Encoding errors can be compensated for through SAO, and these encoding errors may be caused by quantization or other factors. There are two types of SAO: band offset and edge offset.
[0073] As mentioned above, when video restoration is performed in block units (e.g., CU, PU, TU, etc.), block distortion may occur at the boundaries between restored blocks. Block removal filters can be applied to prevent block distortion, but these filters can be applied differently to locations within the same video or picture, depending on whether block distortion is likely to occur or not. For example, different methods can be used to apply block removal filters to locations prone to block distortion and locations less prone to block distortion.
[0074] Therefore, the bS for the boundary between blocks can be determined by considering whether the boundary between blocks corresponds to a boundary to which a block removal filter should be applied, and whether adjacent blocks are blocks to which intra-coding has been applied, and a block distortion removal filter can be applied based on the determined bS.
[0075] On the other hand, if the CU is an I_PCM CU, that is, a pulse-coded modulation (PCM) CU to which intra-prediction is applied, the block distortion removal filter is not applied. In I_PCM mode, since it does not undergo quantization and conversion processes, the same values as the original video data are restored.
[0076] Therefore, in order to restore the best image quality (original image quality), the in-loop filter is not applied to the CU in I_PCM mode (I_PCM CU). For example, in the block distortion removal filter process, the quantization parameter (qP) for the I_PCM CU can be set to 0 (zero) so that the block removal filter is not applied to the I_PCM CU.
[0077] Figure 3 is a schematic sequence diagram illustrating a method for applying the block removal filter according to the present invention. The block distortion removal filter described in Figure 3 can be implemented in an encoding device and a decoding device. For example, the filter processing units in Figures 1 and 2 can implement the block distortion removal filter described in Figure 3.
[0078] The block distortion removal filter is first applied to the vertical edges between blocks in the current picture, and then to the horizontal edges between blocks in the current picture. The block distortion removal filter is then applied to the horizontal edges in the current picture that have samples corrected by the block distortion removal filter applied to the vertical edges.
[0079] Therefore, the block distortion removal filter procedure described in Figure 3 can be applied to the horizontal edges of the picture after it has been applied to the vertical edges of the picture.
[0080] Referring to Figure 3 for the edges between blocks, the block boundaries are derived in order to apply the block distortion removal filter (S310).
[0081] The filter unit can set the size of the current coding block or the current largest coding unit (LCU) (hereinafter, for convenience of explanation, the term "coding block" in this specification includes the LCU), and can determine whether the boundary of the current coding block is not the boundary of the current picture, whether the boundary of the current coding block is a boundary to which a block removal filter is applied as a tile boundary, or whether the boundary of the current coding block is a boundary to which a block removal filter is applied as a slice boundary.
[0082] For example, when applying a block removal filter to a vertical edge, if the left boundary of the currently encoded block is the left boundary of the current picture, the left boundary of the currently encoded block can be excluded from the block removal filter. If the left boundary of the currently encoded block is the left boundary of the current tile, and it is decided not to apply the filter to the edges of the current tile, or if the left boundary of the currently encoded block is the left boundary of the current slice, and it is decided not to apply the filter to the edges of the current slice, the left boundary of the currently encoded block can be excluded from the block removal filter. Therefore, in a block removal filter for a vertical edge, if none of the above cases apply, the block removal filter can be applied to the left boundary of the currently encoded block.
[0083] Furthermore, when applying a block removal filter to horizontal edges, if the upper boundary of the currently encoded block is the upper boundary of the current picture, the upper boundary of the currently encoded block can be excluded from the block removal filter. If the upper boundary of the currently encoded block is the upper boundary of the current tile and it is decided not to apply the filter to the edges of the current tile, or if the upper boundary of the currently encoded block is the upper boundary of the current slice and it is decided not to apply the filter to the edges of the current slice, the upper boundary of the currently encoded block can be excluded from the block removal filter. In the case of a block removal filter for horizontal edges, if none of the above cases apply, the block removal filter can be applied to the upper boundary of the currently encoded block.
[0084] In this specification, applying filtering to a boundary means performing filtering on a given sample located on both sides of the boundary.
[0085] The filter unit can derive block boundaries for the vertical edges of the transformed block and predicted block when applying a block distortion removal filter to the vertical edges within the picture, and can derive block boundaries for the horizontal edges of the transformed block and predicted block when applying a block distortion removal filter to the horizontal edges within the picture.
[0086] When the edges of a transform block are the edges of an encoded block, the boundaries of the transform block can also be derived depending on whether or not a block distortion removal filter is applied to those edges. If the transform block is divided, the boundaries can be derived for each of the divided blocks.
[0087] The filter unit can derive boundaries for each partition of the prediction block. For example, if the partitions of the prediction block are 2N×N pixel blocks, N×N pixel blocks, 2N×nU pixel blocks, and 2N×nD pixel blocks (where N, U, and D are integers corresponding to the number of pixels, and n is an integer corresponding to the number of prediction blocks in the encoded block), then an edge can be derived for each partition.
[0088] Next, bS is derived for the block boundary to which the block removal filter is applied (S320). bS is determined for each edge in the currently encoded block. If the block removal filter is applied to the vertical edges in the picture, bS can be derived for each vertical edge, and if the block removal filter is applied to the horizontal edges in the picture, bS can be derived for each horizontal edge.
[0089] The derivation of bS can be performed on a predetermined unit basis. For example, bS can be derived for each edge of a transform block, or for each edge of a predict block. Alternatively, bS can be derived for blocks of a predetermined size, such as an 8x8 pixel block or a 4x4 pixel block.
[0090] Furthermore, bS can also be derived for the edges of blocks that satisfy specific conditions, among the transform blocks, predictor blocks, and pre-defined blocks of a predetermined size within the currently encoded block. For example, bS can be derived for smaller blocks among the transform blocks (e.g., TU) and predictor blocks (e.g., PU), and for larger blocks among the blocks of a predetermined size (e.g., an 8x8 pixel block).
[0091] In other words, bS can be determined in pixels corresponding to the size of the block that serves as the unit for bS determination at the boundary of the block to which block removal is applied (for example, in L pixels when the unit for bS determination is L × L pixel blocks (where L is an integer)). The derivation of specific values for bS will be discussed later.
[0092] Next, filtering is performed on the block boundaries according to bS (S330).
[0093] For example, in the case of a luminance (luma) sample, the bS for the target edge is a predetermined reference bS, for example, bS th1 The block distortion removal filter may not be applied to the edge in question when the following conditions are met: In the case of chroma samples, the bS for the target edge is a predetermined reference bS, for example, bS th2 The block distortion removal filter may not be applied to the edge in the following cases: (Reference bS) th1 and bS th2 They can be set to be the same, or they can be set to be different.
[0094] An additional threshold (referred to as Th1 for convenience of explanation) can also be set to efficiently apply the block distortion removal filter. For example, when the reference bS value is set to 0, when the bS value for the target edge is greater than 0, Th1 can be used to determine whether to turn on / off the block distortion removal filter at the block level. For example, when the value derived from the target edge is greater than Th1, the block removal filter can also be applied to the target edge.
[0095] First, the case where the block distortion removal filter is applied to the vertical edge in the picture will be described. As the value derived from the target vertical edge for comparison with Th1, the difference between the filter processing target samples in two blocks bounded by the vertical edge in a specific sample row (row) can be considered. For example, for the samples in the k-th sample row (k is an integer), the sum DL of the differences between the filter processing target samples adjacent to the vertical edge in the left block of the vertical edge k (For example, when 3 samples from the vertical edge are the targets of filter processing, the sum of the difference between the first sample from the vertical edge and the second sample from the vertical edge, and the difference between the third sample from the vertical edge and the second sample from the vertical edge) is calculated, and the sum DR of the differences between the filter processing target samples adjacent to the vertical edge in the right block (current block) of the vertical edge k (For example, when 3 samples from the vertical edge are the targets of filter processing, the sum of the difference between the first sample from the vertical edge and the second sample from the vertical edge, and the difference between the third sample from the vertical edge and the second sample from the vertical edge) can be derived. DL k and DR k The sum D of k is compared with Th1, and when D k is smaller than Th1, the block distortion removal filter can be applied to the vertical edge. D kWhen Th1 is smaller than Th, based on the quantization parameters, it can be determined that applying the block removal filter will restore a picture closer to the original picture, considering the vertical boundary as a boundary where applying the block removal filter is not effective (e.g., the actual boundary of the image within the original picture).
[0096] In this case, within two blocks separated by a vertical edge, instead of considering the sum of differences between adjacent filtered samples for a single sample row as described above, it is also possible to consider the sum of differences between adjacent filtered samples for multiple sample rows. For example, the sum of differences D between filtered samples for the k-th sample row in two blocks separated by a vertical edge. k And the sum of the differences between the filtered samples for the k+j-th row (where j is an integer) D k+j The combined D(=D k +D k+j If ) is less than the threshold Th1, it may be decided to apply a block removal filter to that vertical edge.
[0097] Taking the example of setting the difference j between two sample rows to 3, if D (=D2+D5) is less than Th1 for the second and fifth sample rows, the block removal filter can be applied to the corresponding vertical edge. Alternatively, setting the difference j between two sample rows to 3, and comparing the sum of the differences between the samples D (=D0+D3) for the 0th and third sample rows with Th1, the block removal filter can be applied to the corresponding vertical edge if D is less than Th1.
[0098] In this case, in order to effectively reflect the characteristics of each block and sample row, a D value can also be derived by combining the absolute values of the sum of the differences between filtered samples obtained for each sample row and each block. In this case, the D value that considers the k-th and k+j-th sample rows of the left block (L) and right block (R) with the vertical edge as the boundary can be derived as shown in <Equation 1> below.
[0099] <Expression 1> D=abs(DL k )+abs(DL k+j )+abs(DR k )+abs(DR k+j )
[0100] As mentioned above, DL K This is the sum of the differences between filtered samples adjacent to a vertical edge in the k-th sample row of the left block. When applying a block distortion removal filter, if you are targeting three samples adjacent to a vertical edge, DL K This can be derived by summing the difference between the first sample from the vertical edge and the second sample from the vertical edge, and the difference between the third sample from the vertical edge and the second sample from the vertical edge, in the k-th sample row of the block to the left of the vertical edge. DR K DR is the sum of the differences between filtered samples adjacent to a vertical edge in the k-th sample row of the right-hand block. For example, when applying a block distortion removal filter, if you target three samples adjacent to a vertical edge, DR is K This can be derived by summing the difference between the first sample from the vertical edge and the second sample from the vertical edge, and the difference between the third sample from the vertical edge and the second sample from the vertical edge, in the k-th sample row of the block to the right of the vertical edge.
[0101] As mentioned above, when considering multiple sample rows and summing the differences between adjacent filtered samples, the block distortion removal filter can be applied more effectively by considering the sum of the differences between adjacent filtered samples for each sample row. For example, referring to <Equation 1>, if only k sample rows are considered, D k This can be defined as shown in <Equation 2>.
[0102] <Expression 2> D k =abs(DL k )+abs(DR k )
[0103] For example, if we consider the k-th and k+3rd sample rows for the vertical edge as in the example above, then D is smaller than Th1, and D for the k-th sample row k and D for the k+3rd sample row k+3 When each of them is less than half of Th1 (Th1 / 2), a strong filter can be applied to the corresponding vertical edge. In contrast, when D is less than Th1, D k If it is not less than Th1 / 2, or D k+3 If the value is not less than Th1 / 2, a weak filter can also be applied to the vertical edge in question.
[0104] When applying weak filtering, it is possible to apply filtering only to specific samples among the samples to be filtered, and in this case, the filter coefficients can be applied differently than in the case of strong filtering. For example, if the samples to be filtered are six samples located to the left and right of a vertical edge (three samples to the left of the edge and three samples to the right of the edge), strong filtering can be applied to all of the samples to be filtered, while weak filtering can be applied to the two samples located to the left of the edge and the two samples located to the right of the edge. In this case, the filter coefficients for strong filtering and weak filtering may differ.
[0105] When a block distortion removal filter is applied to a horizontal edge in a picture, the difference between filtered samples in two blocks bounded by that horizontal edge in a specific sample column can be considered as a value derived from the target horizontal edge for comparison with Th1. As explained in the example of a vertical edge, for the k-th sample column (where k is an integer), the sum of the differences between filtered samples adjacent to the horizontal edge in the upper block of the horizontal edge is DT. k(For example, when a block removal filter is applied, if three samples from a horizontal edge are filtered, calculate the sum of the difference between the first sample from the horizontal edge and the second sample from the horizontal edge, and the difference between the third sample from the horizontal edge and the second sample from the horizontal edge), and then calculate the sum of the differences between filtered samples adjacent to the horizontal edge in the block below the horizontal edge (current block). k (Even if a block removal filter is applied, and three samples from a horizontal edge are filtered, the sum of the difference between the first sample from the horizontal edge and the second sample from the horizontal edge, and the difference between the third sample from the horizontal edge and the second sample from the horizontal edge can be derived.) DT k and DB k Tono Wa D k Compared to Th1, D k When Th1 is less than the value of Th1, a block distortion removal filter can be applied to the horizontal edge in question.
[0106] In this case, it is also possible to consider the sum of differences between adjacent filtered samples for multiple sample columns within two blocks separated by a horizontal edge. For example, the sum of differences D between filtered samples for the k-th sample column in two blocks separated by a horizontal edge. k And the sum of differences D between the filtered samples for the k+j-th column (where j is an integer) k+j D(=D) k +D k+j If ) is less than the threshold Th1, it may be decided to apply a block removal filter to that horizontal edge.
[0107] Taking the case where the difference j between two sample columns is set to 3 as an example, if D (=D2+D5) is less than Th1 for the second and fifth sample columns, the block removal filter can be applied to the corresponding vertical edge. Alternatively, by setting the difference j between two sample columns to 3, the sum of the differences between samples D (=D0+D3) for the 0th and third sample columns can be compared to Th1, and if D is less than Th1, the block removal filter can be applied to the corresponding horizontal edge.
[0108] The sample rows considered for vertical edges and the sample columns considered for horizontal edges may be corresponding sample rows and columns. For example, if the 0th and 3rd sample rows are considered for vertical edges, then the 0th and 3rd sample columns can be considered for horizontal edges.
[0109] Similar to the case of vertical edges, in order to effectively reflect the characteristics of each block and sample column, we can also take the absolute value of the sum of the differences between filtered samples obtained for each sample column and each block. In this case, the D value, which considers the k-th and k+j-th sample columns of the upper block (T) and lower block (B) with the horizontal edge as the boundary, can be derived as shown in <Equation 3> below.
[0110] <Expression 3> D=abs(DT k )+abs(DT k+j )+abs(DB k )+abs(DB k+j )
[0111] As mentioned above, DT K is the sum of the differences between filtered samples adjacent to a horizontal edge in the k-th sample column of the upper block. When applying the block distortion removal filter, if we target three samples adjacent to a horizontal edge, DT KThis can be derived by summing the differences between the first sample and the second sample from the horizontal edge, and the differences between the third sample and the second sample from the horizontal edge, in the k-th sample column of the upper block of the horizontal edge. K This is the sum of the differences between filtered samples adjacent to a horizontal edge in the k-th sample column of the lower block. For example, when applying a block distortion removal filter, if you target three samples adjacent to a horizontal edge, DB K This can be derived by summing the difference between the first sample from the horizontal edge and the second sample from the horizontal edge, and the difference between the third sample from the horizontal edge and the second sample from the horizontal edge, in the k-th sample column of the lower block of the horizontal edge.
[0112] As illustrated in the example of vertical edges, a block distortion removal filter can be applied more effectively by considering the sum of the differences between adjacent filtered samples for each sample column. For example, referring to Equation 3, D can be applied by considering only k sample columns. k This can be defined as shown in <Equation 4>.
[0113] <Expression 4> D k =abs(DT k )+abs(DB k )
[0114] For example, if we consider the k-th and k+3rd sample rows for the horizontal edge as in the example above, then D is smaller than Th1, and D for the k-th sample row k and D for the k+3rd sample sequence k+3 When each of these is less than 1 / 4 of Th1, and a predetermined relationship with respect to other block removal parameters is satisfied, strong filtering can be applied to the horizontal edge. In contrast, when D is less than Th1, D k If it is not less than Th1 / 4, or D k+3If the value is not less than Th1 / 4 and certain conditions are met, a weak filter can also be applied to the horizontal edge.
[0115] When applying weak filtering, it is possible to apply filtering only to specific samples among the samples to be filtered, and in this case, different filter coefficients can be applied than those used for strong filtering. For example, if the samples to be filtered are six samples located above and below a horizontal edge (three samples above the edge and three samples below the edge), strong filtering can be applied to all of the samples, while weak filtering can be applied to the two samples above the edge and the two samples below the edge. In this case, the filter coefficients used for strong filtering and weak filtering may differ.
[0116] Strong and weak filtering can also be applied to vertical and horizontal edges using the same method (e.g., the same filter coefficients or offsets).
[0117] As described above, the filter unit can apply a block removal filter according to a predetermined method (e.g., filter coefficients or offset) when deciding whether or not to apply a block removal filter, which filter to apply (strong or weak), and which samples to apply the weak filter to. As previously mentioned, after applying a block distortion removal filter to the vertical edges in the picture, a block distortion removal filter can be applied to the horizontal edges in the picture.
[0118] Figure 3 illustrates the method of applying a block strain removal filter in large steps such as derivation of block boundaries (S310), derivation of bS (S320), and application of filtering (S330). However, the process from determining bS to applying filtering can also be divided into more detailed steps.
[0119] For example, the following steps may be performed for a horizontal block distortion removal filter on vertical edges in a picture: (1) Determine the bS for vertical edges within an encoded block (which may be an LCU). Edges for which bS is determined may be edges of the smaller of the TU and PU blocks, edges of a predetermined unit block (e.g., an 8x8 pixel block), or edges of the smaller of the TU and PU blocks and the larger of the predetermined unit blocks. (2) For edges where bS is greater than 0, determine whether to turn the block distortion removal filter on or off at the block level. For this purpose, as described above, predetermined sample rows (e.g., the 2nd and 5th sample rows) from the blocks on both sides of the boundary (edge) can be used. (3) Determine whether to apply filtering or weak filtering to the areas where filtering is to be turned on. (4) If weak filtering is applied, make additional filtering on / off decisions. Additional filtering on / off decisions include filtering on / off decisions for specific samples, as described above. (5) Move to the next encoded block (including LCU) in the current picture and repeat the step - perform block distortion removal filtering on all vertical edges in the picture.
[0120] For vertical block distortion removal filters on horizontal edges in a picture, the following steps may be performed: (1) Determine bS for horizontal edges within an encoded block (which may be an LCU). Edges for which bS is determined may be edges in smaller blocks of TU and PU, edges in predetermined unit blocks (e.g., 8x8 pixel blocks), or edges between smaller unit blocks of TU and PU and larger blocks of predetermined unit blocks. (2) For edges where bS is greater than 0, determine whether to turn the block distortion removal filter on or off at the block level. For this purpose, predetermined sample sequences (e.g., the second and fifth sample sequences) from the blocks on either side of the boundary (edge) can be used. (3) Determine whether to apply strong or weak filtering to the areas where filtering is to be turned on. (4) If weak filtering is applied, make additional filtering on / off decisions. Additional filtering on / off decisions include filtering on / off decisions for specific samples, as described above. (5) Move to the next encoded block (including LCU) in the current picture and repeat the steps. Performs a block distortion removal filter on all horizontal edges in the picture.
[0121] Figure 4 is a schematic diagram illustrating the execution method of the block distortion removal filter according to the present invention. Referring to Figure 4, the block distortion removal filter is executed on the edges within each encoded block (e.g., LCU) (401). As described above, after performing a block distortion removal filter (horizontal filtering) on the vertical edges of the entire picture, a block distortion removal filter (vertical filtering) is performed on the horizontal edges of the entire picture.
[0122] Figure 5 is a schematic diagram illustrating one example of a method for determining bS.
[0123] For the sake of clarity, in this specification, in the block destrain filtering process, the current block is represented as block Q, and the block adjacent to the current block and encoded / decoded before the current block is represented as block P. For example, when performing block destrain filtering on a vertical edge, the block to the left of the vertical edge is designated as block P, and the block to the right is designated as block Q. Similarly, when performing block destrain filtering on a horizontal edge, the block above the horizontal edge is designated as block P, and the block below is designated as block Q.
[0124] Furthermore, samples belonging to block P are represented by p, and samples belonging to block Q are represented by q. For example, if a sample belongs to block P and is the i-th sample from the boundary (edge) between block P and block Q in a specific sample row or column, then p i This can be done (i=0,1,2,...). Similarly, belonging to block Q, the i-th sample from the boundary (edge) between block P and block Q in a specific sample row or specific sample column is q i This can be done (i=0,1,2,...).
[0125] Referring to Figure 5, in order to determine bS, first it is determined whether block P and / or block Q are intra-encoded (S510).
[0126] If block P and / or block Q are intra-encoded, determine whether the boundary between block P and block Q is a CU boundary (S520). In this case, the CU boundary may be an LCU boundary.
[0127] In step S520, if the boundary between block P and block Q is the boundary of CU, the value of bS for the boundary between block P and block Q is determined to be 4 (S530).
[0128] In step S520, when the boundary between block P and block Q is not the boundary of the CU, the value of bS for the boundary between block P and block Q is determined to be 3 (S540).
[0129] When block P and / or block Q is not intra-coded, it is determined whether block P and / or block Q includes non-zero coefficients (transformation coefficients) (S550). At this time, the filter unit can determine the presence or absence of non-zero transformation coefficients based on the transformation coefficients before inverse quantization. Also, the filter unit can determine the presence or absence of non-zero transformation coefficients based on the transformation coefficients after inverse quantization.
[0130] In step S550, when block P and / or block Q includes coefficients (non-zero transformation coefficients), bS for the boundary between block P and block Q is determined to be 2 (S560).
[0131] In step S550, when block P and / or block Q does not include coefficients (non-zero transformation coefficients), it is determined whether block P and block Q have different reference pictures or different motion vectors (S570).
[0132] In step S570, when block P and block Q have different reference pictures or different motion vectors, bS for the boundary between block P and block Q is determined to be 1 (S580).
[0133] In other cases, that is, when it corresponds to the case where the block distortion removal filter is not applied, bS for the boundary between block P and block Q is set to 0 (S590). In FIG. 5, as an example of the case where bS is not applied, the case where none of the above conditions are met is described as an example for convenience of explanation.
[0134] On the other hand, the values of the variables required for the block distortion removal filter can also be set according to the bS value.
[0135] For example, take the case of a variable such as t c offset shown in FIG. 5. c t c offset is a value set by the user to determine a value optimized for video characteristics. c is one of the thresholds used to quantify the block distortion according to the quantization level and determine the parameters related to the block distortion removal filter.
[0136] In FIG. 5, when the bS value is 0, 1, or 2, then c offset is set to 0, and when the bS value is 3 or 4, then c it simply shows an example of setting offset to 2.
[0137] On the other hand, in order to effectively apply the block distortion removal filter, the block unit and determination method for determining bS described in FIGS. 3 and 5 above can also be modified and applied.
[0138] bS can be determined to be equal to or smaller than the block unit that actually executes the block distortion removal filter.
[0139] For example, when actually executing the block distortion removal filter for luminance samples in 8×8 pixel units, bS can be determined in 4×4 pixel units. In this way, when the size of the unit block for executing the block distortion removal filter is larger than the size of the unit block for determining bS, only the boundaries corresponding to the boundaries of the unit block for executing the block distortion removal filter among the boundaries (edges) of the unit block for determining bS can be used to determine bS. In other words, when determining bS for each L×L (L is an integer) pixel block, bS is determined in L pixel units at the boundaries of the unit block for executing the block distortion removal filter.
[0140] Specifically, if we consider an example where the block unit used to determine bS is a 4x4 pixel block, and the actual block distortion removal filter is performed in 8x8 pixel block units, then bS is determined in 4-pixel units at the boundaries of the 8x8 pixel block where the block distortion removal filter is performed. Therefore, it is not necessary to determine bS for the 4x4 pixel block edges inside the 8x8 pixel block that is the unit of the block distortion removal filter.
[0141] Figure 6 is a schematic diagram illustrating one example of a method for determining the bS value. In Figure 6, the example is given where the unit block 600 of the block distortion removal filter is an 8x8 pixel block, and the unit block for bS determination is a 4x4 pixel block.
[0142] Referring to Figure 6, within the unit block 600 of the block distortion removal filter, there are vertical and horizontal edges that are the boundaries (edges) of the 4x4 pixel block that become the unit block for determining bS, and which also form the boundaries of the unit block 600 of the block distortion removal filter.
[0143] To illustrate with an example of a vertical edge, the unit block 600 of the block distortion removal filter has two vertical edges 610 and 620 that are the subject of bS determination. In the example in Figure 6, the bS of the first vertical edge 610 and the bS of the second vertical edge 620 are compared, and the larger bS is determined to be the representative bS for the vertical edge of the unit block 600 of the block distortion removal filter.
[0144] For example, if the bS of the first vertical edge 610 is 1 and the bS of the second vertical edge 620 is 2, then the bS value of the second vertical edge 620, which is 2, may be determined as the representative bS value for the vertical edge that becomes the left boundary of the unit block 600 of the block distortion removal filter.
[0145] In Figure 6, the case of a vertical edge was used as an example for ease of explanation, but the same method can be applied to horizontal edges as well.
[0146] In the example in Figure 6, if the two bS values are the same, it is obvious that one of the two bS values can be used as the representative bS value.
[0147] As shown in Figure 6, another example of a method in which bS is not derived for boundaries located inside the unit block to which the block strain removal filter is applied, that is, a method in which bS is derived only for boundaries (edges) of the unit block to which the block strain removal filter is applied, and which are also boundaries of the unit block that determine bS, will be specifically explained.
[0148] Figures 7 and 8 schematically illustrate other examples of methods for determining the bS value. The examples in Figures 7 and 8 illustrate a method for assigning the bS value through a two-step process. Specifically, in the examples in Figures 7 and 8, when a 4x4 pixel block is the unit for bS determination and an 8x8 pixel block is the unit for block distortion removal filtering, the method is described in which the bS is determined in 4x4 pixel units and then reassigned in 8x8 pixel block units.
[0149] Figure 7 schematically illustrates one example of a method for setting bS for each bS determination unit. Referring to Figure 7, a 16x16 pixel block (e.g., CU) contains 4x4 pixel blocks (e.g., TU) that serve as bS determination units, as illustrated. The bS value can be determined for each boundary of each 4x4 pixel block.
[0150] An example of a specific process (Step 1) for determining bS for every 4x4 pixel block is as follows:
[0151] <How to set the BS in 4x4 pixel block units - Step 1>
[0152] The position of the luminance sample in the upper left of the current block, for example, CU, is identified as (xC, yC) relative to the luminance sample in the upper left of the current picture. The variable log2CUSize is used to identify the size of the current block, CU, and the vertical and horizontal edges that determine bS are indicated by the 2D arrays horEdgeFlags and verEdgeFlags. In this case, the size of the 2D array is nS × nS, where nS = 1 < <log2CUSizeである。
[0153] (xE k , yE j Let ) identify the set of edge-periphery sample (edge sample) locations. k=0,…,nE-1, j=0,…,nE-1, and nE is ((1<<log2CUSize)> >2) is set, xE0=0, yE0=0, xE k+1 =xE k +4, yE j+1 =yE j They have a relationship of +4.
[0154] In this case, the sample to which the block distortion removal filter is applied to the horizontal and vertical edges identifies the set of edge sample locations (xE k , yE j This can be determined based on (1) information indicating that it is a horizontal edge indicates that a block distortion removal filter should be applied to that edge (bS should decide) (for example, horEdgeFlags[xE k ][yE j ]=1), (2) p0 is the (xC+xE) of the picture that was reconstructed after prediction. k , yC+yE j Set to -1), and q0 is the (xC+xE) of the picture restored after prediction. k , yC+yE j (3) This can be set to (3) the direction of the block distortion removal filter will be vertical.
[0155] For a vertical edge, when the information indicating that it is a vertical edge instructs that the block distortion removal filter is to be applied to the edge (determined by bS) (for example, verEdgeFlags[xE k [yE j =1), (2) p0 can be set to (xC + xE k - 1, yC + yE j ) of the picture restored through prediction, and q0 can be set to (xC + xE k , yC + yE j ) of the picture restored through prediction. (3) At this time, the direction of the block distortion removal filter is horizontal.
[0156] According to the method described above (step 1), count how many 4×4 pixel blocks that are the bS determination units are in the current CU (current block) (how many multiples of 4 pixels the horizontal and vertical of the current CU are) ((1 << log2CUSize) >> 2) and assign it to the nE value. Therefore, in step 1, En bS values can be set horizontally and vertically for the current block in units of 4 pixels. Increase (xE k+1 = xE k + 4, yE j+1 = yE j + 4) so that bS is determined in units of 4 pixels, that is, increase the index so that the process of determining bS in units of 4×4 pixel blocks within the current block (current CU) can be executed.
[0157] Following the method described above (step 1), the bS value set for each bS determination unit can be re - assigned for each block removal filter processing unit (step 2).
[0158] FIG. 8 is a diagram schematically explaining an example of a method for re - assigning bS for each block removal filter processing unit. Referring to FIG. 8, bS values can be set for each 8×8 block removal application unit block.
[0159] In step 2, which will be described with reference to FIG. 8, the bS values for 4×4 pixel blocks determined in step 1 are compared, and out of the bS values for two adjacent edges, one of the values is used as the representative bS value for the 8×8 block removal filter processing unit.
[0160] For example, for the left vertical edge of the block removal filter processing unit block 810 in the current CU800 in FIG. 8, the bS value of the upper edge, bS v1 and the bS value of the lower edge, bS v2 are compared, and the larger value can be used as the bS value (bS v ) for the left vertical edge of block 810. Also, for the upper horizontal edge of the block removal filter processing unit block 820 in the current CU800, the bS value of the left edge, bS h1 and the bS value of the right edge, bS h2 are compared, and the larger value can be used as the bS value (bS h ) for the upper horizontal edge of block 820. At this time, among the bS values determined in step 1, the bS values for the edges located within the 8×8 pixel block, which is the unit block to which the block removal filter is applied, are not assigned.
[0161] An example of a specific process (step 2) for reassigning bS for each 8×8 pixel block and performing the block distortion removal filter is as follows.
[0162] <Method of Assigning bS in 8×8 Pixel Block Units and Executing the Block Distortion Removal Filter - Step 2>
[0163] The position of the luminance sample at the upper left corner in the current block, for example, within the CU, is specified as (xC, yC) based on the upper left corner luminance sample of the current picture. The variable for specifying the size of the current block CU is log2CUSize, and the array bS specifies the boundary filtering strength.
[0164] The current block, for example, the block distortion removal filter for the luminance edge of the current CU, can be executed in the following steps.
[0165] (1) Set the variable nD to 1<<(log2CUSize-3).
[0166] (2) Initialize all elements of the 3D array dEdge of size (2)×(nD)×(nD) to 0.
[0167] (3) Initialize all elements of the 3D array dSample of size (2)×(nD)×(1<<log2CUSize) to 0.
[0168] (4) Initialize all elements of the 3D array bStrength of size (2)×(nD)×(nD) to 0.
[0169] (5) ×D k Set the value to xC+(k<<3). At this time, the value of k is 0,…,nD-1. For each xD k value, set yD m to yC+(m<<3) and execute the following procedure. At this time, the value of m is 0,…,nD-1.
[0170] (5-1) Derive the boundary filter processing strength bSVer for the vertical edge as follows. bSVer = Max(bS[0][xD k [yD m +i]). At this time, i is 0,…,7. bS[0][xD [[ID=3S]] k [yD m +i] is the boundary filter processing strength for the vertical edge, which means the bS value defined based on (xD k m m +i).
[0171] (5-2) Set the value of bStrength[0][k][m] to the bSVer value.
[0172] (5-3) Based on the current luminance sample position of CU (xC, yC), the current luminance sample position of block (xDk, yDm), information indicating that it is a vertical edge to which a block removal filter is applied, and the boundary filtering intensity bSVer, a decision process is performed on the luminance block edge to determine dEdge[0][k][m] which indicates whether to apply a strong filter or a weak filter, and an 8x8 array dS as information for the decision.
[0173] (5-4) Set dS[i] to dS[i], which is used to determine the dEdge value, by setting dSample[0][k][(m<<3)+i]. In this case, i is 0, ..., 7.
[0174] (5-5) The boundary filtering intensity bSHor for horizontal edges is derived as follows: bSHor = Max(bS[1][xD k +i][yD m ]). In this case, i is 0, ..., 7. bS[0][xD k +i][yD m ] is the boundary filtering intensity for horizontal edges, and (xD k +i, yD m This refers to the bS value defined based on ).
[0175] (5-6) Set the value of bStrength[1][k][m] to the bSVer value.
[0176] (5-7) Based on the current luminance sample position of CU (xC, yC), the current luminance sample position of block (xDk, yDm), information indicating that it is a vertical edge to which a block removal filter is applied, and the boundary filtering intensity bSHor, a decision process is performed on the luminance block edge to determine dEdge[1][k][m] which indicates whether to apply a strong filter or a weak filter, and an 8x8 array dS as information for the decision.
[0177] (5-8) Set dS[i] to dS[i], which is used to determine the dEdge value, by setting dSample[1][m][(k<<3)+i]. In this case, i is 0, ..., 7.
[0178] (6) For edges to which it has been decided to apply the block distortion removal filter, the block distortion removal filter is executed based on the bS value, dEdge value, and dSample value, etc.
[0179] Step 2 explains the method, and when deriving nD, which represents the number of block distortion removal filter units within the current block, log2CUSize-3 is used. That is, in 8x8 pixel block units, the block removal filter can be applied to the vertical and horizontal edges of the current block (current CU) as many times as there are 8x8 pixel blocks.
[0180] Next, the bS value for vertical edges and the bS value for horizontal edges are compared for each of the eight pixels, and the largest bS value is set. For example, bSVer, which is the bS for vertical edges, is Max(bS[0][xD k ][yD m +i]) is set, and bSHor, which is bS for horizontal edges, is Max(bS[1][xD k +i][yD m ]) is set, in which case i will be 0, ..., 7. The i value can be changed from 0 to 7, and the bS values based on 8 pixels can be compared, with the largest bS being set as the bS for the block currently to which the block de-blocking filter is applied. For example, the bS values based on 8 pixels along the vertical edges can be compared, with the largest bS being set as the bS for the vertical edges of the block currently to which the block de-distortion filter is applied, and the bS values based on 8 pixels along the horizontal edges can be compared, with the largest bS being set as the bS for the horizontal edges of the block currently to which the block de-distortion filter is applied.
[0181] Therefore, in step 1, bS is determined for each boundary of all 4x4 pixel blocks (bS determination unit blocks), but in step 2, the bS determined at the boundary of the 8x8 pixel block (block distortion removal filtering unit block) is used to set bSVer, which is the bS for vertical edges, and bSHor, which is the bS for horizontal edges, at the boundary of the 8x8 pixel block.
[0182] In step 1 of Figures 7 and 8, to clearly explain that processing is done in units of 4 pixels, ((1<<log2CUSize)> >2), xE k+1 =xE k +4, yE j+1 =yE j Although we used a relation such as +4, the present invention is not limited to this formula. For example, if bS can be determined in a predetermined bS determination unit (a 4x4 pixel block in the above example), bS can be set for each bS determination unit by applying other relations that represent this.
[0183] Furthermore, in step 2 of Figures 7 and 8, formulas such as log2CUSize-3 were used to clearly explain that processing is performed in units of 8 pixels, but the present invention is not limited to these formulas. For example, if a block distortion removal filter is applied in a predetermined block distortion removal filter processing unit (8x8 pixel blocks in the above example), and bS can be assigned as a result, then bS can be reassigned for each block distortion removal filter processing unit by applying other formulas that represent this.
[0184] In the examples in Figures 7 and 8, the present invention is explained using the case where the current block is a CU as the luminance sample. However, the present invention is not limited to this and can also be applied to the case of a color difference sample or when the current block is a processing unit other than a CU (e.g., PU or TU). Furthermore, the same method can be applied when the bS determination unit is a 4x4 pixel block and the block distortion removal filter processing unit is not an 8x8 pixel block.
[0185] On the other hand, in the examples of FIGS. 7 and 8, in step 1, the bS value is determined / assigned for each boundary of all 4×4 pixel blocks, but in step 2, bSVer and bSHor are obtained at the boundaries of 8×8 pixel blocks. Therefore, in the examples of FIGS. 7 and 8, determining bS for the edges inside the 8×8 pixel block becomes an unnecessary process.
[0186] Therefore, in order to reduce the complexity of the block distortion removal filter process, a method of deriving bS only in the case of the boundary of the block distortion removal filter processing unit block and also the boundary of the bS determination unit block can be considered. For example, a method of determining bS in the bS determination unit for each block distortion removal filter processing unit block (bS derivation method 1), and a method of determining bS for each bS determination unit and adding a condition that the boundary of the bS determination unit is at the boundary of the block distortion removal filter processing unit block (bS derivation method 2) can be considered.
[0187] First, an example of the method of determining bS in the bS determination unit for each block distortion removal filter processing unit block is as follows.
[0188] <bS derivation method 1>
[0189] The position of the luminance sample at the upper left side in the current block, for example, in the CU, is specified as (xC, yC) based on the upper left side luminance sample of the current picture. Let the variable specifying the size of the CU which is the current block be log2CUSize, and assume that the vertical edge and the horizontal edge where bS is determined are indicated by the two-dimensional arrays horEdgeFlags and verEdgeFlags. At this time, the size of the two-dimensional array is nS×nS, and nS = 1<<log2CUSize.
[0190] (xE k , yE j ) is assumed to specify the set of positions of the edge surrounding samples (edge samples). k = 0,..., nE - 1 and j = 0,..., nE - 1, and nE is set to ((1<<log2CUSize)>>3), xE0 = 0, yE0 = 0, xEk+1 =xE k +8, yE j+1 =yE j They have a relationship of +8.
[0191] In this case, the sample to which the block distortion removal filter is applied to the horizontal and vertical edges identifies the set of edge sample locations (xE k , yE j This can be determined based on (1) information indicating that it is a horizontal edge indicates that a block distortion removal filter should be applied to that edge (bS should decide) (for example, horEdgeFlags[xE k ][yE j ]=1), (2)(xE k+r , yE j For (r=0,1), the (xC+xE) of the picture restored after prediction is k , yC+yE j Set p0 to (-1), and the (xC+xE) of the picture restored after prediction. k , yC+yE j (3) In this case, q0 can be set to (4), and the direction of the block distortion removal filter will be vertical.
[0192] For vertical edges, (1) when information indicating that it is a vertical edge indicates that a block distortion removal filter should be applied to that edge (bS determines this) (for example, verEdgeFlags[xE k ][yE j ]=1), (2)(xE k , yE j+r For (r=0,1), the (xC+xE) of the picture restored after prediction is k -1, yC+yE j Set p0 to ) and the (xC+xE) of the restored picture after prediction. k , yC+yE j (3) In this case, q0 can be set to (4), and the direction of the block distortion removal filter will be horizontal.
[0193] Depending on the filter direction, bS is (Ek , E j ) can be determined based on. For example, bS can be determined as bS[filterDir][E k [E j .
[0194] Looking at bS derivation method 1, edges for determining bS are set for each block of the block distortion removal filter processing unit. Therefore, bS is determined at the edges that are the boundaries of the block removal application unit blocks and also the boundaries of the bS determination unit blocks. In bS derivation method 1, since the case where the block distortion removal filter processing unit is an 8×8 pixel block and bS is determined in 4-pixel units is used as an example, edges for determining bS at the boundaries of the 8×8 pixel blocks are set. For this purpose, nE = ((1 << log2CUSize) >> 3) and xE k+1 = xE k + 8, yE j+1 = yE j + 8 and other relationships are applied. Also, for horizontal edges, bS is set based on (xE k+r , yE j ), block distortion removal filter application samples are specified, for vertical edges, bS is set based on (Ek, yE j+r ), block distortion removal filter application samples are specified, and the r value is limited to 0 and 1.
[0195] After that, when bS determination is performed in 4×4 pixel units, bS is determined for the edges that are the boundaries of the 8×8 pixel blocks and also the boundaries of the 4×4 pixels. In other words, at the boundaries of the 8×8 pixel blocks (block distortion removal filter processing unit blocks), bS is determined in 4-pixel units (bS determination units).<00The position of the luminance sample in the upper left of the current block, for example, CU, is identified as (xC, yC) relative to the upper left luminance sample of the current picture. The variable log2CUSize is used to identify the size of the current block, CU, and the vertical and horizontal edges that determine bS are indicated by the two-dimensional arrays horEdgeFlags and verEdgeFlags. In this case, the size of the two-dimensional array is nS × nS, where nS = 1 < <log2CUSizeである。
[0199] (xE k , yE j Let ) identify the set of edge-periphery sample (edge sample) locations. k=0,…,nE-1, j=0,…,nE-1, and nE is ((1<<log2CUSize)> >2) is set, xE0=0, yE0=0, xE k+1 =xE k +4, yE j+1 =yE j They have a relationship of +4.
[0200] In this case, the sample to which the block distortion removal filter is applied to the horizontal and vertical edges identifies the set of edge sample locations (xE k , yE j This can be determined based on (1) information indicating that it is a horizontal edge, which instructs that a block distortion removal filter be applied to that edge (which bS determines) (for example, horEdgeFlags[xE k ][yE j ]=1) and yE j When the value of %2 is 0, (2) the (xC+xE) of the picture restored after prediction. k , yC+yE j Set p0 to (-1), and the (xC+xE) of the picture restored after prediction. k , yC+yE j ) can be set to q0, and (3) in this case the direction of the block distortion removal filter will be vertical. In this case yE j %2 is yE j This refers to the remainder when divided by 2.
[0201] For vertical edges, (1) information indicating that it is a vertical edge indicates that a block distortion removal filter should be applied to that edge (bS should decide) (for example, verEdgeFlags[xE k ][yE j ]=1) and xE k When the value of %2 is 0, (2) the (xC+xE) of the picture restored after prediction. k -1, yC+yE j Set p0 to ) and the (xC+xE) of the restored picture after prediction. k , yC+yE j (3) In this case, q0 can be set to (3) the direction of the block distortion removal filter will be horizontal. In this case, xE k %2 is xE k This refers to the remainder when divided by 2.
[0202] Depending on the filter direction, bS is (E k , E j It can be determined based on ). For example, bS is bS[filterDir][E k ][E j It can be decided as ].
[0203] Similar to Method 1, Method 2 also does not perform bS determination on edges within the block removal unit block (8x8 pixel block). In Method 2, the process of determining bS is performed in units of 4x4 pixel blocks (bS determination unit blocks), and bS is determined only when the index of the 4x4 block is even, i.e., when the boundary of the 4x4 block is the boundary of the 8x8 block. In this case, the bS at each boundary can be determined by the bS determination method explained in the example in Figure 5, or it can be determined by a simpler bS determination method as described later.
[0204] Figure 9 schematically illustrates an example of a method for determining bS when the boundary of the block removal application unit block coincides with the boundary of the bS determination unit block. The example in Figure 9 schematically explains the application results of Method 1 and Method 2.
[0205] As shown in Figure 9, if we consider a block distortion removal filtering unit block 910, which is an 8x8 pixel block, with respect to the current block (e.g., CU), then bS is not determined for edges located inside block 910.
[0206] On the other hand, in order to simplify the bS determination procedure, reduce its complexity, and enhance the effectiveness of the block strain removal filter, one can also consider a method in which only the bS for one edge among the edges of the unit block of the block strain removal filter is derived and applied as the representative bS for that edge among the edges of the unit block of the block strain removal filter.
[0207] Figure 10 schematically illustrates another example of how to determine a representative bS value in the unit block on which the block distortion removal filter is performed. In Figure 10, the example is given where the unit block 1000 of the block distortion removal filter is an 8x8 pixel block, and the unit block for bS determination is a 4x4 pixel block.
[0208] Referring to Figure 10, of the two vertical edges 1010 and 1020 that are the target of bS determination within the unit block 1000 of the block distortion removal filter, bS is determined only for the 0th edge 1010. In other words, for each unit block of the block distortion removal filter, bS is calculated only for the vertical and horizontal edges of the unit block for the 0th bS determination, and the calculated bS is used as the representative bS for that unit block of the block distortion removal filter. For example, if the unit block of the block distortion removal filter is an 8x8 pixel block and the unit block for bS determination is a 4x4 pixel block, then there are four unit blocks for bS determination within the unit block of the block distortion removal filter. Of these, bS can be determined only for the vertical and horizontal edges of the 0th block (upper left block) and used as the representative bS for the unit block of the block distortion removal filter.
[0209] As shown in the example in Figure 10, determining bS simplifies the process of determining bS, allowing bS to be determined for a process that corresponds to 1 / 4 of the existing process, and the memory required to store bS can also be reduced to 1 / 4 of the existing process.
[0210] The position (edge) for determining bS can be determined using one of the methods described in Figures 6 to 10, as mentioned above. The specific method for determining bS at the bS setting position is as described in Figure 5.
[0211] However, a simpler method than that shown in Figure 5 can also be applied to determine bS. For example, even if the bS value is derived by dividing it into four categories from 0 to 4, as in the example in Figure 5, the block strain removal filter process may not use the subdivided bS value. For example, it may only consider bS > 0, or only bS > 1, or only bS > 2.
[0212] Therefore, a simpler bS decision tree, such as the example in Figure 5, can be further simplified by applying a block distortion removal filter.
[0213] Figure 11 is a schematic diagram illustrating another example of a method for determining bS.
[0214] Referring to Figure 11, we first determine whether block P and / or block Q are intra-encoded (S1110).
[0215] When P and / or Q are intra-encoded, bS for the boundary between block P and block Q is determined to be bS3 (S1120).
[0216] If P and / or Q are not intra-encoded, it is determined whether block P and / or block Q contain coefficients (non-zero transformation coefficients) (S1130). In this case, the transformation coefficients may be the transformation coefficients before inverse quantization is applied, or the transformation coefficients after inverse quantization is applied.
[0217] In step S1130, if block P and / or block Q contain coefficients (non-zero conversion coefficients), the bS value for the boundary between P and Q is determined to be bS2 (S1140).
[0218] In step S1130, if block P and / or block Q do not contain coefficients (non-zero conversion coefficients), it is determined whether block P and block Q have separate reference pictures or whether block P and block Q have separate motion vectors (S1150).
[0219] In step S1150, if block P and block Q have separate reference pictures or separate motion vectors, then bS for the boundary between block P and block Q is determined to be bS1 (S1160).
[0220] In other cases, i.e., when the block distortion removal filter is not applied, bS for the boundary between block P and block Q is set to bS0 (S1170).
[0221] Here, the bS values determined in steps S1120, S1140, S1160, and S1170 are represented as bS3, bS2, bS1, and bS0, respectively, for the sake of explanation. Considering that the bS values are derived by dividing them into four types in the example in Figure 11, the values of bS0 to bS3 can be set as bS0=0, bS1=1, bS2=2, and bS3=3 / 4, as shown in Figure 11. In the example in Figure 11, it is explained that bS3 is determined to be 3 / 4 in step S1120, which is a way to make it easier to understand that in the example in Figure 5, when the bS values are 3 and 4, bS3 is determined to be a single value (for example, 3) in the example in Figure 11.
[0222] You can also use a bS decision tree to set the values of the variables required for the block distortion removal filter. In Figure 11, t cThis example simply illustrates setting the offset to a specific value (e.g., 2) for the largest bS value and to 0 for all other bS values.
[0223] A method to further reduce the number of decision branches than described in the example in Figure 11 can also be considered. In this case, the bS values can also be reduced from 3 (bS0, bS1, bS2) to 4 (bS0, bS1, bS2, bS3) as in the example in Figure 11, and the block distortion removal filter can be used.
[0224] In this case, the largest bS value, bS2, can be determined for the case where block P and / or block Q are intra-encoded, bS1 for the case where other block distortion removal filters can be applied, and bS0 for the case where no block distortion removal filter is applied. Considering that the values of bS0, bS1, and bS2 can be set to, for example, bS0=0, bS1=1, and bS2=2, taking into account that the result will be derived from any one of the three bS values.
[0225] Figure 12 is a schematic diagram illustrating the method for determining the bS value from among the three types of values, as described above.
[0226] Referring to Figure 12, we first determine whether block P and / or block Q are intra-encoded (S1210).
[0227] If block P and / or block Q are intra-encoded, the bS for the boundary between block P and block Q is determined to be bS2 (S1220). bS2 corresponds to the case where the bS values are 3 and 4 in the example in Figure 5 (bS=3 / 4). Since bS2 is the largest of the three types of bS values, the value of bS2 can be set to, for example, 2.
[0228] If block P and / or block Q are not intra-encoded, it is determined whether block P and block Q contain non-zero coefficients (transformation coefficients), whether P and Q have different reference pictures, or whether block P and block Q have different motion vectors (S1230). In this case, the transformation coefficients may be the transformation coefficients before inverse quantization is applied, or the transformation coefficients after inverse quantization is applied.
[0229] In step S1230, if block P and block Q contain a non-zero coefficient (conversion coefficient), block P and block Q have different reference pictures, or block P and block Q have different motion vectors, then the bS for the boundary between block P and block Q is set to bS1 (S1240). bS1 is the bS value for when block P and block Q are not intra-encoded and a block removal filter is applied, corresponding to the cases where the bS values are 1 and 2 (bS=1 / 2) in the example of Figure 5. Since the intermediate value among the three types of bS values is bS1, the value of bS1 can be set to, for example, 1.
[0230] In other cases, i.e., when the block removal filter is not applied, bS is set to bS0 (S1240). bS0 is the bS value when the block removal filter is not applied, and corresponds to the case where the bS value is 0 (bS=0) in the example in Figure 5. Since bS0 is the smallest of the three types of bS values, the value of bS0 can be set to, for example, 0.
[0231] You can also use a bS decision tree to set the values of the variables required for the block distortion removal filter. c This example simply illustrates setting the offset to a specific value (e.g., 2) for the largest bS value and to 0 for all other bS values.
[0232] Figure 13 is a schematic diagram illustrating another method for determining the bS value to one of three different values. In the bS determination method (bS decision tree) described in Figure 12, this shows an example where the three values of bS (bS1, bS2, bS3) are clearly set to 0, 1, and 2 for the purpose of understanding the invention.
[0233] Referring to Figure 13, we first determine whether block P and / or block Q are intra-encoded (S1310).
[0234] If block P and / or block Q are intra-encoded, the value of bS for the boundary between block P and block Q is determined to be 2 (S1320). When bS is 2, it corresponds to the cases where the bS values are 3 and 4 (bS=3 / 4) in the example of Figure 5.
[0235] If block P and / or block Q are not intra-encoded, it is determined whether block P and block Q contain non-zero coefficients (transformation coefficients), whether block P and block Q have different reference pictures, or whether block P and block Q have different motion vectors (S1330). In this case, the transformation coefficients may be the transformation coefficients before inverse quantization is applied, or the transformation coefficients after inverse quantization is applied.
[0236] In step S1330, if block P and block Q contain non-zero coefficients (conversion coefficients), block P and block Q have different reference pictures, or block P and block Q have different motion vectors, the value of bS for the boundary between block P and block Q is set to 1 (S1340). When bS is 1, block P and block Q are not intra-encoded, and the bS value corresponds to the case where the block removal filter is applied, as shown in the example in Figure 5 where the bS values are 1 and 2 (bS=1 / 2).
[0237] In other cases, i.e., when the block removal filter is not applied, the value of bS is set to 0 (S1340). When the value of bS is 0, it corresponds to the case where the bS value is 0 (bS=0) in the example in Figure 5, which is the bS value when the block removal filter is not applied.
[0238] You can also use a bS decision tree to set the values of the variables required for the block distortion removal filter. c This example simply illustrates setting the offset to a specific value (e.g., 2) for the largest bS value and to 0 for all other bS values.
[0239] As shown in Figures 12 and 13, even if the bS value is set to one of the three values, it is not necessary to limit the decision tree's decision steps to two. Even if more or fewer decision steps are taken, a smaller number of the five bS values used in the decision method in Figure 5 can be applied. For example, in Figures 12 and 13, the decisions regarding whether blocks P and Q contain non-zero coefficients (conversion coefficients), whether P and Q have different reference pictures, or whether blocks P and Q have different motion vectors can be performed separately in a single step.
[0240] Figure 14 is a schematic diagram illustrating yet another method for determining the bS value to one of three different values.
[0241] Referring to Figure 14, we first determine whether block P and / or block Q are intra-encoded (S1410).
[0242] If block P and / or block Q are intra-encoded, the value of bS for the boundary between block P and block Q is determined to be 2 (S1420). When bS is 2, it corresponds to the cases where the bS values are 3 and 4 (bS=3 / 4) in the example in Figure 5.
[0243] If block P and / or block Q are not intra-encoded, it is determined whether block P and block Q contain non-zero coefficients (transformation coefficients) (S1430). In this case, the transformation coefficients may be the transformation coefficients before inverse quantization is applied, or the transformation coefficients after inverse quantization is applied.
[0244] If block P and block Q contain non-zero coefficients (transformation coefficients), the value of bS for the boundary between block P and block Q is set to 1 (S1440). In this case, a bS value of 1 means that block P and block Q are not intra-encoded and the block removal filter is applied to the bS value, which corresponds to the case where bS is 2 in the example in Figure 5.
[0245] If neither block P nor block Q contains a non-zero coefficient (transformation coefficient), it is determined whether block P and block Q have different reference pictures or different motion vectors (S1450).
[0246] In step S1450, if block P and block Q have different reference pictures or different motion vectors, the value of bS for the boundary between block P and block Q is set to 1 (S1460). A bS value of 1 means that block P and block Q are not intra-encoded and the block removal filter is applied to the bS value, which corresponds to the case where the bS value is 1 in the example in Figure 5.
[0247] In other cases, i.e., when the block removal filter is not applied, the value of bS is set to 0 (S1470). When the value of bS is 0, it corresponds to the case where the bS value is 0 (bS=0) in the example in Figure 5, which is the bS value when the block removal filter is not applied.
[0248] You can also use a bS decision tree to set the values of the variables required for the block distortion removal filter. cAs an example, it is simply shown that the offset is set to a specific value (for example, 2) for the largest bS value and to 0 for other bS values.
[0249] Hereinafter, when the value of bS is simplified and derived by any one of three types of values, the method for deriving the bS value will be specifically described.
[0250] First, to facilitate understanding of the invention, as shown in FIG. 5 or FIG. 11, the method when the value of bS is derived by any one of five values will be described first.
[0251] <Method for deriving bS by any one of five types of values>
[0252] First, identify the edge where bS is determined. The identification of the edge where bS is determined can be performed using any one of the methods described by referring to FIGS. 6 to 10.
[0253] As described by referring to FIGS. 6 to 10, the reference position (xE k , yE j ) for determining bS and the samples p0 and q0 on the left and right of the edge where bS is determined, the direction of the block distortion removal filter, etc. are derived. p0 and q0 are determined based on (xE k , yE j ) as described above.
[0254] Based on the derived block distortion removal filter direction, the variable bS[filterDir][xE k [yE j representing the boundary filter processing intensity is determined. For example, when the value of filterDir is 1, it indicates vertical filter processing, and thus bS for a horizontal edge is derived. When the value of filterDir is 0, it indicates horizontal filter processing, and thus bS for a vertical edge is derived. xE k and yE jThis identifies the edge that determines bS. For example, the edge that determines bS is (xC+xE) if it is a horizontal edge. k , yC+yE j p0 is set to -1), and (xC+xE k , yC+yE j It can be identified as the boundary between q0 set to ), and in the case of a vertical edge, (xC+xE k -1, yC+yE j p0 is set to (xC+xE k , yC+yE j ) can be identified as the boundary between it and Settingq0.
[0255] bS[filterDir][xE k ][yE j The value of ] can be derived as follows:
[0256] (1) When the block edge to be determined for bS is a CU edge, and sample p0 or q0 belongs to a CU encoded in intra-prediction mode, then bS is defined as bS[filterDir][xE k ][yE j The value is set to 4.
[0257] (2) If sample p0 or q0 belongs to a CU encoded in intra prediction mode, but the block edge to be determined by bS is not a CU edge, then bS[filterDir][xE k ][yE j The value is set to 3.
[0258] (3) When the block edge to be determined for bS is a TU edge and belongs to a TU that contains a conversion coefficient level (level) in which sample p0 or q0 is not 0, bS[filterDir][xE k ][yE j The value is set to 2.
[0259] (4) In addition, when a block distortion removal filter is applied, bS[filterDir][xE k ][yE jThe value is set to 1. For example, in the examples of FIGS. 5, 11, 12, 13, and 14, for convenience of explanation, when the sample p0 or q0 does not belong to the block to which the intra prediction is applied and the block removal filter is applied, the block P and / or the block Q includes a non-zero transform coefficient, and the block P and the block Q have different motion vectors or different reference pictures as examples, but there are various other cases where the non-zero bS can be set. For example, (i) when the block P and the block Q have different numbers of motion vectors from each other, (ii) when the absolute value difference between the vertical components or the absolute value difference between the horizontal components of the motion vector used for the block P and the motion vector used for the block Q is 4 or more in 1 / 4 pixel units, bS[filterDir][xE k [yE j The value can be set to 1.
[0260] (5) If it is not the case of (1) to (4), that is, when the block distortion removal filter is not applied, bS[filterDir][xE k [yE j The value is set to 0.
[0261] On the other hand, different from the case of deriving the bS value by any one of five values, as shown in FIGS. 12 to 14, the bS value can be derived by any one of three values, and the bS can be derived simply with lower complexity.
[0262] Next, an example of a method of deriving the bS value by any one of three values will be described.
[0263] <Method 1 for deriving bS by any one of three values>
[0264] Identify the edge where bS is determined. The identification of the edge where bS is determined can be executed using any one of the methods described by referring to FIGS. 6 to 10.
[0265] The reference position (xE) that determines bS is determined by identifying the edge that determines bS. k , yE j ) and the left and right samples p0 and q0 of the edge that determine bS, as well as the direction of the block distortion removal filter, are derived.
[0266] The variable bS[filterDir][xE] represents the boundary filtering intensity based on the derived block distortion removal filter direction. k ][yE j ] is determined. For example, when the value of filterDir is 1, it instructs vertical filtering, and therefore bS for horizontal edges is derived. When the value of filterDir is 0, it instructs horizontal filtering, and therefore bS for vertical edges is derived. xE k and yE j This identifies the edge that determines bS. For example, the edge that determines bS is a horizontal edge, (xC + xE k , yC+yE j p0 is set to -1), and (xC+xE k , yC+yE j It can be identified as the boundary between q0 set to ), and in the case of a vertical edge, (xC+xE k -1, yC+yE j p0 is set to (xC+xE k , yC+yE j ) can be identified as the boundary between it and Settingq0.
[0267] bS[filterDir][xE k ][yE j The value of ] can be derived as follows:
[0268] (1) When sample p0 or q0 belongs to a CU encoded in intra-predictive mode, bS, i.e., bS[filterDir][xE k ][yE j The value is set to 2.
[0269] (2) When the block edge for which bS is to be determined is a TU edge and the sample p0 or q0 belongs to a TU containing a non-zero transform coefficient level, bS[filterDir][xE k [yE j value is set to 1.
[0270] (3) Otherwise, when the block distortion removal filter is applied, bS[filterDir][xE k [yE j value is set to 1. For example, in connection with the drawings related to the previous bS decision tree structure, as an example, when (i) the PU containing p0 or the PU containing q0 has a different reference picture or has a different number of motion vectors, (ii) the absolute value difference between the vertical components or the absolute value difference between the horizontal components of the motion vectors used for the PU containing p0 and the motion vectors used for the PU containing q0 is 4 or more in 1 / 4 pixel units, (iii) when two motion vectors are used in the PU containing p0 and two motion vectors are used in the PU containing q0, for at least one pair of motion vectors corresponding to the same reference picture, if the absolute value difference between the vertical components or the absolute value difference between the horizontal components of the motion vectors is 4 or more in 1 / 4 pixel units, etc., bS[filterDir][xE k [yE j value can be set to 1.
[0271] (4) If not in cases (1) to (3), that is, when the block distortion removal filter is not applied, bS[filterDir][xE k [yE j value is set to 0.
[0272] On the other hand, as described above, instead of deriving bS in 4 steps, the same bS value can be derived in the same step. Another example of a method for deriving the bS value to one of the three types of bS values is as follows.
[0273] <Method 2 for deriving bS to one of the three types of values>
[0274] Identify the edge that determines the bS. Identifying the edge that determines the bS can be done using any one of the methods described with reference to Figures 6 to 10.
[0275] The reference position (xE) that determines bS is determined by identifying the edge that determines bS. k , yE j ) and the left and right samples p0 and q0 of the edge that determine bS, as well as the direction of the block distortion removal filter, are derived.
[0276] The derived block distortion removal filter direction determines the variable bS[filterDir][xE] which represents the boundary filtering intensity. k ][yE j ] is determined. For example, when the value of filterDir is 1, it instructs vertical filtering, and therefore bS for horizontal edges is derived. When the value of filterDir is 0, it instructs horizontal filtering, and therefore bS for vertical edges is derived. xE k and yE j This identifies the edge that determines bS. For example, the edge that determines bS is a horizontal edge, (xC + xE k , yC+yE j p0 is set to -1), and (xC+xE k , yC+yE j It can be identified as the boundary between q0 set to ), and in the case of a vertical edge, (xC+xE k -1, yC+yE j p0 is set to (xC+xE k , yC+yE j ) can be identified as the boundary between it and Settingq0.
[0277] bS[filterDir][xE k ][yE j The value of ] can be derived as follows:
[0278] (1) When sample p0 or q0 belongs to a CU encoded in intra-predictive mode, bS, i.e., bS[filterDir][xE k ][yE j The value is set to 2.
[0279] (2) In addition, when a block distortion removal filter is applied, bS[filterDir][xE k ][yE j The value is set to 1. For example, when the block edge to be determined by bS is a TU edge, and (i) samples p0 or q0 belong to a TU that contains a transformation coefficient level (level) that is not 0, (ii) the PU containing p0 and the PU containing q0 have different reference pictures or different numbers of motion vectors, (iii) the difference in the absolute value between the vertical components or the difference in the absolute value between the horizontal components of the motion vector used in the PU containing p0 and the motion vector used in the PU containing q0 is 4 or more in units of 1 / 4 pixels, or (iv) when two motion vectors are used in the PU containing p0 and two motion vectors are used in the PU containing q0, and for at least one pair of motion vectors corresponding to the same reference picture, the difference in the absolute value between the vertical components or the difference in the absolute value between the horizontal components of the motion vectors is 4 or more in units of 1 / 4 pixels, then bS[filterDir][xE k ][yE j The value can be set to 1.
[0280] (3) If (1) and (2) are not applicable, i.e., if the block distortion removal filter is not applied, then bS[filterDir][xE k ][yE j Set the value to 0.
[0281] On the other hand, the case in which the bS value is derived by 1 is not limited to the case where the block edge being determined for bS is an edge of TU. Another example of a method for deriving the bS value by any one of the three values is as follows:
[0282] <Method 3 for deriving <bS> with any one of three values>
[0283] Identify the edge where <bS> is determined. The identification of the edge where <bS> is determined can be performed using any one of the methods described by referring to FIGS. 6 to 10.
[0284] The reference position (xE k , yE j ) for determining <bS>, p0 and q0 which are samples on the left and right of the edge for determining <bS>, the direction of the block distortion removal filter, etc. are derived.
[0285] Based on the derived block distortion removal filter direction, the variable bS[filterDir][xE k [yE j representing the boundary filter processing intensity is determined. For example, when the value of filterDir is 1, it indicates vertical filter processing, and thus bS for a horizontal edge is derived. When the value of filterDir is 0, it indicates horizontal filter processing, and thus bS for a vertical edge is derived. xE k and yE j identify the edge for determining <bS>. For example, in the case of a horizontal edge, the edge for determining <bS> can be identified as the boundary between p0 set at (xC + xE k , yC + yE j - 1) and q0 set at (xC + xE k , yC + yE j ). In the case of a vertical edge, it can be identified as the boundary between p0 set at (xC + xE k - 1, yC + yE j ) and q0 set at (xC + xE k , yC + yE j ).
[0286] The value of bS[filterDir][xE k [yE j can be derived as follows.
[0287] (1) When sample p0 or q0 belongs to a CU encoded in intra-predictive mode, bS, i.e., bS[filterDir][xE k ][yE j The value is set to 2.
[0288] (2) In addition, when a block distortion removal filter is applied, bS[filterDir][xE k ][yE j The value is set to 1. For example, (i) when the block edge to be determined by bS is a TU edge and belongs to a TU that contains a transformation coefficient level (level) in which sample p0 or q0 is not 0, (ii) when the PU containing p0 or the PU containing q0 have different reference pictures or different numbers of motion vectors, (iii) when the difference in the absolute value between the vertical components or the difference in the absolute value between the horizontal components of the motion vector used in the PU containing p0 and the motion vector used in the PU containing q0 is 4 or more in units of 1 / 4 pixels, (iv) when two motion vectors are used in the PU containing p0 and two motion vectors are used in the PU containing q0, and for at least one pair of motion vectors corresponding to the same reference picture, the difference in the absolute value between the vertical components or the difference in the absolute value between the horizontal components of the motion vectors is 4 or more in units of 1 / 4 pixels, then bS[filterDir][xE k ][yE j The value can be set to 1.
[0289] (3) If (1) and (2) are not applicable, i.e., if the block distortion removal filter is not applied, then bS[filterDir][xE k ][yE j Set the value to 0.
[0290] The method of deriving bS using one of three values means that the referenced pictures differ between the PU containing p0 and the PU containing q0, and this is determined by which picture is referenced, regardless of which referenced picture list is used or whether the referenced picture indexes of the referenced picture lists are the same.
[0291] On the one hand, although the luminance samples have been described so far, as described above, the derived bS can also be applied to the color difference samples.
[0292] As described, when reducing the number of bS values to lower the complexity and simply deriving bS, it is also necessary to modify and apply the block distortion removal filter method for the color difference components.
[0293] An example of a method of deriving bS by one of five values and applying a block distortion removal filter to the color difference components (color difference samples) using this is as follows.
[0294] <Method 1 of applying a block distortion removal filter to color difference samples>
[0295] Variable t c is specified. The variable t c is a value that quantifies the block distortion according to the quantization level, and t c can be derived based on the offset or set to be mapped on a predetermined table based on other block removal parameters.
[0296] For example, as in described later, t c can be determined by the quantization parameter Q, β as a reference value for determining whether to apply the block distortion removal filter, etc.
[0297] For the edge of the color difference sample, when bS is derived by values from 0 to 4 as described in <Method of deriving bS by one of five values>, t c value can be specified as follows. (1) When the bS value is greater than 2, when the average value of the quantization parameters for blocks P and Q considering the approximate (round) value is qP L , t c is determined to be the value corresponding to the quantization parameter Q = Clip(0, 55, qP L ). (2) When the bS value is 2 or less, tc The quantization parameter Q = qP L The corresponding value is determined.
[0298] Table 1 shows Q, β, t c This illustrates an example of a correspondence between the two. [Table 1]
[0299] At this time, c =t c The relationships '*(1<<(BitDepthY-8)) and β=β'*(1<<(BitDepthY-8)) are acceptable.
[0300] A block distortion removal filter can be applied to color difference samples using parameters identified based on the values in Table 1.
[0301] First, a block distortion removal filter is applied to the vertical edges, based on each color difference sample position (xC+xB, yC+yB+k), as follows, where k=0,...,3.
[0302] (1) In block P and block Q with a vertical edge as the boundary, the color difference sample p of block P i and color difference sample q of block Q i (i=0,1) is q i This is derived by =s'[xC+xB+i, yC+yB+k] and pi=s'[xC+xB-i-1, yC+yB+k].
[0303] (2) When bS is greater than 2, (i) chromatic difference sample value p i and q i (i=0,1) A filtering procedure is performed on (i=0,1). (ii) The filtered sample values p0' and q0' replace the corresponding sample positions in the sample sequence as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB, yC+yB+k]=p0'
[0304] For horizontal edges, a block distortion removal filter for the chromatic difference component is applied as follows, where k=0,...,3.
[0305] (1) Color difference sample p of block P i and color difference sample q of block Q i (i=0,1) is q i =s'[xC+xB+i, yC+yB+k], p i This is derived by =s'[xC+xB-i-1, yC+yB+k].
[0306] (2) When bS is greater than 2, (i) color difference sample p i and q i (i=0,1) A filtering procedure is performed on (i=0,1). (ii) The filtered samples p0' and q0' replace the corresponding samples in the sample sequence as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB, yC+yB+k]=p0'
[0307] For horizontal edges, apply the block distortion removal filter as follows:
[0308] (1) In blocks P and Q with a horizontal edge as the boundary, the color difference sample p of block P i and color difference sample q of block Q i (i=0,1) is q i =s'[xC+xB+k, yC+yB+i], p i This is derived by =s'[xC+xB+k, yC+yB-i-1]. In this case, k can have values of 0, ..., 3.
[0309] (2) When bS is greater than 2, (i) each color difference sample p i and q i (i) Apply a block distortion removal filter to (i=0,1). (ii) The filtered samples p0' and q0' replace the corresponding samples in the sample sequence as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB-1, yC+yB+k]=p0'
[0310] In the above-described filter processing process, when the value of bS is greater than 2, the sample to be filter-processed is derived as shown in the following <Equation 5>.
[0311] <Equation 5> Δ = Clip3(-t C , t C , ((((q0 - p0) << 2) + p1 - q1 + 4) >> 3)) p0’ = Clip1 C (p0 + Δ) q0’ = Clip1 C (q0 - Δ)
[0312] On the other hand, when reducing the number of bS values to lower the complexity and applying the simply-derived bS, the block distortion removal filter method for chromatic aberration samples can be applied as follows.
[0313] <Method 2 of applying a block distortion removal filter to chromatic aberration samples>
[0314] The variable t c is specified. The variable t c is a value that quantifies the block distortion according to the quantization level, and t c can be derived based on the offset or set to be mapped on a predetermined table based on other block removal parameters.
[0315] For example, as shown in described later, t<00003,29>can be determined by the quantization parameter Q, β as a reference value for determining whether to apply the block distortion removal filter, etc.
[0316] For the edge of the chromatic aberration sample, when bS is derived by values from 0 to 2 as described in <Method of deriving bS by any one of three values>, t cThe value can be determined as follows: (1) When the bS value is greater than 2, the average value of the quantization parameters for block P and block Q, considering approximate values, is qP. L When this is the case, t c The quantization parameter Q = Clip(0, 55, qP) L (2) When the bS value is 2 or less, t c The quantization parameter Q = qP L The corresponding value is determined.
[0317] Table 2 shows Q, β, t c This is an example of a correspondence between the two. [Table 2]
[0318] At this time, c =t c The relationships are '*(1<<(BitDepthY-8)) and β=β'*(1<<(BitDepthY-8)).
[0319] Block distortion removal filters for color difference samples can also be applied using parameters identified based on the values in Table 2.
[0320] First, a block distortion removal filter is applied to the vertical edges, based on each color difference sample position (xC+xB, yC+yB+k), as follows, where k=0,...,3.
[0321] (1) In block P and block Q with a vertical edge as the boundary, the color difference sample p of block P i and color difference sample q of block Q i (i=0,1) is q i =s'[xC+xB+i, yC+yB+k], p i This is derived by =s'[xC+xB-i-1, yC+yB+k].
[0322] (2) When bS is greater than 1, (i) the color difference sample value p i and qi (i=0,1) A filtering procedure is performed on (i=0,1). (ii) The filtered sample values p0' and q0' replace the corresponding sample positions in the sample sequence as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB, yC+yB+k]=p0'
[0323] For horizontal edges, a block distortion removal filter for the chromatic difference component is applied as follows, where k=0,...,3.
[0324] (1) Color difference sample p of block P i and color difference sample q of block Q i (i=0,1) is q i =s'[xC+xB+i, yC+yB+k], p i This is derived by =s'[xC+xB-i-1, yC+yB+k].
[0325] (2) When bS is greater than 1, (i) color difference sample p i and q i (i=0,1) A filtering procedure is performed. (ii) The filtered samples p0' and q0' replace the corresponding samples in the sample sequence as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB, yC+yB+k]=p0'
[0326] For horizontal edges, apply the block distortion removal filter as follows:
[0327] (1) In blocks P and Q with a horizontal edge as the boundary, the color difference sample p of block P i and color difference sample q of block Q i (i=0,1) is q i =s'[xC+xB+k, yC+yB+i], p i This is derived by =s'[xC+xB+k, yC+yB-i-1]. In this case, k can have values of 0, ..., 3.
[0328] (2) When bS is greater than 1, (i) each color difference sample p i and q i (i) Apply a block distortion removal filter to (i=0,1). (ii) The filtered samples p0' and q0' replace the corresponding samples in the sample sequence as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB-1, yC+yB+k]=p0'
[0329] In the filtering process described above, when the value of bS is greater than 1, the samples to be filtered are derived as shown in <Equation 6> below.
[0330] <Formula 6> Δ = Clip3(-t C , t C , ( ( ( ( q0- p0) << 2 ) + p1- q1+ 4 ) >> 3 ) ) p0' = Clip1 C ( p0 + Δ ) q0' = Clip1 C ( q0 - Δ )
[0331] On the other hand, one of the main causes of block distortion at block boundaries is block-based motion compensation. Overlapped Block Motion Compensation (OBMC) can be used to overcome this.
[0332] When using OBMC, the bS determination process described above also needs to be modified to suit OBMC. For example, when the motion information between blocks differs, block distortion can be severe, so one of the criteria for determining the bS value of 0 and 1 can be the similarity of the motion information. However, when using OBMC technology, block distortion is reduced at the boundaries of the region where motion compensation is performed. As a result, unnecessary block distortion removal filters can be reduced, but the bS determination process (bS decision tree) needs to be modified to reflect this.
[0333] Figure 15 is an example of a bS decision tree applied when OMBC is used, and is a sequence diagram that schematically explains the method for determining bS.
[0334] Referring to Figure 15, we first determine whether block P and / or block Q are intra-encoded (S1500).
[0335] If block P and / or block Q are intra-encoded, it is determined whether the boundary of block Q, i.e., the boundary between block P and block Q, is the boundary of an encoded block (S1510). In this case, an encoded block includes CU and LCU.
[0336] In step S1510, if the boundary between block P and block Q is the boundary of an encoded block, the value of bS for the boundary between block P and block Q is determined to be bS4 (for example, bS4=4) (S1520).
[0337] In step S1520, if the boundary between block P and block Q is not the boundary of an encoded block, the value of bS for the boundary between block P and block Q is determined to be bS3 (for example, bS3=3) (S1530).
[0338] In step S1500, if blocks P and Q are not intra-encoded, it is determined whether blocks P and Q are located within a rectangular or asymmetric partition in a single-encoded block (e.g., CU) (S1540).
[0339] In step S1540, if block P and block Q are not located within a rectangular or asymmetric partition in a single coding block (e.g., CU), it is determined whether block P and / or block Q contain coefficients (non-zero transformation coefficients) (S1550). In this case, the transformation coefficients may be the transformation coefficients before inverse quantization is applied, or the transformation coefficients after inverse quantization is applied.
[0340] In step S1550, if block P and / or block Q contain coefficients (non-zero transformation coefficients), the bS for the boundary between block P and block Q is determined to be bS2 (for example, bS2=2) (S1560).
[0341] In step S1550, if block P and / or block Q do not contain coefficients (non-zero conversion coefficients), it is determined whether block P and block Q have different reference pictures or motion vectors (S1570).
[0342] In step S1570, if block P and block Q have different reference pictures or motion vectors, the bS for the boundary between block P and block Q is determined to be bS1 (for example, bS1=1) (S1580).
[0343] In other cases, i.e., when no block removal filter is applied, bS is set to bS0 (e.g., bS0=0) (S1590). Setting bS to bS0 includes cases where, in step S1540, block P and block Q are not in a rectangular or asymmetric partition within a single encoded block (e.g., CU), or where, in step S1570, block P and block Q do not have different reference pictures or motion vectors.
[0344] In the example in Figure 15, the relationship bS4 > bS3 > bS2 > bS1 > bS0 is maintained, similar to the previous example regarding bS determination. Therefore, the values of bS0 to bS4 can be set to bS4=4, bS3=3, bS2=2, bS1=1, and bS0=0, as shown in the example and diagram above.
[0345] Also, similar to the previous example, we can use a bS decision tree to set the values of the variables required for the block distortion removal filter. In Figure 15, for the largest 2bS value, t c Set the offset to a specific value (for example, 2), and for other bS values, t c A simple example of setting the offset to 0 is shown.
[0346] In the example in Figure 15, when block P and block Q are in the same encoded block (e.g., CU) and are located within a rectangular partition (e.g., a prediction block, PU, etc.) or an asymmetric partition (e.g., a prediction block, PU, etc.), the value of bS for the boundary between block P and block Q can be determined to be 0.
[0347] In contrast, if block P and block Q are in the same encoded block (e.g., CU) and are located within a rectangular partition (e.g., prediction block, PU, etc.) or an asymmetric partition (e.g., prediction block, PU, etc.), then when the difference between the motion information of block P and the motion information of block Q is large, the bS value for the boundary between block P and block Q can be determined to be 1, and when the difference between the motion information of block P and the motion information of block Q is small, the bS value for the boundary between block P and block Q can be determined to be 0.
[0348] Figure 16 is another example of a bS decision tree applied when OMBC is applied, and is a sequence diagram that schematically illustrates how bS is determined.
[0349] Referring to Figure 16, we first determine whether P and / or Q are intra-encoded (S1600).
[0350] If block P and / or block Q are intra-encoded, it is determined whether the boundary of block Q, i.e., the boundary between block P and block Q, is the boundary of an encoded block (S1610). In this case, the encoded block includes CU and LCU.
[0351] In step S1610, if the boundary between block P and block Q is the boundary of an encoded block, the value of bS for the boundary between block P and block Q is determined to be bS4 (for example, bS4=4) (S1620).
[0352] In step S1620, if the boundary between block P and block Q is not the boundary of an encoded block, the value of bS for the boundary between block P and block Q is determined to be bS3 (for example, bS3=3) (S1630).
[0353] In step S1600, if blocks P and Q are not intra-encoded, it is determined whether blocks P and Q are located within a rectangular or asymmetric partition in a single-encoded block (e.g., CU) (S1640).
[0354] In step S1640, if block P and block Q are not located within a rectangular or asymmetrical partition in a single coding block (e.g., CU), it is determined whether block P and / or block Q contain coefficients (non-zero transformation coefficients) (S1650). In this case, the transformation coefficients may be the transformation coefficients before inverse quantization is applied, or the transformation coefficients after inverse quantization is applied.
[0355] In step S1650, if block P and / or block Q contain coefficients (non-zero conversion coefficients), the bS for the boundary between block P and block Q is determined to be bS2 (for example, bS2=2) (S1660).
[0356] In step S1640, if block P and block Q are located within a rectangle or asymmetric partition in a single encoding block (e.g., CU), or in step S1650, if block P and / or block Q do not contain coefficients (non-zero conversion coefficients), it is determined whether block P and block Q have different reference pictures or motion vectors (S1670).
[0357] In step S1670, if block P and block Q have different reference pictures or motion vectors, the bS for the boundary between block P and block Q is determined to be bS1 (for example, bS1=1) (S1680).
[0358] In other cases, i.e., when the block removal filter is not applied, bS is set to bS0 (for example, bS0=0) (S1690).
[0359] In the example in Figure 16, the relationship bS4 > bS3 > bS2 > bS1 > bS0 is maintained, similar to the previous example regarding bS determination. Therefore, as shown in the example and illustration of the values of bS0 to bS4, bS4 can be set to 4, bS3 to 3, bS2 to 2, bS1 to 1, and bS0 to 0.
[0360] As described above, in the example in Figure 16, when block P and block Q are in the same encoded block (e.g., CU) and are located within a rectangular partition (e.g., prediction block, PU, etc.) or an asymmetric partition (e.g., prediction block, PU, etc.), the bS value for the boundary between block P and block Q can be determined to be bS1 (e.g., bS=1).
[0361] Also, similar to the previous example, we can use a bS decision tree to set the values of the variables required for the block distortion removal filter. In Figure 16, for the largest 2bS value, t c Set the offset to a specific value (for example, 2), and for other bS values, t c A simple example of setting the offset to 0 is shown.
[0362] On the other hand, if block P and / or block Q are intra-encoded, it may not be necessary to distinguish the value of bS. For example, as shown in the examples in Figures 5, 15, or 16, if we determine whether the target boundary of an I-slice (intra-encoded slice) is the boundary of an encoded block (e.g., CU), and if it is the boundary of an encoded block, we determine bS to be 4, and if it is any other boundary, we determine bS to be 3, then for all I-slices, the value of bS ultimately ends up being either 3 or 4.
[0363] In connection with this, when methods are applied to modify the bS decision tree to reduce complexity, as shown in Figures 12 to 14, it may simply be possible to apply them by considering whether the bS value is greater than 0, or greater than 1 or 2. Therefore, it may not be necessary to distinguish whether the bS value is 3 or 4.
[0364] Figure 17 schematically illustrates one example of a method for determining bS and applying a block strain removal filter.
[0365] Referring to Figure 17, bS is determined to apply the block strain removal filter (S1710), the on / off status of the block substrate filter processing is determined based on the determined bS (S1720), it is determined whether to apply a strong filter or a weak filter for a given bS (S1730), and the filter processing is executed (S1740).
[0366] In the example shown in Figure 17, it can be confirmed that the method for applying the block removal filter is the same as or similar to the method described based on Figure 3.
[0367] In this case, in the bS determination step (S1710), as shown in Figure 5, Figure 15, or Figure 16, if block P and / or block Q are intra-encoded, the bS value can also be determined by distinguishing whether the target boundary is the boundary of an encoded block.
[0368] Figure 18 schematically illustrates another example of how to determine bS and apply a block distortion removal filter. Unlike Figure 17, Figure 18 does not additionally segment and determine bS when blocks P and / or block Q are intra-encoded (in the case of an I-slice).
[0369] Referring to Figure 18, we determine whether block P and / or block Q are intra-encoded (i-slice) in order to apply the block distortion removal filter (S1810).
[0370] If block P and / or block Q are not intra-encoded, perform the general steps to determine bS, as shown in the example in Figure 17 (S1820).
[0371] If block P and / or block Q are intra-encoded (in the case of an I-slice), unlike the example in Figure 17, bS is determined to a single value (e.g., 4) (S1830).
[0372] Next, the filtering of the block substrate is turned on or off based on the determined bS (S1840), it is decided whether to apply a strong filter or a weak filter to a given bS (S1450), and the filtering is executed (S1860).
[0373] In addition to the example in Figure 18, another way to modify and apply the block strain removal filter method described earlier is to modify the method using representative bS as described in the example in Figure 6 and perform the block strain removal filter.
[0374] In the example in Figure 6, when performing a block distortion removal filter on an 8x8 pixel block unit, the method of using the larger of the two bS values determined on a 4x4 pixel unit basis as the representative bS is explained.
[0375] Figure 19 is a schematic diagram illustrating one example of a method for determining representative bS.
[0376] Referring to Figure 19, in order to select a representative bS, the sizes of bS1 and bS2 are compared in the unit block of the block strain removal filter (S1910).
[0377] In step S1910, if bS1 is greater than bS2, the representative bS is determined to be bS1 (S1920). Conversely, in step S1910, if bS2 is greater than bS1, the representative bS is determined to be bS2 (S1930).
[0378] bS1 and bS2 may be the bS for two vertical edges or two horizontal edges in a unit block of the block strain removal filter. The method in Figure 15 can be used to determine a representative bS for vertical edges after being performed in the block strain removal filter process for vertical edges, and then used to determine a representative bS for horizontal edges after being performed in the block strain removal filter process for horizontal edges.
[0379] The filter processing unit can perform a block distortion removal filter using the determined representative bS.
[0380] The example in Figure 19 illustrates the method of using a representative bS with a large value, similar to the example in Figure 6. Alternatively, a different method can be used to determine the representative bS in order to reduce excessive block distortion removal filtering and decrease the computational load of the filtering process.
[0381] Figure 20 is a schematic diagram illustrating another example of a method for determining representative bS.
[0382] Referring to Figure 20, in order to select a representative bS, the sizes of bS1 and bS2 are compared in the unit block of the block strain removal filter (S2010).
[0383] In step S2010, if bS1 is smaller than bS2, bS1 is determined to be the representative bS (S2020). Conversely, in step S2010, if bS2 is smaller than bS1, bS2 is determined to be the representative bS (S2030).
[0384] bS1 and bS2 may be the bS for two vertical edges or two horizontal edges in a unit block of the block strain removal filter. The method in Figure 20 can also be used to determine a representative bS for vertical edges after being performed in the block strain removal filter process for vertical edges, and then used to determine a representative bS for horizontal edges after being performed in the block strain removal filter process for horizontal edges.
[0385] Using the determined representative bS, the filter processing unit can perform a block distortion removal filter.
[0386] On the other hand, as explained in Figures 17 and 18, even if the bS value is derived and applied using one of the five different values, when actually performing the block distortion removal filter, it is only necessary to determine whether the bS value is greater than 0 or greater than 2. Therefore, when there are only three distinguishable bS values, the block distortion removal filter can be effectively performed based on the characteristics of the pixel or block.
[0387] Figure 21 is a schematic diagram illustrating other methods for simplifying the bS decision tree (bS decision method).
[0388] Referring to Figure 21, we first determine whether P and / or Q are intra-encoded (S2110).
[0389] If block P and / or block Q are intra-encoded, the value of bS for the boundary between block P and block Q is determined to be 2 (S2120).
[0390] If block P and / or block Q are not intra-encoded, determine whether block P and block Q contain non-zero coefficients (conversion coefficients), whether block P and block Q have different reference pictures, or whether block P and block Q have different motion vectors (S2130).
[0391] In step S2130, if block P and block Q contain a non-zero coefficient (conversion coefficient), P and Q have different reference pictures, or block P and block Q have different motion vectors, the value of bS for the boundary between block P and block Q is set to 1 (S2140).
[0392] In other cases, i.e., when the block removal filter is not applied, the value of bS is set to 0 (S2140).
[0393] In other words, when the bS value is 0, which is the case when no block distortion removal filter is applied, P and Q are all encoded in interprediction mode and the motion information is similar. In this case, the motion information is similar if the reference pictures are the same and the difference between each component of the motion vector is less than 4 (for example, the difference between the x components of the motion vector is less than 4 and the difference between the y components is also less than 4).
[0394] In this case, if the coded block flag (cbf) for block P and block Q is not 0, that is, if there are non-zero conversion coefficients for block P and block Q, then if block P and block Q are predicted in inter-prediction mode and their motion information is similar, the bS value can be determined to be 0. In other cases, that is, if the motion information is not similar, or if block P and / or block Q are coded in intra-prediction mode, then bS can be determined to be 1 or 2.
[0395] However, when non-zero conversion coefficients exist between block P and block Q (i.e., when the value of cbf is not zero), even if the motion information of block P and block Q is similar and bS is determined to be 0, it may still be necessary to apply a block distortion removal filter. This is because if the application of a block distortion removal filter is excluded when the motion information is similar in the presence of non-zero conversion coefficients, both subjective loss for the user and objective loss of data may occur.
[0396] Therefore, we can strictly determine when the value of bS becomes 0, as follows:
[0397] For example, as mentioned above, in Figure 21, the reference pictures of the two blocks P and Q via the edge are identical, and the case where the difference between the motion vector components of block P and block Q is less than 4 was determined to be a case where the motion information is similar. Therefore, the motion vector MV of block P P and the motion vector MV of block Q Q In contrast, even if the difference between one component becomes 4 or more, bS will no longer be 0. That is, MV P x component MV p0 and MV Q x component MV Q0 The difference between the two is 4 or more, or MV P y component MV P1 and MV Q y component MV Q1 When the difference between the two values is 4 or greater, bS is set to a non-zero value, for example, 1.
[0398] Therefore, instead of determining whether the difference between the components of the motion vector is less than 4, equal to 4, or greater than 4, it is also possible to set an arbitrary threshold and then compare the difference between the components of the motion vector to the threshold. For example, MV P x component MV p0 and MV Q x component MV Q0 The difference between the two is greater than or equal to the threshold Th0, or MV P y component MV P1 and MV Q y component MV Q1 When the difference between Th0 and Th1 is greater than or equal to the threshold Th1, bS can be set to 1 (or 2 if block P and / or block Q are encoded in intra-predictive mode). In this case, Th0 and Th1 can be the same. For example, when the threshold is small, the number of cases where the value of bS is 0 decreases, so the threshold Th0 / Th1 can be set to a value less than 4 (2 or 3) to reduce the number of cases where the value of bS is 0.
[0399] Equation 7 represents an example of a method for determining whether the bS value should be 0 or 1 using the method described above.
[0400] <Formula 7> (1) pcMV P0 -= pcMV Q0 pcMV P0 -= pcMV Q0 ; (2) uiBs = (pcMVP0.getAbsHor() >= th) | (pcMVP0.getAbsVer() >= th) | (pcMVP1.getAbsHor() >= th) | (pcMVP1.getAbsVer() >= th);
[0401] In <Equation 3>, (1) calculates the difference between the x components and the difference between the y components of the motion vectors of block P and block Q, and (2) determines whether the difference between each component is greater than a threshold.
[0402] On the other hand, in order to reduce the complexity of the block distortion removal filter, c It is also possible to remove the _offset.
[0403] As explained in the block distortion removal filter method for the color difference component above, the average value of the quantization parameters for block P and block Q, taking approximate values into account, is qP L In this case, (1) when the bS value is greater than a predetermined value (for example, 2 or 1), t c The quantization parameter Q = Clip(0, 55, qP) L (2) When the bS value is less than or equal to a predetermined value (for example, 2 or 1), t c The quantization parameter Q = qP L The corresponding value can be determined.
[0404] In this case, the quantization parameter Q value and t c The correspondence between them can be identified through the table.
[0405] Table 3 shows the block removal parameters (Q, t c This represents an example of a correspondence between β) and . [Table 3]
[0406] In Table 3, for the sake of explanation, β and t are shown. c As shown above, the present invention is not limited thereto. For example, Table 3 is as shown in Tables 1 and 2, with β' and t c It can also be represented as ', in this case, t c And β is t c =t c Using '*(1<<(BitDepthY-8)) and β=β'*(1<<(BitDepthY-8)), t c It can be derived from 'and β'.
[0407] As mentioned above, t c And β may be a criterion for deciding whether to apply strong filtering. For example, if the three samples of P closest to the edge are p0, P1, and P2 in order, and the three samples of Q closest to the edge are q0, q1, and q2 in order, then (1) if abs(p2-2p1+p0)+abs(q2-2q1+q0)=dPq, it can be determined whether dPq is smaller than (β>>2). (2) If samples other than p0, p1, p2 and q0, q1, q2, for example p3 and q3 are further considered, it can be determined whether abs(p3-p0)+abs(q0-q3) is smaller than (β>>3). (3) Also, for the two samples p0 and q0 on the left and right of the boundary, if abs(p0-q0) is (5*t c It is possible to determine whether (+1) is less than or equal to 1. As mentioned above, multiple columns or rows can be selected within a block to perform the determination. For example, for vertical edges, multiple rows can be selected and (1) through (3) can be determined for each row, and for horizontal edges, multiple columns can be selected and (1) through (3) can be determined for each column.
[0408] For vertical edges, if the results of (1) through (3) are all determined to be smaller than the criterion for multiple rows, a strong filter can be applied to that edge. For horizontal edges, if the results of (1) through (3) are all determined to be smaller than the criterion for multiple columns, a strong filter can be applied to that edge.
[0409] Quantization parameter QP for luminance sample relative to block P P And the quantization parameter QP of the luminance sample relative to block Q. Qと Using the variable qP related to the quantization parameter, L to qP L =((QP Q +QP P It can be defined as +1)>>1).
[0410] When bS is derived using one of five values, if bS is greater than 2, the quantization parameter Q = Clip3(0, 55, qP L It can be set to +2), and the quantization parameter Q corresponds to t of the β value. c The values can be obtained from . In this case, when bS is less than or equal to 2, Q = qP L Set to the quantization parameter Q and the corresponding t value β. c The values can be obtained from Table 3.
[0411] On the other hand, when deriving bS using one of the three values (for example, the example in Figures 12 to 14), the quantization Q value is determined to a single value regardless of the bS value, and then the t values corresponding to the determined quantization parameter Q value and β value are determined. c The values can be obtained from Table 3. For example, if the bS value is derived using one of the three values (0, 1, 2), the quantization parameter Q = Clip3(0, 55, qP L The value is determined to be +2*bS-2), and the t corresponding to the determined quantization parameters Q and β values is determined. c The values can be obtained from Table 3.
[0412] On the other hand, when determining the quantization parameter Q value, in addition to the bS value, the quantization parameters of block P and block Q, and the bS value, t c Taking the _offset value into account, a more accurate t c It is also possible to retrieve values. For example, the decoder receives t from the slice header. c The quantization parameter Q value can be determined by reflecting the _offset information.
[0413] t transferred from the slice header c The _offset information is a value transferred to apply an optimized block removal filter to each slice, and is t for slices containing q samples adjacent to the edge. c The _offset information can be represented as slice_tc_offset_div2. slice_tc_offset_div2 is t c Identify the value of the default block removal parameter offset for this parameter.
[0414] In this case, the quantization parameters Q = Clip3(0, 55, qP) L It is set to +2*bS-2+slice_tc_offset_div2<<1) and the variable t c This can be determined based on the set quantization parameters Q and β. For example, t c Based on the quantization parameters Q and β values, the quantization parameters Q, β, and t are as shown in Table 3. c This can be determined using a table that defines the relationships between them.
[0415] Therefore, the t transferred from the slice header c Based on the _offset information (slice_tc_offset_div2), the Q value is determined as described above, and again based on the β value and Q value transferred from the encoding device, t c The value can be determined. cAs mentioned above, this value quantifies block distortion according to the degree of quantization, and may be used as a criterion for determining the range of filtered pixel values (clip range) when applying a block distortion removal filter, or as a criterion for determining whether to apply a strong filter or a weak filter.
[0416] Figure 22 is a schematic sequence diagram illustrating a method for encoding video according to the present invention.
[0417] Referring to Figure 22, the encoding device divides the input video and performs a prediction for the current block (S2210). The prediction for the current block can be performed by the prediction unit of the encoding device. The prediction unit can perform either intra-prediction or inter-prediction for the current block. Whether to perform intra-prediction or inter-prediction can be determined by considering rate distortion optimization (RDO), etc.
[0418] When skip mode is not applied, the prediction unit can generate a prediction signal and a residual signal, which is the difference between the original video signal and the prediction signal.
[0419] The encoding device can transform and quantize the residual signal (S2220). The transformation of the residual signal can be performed by the transformation unit, and the quantization of the transformed signal (e.g., transformation coefficients) can be performed by the quantization unit.
[0420] The transformed and quantized signals can be transmitted via an entropy coding process.
[0421] The encoding device dequantizes and dequantizes the converted and quantized signal to restore the current block (S2230). The dequantized and dequantized signal is added to the residual signal to restore the original video signal.
[0422] The encoding device can apply a block distortion removal filter to the restored signal (S2240). The restored signal can be restored to a signal that is even closer to the original image by the block distortion removal filter. The block distortion removal filter can be performed by the filter unit, and the filter unit can also apply SAO after applying the block distortion removal filter.
[0423] The specific method for the block distortion removal filter is as described above, along with the diagram.
[0424] The signal to which the block distortion removal filter has been applied is stored in memory, such as a decoding picture buffer (DPB), and can be referenced for predictions of other blocks or other pictures.
[0425] Here, we explained how to generate and transfer residual signals through prediction, but when skip mode is applied, residual signals are not generated / transferred.
[0426] Figure 23 is a schematic sequence diagram illustrating a method for decoding video according to the present invention.
[0427] Referring to Figure 23, the decoder performs entropy decoding of the received bitstream and performs a prediction for the current block (S2310). The prediction for the current block can be performed by a prediction unit within the decoder. The prediction unit can perform inter-prediction or intra-prediction for the current block based on information notified by the encoder. The prediction unit generates a prediction signal (predicted block) for the current block based on the prediction.
[0428] The decoder reconstructs the current block based on predictions for the current block (S2320). The decoder can generate a residual signal (residual block) from the bitstream received from the encoder through inverse quantization / inverse transform, and generate a reconstructed signal (reconstructed block) by adding the predicted signal (predicted block) and the residual signal (predicted block). If skip mode is applied, the residual signal is not transmitted, and the predicted signal can be used as the reconstructed signal.
[0429] The decoding device applies a block distortion removal filter to the restored signal (restored block) (S2330). The block distortion removal filter can be performed by the filter unit within the decoding device. The filter unit applies the block distortion removal filter to the restored block to correct it to be closer to the original video block.
[0430] The specific details of the block distortion removal filter are as described in the previous diagram.
[0431] The filter unit can also apply SAO to the reconstructed block based on the information received from the encoding device after applying a block distortion removal filter.
[0432] The signal restored through the filter section is stored in memory such as DPB and can be referenced to predict other blocks or other pictures, and can also be output as restored video.
[0433] Figures 22 and 23 are provided to schematically illustrate how the block distortion removal filter according to the present invention is applied in the encoding / decoding process, in order to aid in understanding the invention. Note that the encoding / decoding process described in detail with the previous drawings can be applied to both.
[0434] Figure 24 is a schematic sequence diagram illustrating an example of a method for deriving bS according to the present invention.
[0435] Referring to Figure 24, the boundary for determining bS is derived (S2410). The boundary for determining bS may be the boundary of the unit block to which the block strain removal filter is applied. Alternatively, the boundary for determining bS may be the boundary of the unit block that determines bS. Alternatively, the boundary for determining bS may be the boundary of the unit block to which the block strain removal filter is applied, and also the boundary of the unit block that determines bS.
[0436] When a boundary for determining bS is derived, bS is set for each bS setting unit (S2420). If the boundary for determining bS is the boundary of a unit block to which the block distortion removal filter is applied, bS can be set for each edge that is both the boundary for determining bS and the boundary of the bS determination unit block. If the boundary for determining bS is the boundary of a unit block to which the bS is determined, bS can be set for edges that are both the boundary for determining bS and the boundary of a unit block to which the block distortion removal filter is applied. If the boundary for determining bS is the boundary of a unit block to which the block distortion removal filter is applied and the boundary of a unit block to which bS is determined, bS can be set for the boundary for determining bS.
[0437] As described above, the method for setting the bS (value of the boundary) is to derive the bS for the boundary from one of the five types of bS values, or from one of the three types of bS values. In addition, methods for deriving the bS with reduced complexity can be applied. The specific method for deriving / determining the bS is as described above.
[0438] In Figure 24, for the sake of explanation, we have illustrated that bS is determined for edges that are both the boundary of a bS determination unit block and the boundary of a block distortion removal filter processing unit block. However, the present invention is not limited to this, and bS can also be determined using the method for determining representative values as described above.
[0439] In the exemplary systems described above, the method is a series of steps or blocks, described in terms of sequence; however, the present invention is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps different from those described above. Furthermore, the embodiments described above include examples of various aspects. Accordingly, the present invention may include all other replacements, modifications, and changes that fall within the following claims.
[0440] Up to this point, in descriptions relating to the present invention, when one component is referred to as being "connected" or "linked" to another component, it should be understood that the above-mentioned component may be directly connected to or linked to the other component, but other components may also exist between the two components. On the other hand, when one component is referred to as being "directly connected" or "directly linked" to another component, it should be understood that no other components exist between the two components.
Claims
1. A block distortion removal filtering method performed by a decoding device, The steps include: deriving the restored picture based on information obtained from the bitstream, The steps include: deriving the boundary of the block distortion removal filter unit block, which is the unit block to which the block distortion removal filter is applied; The steps include setting bS (boundary strength) for a predetermined length of target boundary at the block strain removal filtering unit boundary where block strain removal filtering is performed, The step of applying the block strain removal filter to the block strain removal filter unit boundary based on the bS value, The aforementioned bS is set to a value among 0, 1, and 2. The step of applying the block distortion removal filter process is: If the set bS value is greater than 0, the step of determining whether the block distortion removal filter is not applied to the target boundary based on a specific sample located in a specific row or column of the target boundary, The step of applying a strong filter or a weak filter based on the determination that the block distortion removal filter is applied to the target boundary, The block distortion removal filter processing unit block includes a transformation block or a prediction block, The size of the block distortion removal filter processing unit block is 8 x 8 pixels. The length of the target boundary where bS is set is 4 pixels long. Based on the determination that at least one of the two blocks adjacent to the target boundary is encoded based on the intra-prediction mode, the bS value is set to 2. A block distortion removal filtering method in which the bS value is set to 1 based on the determination that at least one of the two blocks contains a coefficient other than 0, or based on the determination that the two blocks have different reference pictures or different motion vectors.
2. A block distortion removal filter processing method performed by an encoding device, The steps to derive the restored picture, The steps include: deriving the boundary of the block distortion removal filter unit block, which is the unit block to which the block distortion removal filter is applied; The steps include setting bS (boundary strength) for a predetermined length of target boundary in the block distortion removal filtering unit boundary where block distortion removal filtering is performed on the restored picture, The step of applying the block strain removal filter to the block strain removal filter unit boundary based on the bS value, The aforementioned bS is set to a value among 0, 1, and 2. The step of applying the block distortion removal filter process is: If the set bS value is greater than 0, the step of determining whether the block distortion removal filter is not applied to the target boundary based on a specific sample located in a specific row or column of the target boundary, The step of applying a strong filter or a weak filter based on the determination that the block distortion removal filter is applied to the target boundary, The block distortion removal filter processing unit block includes a transformation block or a prediction block, The size of the block distortion removal filter processing unit block is 8 x 8 pixels. The length of the target boundary where bS is set is 4 pixels long. Based on the determination that at least one of the two blocks adjacent to the target boundary is encoded based on the intra-prediction mode, the bS value is set to 2. A block distortion removal filtering method in which the bS value is set to 1 based on the determination that at least one of the two blocks contains a coefficient other than 0, or based on the determination that the two blocks have different reference pictures or different motion vectors.
3. A method for transmitting image-related data, A step of generating a bitstream relating to the image, wherein the bitstream is: The steps to derive the restored picture, The steps include: deriving the boundary of the block distortion removal filter unit block, which is the unit block to which the block distortion removal filter is applied; The steps include setting bS (boundary strength) for a predetermined length of target boundary in the block distortion removal filtering unit boundary where block distortion removal filtering is performed on the restored picture, A step of applying the block strain removal filter to the block strain removal filter unit boundary based on the bS value, and a step of generating based on that, The step of transmitting the data, which includes the bitstream, The aforementioned bS is set to a value among 0, 1, and 2. The step of applying the block distortion removal filter process is: If the set bS value is greater than 0, the step of determining whether the block distortion removal filter is not applied to the target boundary based on a specific sample located in a specific row or column of the target boundary, The step of applying a strong filter or a weak filter based on the determination that the block distortion removal filter is applied to the target boundary, The block distortion removal filter processing unit block includes a transformation block or a prediction block, The size of the block distortion removal filter processing unit block is 8 x 8 pixels. The length of the target boundary where bS is set is 4 pixels long. Based on the determination that at least one of the two blocks adjacent to the target boundary is encoded based on the intra-prediction mode, the bS value is set to 2. A method in which the bS value is set to 1 based on the determination that at least one of the two blocks contains a coefficient other than 0, or based on the determination that the two blocks have different reference pictures or different motion vectors.