Video information encoding / decoding method and device
By setting boundary strength values for deblocking filters based on block coding and characteristics, the method addresses blocking artifacts in video compression, improving efficiency and image restoration.
Patent Information
- Application Number
- JP2025016118
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2011-12-12
- Filing Date
- 2025-02-03
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2032-11-05
AI Technical Summary
Existing video compression methods face challenges in effectively removing blocking artifacts while maintaining high compression efficiency, particularly when applying deblocking filters.
A method for setting boundary strength (bS) values for deblocking filters based on the coding type and characteristics of adjacent blocks, allowing for targeted application of strong or weak filtering to reduce complexity and improve compression efficiency.
Effectively removes blocking artifacts and enhances compression efficiency by optimizing the application of deblocking filters based on block characteristics, restoring images closer to the original quality.
Smart Images

Figure 0007763371000004 
Figure 0007763371000005 
Figure 0007763371000006
Abstract
Description
[Technical Field]
[0001] The present invention relates to video compression technology, and more particularly to a method for applying a deblocking filter as an in-loop filter. [Background technology]
[0002] Recently, there has been an increasing demand for high-resolution, high-quality images in various application fields. However, as the resolution and quality of images increase, the amount of information contained in the images also increases.
[0003] Therefore, when video information is transmitted using a medium such as an existing wired or wireless broadband line, or when video information is stored using an existing storage medium, the costs of transmitting and storing information increase.
[0004] Highly efficient video compression techniques can be used to efficiently transfer, store, and play back high-resolution, high-quality video information.
[0005] To improve the efficiency of video compression, inter-prediction and intra-prediction can be used. Inter-prediction predicts pixel values of a current picture by referring to information from other pictures, while intra-prediction predicts pixel values using the relationship between pixels within the same picture.
[0006] Various methods can be applied to the processing unit of the predicted image, e.g., a block, to make the image identical to the original image, allowing the decoder to decode the image more accurately (to match the original image more closely), and the encoder to encode the image so that it can be restored more accurately. Summary of the Invention [Problem to be solved by the invention]
[0007] SUMMARY OF THE INVENTION An object of the present invention is to provide a method and apparatus for effectively removing blocking artifacts when applying a deblocking filter to restore an image close to the original image.
[0008] SUMMARY OF THE INVENTION An object of the present invention is to provide a method and apparatus for applying a deblocking filter that can reduce complexity and improve compression efficiency.
[0009] An object of the present invention is to provide a method and apparatus for effectively setting unit blocks for determining boundary strength (bS) when applying a deblocking filter, thereby reducing complexity.
[0010] SUMMARY OF THE INVENTION An object of the present invention is to provide a method and apparatus for effectively setting the bS value when applying a deblocking filter, thereby reducing the complexity. [Means for solving the problem]
[0011] In one embodiment of the present invention, a bS deriving method includes a step of deriving a boundary of a deblocking filter unit block, which is a unit block to which a deblocking filter is applied, and a step of setting a bS for each bS setting unit block within the deblocking filter unit block. In the bS setting step, a bS value can be set for a target boundary corresponding to the boundary of the deblocking 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 filtering or weak filtering can be determined based on samples of two blocks that share the target boundary. If the target boundary is a vertical edge, the determination can be based on samples in a sample row that shares the target boundary and that are subject to the block distortion removal filter. If the target boundary is a horizontal edge, the determination can be based on samples in a sample column that shares the target boundary and that are subject to the block distortion removal filter.
[0022] If it is decided to apply weak filtering, it is also possible to apply filtering only to certain samples among the samples that are subject to the deblocking filter.
[0023] The deblocking filter unit block may be any one of a coding block, a transform block, a prediction block, and an 8x8 pixel block, and the bS decision unit block may be a 4x4 pixel block. [Effects of the Invention]
[0024] According to the present invention, when a deblocking filter is applied, it is possible to effectively remove block distortion and restore an image close to the original image.
[0025] According to the present invention, when applying a deblocking filter, it is possible to reduce the complexity and increase the compression efficiency.
[0026] For example, according to the present invention, when applying a deblocking filter, complexity can be reduced by effectively setting the unit block that determines bS. Also, according to the present invention, when applying a deblocking filter, complexity can be reduced by effectively setting the bS value. [Brief explanation of the drawings]
[0027] [Figure 1] 1 is a block diagram schematically illustrating an encoding device (video encoding device) according to an embodiment of the present invention. [Figure 2] 1 is a block diagram illustrating a video decoding apparatus according to an embodiment of the present invention; [Figure 3] 1 is a flow chart illustrating a method for applying a deblocking filter according to the present invention; [Figure 4] FIG. 2 is a diagram illustrating a schematic implementation of a deblocking filter according to the present invention; [Figure 5] FIG. 10 is a flow chart illustrating an example of a method for determining bS. [Figure 6] FIG. 10 is a diagram illustrating an example of a method for determining a bS value. [Figure 7] FIG. 10 is a diagram for explaining roughly another example of a method for determining a bS value. [Figure 8] FIG. 10 is a diagram for explaining roughly another example of a method for determining a bS value. [Figure 9] 10 is a diagram illustrating an example of a method for determining bS when the boundary of a block removal application unit block coincides with the boundary of a bS determination unit block. FIG. [Figure 10] FIG. 10 is a diagram for explaining roughly another example of a method for determining a representative bS value in a unit block for executing a deblocking filter. [Figure 11] 10 is a flow chart illustrating another example of a method for determining bS. [Figure 12] 10 is a flow chart illustrating an example of a method for determining the bS value to be one of three values. [Figure 13] 10 is a flow chart illustrating an example of a method for determining the bS value to be one of three values. [Figure 14] 10 is a flow chart illustrating an example of a method for determining the bS value to be one of three values. [Figure 15] FIG. 10 is a flow chart illustrating an example of a bS decision tree applied when applying OMBC, which is a schematic diagram illustrating a method for determining bS. [Figure 16] FIG. 10 is a flow chart illustrating an example of a bS decision tree applied when applying OMBC, which is a schematic diagram illustrating a method for determining bS. [Figure 17] 10A and 10B are diagrams illustrating generally examples of methods for determining bS and applying a deblocking filter; [Figure 18] 10A and 10B are diagrams illustrating generally examples of methods for determining bS and applying a deblocking filter; [Figure 19] FIG. 10 is a flowchart illustrating an example of a method for determining a representative bS. [Figure 20] FIG. 10 is a flowchart illustrating another example of a method for determining a representative bS. [Figure 21] FIG. 1 is a flow chart outlining a method for simplifying a bS decision tree. [Figure 22] 1 is a flow chart illustrating a method for encoding video according to the present invention; [Figure 23] 1 is a flow chart illustrating a method for decoding video according to the present invention; [Figure 24] 1 is a flow chart illustrating an example of a method for deriving bS according to the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0028] The present invention is susceptible to various modifications and embodiments, and specific embodiments are illustrated in the drawings and described in detail. However, this is not intended to limit the present invention to the specific embodiments. The terms used in this specification are used merely to describe specific embodiments and are not intended to limit the technical spirit of the present invention. The singular expressions include the plural expressions unless the context clearly dictates otherwise. In this specification, the terms "comprise" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preclude the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0029] Meanwhile, each component in the drawings described in the present 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 implemented as separate hardware or software. For example, two or more components may be combined into one component, or one component may be divided into multiple components. Embodiments in which each component is integrated and / or separated are also included within the scope of the present invention as long as they do not deviate from the essence of the present invention.
[0030] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. In the following, the same reference numerals are used to refer to the same components in the drawings, and redundant description of the same components will be omitted.
[0031] 1 is a block diagram illustrating a coding device (video coding device) according to an embodiment of the present invention. Referring to FIG. 1, the coding device 100 includes a picture division unit 105, a prediction unit 110, a transformation unit 115, a quantization unit 120, a reordering unit 125, an entropy coding unit 130, a dequantization unit 135, an inverse transformation unit 140, a filter unit 145, and a memory 150.
[0032] The picture division unit 105 can divide an input picture into at least one processing unit block, where the processing unit block may be a prediction unit (hereinafter referred to as 'PU'), a transform unit (hereinafter referred to as 'TU'), or a coding unit (hereinafter referred to as 'CU').
[0033] As will be 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 prediction on processing units of a picture divided by the picture division unit 105 to generate a predicted block. In the prediction unit 110, the processing unit of a picture may be a CU, a TU, or a PU. The prediction unit 110 may also determine whether the prediction to be performed on the processing unit is inter prediction or intra prediction, and determine specific details of each prediction method (e.g., a prediction mode, etc.). In this case, the processing unit in which the prediction is performed may differ from the processing unit in which the prediction method and the specific details of the prediction method are determined. For example, the prediction method, prediction mode, etc. may be determined on a PU basis, and the prediction may be performed on a TU basis.
[0034] Inter-prediction can generate a predicted block based on information of at least one of a previous picture and / or a subsequent picture of the current picture, and intra-prediction can generate a predicted block based on pixel information within the current picture.
[0035] Inter-prediction methods include skip mode, merge mode, and motion vector prediction (MVP) mode. In inter-prediction, a reference picture can be selected for the PU, and a reference block of the same size as the PU can be selected. The reference block can be selected in integer pixel units. Then, a prediction block is generated that minimizes the residual signal with the current PU and minimizes the motion vector size.
[0036] The prediction block can be generated in integer sample units or in sub-integer pixel units such as half pixel units or quarter pixel units. In this case, the motion vector can also be expressed in units of sub-integer pixels. For example, the motion vector can be expressed in quarter pixel units for luma samples and in eighth pixel units for chroma samples.
[0037] Information such as an index of a reference picture selected through inter-prediction, a motion vector (e.g., a motion vector predictor), and a residual signal is entropy coded and transmitted to a decoding device. When a skip mode is applied, the prediction block can be used as a reconstructed block, so the residual may not be generated, transformed, quantized, or transmitted.
[0038] When intra prediction is performed, a prediction mode is determined for each PU, and prediction can be performed for each PU. Alternatively, a prediction mode can be determined for each PU, and intra prediction can be performed for each TU.
[0039] In intra prediction, prediction modes may include 33 directional prediction modes and at least two non-directional modes. The non-directional modes may include a DC prediction mode and a planar mode.
[0040] Intra prediction may generate a predicted block after applying a filter to a reference sample, where whether or not to apply a filter to the reference sample may be determined depending on the intra prediction mode and / or size of the current block.
[0041] A PU is a block of various sizes / shapes. For example, in the case of inter prediction, a PU may be a 2N×2N block, a 2N×N block, an N×2N block, or an N×N block (N is an integer). In the case of intra prediction, a PU may be a 2N×2N block or an N×N block (N is an integer). In this case, a PU of an N×N block size can be set to be applied only in a specific case. For example, it can be set to use a PU of an N×N block size only for the smallest size CU, or it can be set to be used only for intra prediction. In addition to the PUs of the above sizes, PUs of N×mN blocks, mN×N blocks, 2N×mN blocks, or mN×2N blocks (m<1) can be further defined and used.
[0042] The residual value (residual block or residual signal) between the generated prediction block and the original video block is input to the conversion unit 115. In addition, prediction mode information, motion vector information, etc. used for prediction are coded together with the residual value by the entropy coding unit 130 and transmitted to the decoding device.
[0043] The transform unit 115 performs a transform on the residual block in transform units to generate transform coefficients. The transform unit in the transform unit 115 may be a TU and may have a quadtree structure. In this case, the size of the transform unit may be determined within a predetermined maximum and minimum size range. The transform unit 115 may transform the residual block using a discrete cosine transform (DCT) and / or a discrete sine transform (DST).
[0044] The quantization unit 120 may generate quantized coefficients by quantizing the residual values transformed by the transformation unit 115. The values calculated by the quantization unit 120 are provided to the inverse quantization unit 135 and the reordering unit 125.
[0045] The rearrangement unit 125 rearranges the quantized coefficients provided from the quantization unit 120. By rearranging the quantized coefficients, the encoding efficiency of the entropy encoding unit 130 can be improved. The rearrangement unit 125 can rearrange the quantized coefficients in a two-dimensional block format into a one-dimensional vector format through a coefficient scanning method. The rearrangement unit 125 can also improve the entropy encoding efficiency of the entropy encoding unit 130 by changing the order of coefficient scanning based on the probabilistic statistics of the coefficients provided from the quantization unit.
[0046] The entropy encoding unit 130 may perform entropy encoding on the quantized coefficients reordered by the reordering unit 125. For the entropy encoding, encoding methods such as Exponential Golomb, Context Adaptive Variable Length Coding (CAVLC), Context Adaptive Binary Arithmetic Coding (CABAC), etc. may be used. The entropy encoding unit 130 may encode various information, such as CU quantization coefficient information and block type information, prediction mode information, partition unit information, PU information and transmission unit information, motion vector information, reference picture information, block interpolation information, and filtering information, received from the reordering unit 125 and the prediction unit 110.
[0047] The entropy encoder 130 may also make certain changes to the parameter set or syntax to be transmitted, if necessary.
[0048] The inverse quantization unit 135 inversely quantizes the values quantized by the quantization unit 120, and the inverse transform unit 140 inversely transforms the values inversely quantized by the inverse quantization unit 135. A reconstructed block can be generated by combining the residual values generated by the inverse quantization unit 135 and the inverse transform unit 140 with the predicted block predicted by the prediction unit 110.
[0049] 1 illustrates that a reconstructed block is generated by combining a residual block and a predicted block through an adder. In this case, the adder can be regarded as a separate unit (reconstructed block generator) that generates a reconstructed block.
[0050] The filter unit 145 can apply a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) to the reconstructed picture.
[0051] A deblocking filter can remove distortions that occur at the boundaries between blocks in a restored picture. ALF can perform filtering based on the value obtained by comparing the restored image with the original image after the block has been filtered by the deblocking filter. ALF can also be performed only when high efficiency is required. SAO restores the offset difference between the residual block to which the deblocking filter has been applied and the original image in pixel units, and is applied in the form of band offset, edge offset, etc.
[0052] On the other hand, the filter unit 145 may not apply filtering to the reconstructed block used for inter prediction.
[0053] The memory 150 may store the reconstructed blocks or pictures calculated through the filter unit 145. The reconstructed blocks or pictures stored in the memory 150 may be provided to the prediction unit 110 that performs inter-prediction.
[0054] 2 is a block diagram illustrating a video decoding device according to an embodiment of the present invention. Referring to FIG. 2, the video decoding device 200 may include an entropy decoding unit 210, a reordering unit 215, an inverse quantization unit 220, an inverse transform 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 procedure by which video information is processed in the video encoding device.
[0056] For example, if a variable length coding (hereinafter referred to as "VLC") such as CAVLC is used to perform entropy coding in a video coding device, the entropy decoder 210 may also be implemented with the same VLC table as the VLC table used in the coding device to perform entropy decoding. Also, if CABAC is used to perform entropy coding in a video coding device, the entropy decoder 210 may perform entropy decoding using CABAC accordingly.
[0057] Among the information decoded by the entropy decoding unit 210, information for generating a prediction block is provided to the prediction unit 230, and the residual values entropy decoded by the entropy decoding unit 210 are input to the reordering unit 215.
[0058] The reordering unit 215 may reorder the bitstream entropy decoded by the entropy decoding unit 210 based on the reordering method used in the video encoding device. The reordering unit 215 may restore coefficients expressed in a one-dimensional vector format to coefficients in a two-dimensional block format and reorder them. The reordering unit 215 may receive information related to coefficient scanning performed in the encoding device and perform reordering by a method of scanning in reverse based on the scanning order performed in the encoding device.
[0059] The inverse quantization unit 220 may perform inverse quantization based on the quantization parameter provided by the encoding device and the coefficient values of the reordered blocks.
[0060] The inverse transform unit 225 can perform an inverse DCT and / or an inverse DST on the DCT and DST performed by the transform unit of the video encoding device on the quantization result performed by the video encoding device. The inverse transform can be performed based on a transmission unit or a 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 a prediction method, a size of a current block, and a prediction direction, and the inverse transform unit 225 of the decoding device can perform the inverse transform based on the transform information performed by the transform unit of the encoding device.
[0061] The prediction unit 230 can generate a prediction block based on prediction block generation related information provided by the entropy decoding unit 210 and previously decoded block and / or picture information provided by the memory 240.
[0062] If the prediction mode for the current PU is an intra prediction mode, intra prediction can be performed to generate a prediction block based on pixel information in the current picture.
[0063] When the prediction mode for the current PU is an inter prediction mode, inter prediction for the current PU can be performed based on information included in at least one of the preceding or succeeding pictures of the current picture. In this case, motion information required for inter prediction of the current PU provided by the video encoding device, such as information about a motion vector and a reference picture index, can be derived from a skip flag, a merge flag, etc. received from the encoding device.
[0064] The reconstructed block can be generated using a predicted block generated by the prediction unit 230 and a residual block provided by the inverse transform unit 225. Figure 2 illustrates how an adder combines the predicted block and the residual block to generate a reconstructed block. In this case, the adder can be considered as a separate unit (reconstructed block generator) that generates a reconstructed block.
[0065] When the skip mode is applied, the residual is not transmitted and the predicted block can be the reconstructed block.
[0066] The reconstructed blocks and / or pictures may be provided to a filter unit 235. The filter unit 235 may apply a deblocking filter, SAO and / or ALF, etc. to the reconstructed blocks and / or pictures.
[0067] The memory 240 can store the reconstructed pictures or blocks for use as reference pictures or blocks, and can provide the reconstructed pictures to an output.
[0068] On the other hand, as described above, the filter units of the encoding device and the decoding device can apply a deblocking filter, ALF, or SAO as an in-loop filter.
[0069] The deblocking filter removes interblock artifacts that result from block-based prediction, transformation, and quantization. The deblocking filter is applied to the edges of prediction units or transform units, and can set a predetermined minimum block size for applying the deblocking filter.
[0070] To apply a deblocking filter, first determine the block boundary strength (hereinafter referred to as bS) of the horizontal or vertical filter boundary. Then, based on bS, it is decided on a block-by-block basis whether to perform filtering. If it is decided to perform filtering, it determines the type of filter to apply. The filter to be applied can be selected from a weak filter and a strong filter. The filtering processor applies the selected filter to the boundary of the block.
[0071] The ALF can be applied after SAO (described later). The ALF compensates for coding errors using a Wiener filter, and unlike SAO, it is applied globally within a slice. The ALF can also be applied only in the case of high efficiency (HE).
[0072] SAO is a procedure that restores the offset difference between the original image and the image that has been subjected to a deblocking filter on a pixel-by-pixel basis. SAO can compensate for coding errors, which may be caused by quantization. There are two types of SAO: band offset and edge offset.
[0073] As described above, when image restoration is performed in block units (e.g., CU, PU, TU, etc.), block distortion may occur at boundaries between restored blocks. To prevent block distortion, a deblocking filter can be applied, and the deblocking filter can be applied separately to positions where block distortion is likely to occur and positions where block distortion is unlikely to occur, even within the same image or picture. For example, different deblocking filters can be applied to positions where block distortion is likely to occur and positions where block distortion is unlikely to occur.
[0074] Therefore, the bS for the boundary between blocks is determined by taking into consideration whether the boundary between blocks corresponds to a boundary to which a deblocking filter is applied, whether the adjacent block is a block to which intra-coding is applied, etc., and the deblocking filter can be applied based on the determined bS.
[0075] On the other hand, if the CU is an I_PCM CU, i.e., a Pulse Coded Modulation (PCM) CU to which intra prediction is applied, the deblocking filter is not applied. The I_PCM mode does not undergo quantization and conversion processes, so the same values as the original image data are restored.
[0076] Therefore, to restore the highest image quality (original image quality), the in-loop filter is not applied to the I_PCM mode CU (I_PCM CU). For example, in the deblocking filter process, the quantization parameter (qP) for the I_PCM CU can be set to 0 (zero) so that the deblocking filter is not applied to the I_PCM CU.
[0077] 3 is a flow chart illustrating a method for applying a deblocking filter according to the present invention. The deblocking filter illustrated in FIG. 3 can be implemented in an encoding device and a decoding device. For example, the filter processing units in FIGS. 1 and 2 can implement the deblocking filter illustrated in FIG. 3.
[0078] The deblocking filter is applied to the vertical edges between blocks in the current picture first, and then to the horizontal edges between blocks in the current picture, and then to the horizontal edges in the current picture with the samples modified by the deblocking filter applied to the vertical edges.
[0079] Therefore, the deblocking filter procedure described in FIG. 3 can be applied to the vertical edges in the current picture, and then to the horizontal edges in the current picture.
[0080] Referring to FIG. 3, for edges between blocks, block boundaries are derived for applying a deblocking filter (S310).
[0081] The filter unit sets the size of a current coding block or a current largest coding unit (LCU) (hereinafter, for convenience of explanation, the coding block in this specification includes an 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 the boundary to which a deblocking filter is applied as a tile boundary, or whether the boundary of the current coding block is the boundary to which a deblocking filter is applied as a slice boundary.
[0082] For example, when applying a deblocking filter to a vertical edge, if the left boundary of the currently coded block is the left boundary of the current picture, the left boundary of the currently coded block can be excluded from the target of the deblocking filter. If the left boundary of the currently coded block is the left boundary of the current tile and it is determined not to apply a filter to the edge of the current tile, or if the left boundary of the currently coded block is the left boundary of the current slice and it is determined not to apply a filter to the edge of the current slice, the left boundary of the currently coded block can be excluded from the target of the deblocking filter. Therefore, in a deblocking filter for a vertical edge, if the above cases are not met, the deblocking filter can be applied to the left boundary of the currently coded block.
[0083] Furthermore, when applying a deblocking filter to a horizontal edge, if the upper boundary of the currently coded block is the upper boundary of the current picture, the upper boundary of the currently coded block may be excluded from the target of the deblocking filter. If the upper boundary of the currently coded block is the upper boundary of the current tile and it is determined not to apply a filter to the edge of the current tile, or if the upper boundary of the currently coded block is the upper boundary of the current slice and it is determined not to apply a filter to the edge of the current slice, the upper boundary of the currently coded block may be excluded from the target of the deblocking filter. In the case of a deblocking filter for a horizontal edge, if the above cases are not met, the deblocking filter may be applied to the upper boundary of the currently coded block.
[0084] In this specification, applying filtering to a boundary means performing filtering on certain samples located on both sides of the boundary.
[0085] The filter unit can derive block boundaries for vertical edges of the transform blocks and prediction blocks when applying a deblocking filter to vertical edges in a picture, and can derive block boundaries for horizontal edges of the transform blocks and prediction blocks when applying a deblocking filter to horizontal edges in a picture.
[0086] When an edge of a transform block is an edge of a coding block, the boundary of the transform block can also be derived according to whether a deblocking filter is applied to the edge.When a transform block is divided, the boundary can be derived for each divided block.
[0087] The filter unit may derive a boundary for each partition of the prediction block. For example, if the partition of the prediction block is a 2N×N pixel block, an N×N pixel block, a 2N×nU pixel block, or a 2N×nD pixel block (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 coding block), the filter unit may derive an edge for each partition.
[0088] Next, bS for the block boundary to which the deblocking filter is applied is derived (S320). bS is determined for each edge within the current coding block. If the deblocking filter is applied to vertical edges within the picture, bS is derived for each vertical edge. If the deblocking filter is applied to horizontal edges within the picture, bS is derived for each horizontal edge.
[0089] The derivation of bS can be performed in a predetermined unit. For example, bS can be derived for each edge of a transform block or for each edge of a prediction block. Alternatively, bS can be derived for each block of a predetermined size, for example, an 8x8 pixel block or a 4x4 pixel block.
[0090] Furthermore, bS can be derived for the edges of blocks that satisfy certain conditions among transform blocks, predictive blocks, and blocks of a predetermined size within the currently coded block. For example, bS can be derived for smaller blocks among transform blocks (e.g., TUs) and predictive blocks (e.g., PUs), and larger blocks among blocks of a predetermined size (e.g., 8x8 pixel blocks).
[0091] In other words, bS can be determined in pixel units corresponding to the size of the block that is the unit of bS determination at the boundary of the block to which deblocking is applied (for example, when the unit of bS determination is an L×L pixel block (L is an integer), then bS can be determined in L pixel units). The derivation of a specific value of bS will be described later.
[0092] Next, filtering is performed on the block boundaries according to bS (S330).
[0093] For example, in the case of luma samples, the bS for the target edge is set to a predetermined reference bS, e.g., bS th1 If bS is less than or equal to a predetermined reference bS, the deblocking filter can be prevented from being applied to the edge. th2 It is possible to avoid applying the deblocking filter to the edge in the following cases: th1 and bS th2 can be set to be the same as or different from each other.
[0094] An additional threshold (referred to as Th1 for convenience of explanation) can be set to efficiently apply the deblocking filter. For example, if the reference bS value is set to 0, and the bS value for the target edge is greater than 0, Th1 can be used to determine whether to turn on or off the deblocking filter at the block level. For example, if the value derived from the target edge is greater than Th1, the deblocking filter can be applied to the target edge.
[0095] First, when a deblocking filter is applied to a vertical edge in a picture, the value derived from the target vertical edge for comparison with Th1 may be the difference between the target samples in the two blocks bordering the vertical edge in a particular sample row. For example, for the kth sample row (k is an integer), the sum of the differences between the target samples adjacent to the vertical edge in the block to the left of the vertical edge, DL, may be calculated as follows: k (For example, when three samples from a vertical edge are to be filtered, the sum of the difference between the first sample from the vertical edge and the second sample from the vertical edge, and the sum of the difference between the third sample from the vertical edge and the second sample from the vertical edge) is calculated, and the sum of the differences between the samples to be filtered adjacent to the vertical edge in the right block (current block) of the vertical edge is calculated as DR. k (For example, when three samples from a vertical edge are subject to filtering, 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 Tonowa D k Compared with Th1, D k If D is smaller than Th1, a deblocking filter can be applied to the vertical edge. kWhen is smaller than Th1, based on the quantization parameter, it can be determined that the vertical boundary is a boundary where applying a deblocking filter is not effective (e.g., an actual boundary of an image in the original picture), and that applying a deblocking filter will restore a picture that is close to the original picture.
[0096] In this case, it is also possible to consider the sum of differences between adjacent samples to be filtered for multiple sample rows, rather than considering the sum of differences between adjacent samples to be filtered for only one sample row in two blocks that share a vertical edge as a boundary, as described above. For example, the sum of differences D between samples to be filtered for the k-th sample row in two blocks that share a vertical edge as a boundary is k and the sum of the differences between the filtered samples for the k+j-th row (j is an integer), D k+j Combined D(=D k +D k+j ) is less than the threshold Th1, it may be decided to apply a deblocking filter for that vertical edge.
[0097] For example, if the difference j between two sample rows is set to 3, then for the second and fifth sample rows, if D (=D2+D5) is smaller than Th1, a deblocking filter can be applied to the vertical edge. Alternatively, the difference j between two sample rows can be set to 3, and for the zeroth and third sample rows, the sum of the differences between samples, D (=D0+D3), can be compared with Th1, and if D is smaller than Th1, a deblocking filter can be applied to the vertical edge.
[0098] In this case, in order to effectively reflect the characteristics according to each block and sample row, it is also possible to derive a D value by adding the absolute value of the sum of the differences between samples to be filtered calculated for each sample row and for each block. In this case, the D value considering the kth sample row and the k+jth sample row of the left block (L) and the right block (R) with the vertical edge as the boundary can be derived as follows:
[0099] <Expression 1> D=abs(DL k )+abs(DL k+j )+abs(DR k )+abs(DR k+j )
[0100] As mentioned above, DL K is the sum of the differences between the samples to be filtered adjacent to the vertical edge in the kth sample row of the left block. When applying a deblocking filter, if three samples adjacent to a vertical edge are targeted, DL K can be derived by adding 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. K is the sum of the differences between the samples to be filtered that are adjacent to the vertical edge in the kth sample row of the right block. For example, when applying a deblocking filter, if three samples adjacent to the vertical edge are targeted, DR K can be derived by 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 in the k-th sample row of the vertical edge right block.
[0101] As described above, even when summing the differences between adjacent samples to be filtered by considering multiple sample rows, a more effective deblocking filter can be applied by considering the sum of the differences between adjacent samples to be filtered for each sample row. For example, referring to Equation 1, if only k sample rows are considered, D k can be defined as <Equation 2>.
[0102] <Expression 2> D k =abs(DL k )+abs(DR k )
[0103] For example, for the vertical edge, when the kth sample row and the k+3th sample row are considered as in the above example, D is smaller than Th1, and D for the kth sample row is k and D for the k+3th sample row k+3 When D is smaller than half of Th1 (Th1 / 2), strong filtering can be applied to the vertical edge. k is not smaller than Th1 / 2 or D k+3 If is not less than Th1 / 2, weak filtering may be applied to the vertical edge.
[0104] When applying weak filtering, filtering can be applied only to specific samples among the samples to be filtered, and in this case, the filter coefficients applied can be different from those applied in the case of strong filtering. For example, if the samples to be filtered are six samples located on 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 the samples to be filtered, while weak filtering can be applied to two samples located on the left of the target edge and two samples located on the right of the target edge. In this case, the filter coefficients for strong filtering and weak filtering can be different.
[0105] When a deblocking filter is applied to a horizontal edge in a picture, the value derived from the horizontal edge for comparison with Th1 can also be the difference between the filtered samples in two blocks bordering the horizontal edge in a particular sample column. As explained in the vertical edge example, for a sample in the kth sample column (k is an integer), the sum of the differences between the filtered samples adjacent to the horizontal edge in the block above the horizontal edge, DT k(For example, when a deblocking filter is applied, if three samples from a horizontal edge are subject to filtering, the sum of the difference between the first sample from the horizontal edge and the second sample from the horizontal edge, and the sum of the difference between the third sample from the horizontal edge and the second sample from the horizontal edge) is calculated, and the sum of the differences between the samples subject to filtering adjacent to the horizontal edge in the block below the horizontal edge (current block) is calculated. k (For example, when a deblocking filter is applied, if three samples from a horizontal edge are subject to filtering, 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 Tonowa D k Compared with Th1, D k If Th is smaller than Th1, a deblocking filter can be applied to the horizontal edge.
[0106] In this case, the sum of differences between adjacent samples to be filtered for multiple sample sequences in two blocks bounded by a horizontal edge can also be taken into consideration. For example, the sum of differences D between samples to be filtered for the k-th sample sequence in two blocks bounded by a horizontal edge can be taken into consideration. k and the sum of the differences between the filtered samples for the k+j-th column (j is an integer), D k+j D (=D k +D k+j ) is less than the threshold Th1, it may be decided to apply a deblocking filter for that horizontal edge.
[0107] For example, if the difference j between two sample columns is set to 3, then for the second and fifth sample columns, if D (= D2 + D5) is smaller than Th1, a deblocking filter can be applied to the vertical edge. Alternatively, the difference j between two sample columns can be set to 3, and the sum of the inter-sample differences D (= D0 + D3) for the zeroth and third sample columns can be compared with Th1. If D is smaller than Th1, a deblocking filter can be applied to the horizontal edge.
[0108] The sample row to be considered for the vertical edge and the sample column to be considered for the horizontal edge may be the corresponding sample row and sample column, for example, when the 0th sample row and the 3rd sample row are considered for the vertical edge, the 0th sample column and the 3rd sample column may be considered for the horizontal edge.
[0109] As in the case of vertical edges, to effectively reflect the characteristics of each block and sample sequence, the absolute value of the sum of the differences between the samples to be filtered calculated for each sample sequence and for each block can be taken. In this case, the value D, which takes into account the kth sample sequence and the k+jth sample sequence of the upper block (T) and the lower block (B) with the horizontal edge as the boundary, can be derived as follows:
[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 the samples to be filtered adjacent to the horizontal edge in the k-th sample row of the upper block. When applying a deblocking filter, when three samples adjacent to a horizontal edge are targeted, DT KDB can be derived by adding the difference between the first sample from the horizontal edge and the second sample from the horizontal edge in the k-th sample column of the block above the horizontal edge, and the difference between the third sample from the horizontal edge and the second sample from the horizontal edge. K is the sum of the differences between the samples to be filtered that are adjacent to the horizontal edge in the k-th sample row of the lower block. For example, when applying a deblocking filter, if three samples adjacent to a horizontal edge are targeted, DB K can be derived by adding the difference between the first sample from the horizontal edge and the second sample from the horizontal edge in the k-th sample column of the block below the horizontal edge, and the difference between the third sample from the horizontal edge and the second sample from the horizontal edge.
[0112] As explained in the vertical edge example, a more effective deblocking filter can be applied by considering, for each sample column, the sum of the differences between adjacent samples to be filtered. For example, referring to Equation 3, if we consider only the k sample columns, D k can be defined as in Equation 4.
[0113] <Expression 4> D k =abs(DT k )+abs(DB k )
[0114] For example, when considering the kth sample sequence and the k+3th sample sequence for the horizontal edge as in the above example, if D is smaller than Th1 and D for the kth sample sequence is k and D for the k+3th sample sequence k+3 If each of D is smaller than 1 / 4 of Th1 and satisfies a predetermined relationship with other deblocking parameters, strong filtering can be applied to the horizontal edge. k is not less than Th1 / 4 or D k+3If is not smaller than Th1 / 4 and satisfies a predetermined condition, weak filtering can 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, a filter coefficient different from that of the strong filter can be applied. 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 the samples to be filtered, while weak filtering can be applied to two samples located above the edge and two samples located below the edge. In this case, the filter coefficients for strong filtering and weak filtering can be different.
[0116] The strong and weak filtering may also be applied in the same way (eg, the same filter coefficients or offsets) to vertical and horizontal edges.
[0117] As described above, when determining whether to apply a deblocking filter, whether to apply a strong filter or a weak filter, and which samples to apply the weak filter to, the filter unit can apply the deblocking filter according to a predetermined method (e.g., filter coefficients or offsets).As described above, after applying a deblocking filter to vertical edges in a picture, the filter unit can apply a deblocking filter to horizontal edges in the picture.
[0118] FIG. 3 illustrates a method for applying a deblocking filter in large steps, such as deriving block boundaries (S310), deriving bS (S320), and applying filter processing (S330). However, the process from determining bS to applying filter processing can also be divided into more detailed steps.
[0119] For example, the following steps may be performed for a horizontal deblocking filter for a vertical edge in a picture: (1) Determine bS for a vertical edge in a coding block (which may be an LCU). The edge for which bS is determined may be an edge for a smaller block among TUs and PUs, an edge of a predetermined unit block (e.g., an 8x8 pixel block), or an edge between a smaller unit block among TUs and PUs and a larger block among the predetermined unit blocks. (2) Determine whether to turn on or off the deblocking filter at the block level for edges for which bS is greater than 0. For this purpose, as described above, certain sample rows (e.g., the second and fifth sample rows) among the blocks on both sides of the boundary (edge) can be used. (3) Determine whether to apply filtering or weak filtering to the region for which filtering is to be turned on. (4) If weak filtering is to be applied, determine whether to turn on or off additional filtering. As described above, the additional filtering on or off includes determining whether to turn on or off filtering for a specific sample. (5) Move to the next coding block (including the LCU) in the current picture and repeat the steps—perform deblocking filtering on all vertical edges in the picture.
[0120] The following steps may be performed for a vertical deblocking filter for horizontal edges within a picture: (1) Determine bS for a horizontal edge within a coding block (which may be an LCU). The edge for which bS is determined may be an edge for a smaller block among TUs and PUs, an edge of a predetermined unit block (e.g., an 8x8 pixel block), or an edge between a smaller unit block among TUs and PUs and a larger block among the predetermined unit blocks. (2) Determine whether to turn on or off the deblocking filter at the block level for edges for which bS is greater than 0. To this end, as described above, a predetermined sample sequence (e.g., the second and fifth sample sequences) among the blocks on both sides of the boundary (edge) may be used. (3) Determine whether to apply strong filtering or weak filtering to the region for which filtering is to be turned on. (4) If weak filtering is to be applied, determine whether to turn on or off additional filtering. As described above, the additional filtering on or off includes determining whether to turn on or off filtering for a specific sample. (5) Move to the next coding block (including an LCU) within the current picture and repeat the steps. Perform deblocking filtering on all horizontal edges in the picture.
[0121] 4 is a diagram illustrating an outline of a deblocking filter implementation method according to the present invention. Referring to FIG. 4, deblocking filters are applied to edges within a coding block (e.g., LCU) in units of the coding block (401). As described above, after applying deblocking filters (horizontal filtering) to vertical edges for the entire current picture, deblocking filters (vertical filtering) to horizontal edges for the entire current picture are applied.
[0122] FIG. 5 is a flow chart outlining an example of a method for determining bS.
[0123] For ease of explanation, in this specification, in the deblocking filtering process, the current block is represented by block Q, and the block adjacent to the current block that was coded / decoded before the current block is represented by block P. For example, when performing deblocking filtering on a vertical edge, the left block of the vertical edge is represented by block P, and the right block is represented by block Q. When performing deblocking filtering on a horizontal edge, the upper block of the horizontal edge is represented by block P, and the lower block is represented by block Q.
[0124] A sample belonging to block P is represented by p, and a sample belonging to block Q is represented by q. For example, the i-th sample from the boundary (edge) between block P and block Q in a specific sample row or column belonging to block P is represented by p. i (i=0, 1, 2, ...). Similarly, the i-th sample belonging to block Q and located in a specific sample row or a specific sample column from the boundary (edge) between block P and block Q can be expressed as q i (i=0,1,2,...).
[0125] Referring to FIG. 5, to determine bS, it is first determined whether block P and / or block Q are intra-coded (S510).
[0126] If block P and / or block Q is intra-coded, it is determined whether the boundary between block P and block Q is a CU boundary (S520). In this case, the CU boundary may be a boundary of an LCU.
[0127] In step S520, if the boundary between block P and block Q is a CU boundary, the value of bS for the boundary between block P and block Q is determined to be 4 (S530).
[0128] In step S520, if the boundary between block P and block Q is not a CU boundary, the value of bS for the boundary between block P and block Q is determined to be 3 (S540).
[0129] If block P and / or block Q is not intra-coded, it is determined whether block P and / or block Q includes non-zero coefficients (transform coefficients) (S550). In this case, the filter unit may determine whether non-zero coefficients exist based on the transform coefficients before inverse quantization. Alternatively, the filter unit may determine whether non-zero coefficients exist based on the transform coefficients after inverse quantization.
[0130] In step S550, if block P and / or block Q includes coefficients (non-zero transform coefficients), bS for the boundary between block P and block Q is determined to be 2 (S560).
[0131] If block P and / or block Q does not contain any coefficients (non-zero transform coefficients) in step S550, it is determined whether block P and block Q have different reference pictures or different motion vectors (S570).
[0132] In step S570, if 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, i.e., when a deblocking filter is not applied, bS for the boundary between block P and block Q is set to 0 (S590). For convenience of explanation, Fig. 5 illustrates an example of when bS is not applied, in which none of the above conditions are met.
[0134] On the other hand, it is also possible to set the values of the variables required for the deblocking filter according to the bS value.
[0135] For example, the t c An example would be a variable like offset. c offset is optimized for the video characteristics. c This is the value set by the user to determine the value of t c is one of the thresholds used to quantify the blockiness according to the degree of quantization and to determine the parameters associated with the deblocking filter.
[0136] In Figure 5, when bS value is 0, 1, or 2, t c Set offset to 0, and if bS value is 3 or 4, set t c A simple example of setting the offset to 2 is shown below.
[0137] Meanwhile, in order to effectively apply the deblocking filter, the block unit and the method for determining bS described with reference to FIGS. 3 and 5 may be modified and applied.
[0138] bS can be determined in units equal to or smaller than the block units for which the deblocking filter is actually executed.
[0139] For example, if an actual deblocking filter is executed on luminance samples in units of 8x8 pixels, bS can be determined in units of 4x4 pixels. In this way, if the size of the unit block for executing the deblocking filter is larger than the size of the unit block for determining bS, bS can be determined only at the boundaries (edges) of the unit blocks for determining bS that correspond to the boundaries (edges) of the unit blocks for executing the deblocking filter. In other words, when bS is determined for each LxL (L is an integer) pixel block, bS is determined in units of L pixels at the boundaries of the unit blocks for executing the deblocking filter.
[0140] Specifically, in the case where the block unit for determining bS is a 4×4 pixel block and the actual deblocking filter is executed in units of 8×8 pixel blocks, bS is determined in units of 4 pixels at the boundaries of the 8×8 pixel blocks on which the deblocking filter is executed. Therefore, it is not necessary to determine bS for the edges of 4×4 pixel blocks within the 8×8 pixel blocks that are the unit of the deblocking filter.
[0141] Fig. 6 is a diagram for explaining an example of a method for determining a bS value, taking as an example a case where a unit block 600 of the deblocking filter is an 8x8 pixel block and a unit block for determining bS is a 4x4 pixel block.
[0142] Referring to FIG. 6, within the unit block 600 of the deblocking filter, there are vertical and horizontal edges that are the boundaries (edges) of the 4×4 pixel block that is the unit block for determining bS and that are also the boundaries of the unit block 600 of the deblocking filter.
[0143] Taking the case of vertical edges as an example, there are two vertical edges 610 and 620 that are the targets of bS determination in a deblocking filter unit block 600. In the example of Figure 6, the bS of the first vertical edge 610 is compared with the bS of the second vertical edge 620, and the larger bS is determined as the representative bS for the vertical edges of the deblocking filter unit block 600.
[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, the bS value of the second vertical edge 620, 2, may be determined as the representative bS value for the vertical edge that is the left boundary of the unit block 600 of the deblocking filter.
[0145] For convenience of explanation, FIG. 6 shows an example of a vertical edge, but the same method can be applied to a horizontal edge.
[0146] In the example of FIG. 6, if the two bS values are the same, it goes without saying that either one of the two bS values can be used as the representative bS value.
[0147] Another example of a method for not deriving bS for boundaries located inside a unit block to which a block distortion removal filter is applied, as shown in Figure 6, i.e., a method for deriving bS only for boundaries (edges) of a unit block to which a block distortion removal filter is applied and for which bS is determined, will be specifically described.
[0148] 7 and 8 are diagrams for schematically illustrating another example of a method for determining a bS value. In the examples of Figures 7 and 8, a method for allocating a bS value through a two-step process is illustrated. Specifically, in the examples of Figures 7 and 8, when a 4x4 pixel block is used as a unit for determining a bS and an 8x8 pixel block is used as a unit for deblocking filtering, a method for determining a bS in 4x4 pixel units and then reallocating the bS in 8x8 pixel block units is illustrated.
[0149] 7 is a diagram illustrating an example of a method for setting bS for each bS determination unit. Referring to FIG. 7, a 16×16 pixel block (e.g., CU) includes 4×4 pixel blocks (e.g., TUs) that serve as bS determination units. A bS value can be determined for each boundary of each 4×4 pixel block.
[0150] An example of a specific process (step 1) for determining bS for each 4×4 pixel block is as follows.
[0151] <How to set bS in 4x4 pixel blocks - Step 1>
[0152] The position of the luminance sample at the upper left corner of the current block, for example, CU, is specified as (xC, yC) based on the luminance sample at the upper left corner of the current picture. The variable specifying the size of the CU, which is the current block, is log2CUSize, and the vertical and horizontal edges for which bS is determined are specified 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である。
[0153] (xE k , yE j ) specifies the set of edge sample locations, where k = 0, ..., nE-1 and j = 0, ..., nE-1, and nE is ((1 <<log2CUSize)> >2), xE0=0, yE0=0, xE k+1 =xE k +4, yE j+1 =yE j It has a +4 relationship.
[0154] In this case, the samples to which the deblocking filter is applied for horizontal and vertical edges specify a set of edge sample locations (xE k , yE j For example, for a horizontal edge, (1) when the information indicating that it is a horizontal edge indicates that a deblocking filter is to be applied to the edge (bS determines that), (for example, horEdgeFlags[xE k ][yE j ]=1), (2) p0 is the (xC+xE k , yC+yE j -1), and q0 is the (xC+xE k , yC+yE j ) and (3) in this case, the direction of the deblocking filter is vertical.
[0155] For vertical edges, (1) when the information indicating a vertical edge indicates that a deblocking filter is to be applied to the edge (bS determines that), e.g., verEdgeFlags[xE k ][yE j ]=1), (2) p0 is the (xC+xE k -1, yC+yE j ) and q0 is set to (xC+xE k , yC+yE j ) and (3) in this case, the direction of the deblocking filter is horizontal.
[0156] According to the above method (Step 1), the number of 4x4 pixel blocks, which are the bS determination unit, in the current CU (current block) is counted ((1<<log2CUSize)> >2) and assign it to the nE value. Therefore, in step 1, En bSs can be set horizontally and vertically in 4 pixel units for the current block. In order for bS to be determined in 4 pixel units, (xEk, yEj) is incremented in 4 pixel units (xE k+1 =xE k +4, yE j+1 =yE j +4), that is, the index is increased so that the process of determining bS can be performed in units of 4×4 pixel blocks within the current block (current CU).
[0157] Following the above-described method (step 1), the bS values set for each bS determination unit can be reallocated for each deblocking filtering unit (step 2).
[0158] 8 is a diagram for explaining an example of a method for reallocating bS for each deblocking filter processing unit. Referring to FIG. 8, a bS value can be set for each 8×8 deblocking application unit block.
[0159] In step 2 described in FIG. 8, the bS values for the 4×4 pixel block units determined in step 1 are compared, and one of the bS values for the two adjacent edges is used as the representative bS value for the 8×8 block deblocking filter processing unit.
[0160] For example, in FIG. 8, for the left vertical edge of the deblocking filtering unit block 810 in the current CU 800, the bS of the upper edge is v1 and bS on the lower edge v2 and the larger value is the bS value (bS v ) can be used. In addition, for the upper horizontal edge of the deblocking filtering unit block 820 in the current CU 800, the bS of the left edge, bS h1 and bS on the right edge h2 and the larger value is the bS value for the upper horizontal edge of block 820 (bS h In this case, among the bS values determined in step 1, the bS values for edges located within the 8x8 pixel block, which is the unit block to which the deblocking filter is applied, are not assigned.
[0161] An example of a specific process (step 2) for reallocating bS for each 8x8 pixel block to perform deblocking filtering is as follows.
[0162] <Step 2: How BS allocates 8x8 pixel blocks and performs deblocking filtering>
[0163] The position of the luminance sample at the upper left side of the current block (e.g., CU) is specified as (xC, yC) based on the luminance sample at the upper left side of the current picture. The variable specifying the size of the CU that is the current block 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 k [yD m +i] is the boundary filter processing strength for the vertical edge, which means the bS value defined based on (xD k , yD m +i).
[0171] (5-2) Set the value of bStrength[0][k][m] to the bSVer value.
[0172] (5-3) A decision process is performed for the luminance block edge based on the luminance sample position (xC, yC) of the current CU, the luminance sample position (xDk, yDm) of the current block, information indicating that it is a vertical edge to which the deblocking filter is applied, and the boundary filter processing strength bSVer, and dEdge[0][k][m] indicating whether to apply strong or weak filtering as information for the decision, and an 8x8 array dS are determined.
[0173] (5-4) Set dSample[0][k][(m<<3)+i] to dS[i] to determine the dEdge value, where i is 0,...,7.
[0174] (5-5) The boundary filtering strength bSHor for horizontal edges is derived as follows: bSHor=Max(bS[1][xD k +i][yD m ]), where i is 0,…,7. bS[0][xD k +i][yD m ] is the boundary filtering strength for horizontal edges, (xD k +i, yD m ) means the bS value defined based on the standard.
[0175] (5-6) Set the value of bStrength[1][k][m] to the value of bSVer.
[0176] (5-7) A decision process is performed on the luminance block edge based on the luminance sample position (xC, yC) of the current CU, the luminance sample position (xDk, yDm) of the current block, information indicating that it is a vertical edge to which the deblocking filter is applied, and the boundary filter processing strength bSHor, and dEdge[1][k][m] indicating whether to apply strong or weak filtering as information for the decision, and an 8x8 array dS are determined.
[0177] (5-8) Set dSample[1][m][(k<<3)+i] to dS[i] to determine the dEdge value, where i is 0,...,7.
[0178] (6) For the edges to which it has been determined that the deblocking filter should be applied, the deblocking filter is executed based on the bS value, the dEdge value, the dSample value, and the like.
[0179] To explain the method of step 2, log2CUSize-3 is used to derive nD, which represents the number of deblocking filter processing unit blocks in the current block. That is, in 8x8 pixel block units, the deblocking filter can be applied to the vertical and horizontal edges of the current block (current CU) as many times as the number of 8x8 pixel blocks.
[0180] Next, the bS value for the vertical edge and the bS value for the horizontal edge are compared for each of the eight pixels, and the largest bS value is set. For example, the bS value for the vertical edge, bSVer, is calculated as Max(bS[0][xD k ][yD m +i]), and bSHor, the bS for horizontal edges, is set to Max(bS[1][xD k +i][yD m ]), where i is 0,...,7. The value of i is changed from 0 to 7, and the bS values based on eight pixels are compared, and the largest bS is set as the bS for the current deblocking filtered block. For example, the bS values based on eight pixels along a vertical edge are compared, and the largest bS is set as the bS for the vertical edge of the current deblocking filtered block, and the bS values based on eight pixels along a horizontal edge are compared, and the largest bS is set as the bS for the horizontal edge of the current deblocking filtered block.
[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 (deblocking filter processing 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 +4, the present invention is not limited to this formula. For example, if bS can be determined in a predetermined bS determination unit (4x4 pixel block in the above example), bS can be set for each bS determination unit by applying another relationship that represents this.
[0183] 7 and 8, equations such as log2CUSize-3 are used to clearly explain that processing is performed in 8-pixel units, but the present invention is not limited to these equations. For example, if a deblocking filter is applied to a predetermined deblocking filter processing unit (8×8 pixel blocks in the above example) and bS can be assigned accordingly, bS can also be reallocated for each deblocking filter processing unit by applying another equation that represents this.
[0184] 7 and 8, the current block is a CU as a luma sample, but the present invention is not limited thereto and can be applied to chroma samples or to a processing unit other than a CU (e.g., a PU or a TU).Furthermore, the present invention can be applied equally to a case where the bS determination unit is a 4x4 pixel block and the deblocking filter processing unit is not an 8x8 pixel block.
[0185] On the one 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 an 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 the 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, inside 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, j = 0,..., nE - 1, nE is set to ((1<<log2CUSize)>>3), xE0 = 0, yE0 = 0, xEk+1 =xE k +8, yE j+1 =yE j It has a relationship of +8.
[0191] In this case, the samples to which the deblocking filter is applied for horizontal and vertical edges specify a set of edge sample locations (xE k , yE j For example, for a horizontal edge, (1) when the information indicating that it is a horizontal edge indicates that a deblocking filter is to be applied to the edge (bS determines that), (for example, horEdgeFlags[xE k ][yE j ]=1), (2)(xE k+r , yE j ) (r=0,1), the (xC+xE k , yC+yE j Set p0 to (xC + xE -1) and set p1 to (xC + xE -1) k , yC+yE j ) can be set to q0, and (3) in this case, the direction of the deblocking filter is vertical.
[0192] For vertical edges, (1) when the information indicating that the edge is vertical indicates that a deblocking filter is to be applied to the edge (bS determines that), e.g., verEdgeFlags[xE k ][yE j ]=1), (2)(xE k , yE j+r ) (r=0,1), the (xC+xE k -1, yC+yE j ) of the picture restored through prediction is set to (xC+xE k , yC+yE j ) can be set to q0, and (3) in this case, the direction of the deblocking filter is 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 distortion removal filter processing unit block. Therefore, bS is determined at the edge that is the boundary of the block removal application unit block and also the boundary of the bS determination unit block. In bS derivation method 1, since the block distortion removal filter processing unit is an 8×8 pixel block and the case where bS is determined in 4-pixel units is taken as an example for explanation, edges for determining bS at the boundary of the 8×8 pixel block 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 identified, for vertical edges, bS is set based on (Ek, yE j+r ), block distortion removal filter application samples are identified, 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 edge that is the boundary of the 8×8 pixel block and also the boundary of the 4×4 pixels. In other words, at the boundary of the 8×8 pixel block (block distortion removal filter processing unit block), bS is determined in 4-pixel units (bS determination unit).
[0196] On the other hand, an example of a method of determining bS for each bS determination unit and adding the condition that the bS determination unit is at the boundary of the block distortion removal filter processing unit block is as follows.
[0197] <bS Derivation Method 2>
[0198] The position of the luminance sample at the upper left side of the current block, for example, CU, is specified as (xC, yC) based on the luminance sample at the upper left side of the current picture. The variable specifying the size of the CU, which is the current block, is log2CUSize, and the vertical and horizontal edges for which bS is determined are specified 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 ) specifies the set of edge sample locations, where k = 0, ..., nE-1 and j = 0, ..., nE-1, and nE is ((1 <<log2CUSize)> >2), xE0=0, yE0=0, xE k+1 =xE k +4, yE j+1 =yE j It has a +4 relationship.
[0200] In this case, the samples to which the deblocking filter is applied for horizontal and vertical edges specify a set of edge sample locations (xE k , yE j For example, for a horizontal edge, (1) the information indicating that it is a horizontal edge indicates that a deblocking filter is to be applied to the edge (bS determines that). k ][yE j ]=1) and yE j When the value of %2 is 0, (2) the (xC+xE) of the picture restored through prediction k , yC+yE j Set p0 to (xC + xE -1) and set p1 to (xC + xE -1) k , yC+yE j ) can be set to q0, and (3) in this case, the direction of the deblocking filter is vertical. j %2 is yE j It means the remainder when divided by 2.
[0201] For vertical edges, (1) the information indicating that it is a vertical edge indicates that a deblocking filter is to be applied to the edge (bS determines that). (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 through prediction k -1, yC+yE j ) of the picture restored through prediction is set to (xC+xE k , yC+yE j ) can be set to q0, and (3) in this case, the direction of the deblocking filter is horizontal. k %2 is xE k It means the remainder when divided by 2.
[0202] Depending on the filter direction, bS is (E k , E j ) can be determined based on the filterDir. For example, bS can be determined based on the filterDir. k ][E j ] can be determined.
[0203] Like Method 1, Method 2 does not determine bS for edges inside the block removal application unit block (8x8 pixel block). In Method 2, the process of determining bS is performed in units of 4x4 pixel blocks (bS determination unit block), and bS is determined only when the index of the 4x4 block is even, that is, when the boundary of the 4x4 block is the boundary of an 8x8 block. In this case, bS at each boundary can be determined using the bS determination method described in the example of Figure 5, or it can be determined using a simpler bS determination method, as will be described later.
[0204] 9 is a diagram illustrating 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 FIG. 9 illustrates the results of applying Method 1 and Method 2.
[0205] As shown in FIG. 9, considering a deblocking filtering unit block 910, which is an 8×8 pixel block for a current block (eg, CU), edges located inside the block 910 do not determine bS.
[0206] On the other hand, in order to further simplify the bS determination procedure, reduce complexity, and enhance the effectiveness of the deblocking filter, it is also possible to consider a method in which a bS for only one edge among the edges for the unit block of the deblocking filter is derived and used as a representative bS for that edge among the edges of the unit block of the deblocking filter.
[0207] 10 is a diagram illustrating another example of a method for determining a representative bS value in a unit block that executes a deblocking filter. Also in FIG. 10, an example is described in which the unit block 1000 of the deblocking filter is an 8×8 pixel block, and the unit block for determining the bS value is a 4×4 pixel block.
[0208] 10, of two vertical edges 1010 and 1020 that are subject to bS determination within a unit block 1000 of the deblocking filter, a bS is determined only for the 0th edge 1010. In other words, for each unit block of the deblocking filter, a bS is calculated only for the vertical and horizontal edges of the 0th bS determination unit block, and the calculated bS is used as a representative bS for the unit block of the deblocking filter. For example, if the unit block of the deblocking filter is an 8x8 pixel block and the bS determination unit block is a 4x4 pixel block, there are four bS determination unit blocks within the unit block of the deblocking filter. Of these, a bS is determined only for the vertical and horizontal edges of the 0th block (the upper left block) and used as a representative bS for the unit block of the deblocking filter.
[0209] By determining bS as in the example of Figure 10, the process of determining bS can be simplified, and bS can be determined to a process that is 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 any one of the methods described above with reference to Figures 6 to 10. In this case, the specific method for determining bS at the position where bS is set is as described with reference to Figure 5.
[0211] However, the method of determining bS may also be simpler than that shown in Fig. 5. For example, even if the bS value is derived by dividing it into a range from 0 to 4 as in the example of Fig. 5, the bS value may not be subdivided and used in the deblocking filter process. For example, it may be possible to determine only bS>0, only bS>1, or only bS>2.
[0212] Therefore, a simpler bS decision tree such as the example of FIG. 5 can also be used to implement a deblocking filter.
[0213] FIG. 11 is a flow chart that schematically illustrates another example of a method for determining bS.
[0214] Referring to FIG. 11, first, it is determined whether block P and / or block Q are intra-coded (S1110).
[0215] If P and / or Q are intra-coded, 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-coded, it is determined whether the block P and / or Q includes coefficients (non-zero transform coefficients) (S1130). In this case, the transform coefficients may be transform coefficients before inverse quantization is applied or transform coefficients after inverse quantization is applied.
[0217] In step S1130, if block P and / or block Q includes coefficients (transform coefficients that are not zero), 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 does not contain coefficients (non-zero transform coefficients), it is determined whether block P and block Q have different reference pictures or whether block P and block Q have different motion vectors (S1150).
[0219] In step S1150, if 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 bS1 (S1160).
[0220] In other cases, ie, when a deblocking 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 convenience of explanation. In the example of Fig. 11, considering that the bS values are derived by dividing them into four types, the values of bS0 to bS3 can be set as bS0 = 0, bS1 = 1, bS2 = 2, and bS3 = 3 / 4, as shown in Fig. 11. In the example of Fig. 11, it is explained that bS3 is determined to be 3 / 4 in step S1120, but this is a representation that makes it easy to understand that the bS values of 3 and 4 in the example of Fig. 5 are determined to be a single value of bS3 (e.g., 3) in the example of Fig. 11.
[0222] The bS decision tree can also be used to set the values of the variables required for the deblocking filter. cAs a simple example, the offset is set to a specific value (for example, 2) for the largest bS value, and set to 0 for other bS values.
[0223] It is also possible to consider a method of further reducing the number of decision branches compared to the example of Figure 11. In this case, the bS values can be reduced from three (bS0, bS1, bS2) instead of four (bS0, bS1, bS2, bS3) as in the example of Figure 11, and a deblocking filter can be used.
[0224] In this case, the largest bS value, bS2, may be determined when block P and / or block Q are intra-coded, the bS value may be determined as bS1 when a deblocking filter is applicable, and the bS value may be determined as bS0 when a deblocking filter is not applicable. Considering that the bS values are derived using one of the three types of bS values, the values of bS0, bS1, and bS2 may be set to, for example, bS0=0, bS1=1, and bS2=2.
[0225] FIG. 12 is a flow chart for explaining a method for determining the bS value to be one of three values as described above.
[0226] Referring to FIG. 12, first, it is determined whether block P and / or block Q are intra-coded (S1210).
[0227] If block P and / or block Q is intra-coded, bS for the boundary between block P and block Q is determined to be bS2 (S1220). bS2 corresponds to the bS values of 3 and 4 (bS=3 / 4) in the example of Fig. 5. Since bS2 is the largest of the three bS values, the value of bS2 can be set to, for example, 2.
[0228] If block P and / or block Q are not intra-coded, it is determined whether block P and block Q include non-zero coefficients (transform coefficients), whether block P and block Q have different reference pictures, or whether block P and block Q have different motion vectors (S1230). In this case, the transform coefficients may be transform coefficients before inverse quantization is applied or transform coefficients after inverse quantization is applied.
[0229] In step S1230, if block P and block Q contain non-zero coefficients (transform coefficients), or if block P and block Q have different reference pictures, or if block P and block Q have different motion vectors, bS for the boundary between block P and block Q is set to bS1 (S1240). bS1 is the bS value when block P and block Q are not intra-coded and a deblocking filter is applied, and corresponds to the bS values of 1 and 2 (bS=1 / 2) in the example of FIG. 5. Since bS1 is the intermediate value among the three bS values, the value of bS1 can be set to 1, for example.
[0230] In other cases, i.e., when a deblocking filter is not applied, bS is set to bS0 (S1240). bS0 is the bS value when a deblocking filter is not applied, and corresponds to the bS value of 0 (bS=0) in the example of Fig. 5. Since bS0 is the smallest of the three bS values, the value of bS0 can be set to 0, for example.
[0231] The bS decision tree can also be used to set the values of the variables required for the deblocking filter. c As a simple example, the offset is set to a specific value (for example, 2) for the largest bS value, and set to 0 for other bS values.
[0232] Figure 13 is a flow chart outlining another method for determining one of three values for the bS value. In the bS determination method (bS decision tree) described in Figure 12, the three bS values (bS1, bS2, bS3) are clearly set to 0, 1, and 2 for easier understanding of the invention.
[0233] Referring to FIG. 13, first, it is determined whether block P and / or block Q is intra-coded (S1310).
[0234] If block P and / or block Q is intra-coded, the bS value for the boundary between block P and block Q is determined to be 2 (S1320). A bS of 2 corresponds to the bS values of 3 and 4 (bS=3 / 4) in the example of FIG.
[0235] If block P and / or block Q are not intra-coded, it is determined whether block P and block Q include non-zero coefficients (transform 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 transform coefficients may be transform coefficients before inverse quantization is applied or transform coefficients after inverse quantization is applied.
[0236] In step S1330, if blocks P and Q contain non-zero coefficients (transform coefficients), or if blocks P and Q have different reference pictures, or if blocks P and Q have different motion vectors, the bS value for the boundary between blocks P and Q is set to 1 (S1340). When bS is 1, blocks P and Q are not intra-coded, and the bS value corresponds to the bS values of 1 and 2 (bS=1 / 2) in the example of FIG. 5 when a deblocking filter is applied.
[0237] In other cases, i.e., when the deblocking filter is not applied, the bS value is set to 0 (S1340). When the bS value is 0, it is the bS value for when the deblocking filter is not applied, and corresponds to the bS value of 0 (bS=0) in the example of FIG. 5.
[0238] The bS decision tree can also be used to set the values of the variables required for the deblocking filter. c As a simple example, the offset is set to a specific value (for example, 2) for the largest bS value, and set to 0 for other bS values.
[0239] Even if the bS value is set to one of three values as in Figures 12 and 13, the decision steps of the decision tree do not need to be limited to two. Even if more or fewer decision steps are performed, the five types of bS values used in the decision method of Figure 5 can be reduced and applied. For example, in Figures 12 and 13, the decisions regarding whether blocks P and Q contain non-zero coefficients (transform coefficients), whether P and Q have different reference pictures, or whether blocks P and Q have different motion vectors can be performed separately in one step.
[0240] FIG. 14 is a flow chart illustrating another method for determining the bS value to be one of three values.
[0241] Referring to FIG. 14, first, it is determined whether block P and / or block Q are intra-coded (S1410).
[0242] If block P and / or block Q is intra-coded, the bS value for the boundary between block P and block Q is determined to be 2 (S1420). A bS of 2 corresponds to the bS values of 3 and 4 (bS=3 / 4) in the example of FIG.
[0243] If the block P and / or the block Q is not intra-coded, it is determined whether the block P and the block Q include non-zero coefficients (transform coefficients) (S1430). In this case, the transform coefficients may be transform coefficients before inverse quantization is applied or transform coefficients after inverse quantization is applied.
[0244] If blocks P and Q contain non-zero coefficients (transform coefficients), the bS value for the boundary between blocks P and Q is set to 1 (S1440). In this case, a bS value of 1 indicates that blocks P and Q are not intra-coded and a deblocking filter is applied, which corresponds to a bS value of 2 in the example of FIG. 5.
[0245] If block P and block Q do not contain any non-zero coefficients (transform coefficients), 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 bS value for the boundary between block P and block Q is set to 1 (S1460). A bS value of 1 indicates that block P and block Q are not intra-coded and a deblocking filter is applied, which corresponds to the bS value of 1 in the example of FIG. 5.
[0247] In other cases, i.e., when the block removal filter is not applied, the bS value is set to 0 (S1470). When the bS value is 0, it is the bS value for when the block removal filter is not applied, and corresponds to the bS value of 0 (bS=0) in the example of FIG. 5.
[0248] The bS decision tree can also be used to set the values of the variables required for the deblocking filter. cAs an example, it is simply shown that the offset is set to a specific value (e.g., 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, the method when the value of bS is derived by any one of five values as shown in FIG. 5 or FIG. 11 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] The variable bS[filterDir][xE k [yE j representing the boundary filter processing intensity is determined according to the derived block distortion removal filter direction. 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 jspecifies the edge that determines bS. For example, the edge that determines bS is (xC + xE k , yC+yE j p0 is set to (xC+xE k , yC+yE j ) can be specified for the boundary between q0 and q1, and for vertical edges, (xC + xE k -1, yC+yE j ) and p0 is set to (xC+xE k , yC+yE j ) can be specified as the boundary between q0 and
[0255] bS[filterDir][xE k ][yE j The value of ] can be derived as follows:
[0256] (1) When the block edge to be determined as bS is a CU edge and sample p0 or q0 belongs to a CU coded in intra prediction mode, bS, i.e., bS[filterDir][xE k ][yE j ] value is set to 4.
[0257] (2) When sample p0 or q0 belongs to a CU coded in intra prediction mode, but the block edge for which bS is determined is not a CU edge, bS[filterDir][xE k ][yE j ] value is set to 3.
[0258] (3) When the block edge to be determined as bS is a TU edge and the sample p0 or q0 belongs to a TU including a transform coefficient level that is not 0, bS[filterDir][xE k ][yE j ] value is set to 2.
[0259] (4) Other, bS[filterDir][xE when a deblocking filter is applied k ][yE jThe value is set to 1. For example, in the examples of FIGS. 5, 11, 12, 13, and 14, for the sake of 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 cases where the block P and / or the block Q include non-zero transform coefficients, and the cases where the block P and the block Q have different motion vectors or have different reference pictures are taken as examples. However, there are various other cases where 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 units of 1 / 4 pixel, bS[filterDir][xE k [yE j 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 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 more 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] Specify the edge where bS is determined. The specification of the edge where bS is determined can be executed using any one of the methods described with reference to FIGS. 6 to 10.
[0265] The reference position (xE) that determines bS is determined by identifying the edge where bS is determined. k , yE j ) and bS, which are the left and right samples of the edge, p0 and q0, and the direction of the deblocking filter are derived.
[0266] The variable bS[filterDir][xE] represents the boundary filtering strength according to the derived deblocking filter direction. k ][yE j For example, a filterDir value of 1 indicates vertical filtering, and therefore bS for horizontal edges is derived. A filterDir value of 0 indicates horizontal filtering, and therefore bS for vertical edges is derived. xE k and yE j specifies the edge that determines bS. For example, the edge that determines bS is (xC + xE k , yC+yE j p0 is set to (xC+xE k , yC+yE j ) can be specified for the boundary between q0 and q1, and for vertical edges, (xC + xE k -1, yC+yE j ) and p0 is set to (xC+xE k , yC+yE j ) can be specified as the boundary between q0 and
[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 coded in intra prediction mode, bS, i.e., bS[filterDir][xE k ][yE j ] value is set to 2.
[0269] (2) When the block edge that is the bS decision target is a TU edge and the sample p0 or q0 belongs to a TU that includes 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 relation to the drawings regarding the previous bS decision tree structure, as an example, when (i) the PU including p0 or the PU including q0 has different reference pictures 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 including p0 and the motion vectors used for the PU including q0 is 4 or more in 1 / 4 pixel units, (iii) when two motion vectors are used in the PU including p0 and two motion vectors are used in the PU including 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 it does not fall under (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 four 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] Identifying the Edges for Determining bS Identifying the edges for determining bS can be performed using any one of the methods described with reference to FIGS.
[0275] The reference position (xE) that determines bS is determined by identifying the edge where bS is determined. k , yE j ) and bS, which are the left and right samples of the edge, p0 and q0, and the direction of the deblocking filter are derived.
[0276] The derived deblocking filter direction is used to define the boundary filtering strength variable bS[filterDir][xE k ][yE j For example, a filterDir value of 1 indicates vertical filtering, and therefore bS for horizontal edges is derived. A filterDir value of 0 indicates horizontal filtering, and therefore bS for vertical edges is derived. xE k and yE j specifies the edge that determines bS. For example, the edge that determines bS is (xC + xE k , yC+yE j p0 is set to (xC+xE k , yC+yE j ) can be specified for the boundary between q0 and q1, and for vertical edges, (xC + xE k -1, yC+yE j ) and p0 is set to (xC+xE k , yC+yE j ) can be specified as the boundary between q0 and
[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 coded in intra prediction mode, bS, i.e., bS[filterDir][xE k ][yE j ] value is set to 2.
[0279] (2) Other, bS[filterDir][xE when a deblocking filter is applied k ][yE j ] value is set to 1. For example, when the block edge for which bS is determined is a TU edge, and (i) sample p0 or q0 belongs to a TU that includes a transform coefficient level that is not 0, (ii) the PU including p0 and the PU including q0 have different reference pictures or different numbers of motion vectors, (iii) the difference in absolute value between the vertical components or the horizontal components of the motion vector used in the PU including p0 and the motion vector used in the PU including q0 is 4 or more in 1 / 4 pixel units, or (iv) when two motion vectors are used in the PU including p0 and two motion vectors are used in the PU including q0, the difference in absolute value between the vertical components or the horizontal components of the motion vectors for at least one pair of motion vectors corresponding to the same reference picture is 4 or more in 1 / 4 pixel units, bS[filterDir][xE k ][yE j ] value can be set to 1.
[0280] (3) If neither (1) nor (2) applies, i.e., if the deblocking filter is not applied, then bS[filterDir][xE k ][yE j ] Set the value to 0.
[0281] On the other hand, the bS value may be derived by 1 without being limited to the case where the block edge for which the bS is determined is a TU edge. Another example of a method for deriving the bS value by one of three values is as follows.
[0282] <Method 3 for deriving <bS> using 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] Based on the identified edge where <bS> is determined, the reference position (xE <00,00268>, yE j ), p0 and q0 which are the samples on the left and right of the edge where <bS> is determined, 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 strength 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 where <bS> is determined. For example, for a horizontal edge, the edge where <bS> is determined 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 ). For 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 coded in intra prediction mode, bS, i.e., bS[filterDir][xE k ][yE j ] value is set to 2.
[0288] (2) Other, bS[filterDir][xE when a deblocking filter is applied k ][yE j ] value is set to 1. For example, in cases such as (i) when the block edge for which bS is determined is a TU edge and sample p0 or q0 belongs to a TU that includes a transform coefficient level that is not 0, (ii) when the PU including p0 and the PU including q0 have different reference pictures or different numbers of motion vectors, (iii) when the difference in absolute value between the vertical components or the horizontal components of the motion vector used in the PU including p0 and the motion vector used in the PU including q0 is 4 or more in 1 / 4 pixel units, or (iv) when two motion vectors are used in the PU including p0 and two motion vectors are used in the PU including q0, for at least one pair of motion vectors corresponding to the same reference picture, the difference in absolute value between the vertical components or the horizontal components of the motion vectors is 4 or more in 1 / 4 pixel units, the bS[filterDir][xE k ][yE j ] value can be set to 1.
[0289] (3) If neither (1) nor (2) applies, i.e., if the deblocking filter is not applied, then bS[filterDir][xE k ][yE j ] Set the value to 0.
[0290] When deriving bS using one of three values, the fact that the reference pictures of the PU including p0 and the PU including q0 are different is determined by what picture is referenced, regardless of what reference picture list is used or whether the reference picture index of the reference picture list is 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 reduce complexity and easily derive 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 using one of five values and applying a block distortion removal filter to the color difference components (color difference samples) 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] [[ID=2c is the quantization parameter Q=qP L is determined to be the value corresponding to
[0298] shows Q, β, t c 10 shows an example of the correspondence between [Table 1]
[0299] In this case, t c =t c The relationship may be '*(1<<(BitDepthY-8)), β=β'*(1<<(BitDepthY-8)).
[0300] A deblocking filter for the chrominance samples can be performed with parameters specified based on the values in Table 1.
[0301] First, for vertical edges, a deblocking filter is applied based on each chrominance sample position (xC+xB, yC+yB+k) as follows, where k=0,...,3:
[0302] (1) In blocks P and Q, which are bounded by a vertical edge, the color difference sample p i and color difference sample q of block Q i (i=0,1) is q i =s'[xC+xB+i, yC+yB+k], pi=s'[xC+xB-i-1, yC+yB+k].
[0303] (2) When bS is greater than 2, (i) the color difference sample value p i and q i The filtering procedure is performed for (i=0,1). (ii) The filtered sample values p0' and q0' replace the corresponding sample positions in the sample array as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB, yC+yB+k]=p0'
[0304] For horizontal edges, perform a chrominance deblocking filter 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 =s'[xC+xB-i-1, yC+yB+k].
[0306] (2) When bS is greater than 2, (i) the color difference sample p i and q i The filtering procedure is performed for (i=0,1). (ii) The filtered samples p0' and q0' replace the corresponding samples in the sample array as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB, yC+yB+k]=p0'
[0307] For horizontal edges, we perform a deblocking filter as follows:
[0308] (1) In blocks P and Q, which are bounded by horizontal edges, the color difference sample 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 =s'[xC+xB+k, yC+yB-i-1], where k can have values 0,...,3.
[0309] (2) When bS is greater than 2, (i) each color difference sample p i and q i (ii) Apply a deblocking filter to (i=0,1). (ii) The filtered samples p0' and q0' replace the corresponding samples in the sample array 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 follows 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 reduce 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 c 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 specified as follows: (1) When the bS value is greater than 2, the average value of the quantization parameter for block P and block Q, taking into account the approximate value, is set to qP L When t c is the quantization parameter Q=Clip(0,55,qP L (2) When the bS value is 2 or less, t c is the quantization parameter Q=qP L is determined to be the value corresponding to
[0317] shows Q, β, t c 1 shows an example of the correspondence between [Table 2]
[0318] In this case, t c =t c ´*(1<<(BitDepthY-8)), β=β´*(1<<(BitDepthY-8)).
[0319] A deblocking filter for the chrominance samples can also be implemented with parameters specified based on the values in Table 2.
[0320] First, for vertical edges, a deblocking filter is applied based on each chrominance sample position (xC+xB, yC+yB+k) as follows, where k=0,...,3:
[0321] (1) In blocks P and Q that are bounded by a vertical edge, the color difference sample 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 =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 The filtering procedure is performed for (i=0,1). (ii) The filtered sample values p0' and q0' replace the corresponding sample positions in the sample array as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB, yC+yB+k]=p0'
[0323] For horizontal edges, perform a chrominance deblocking filter 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 =s'[xC+xB-i-1, yC+yB+k].
[0325] (2) When bS is greater than 1, (i) the color difference sample p i and q i The filtering procedure is performed for (i=0,1). (ii) The filtered samples p0' and q0' replace the corresponding samples in the sample array as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB, yC+yB+k]=p0'
[0326] For horizontal edges, we perform a deblocking filter as follows:
[0327] (1) In blocks P and Q, which are bounded by horizontal edges, the color difference sample 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 =s'[xC+xB+k, yC+yB-i-1], where k can have values 0,...,3.
[0328] (2) When bS is greater than 1, (i) each color difference sample p i and q i (ii) Apply a deblocking filter to (i=0,1). (ii) The filtered samples p0' and q0' replace the corresponding samples in the sample array as follows: s'[xC+xB, yC+yB+k]=q0', s'[xC+xB-1, yC+yB+k]=p0'
[0329] In the above filtering process, when the value of bS is greater than 1, the filtered samples are derived as shown in the following Equation 6.
[0330] <Formula 6> Δ = Clip3(-t C , t C , ( ( ( ( q0- p0) << 2 ) + p1- q1+ 4 ) >> 3 ) ) p0' = Clip1 C ( p0+ Δ ) q0' = Clip1 C ( q0- Δ )
[0331] Meanwhile, one of the main causes of block distortion at block boundaries is block-based motion compensation, and to overcome this, overlapped block motion compensation (OBMC) can be used.
[0332] When using OBMC, the bS decision process described above must also be modified to suit OBMC. For example, when motion information between blocks differs, blockiness can be severe, so one of the criteria for determining the bS value of 0 or 1 is the similarity of the motion information. However, when OBMC technology is used, blockiness at the boundaries of the area where motion compensation is performed is reduced. As a result, unnecessary deblocking filters can be reduced, but the bS decision process (bS decision tree) must be modified to reflect this.
[0333] FIG. 15 is an example of a bS decision tree applied when OMBC is applied, and is a flow chart for explaining a method for determining bS.
[0334] Referring to FIG. 15, first, it is determined whether block P and / or block Q is intra-coded (S1500).
[0335] If block P and / or block Q is intra-coded, it is determined whether the boundary of block Q, i.e., the boundary between block P and block Q, is a boundary of a coding block (S1510). In this case, the coding block includes a CU and an LCU.
[0336] In step S1510, if the boundary between block P and block Q is the boundary of the coding 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 a coding block boundary, 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-coded, it is determined whether blocks P and Q are within a rectangular or asymmetric partition within a single coding block (e.g., CU) (S1540).
[0339] In step S1540, if block P and block Q are not in a rectangular or asymmetric partition within a single coding block (e.g., CU), it is determined whether block P and / or block Q include coefficients (non-zero transform coefficients) (S1550). In this case, the transform coefficients may be transform coefficients before inverse quantization is applied or transform coefficients after inverse quantization is applied.
[0340] In step S1550, if block P and / or block Q includes coefficients (non-zero transform coefficients), bS for the boundary between block P and block Q is determined to be bS2 (eg, bS2=2) (S1560).
[0341] If block P and / or block Q does not contain any coefficients (non-zero transform coefficients) in step S1550, 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, bS for the boundary between block P and block Q is determined to be bS1 (eg, bS1=1) (S1580).
[0343] In other cases, i.e., when a deblocking filter is not applied, bS is set to bS0 (e.g., bS0=0) (S1590). Examples of cases where bS is set to bS0 include when blocks P and Q are not in a rectangular or asymmetric partition within a single coding block (e.g., CU) in step S1540, or when blocks P and Q do not have different reference pictures or motion vectors in step S1570.
[0344] 15, as in the previous example regarding bS determination, the relationship bS4>bS3>bS2>bS1>bS0 is maintained. Therefore, the values of bS0 to bS4 can be set as bS4=4, bS3=3, bS2=2, bS1=1, and bS0=0, as in the above example and illustrated.
[0345] Also, as in the previous example, the bS decision tree can be used to set the values of the variables required for the deblocking filter. In Figure 15, for the largest 2bS value, t c Set offset to a specific value (e.g., 2) and use t for other bS values. c A simple example of setting the offset to 0 is shown below.
[0346] In the example of Figure 15, when block P and block Q are in the same coding block (e.g., CU) and are in a rectangular partition (e.g., a prediction block, PU, etc.) or in 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] Alternatively, if blocks P and Q are in the same coding block (e.g., CU) and are in a rectangular partition (e.g., a predicted block, PU, etc.) or in an asymmetric partition (e.g., a predicted block, PU, etc.), 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] FIG. 16 is another example of a bS decision tree applied when OMBC is applied, and is a flow chart for explaining a method for determining bS.
[0349] Referring to FIG. 16, first, it is determined whether P and / or Q are intra-coded (S1600).
[0350] If block P and / or block Q is intra-coded, it is determined whether the boundary of block Q, i.e., the boundary between block P and block Q, is a boundary of coded blocks (S1610). In this case, coded blocks include CUs and LCUs.
[0351] In step S1610, if the boundary between block P and block Q is the boundary of the coding 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 a coding block boundary, 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-coded, it is determined whether blocks P and Q are within a rectangular or asymmetric partition within a single coding block (e.g., CU) (S1640).
[0354] In step S1640, when block P and block Q are not in a rectangular or asymmetric partition within a single coding block (e.g., CU), it is determined whether block P and / or block Q include coefficients (non-zero transform coefficients) (S1650). In this case, the transform coefficients may be transform coefficients before inverse quantization is applied or transform coefficients after inverse quantization is applied.
[0355] In step S1650, if block P and / or block Q includes coefficients (non-zero transform coefficients), bS for the boundary between block P and block Q is determined to be bS2 (e.g., bS2=2) (S1660).
[0356] In step S1640, if blocks P and Q are in a rectangular or asymmetric partition within a single coding block (e.g., CU), or in step S1650, if blocks P and / or Q do not contain coefficients (non-zero transform coefficients), it is determined whether blocks P and 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, bS for the boundary between block P and block Q is determined to be bS1 (for example, bS1=1) (S1680).
[0358] In other cases, that is, when the block removal filter is not applied, bS is set to bS0 (for example, bS0=0) (S1690).
[0359] 16, as in the previous example regarding bS determination, the relationship bS4>bS3>bS2>bS1>bS0 is maintained. Therefore, as shown in the example of values of bS0 to bS4 and in the figure, it is possible to set bS4=4, bS3=3, bS2=2, bS1=1, and bS0=0.
[0360] As described above, in the example of Figure 16, when blocks P and Q are in the same coding block (e.g., CU) and in a rectangular partition (e.g., a predictive block, PU, etc.) or in an asymmetric partition (e.g., a predictive block, PU, etc.), the bS value for the boundary between blocks P and Q can be determined to be bS1 (e.g., bS = 1).
[0361] Also, as in the previous example, the bS decision tree can be used to set the values of the variables required for the deblocking filter. In Figure 16, for the largest 2bS value, t c Set offset to a specific value (e.g., 2) and use t for other bS values. c A simple example of setting the offset to 0 is shown below.
[0362] On the other hand, if block P and / or block Q is intra-coded, it may not be necessary to distinguish the value of bS. For example, as in the examples of Figures 5, 15, and 16, it is determined whether a target boundary in an I slice (intra-coded slice) is a boundary of a coded block (e.g., a CU), and if it is a boundary of a coded block, bS is set to 4, and if it is any other boundary, bS is set to 3, so that the value of bS for all I slices is ultimately 3 or 4.
[0363] In this regard, when a method for reducing complexity by modifying the bS decision tree is applied as shown in Figures 12 to 14, it may be applied simply 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] FIG. 17 is a diagram illustrating an example of a method for determining bS and applying a deblocking filter.
[0365] Referring to FIG. 17, a bS is determined to apply a deblocking filter (S1710), block-based filtering is turned on or off based on the determined bS (S1720), and it is determined whether to apply a strong filter or a weak filter for the given bS (S1730), and filtering is performed (S1740).
[0366] In the example of FIG. 17, it can be seen that the method of applying the deblocking filter is the same as or similar to the method described above with reference to FIG.
[0367] In this case, in the bS determination step (S1710), if block P and / or block Q are intra-coded, as shown in Figure 5, Figure 15, or Figure 16, the bS value can also be determined by distinguishing whether the target boundary is a boundary of a coding block.
[0368] 18 is a diagram for explaining another example of a method for determining bS and applying a deblocking filter. Unlike FIG. 17, bS is not additionally determined by dividing it when block P and / or block Q are intra-coded (in the case of an I slice).
[0369] Referring to FIG. 18, it is determined whether block P and / or block Q are intra-coded (I-slice) in order to apply a deblocking filter (S1810).
[0370] If block P and / or block Q are not intra-coded, the general step of determining bS is performed (S1820), as in the example of FIG.
[0371] If block P and / or block Q is intra-coded (I slice), bS is determined to be one value (for example, 4) (S1830), unlike the example in FIG.
[0372] Next, the block-based filtering process is turned on / off based on the determined bS (S1840), and it is determined whether to apply a strong filter or a weak filter to the given bS (S1450), and filtering is performed (S1860).
[0373] In addition to the example of Figure 18, as another method of modifying and applying the deblocking filter method described above, it is possible to consider modifying the method using the representative bS described in the example of Figure 6 to perform the deblocking filter.
[0374] In the example of FIG. 6, when a deblocking filter is executed in units of 8×8 pixel blocks, the bS having the larger value of two bSs determined in units of 4×4 pixels is used as the representative bS.
[0375] FIG. 19 is a flowchart illustrating an example of a method for determining the representative bS.
[0376] Referring to FIG. 19, in order to select a representative bS, the sizes of bS1 and bS2 are compared in the unit block of the deblocking filter (S1910).
[0377] In step S1910, if bS1 is greater than bS2, then bS1 is determined as the representative bS (S1920). Conversely, in step S1910, if bS2 is greater than bS1, then bS2 is determined as the representative bS (S1930).
[0378] bS1 and bS2 may be bS for two vertical edges or bS for two horizontal edges in a unit block of the deblocking filter. The method of Fig. 15 can be used to determine a representative bS for a horizontal edge in a deblocking filter process for a vertical edge after being performed in a deblocking filter process for a horizontal edge.
[0379] The filter processing unit can execute a deblocking filter using the determined representative bS.
[0380] The example of Figure 19 illustrates a method of using a bS having a large value as the representative bS, as in the example of Figure 6. Alternatively, a different method of determining the representative bS may be used to reduce excessive deblocking filtering and reduce the amount of calculation required for filtering.
[0381] FIG. 20 is a flow chart illustrating another example of a method for determining a representative bS.
[0382] Referring to FIG. 20, in order to select a representative bS, the sizes of bS1 and bS2 are compared in the unit block of the deblocking filter (S2010).
[0383] In step S2010, if bS1 is smaller than bS2, the representative bS is determined to be bS1 (S2020). Conversely, in step S2010, if bS2 is smaller than bS1, the representative bS is determined to be bS2 (S2030).
[0384] bS1 and bS2 may be bS for two vertical edges or bS for two horizontal edges in a unit block of the deblocking filter. The method of Figure 20 can also be used to determine a representative bS for a vertical edge by being executed in a deblocking filter process for a vertical edge, and then to determine a representative bS for a horizontal edge by being executed in a deblocking filter process for a horizontal edge.
[0385] Using the determined representative bS, the filter processing unit can execute a deblocking filter.
[0386] Meanwhile, even if the bS value is derived and applied based on one of five values as described with reference to Figures 17 and 18, when actually executing a deblocking filter, it can only be determined whether the bS value is greater than 0 or greater than 2. Therefore, when there are only three distinct bS values, it is possible to effectively execute a deblocking filter according to the characteristics of a pixel or block.
[0387] FIG. 21 is a flow chart that schematically illustrates another method for simplifying a bS decision tree (bS decision method).
[0388] Referring to FIG. 21, first, it is determined whether P and / or Q are intra-coded (S2110).
[0389] If block P and / or block Q is intra-coded, 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-coded, it is determined whether block P and block Q contain non-zero coefficients (transform 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 non-zero coefficients (transform coefficients), or 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, that is, 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 indicates that no deblocking filter is applied, P and Q are both coded in inter-prediction mode and have similar motion information. In this case, similar motion information means that the reference picture is 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, even if the coded block flag (cbf) for block P and block Q is not 0, i.e., block P and block Q have non-zero transform coefficients, if block P and block Q are predicted in inter prediction mode and motion information is similar, bS value can be determined to be 0. In other cases, i.e., when motion information is not similar or block P and / or block Q are coded in intra prediction mode, bS can be determined to be 1 or 2.
[0395] However, when block P and block Q have non-zero transform coefficients (when the value of cbf is not 0), the motion information of block P and block Q is similar and application of a deblocking filter may be necessary even if bS is determined to be 0. This is because if the motion information is similar when non-zero transform coefficients are present and application of a deblocking filter is precluded, subjective loss to the user and objective loss of data may occur.
[0396] Therefore, it is possible to strictly determine when the value of bS becomes 0 as follows:
[0397] For example, as described above, in FIG. 21, the reference picture of two blocks P and Q across an edge is the same, and the difference between the motion vector components of block P and block Q is less than 4, which is determined as a case where the motion information is similar. Therefore, the motion vector MV of block P is P and the motion vector MV of block Q Q On the other hand, even if the difference between one component becomes 4 or more, bS is no longer 0. That is, MV P x component MV of p0 and MV Q x component MV of Q0 The difference between is 4 or more, or MV P y component MV P1 and MV Q y component MV Q1 is greater than or equal to 4, 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, equal to, or greater than 4, an arbitrary threshold value can be set, and then the difference between the components of the motion vector can be compared with the threshold value. For example, P x component MV of p0 and MV Q x component MV of Q0 The difference between is greater than or equal to the threshold value Th0, or MV P y component MV P1 and MV Q y component MV Q1 If the difference between bS and Th0 is equal to or greater than a threshold Th1, bS can be set to 1 (or 2 if block P and / or block Q are coded in intra prediction mode). In this case, Th0 and Th1 can be the same. For example, when the threshold is small, the number of cases where bS is 0 decreases, so the threshold Th0 / Th1 can be set to a value smaller than 4 (2 or 3) to reduce the number of cases where bS is 0.
[0399] <Equation 7> shows an example of a method for determining whether the bS value is set to 0 or 1 using the above method.
[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 component and the y component of the motion vector of block P and the motion vector of block Q, and (2) determines whether the difference between each component is greater than a threshold value.
[0402] On the other hand, to reduce the complexity of the deblocking filter, t c You can also remove the _offset.
[0403] As explained in the previous deblocking filter method for the chrominance component, the average value of the quantization parameters for the blocks P and Q, taking into account the approximate values, is set to qP L (1) When the bS value is greater than a predetermined value (e.g., 2 or 1), t c is the quantization parameter Q=Clip(0,55,qP L (2) When the bS value is equal to or less than a predetermined value (e.g., 2 or 1), t c is the quantization parameter Q=qP L can be determined to be the value corresponding to
[0404] In this case, the quantization parameter Q and t c The correspondence between can be identified through a table.
[0405] Table 3 shows the block removal parameters (Q, t c , β). [Table 3]
[0406] In Table 3, for the sake of convenience, β and t c However, the present invention is not limited to this. For example, Table 3 shows the same as Table 1 and Table 2 in that β' and t c ', in which case t c and β is t c =t c ´*(1<<(BitDepthY-8)), β=β´*(1<<(BitDepthY-8)) to c ' and β'.
[0407] As mentioned above, t c and β may be a criterion for determining whether to apply strong filtering. For example, if the three samples of P closest to the edge are p0, P1, and P2, respectively, and the three samples of Q closest to the edge are q0, q1, and q2, respectively, then (1) abs(p2-2p1+p0)+abs(q2-2q1+q0)=dPq, it can be determined whether dPq is smaller than (β>>2). (2) By further considering samples other than p0, p1, p2, and q0, q1, and q2, for example, p3 and q3, it can be determined whether abs(p3-p0)+abs(q0-q3) is smaller than (β>>3). (3) Furthermore, for two samples p0 and q0 on the left and right of the boundary, abs(p0-q0) is smaller than (5*t c +1)>>1. As mentioned above, the determination can be made for multiple columns or rows within a block. For example, for a vertical edge, multiple rows can be selected and (1) through (3) can be determined for each row, and for a horizontal edge, multiple columns can be selected and (1) through (3) can be determined for each column.
[0408] For vertical edges, if the results of (1) to (3) for multiple rows are all determined to be smaller than the criterion, strong filtering can be applied to the edge.For horizontal edges, if the results of (1) to (3) for multiple columns are all determined to be smaller than the criterion, strong filtering can be applied to the edge.
[0409] Quantization parameter QP of luma samples for block P P and the quantization parameter QP of the luma samples for block Q. Qと Using the quantization parameter variable qP L qP L =((QP Q +QP P +1)>>1).
[0410] When bS is derived from one of the five values, if bS is greater than 2, the quantization parameter Q = Clip3(0, 55, qP L +2), and the quantization parameter Q and the β value correspond to t c The values can be obtained from Table 3. In this case, when bS is less than or equal to 2, Q = qP L and the quantization parameter Q and the β value are set to t c The values can be obtained from Table 3.
[0411] On the other hand, when bS is derived from one of the three values (for example, in the examples of FIGS. 12 to 14), the quantization Q value is determined to be one value regardless of the bS value, and then the t corresponding to the determined quantization parameter Q value and β value is calculated. c The value can be obtained from Table 3. For example, if the bS value is derived from one of three values (0, 1, 2), the quantization parameter Q = Clip3(0, 55, qP L +2*bS-2), and the t corresponding to the determined quantization parameter Q value and β value c The values can be obtained from .
[0412] On the other hand, when determining the quantization parameter Q value, in addition to the bS value, the quantization parameters and bS values of the blocks P and Q, t c Considering the value of _offset, a more accurate t c It is also possible to obtain the value of t transmitted from the slice header. c The quantization parameter Q value can be determined by reflecting the _offset information.
[0413] t transferred from slice header c The _offset information is a value transferred to apply a deblocking filter optimized for each slice, and is the t for the slice containing q samples adjacent to the edge. c The _offset information can be expressed as slice_tc_offset_div2. slice_tc_offset_div2 is t c Specifies the value of the default block removal parameter offset for
[0414] In this case, the quantization parameter Q = Clip3(0, 55, qP L +2*bS-2+slice_tc_offset_div2<<1), and the variable t c can be determined based on the set quantization parameter Q and β. For example, t c Based on the quantization parameters Q and β, the quantization parameters Q, β, t c This can be determined using a table that defines the relationship between
[0415] Therefore, the t transferred from the slice header c The Q value is determined as described above based on the slice_tc_offset_div2 information, and the t c The value of t can be determined. cAs described above, the value quantifies the 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 deblocking filter, or may be used as a criterion for determining whether to apply strong filtering or weak filtering.
[0416] FIG. 22 is a flow chart that outlines a method for encoding video in accordance with the present invention.
[0417] 22, the encoding device divides an input image and performs prediction on a current block (S2210). The prediction on the current block may be performed by a prediction unit of the encoding device. The prediction unit may perform intra-prediction or inter-prediction on the current block. Whether to perform intra-prediction or inter-prediction may be determined taking into account rate distortion optimization (RDO), etc.
[0418] When the skip mode is not applied, the prediction unit generates a prediction signal and can generate a residual signal, which is the difference between the original video signal and the prediction signal.
[0419] The encoding apparatus may transform and quantize the residual signal (S2220). The transformation of the residual signal may be performed in a transform unit, and the quantization of the transformed signal (e.g., transform coefficients) may be performed in a quantization unit.
[0420] The transformed and quantized signal can be transmitted through an entropy coding process.
[0421] The encoding device inversely quantizes and inversely transforms the transformed and quantized signal to restore the current block (S2230). The inversely quantized and inverse transformed signal is added to the residual signal to restore the original video signal.
[0422] The encoding device may apply a deblocking filter to the restored signal (S2240). The restored signal may be restored to a signal closer to the original image by the deblocking filter. The deblocking filter may be implemented in a filter unit, and the filter unit may apply SAO after applying the deblocking filter.
[0423] The specific method for removing block distortion from the filter has been described above with reference to the drawings.
[0424] The signal to which the deblocking filter has been applied is stored in a memory such as a decoded picture buffer (DPB) and can be used as a reference for predicting other blocks or other pictures.
[0425] Here, it has been described that a residual signal is generated and transmitted by prediction, but when the skip mode is applied, the residual signal is not generated / transmitted.
[0426] FIG. 23 is a flow chart that outlines a method for decoding video in accordance with the present invention.
[0427] Referring to FIG. 23, the decoding device entropy decodes the received bitstream and performs prediction on the current block (S2310). The prediction on the current block may be performed by a prediction unit within the decoding device. The prediction unit may perform inter-prediction or intra-prediction on the current block based on information notified from the encoding device. The prediction unit generates a prediction signal (predicted block) for the current block through prediction.
[0428] The decoding device reconstructs the current block based on the prediction for the current block (S2320). The decoding device generates a residual signal (residual block) from the bitstream received from the encoding device through inverse quantization / inverse transform, and can generate a reconstructed signal (reconstructed block) by adding the predicted signal (predicted block) to the residual signal (predicted block). When 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 deblocking filter to the reconstructed signal (reconstructed block) (S2330). The deblocking filter can be implemented in a filter unit within the decoding device. The filter unit applies the deblocking filter to the reconstructed block to modify the reconstructed block to more closely resemble the original image block.
[0430] The specific contents of the block distortion removal filter have been explained in detail above with reference to the drawings.
[0431] After applying the deblocking filter, the filter unit may also apply SAO to the reconstructed block based on information received from the encoding device.
[0432] The signal restored through the filter unit is stored in a memory such as a DPB and can be used as a reference for predicting other blocks or other pictures, and can also be output as a restored image.
[0433] To facilitate understanding of the invention, FIGS. 22 and 23 are intended to provide a general explanation of the application of a deblocking filter according to the present invention in the encoding / decoding process, and it should be noted that the encoding / decoding processes described in detail in conjunction with the previous figures can also be applied.
[0434] FIG. 24 is a flow chart that outlines an example of a method for deriving bS in accordance with the present invention.
[0435] 24, a boundary for determining bS is derived (S2410). The boundary for determining bS may be a boundary of a unit block to which a deblocking filter is applied. Alternatively, the boundary for determining bS may be a boundary of a unit block to which bS is determined. Alternatively, the boundary for determining bS may be a boundary of a unit block to which a deblocking filter is applied and a boundary of a unit block to which bS is determined.
[0436] When the 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 a deblocking filter is applied, bS can be set for each edge that is the boundary for determining bS and corresponds to the boundary of the bS determination unit block. If the boundary for determining bS is the boundary of a unit block to which a bS is determined, bS can be set for an edge that is the boundary for determining bS and corresponds to the boundary of a unit block to which a deblocking filter is applied. If the boundary for determining bS is the boundary of a unit block to which a deblocking filter is applied and corresponds to the boundary of the unit block to which bS is determined, bS can be set for the boundary for determining bS.
[0437] As described above, the method of setting bS can derive the bS for the boundary to any one of five bS values, or can derive the bS for the boundary to any one of three bS values. Alternatively, a method of deriving bS with reduced complexity can be applied. Specific methods for deriving / determining bS are as described above.
[0438] For ease of explanation, FIG. 24 illustrates determining bS for an edge that is the boundary of a bS determination unit block and also the boundary of a block for deblocking filtering. However, the present invention is not limited to this, and bS can also be determined using the method of determining a representative value described above.
[0439] In the exemplary systems described above, the methods are described as a series of steps or blocks in a sequential order, but the present invention is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps described above. Furthermore, the above-described embodiments include examples of various aspects. Accordingly, the present invention includes all other alternatives, modifications, and variations that fall within the scope of the following claims.
[0440] Up until now, in the description of the present invention, when a component is said to be "coupled" or "connected" to another component, it should be understood that the component may be directly coupled or connected to the other component, but that there may be other components between the two components. On the other hand, when a component is said to be "directly coupled" or "directly connected" to another component, it should be understood that there is no other component between the two components.
Claims
1. An image decoding method performed by a decoding device, comprising: deriving a reconstructed picture of the current picture; deriving a boundary strength bS (boundary strength) for a predetermined length boundary within a deblocking filtering unit boundary on which deblocking filtering is performed; performing deblocking filtering on the deblocking filtering unit boundary based on the bS being greater than 0; said bS being set to one of 0, 1 and 2; The bS is set to 2 based on the fact that at least one of the two blocks adjacent to the predetermined length boundary is coded based on an intra prediction mode; the bS is set to 1 based on at least one of the two blocks containing a non-zero transform coefficient, or the two blocks having different reference pictures or different motion vectors; bS is set to 0 based on the fact that the deblocking filtering is not applied; based on bS being greater than 0, the deblocking filtering is performed on luma samples; based on bS being greater than 1, the deblocking filtering is performed on the chrominance samples; The image decoding method, wherein the length of the deblocking filtering unit boundary is longer than the length of the predetermined length boundary.
2. An image coding method performed by a coding device, comprising: deriving a reconstructed picture of the current picture; deriving a boundary strength bS (boundary strength) for a predetermined length boundary within a deblocking filtering unit boundary on which deblocking filtering is performed; performing deblocking filtering on the deblocking filtering unit boundary based on the bS being greater than 0; said bS being set to one of 0, 1 and 2; The bS is set to 2 based on the fact that at least one of the two blocks adjacent to the predetermined length boundary is coded based on an intra prediction mode; the bS is set to 1 based on at least one of the two blocks containing a non-zero transform coefficient, or the two blocks having different reference pictures or different motion vectors; bS is set to 0 based on the fact that the deblocking filtering is not applied; based on bS being greater than 0, the deblocking filtering is performed on luma samples; based on bS being greater than 1, the deblocking filtering is performed on the chrominance samples; The image coding method, wherein the length of the deblocking filtering unit boundary is longer than the length of the predetermined length boundary.
3. A method for transmitting data relating to an image, comprising: obtaining a bitstream relating to the image, the bitstream comprising: deriving a reconstructed picture of the current picture; deriving a boundary strength bS (boundary strength) for a predetermined length boundary within a deblocking filtering unit boundary on which deblocking filtering is performed; performing deblocking filtering on the deblocking filtering unit boundary based on whether bS is greater than 0; generating the bitstream based on a step of encoding image information including information related to the deblocking filtering process; transmitting the data including the bitstream; said bS being set to one of 0, 1 and 2; The bS is set to 2 based on the fact that at least one of the two blocks adjacent to the predetermined length boundary is coded based on an intra prediction mode; the bS is set to 1 based on at least one of the two blocks containing a non-zero transform coefficient, or the two blocks having different reference pictures or different motion vectors; bS is set to 0 based on the fact that the deblocking filtering is not applied; based on bS being greater than 0, the deblocking filtering is performed on luma samples; based on bS being greater than 1, the deblocking filtering is performed on the chrominance samples; A method wherein the length of the deblocking filtering unit boundary is longer than the length of the predetermined length boundary.
Citation Information
Patent Citations
Video encoding method and video encoding apparatus and video decoding method and video decoding apparatus, which perform deblocking filtering based on tree-structure encoding units
WO2011129619A2
Determining boundary strength values for deblocking filtering for video coding
WO2013063117A1