Encoding method, decoding method, encoder, decoder, bitstream, and storage medium
Through the de-blocking filtering method that determines the filter parameters based on the prediction mode, the problem of block effect during the encoding and decoding process is solved and the image quality is improved.
Patent Information
- Application Number
- PCT/CN2024/076981
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-02-08
- Publication Date
- 2025-08-14
AI Technical Summary
During the encoding and decoding process, due to the different encoding methods of adjacent blocks, pixels at the boundary are discontinuous, resulting in block effect. The existing filtering parameters for de-blocking filtering are unreasonable, which reduces the filtering effect.
Based on the prediction mode of the current block and adjacent blocks, reasonable filtering parameters are determined for deblocking filtering. By determining the boundary to be filtered, filtering decisions and filtering operations, the deblocking filtering process is optimized.
The effect of deblocking filtering is improved, the block effect is reduced, and the subjective quality of the image is improved.
Smart Images

Figure CN2024076981_14082025_PF_FP_ABST
Abstract
Description
Coding and decoding method, codec, code stream and storage medium Technical Field
[0001] The present application relates to the field of video coding and decoding technology, and in particular to a coding and decoding method, a codec, a bit stream, and a storage medium. Background Art
[0002] During the encoding and decoding process, adjacent blocks may use different encoding methods, resulting in discontinuities in pixels at their boundaries. This phenomenon is also known as blocking artifacts. Therefore, deblocking filters are required to remove these artifacts. However, the filter parameters used for deblocking filters are sometimes incorrect, reducing their effectiveness.
[0003] Summary of the Invention
[0004] The present application provides a coding and decoding method, a codec, a bit stream, and a storage medium. The following introduces various aspects of the present application.
[0005] In a first aspect, a decoding method is provided, which is applied to a decoder and includes: determining adjacent blocks of a current block; determining a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the adjacent blocks; and performing deblocking filtering on the current block based on the first filtering parameter.
[0006] In a second aspect, a coding method is provided, which is applied to an encoder and includes: determining adjacent blocks of a current block; determining a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the adjacent blocks; and performing deblocking filtering on the current block based on the first filtering parameter.
[0007] In a third aspect, a decoder is provided, comprising: a first determination unit configured to determine adjacent blocks of a current block; a second determination unit configured to determine a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the adjacent blocks; and a filtering unit configured to perform deblocking filtering on the current block based on the first filtering parameter.
[0008] In a fourth aspect, a decoder is provided, comprising: a memory for storing a computer program; and a processor for executing the method of the first aspect when running the computer program.
[0009] In a fifth aspect, an encoder is provided, comprising: a first determination unit configured to determine adjacent blocks of a current block; a second determination unit configured to determine a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the adjacent blocks; and a filtering unit configured to perform deblocking filtering on the current block based on the first filtering parameter.
[0010] In a sixth aspect, an encoder is provided, comprising: a memory for storing a computer program; and a processor for executing the method of the second aspect when running the computer program.
[0011] In a seventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the method of the first aspect or the second aspect is implemented.
[0012] In an eighth aspect, a computer program product is provided, comprising a computer program, which implements the method of the first aspect or the second aspect when the computer program is executed.
[0013] In a ninth aspect, a non-volatile computer-readable storage medium for storing a bit stream is provided, wherein the bit stream is generated by an encoding method of an encoder, or the bit stream is decoded by a decoding method of a decoder, wherein the decoding method is the method described in the first aspect and the encoding method is the method described in the second aspect.
[0014] In a tenth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the method described in the first aspect or the second aspect is implemented.
[0015] According to an eleventh aspect, a code stream is provided, including a code stream generated according to the method described in the second aspect.
[0016] The embodiments of the present application determine the filter parameters corresponding to the deblocking filter based on the prediction mode of the current block and / or adjacent blocks. Since the blocking effect at the boundary between the current block and the adjacent blocks is closely related to the prediction mode of the blocks, the filter parameters determined based on the prediction mode are more reasonable, thereby achieving better filtering effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] FIG1 is a structural diagram illustrating an example of a video encoder to which an embodiment of the present application may be applied.
[0018] FIG2 is a diagram showing an example structure of a video decoder to which an embodiment of the present application can be applied.
[0019] FIG3 is a schematic diagram of a filtering process of deblocking filtering.
[0020] FIG4 is a schematic diagram of a filtering decision process.
[0021] FIG5 is a schematic diagram of pixel relationships at boundary positions.
[0022] FIG6 is a schematic diagram of a DBV search position.
[0023] FIG7 is a schematic diagram of the flip perception process for the DBV mode.
[0024] FIG8 is a schematic diagram of a SAD decision process.
[0025] FIG9 is a schematic diagram of the chrominance prediction process of DBV.
[0026] FIG10 is a schematic diagram of an intra-frame TMP.
[0027] FIG11 is a flow chart of a decoding method provided in an embodiment of the present application.
[0028] FIG12 is a flow chart of the encoding method provided in an embodiment of the present application.
[0029] FIG13 is a diagram showing the effects of filtering based on the solution provided in an embodiment of the present application and based on a traditional solution.
[0030] FIG14 is a diagram showing the effects of filtering based on the solution provided in an embodiment of the present application and based on a traditional solution.
[0031] FIG15 is a diagram showing the effects of filtering based on the solution provided in an embodiment of the present application and based on a traditional solution.
[0032] FIG16 is a schematic diagram of the structure of a decoder provided in one embodiment of the present application.
[0033] FIG17 is a schematic diagram of the structure of a decoder provided in another embodiment of the present application.
[0034] FIG18 is a schematic diagram of the structure of an encoder provided in one embodiment of the present application.
[0035] FIG19 is a schematic diagram of the structure of an encoder provided in another embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solution in this application will be described below with reference to the accompanying drawings.
[0037] FIG1 is a schematic block diagram of a video encoder according to an embodiment of the present application.
[0038] It should be understood that the video encoder 100 can be used to perform lossy compression or lossless compression on an image. The lossless compression can be visually lossless compression or mathematically lossless compression.
[0039] The video encoder 100 can be applied to image data in a luminance and chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents brightness (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) for describing color and saturation. For example, in terms of color format, 4:2:0 means that every 4 pixels have 4 luminance components and 2 chrominance components (YYYYCbCr), 4:2:2 means that every 4 pixels have 4 luminance components and 4 chrominance components (YYYYCbCrCbCr), and 4:4:4 represents full pixel display (YYYYCbCrCbCrCbCrCbCr).
[0040] For example, the video encoder 100 reads video data and, for each image in the video data, divides the image into a number of coding tree units (CTUs). In some examples, a CTU may be referred to as a "tree block," a "largest coding unit" (LCU) or a "coding tree block" (CTB). Each CTU may be associated with a pixel block of equal size within the image. Each pixel may correspond to a luminance (luminance or luma) sample and two chrominance (chroma) samples. Therefore, each CTU may be associated with a luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU may be further divided into a number of coding units (CUs) for encoding. A CU may be a rectangular block or a square block. A CU may correspond to a prediction unit (PU) and a transform unit (TU).
[0041] In some embodiments, as shown in FIG1 , the video encoder 100 may include a prediction module 110, a residual module 120, a transform / quantization module 130, an inverse transform / quantization module 140, a reconstruction module 150, a loop filter module 160, a decoded image buffer 170, and an entropy coding module 180. It should be noted that the video encoder 100 may include more, fewer, or different functional components.
[0042] Optionally, in this application, the current block may be referred to as the current coding unit (CU). The prediction block may also be referred to as a predicted image block or an image prediction block, and the reconstructed image block may also be referred to as a reconstructed block or an image reconstruction block. Due to the need for parallel processing, an image may be divided into slices. Slices in the same image may be processed in parallel, meaning that there is no data dependency between them. The term "frame" is commonly used, and it can generally be understood that a frame is an image. The term "frame" herein may also be replaced by "image" or "slice," etc.
[0043] In some embodiments, the prediction module 110 includes an inter-frame prediction module 111 and an intra-frame prediction module 112. Because there is a strong correlation between adjacent pixels in a video image, intra-frame prediction is used in video coding and decoding technologies to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent images in a video, inter-frame prediction is used in video coding and decoding technologies to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.
[0044] The inter-frame prediction module 111 can be used for inter-frame prediction. Inter-frame prediction can include motion estimation and motion compensation. It can refer to image information from different images. Inter-frame prediction uses motion information to find a reference block from a reference image and generate a prediction block based on the reference block to eliminate temporal redundancy. Inter-frame prediction uses motion information to find a reference block from a reference image and generate a prediction block based on the reference block. Motion information includes the reference image list in which the reference image is located, the reference image index, and the motion vector. The motion vector can be integer pixel or fractional pixel. If the motion vector is fractional pixel, interpolation filtering is required to generate the required fractional pixel block in the reference image. Here, the integer pixel or fractional pixel block in the reference image found based on the motion vector is called a reference block. Some technologies directly use the reference block as the prediction block, while others further process the reference block to generate a prediction block. Reprocessing the reference block to generate a prediction block can also be understood as using the reference block as the prediction block and then processing the prediction block to generate a new prediction block.
[0045] The intra-frame prediction module 112 only refers to information of the same image to predict pixel information within the current image block to eliminate spatial redundancy.
[0046] Intra-frame prediction has multiple prediction modes. For example, the H-series international digital video coding standard H.264 / AVC has eight angular prediction modes and one non-angular prediction mode. H.265 / HEVC expands this to 33 angular prediction modes and two non-angular prediction modes. High-efficiency video coding (HEVC) uses planar, direct current (DC), and 33 angular modes for a total of 35 intra-frame prediction modes. Versatile video coding (VVC) uses planar, DC, and 65 angular modes for a total of 67 intra-frame prediction modes.
[0047] It should be noted that with the increase of angle modes, intra-frame prediction will be more accurate and more in line with the needs of high-definition and ultra-high-definition digital video development.
[0048] Residual module 120 may generate a residual block for a CU based on the pixel block of the CU and the prediction block of the CU. For example, residual module 120 may generate a residual block for the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the CU.
[0049] The transform / quantization module 130 may quantize the transform coefficients. The transform / quantization module 130 may quantize the transform coefficients associated with the CU based on a quantization parameter (QP) value associated with the CU. The video encoder 100 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.
[0050] The inverse transform / quantization module 140 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.
[0051] Reconstruction module 150 can add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction module 110 to generate a reconstructed image block associated with the CU. By reconstructing each sample block of the CU in this manner, video encoder 100 can reconstruct the pixel blocks of the CU.
[0052] The loop filter module 160 is used to process the inverse transformed and inverse quantized pixels to compensate for distortion information and provide a better reference for subsequent pixel encoding. For example, it can perform a deblocking filtering operation to reduce the blocking effect of pixel blocks associated with the CU.
[0053] In some embodiments, the loop filtering module 160 includes a deblocking filtering module and a sample adaptive offset / adaptive loop filtering (SAO / ALF) module, wherein the deblocking filtering module is used to remove blocking effects, and the SAO / ALF module is used to remove ringing effects.
[0054] The decoded image buffer 170 may store the reconstructed pixel blocks. The inter prediction module 111 may use a reference image containing the reconstructed pixel blocks to perform inter prediction on PUs of other images. In addition, the intra prediction module 112 may use the reconstructed pixel blocks in the decoded image buffer 170 to perform intra prediction on other PUs in the same image as the CU.
[0055] The entropy encoding module 180 may receive the quantized transform coefficients from the transform / quantization module 130. The entropy encoding module 180 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy-encoded data.
[0056] FIG2 is a schematic block diagram of a video decoder according to an embodiment of the present application.
[0057] 2 , video decoder 200 includes an entropy decoding module 210, a prediction module 220, an inverse quantization / transformation module 230, a reconstruction module 240, a loop filter module 250, and a decoded image buffer 260. It should be noted that video decoder 200 may include more, fewer, or different functional components.
[0058] The video decoder 200 may receive a bitstream. The entropy decoding module 210 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding module 210 may parse the entropy-encoded syntax elements in the bitstream. The prediction module 220, the inverse quantization / transformation module 230, the reconstruction module 240, and the loop filter module 250 may decode the video data based on the syntax elements extracted from the bitstream, thereby generating decoded video data.
[0059] In some embodiments, the prediction module 220 includes an intra-frame prediction module 222 and an inter-frame prediction module 221 .
[0060] The intra prediction module 222 may perform intra prediction to generate a prediction block for a PU. The intra prediction module 222 may use an intra prediction mode to generate a prediction block for the PU based on pixel blocks of spatially neighboring PUs. The intra prediction module 222 may also determine the intra prediction mode for the PU based on one or more syntax elements parsed from the codestream.
[0061] The inter-frame prediction module 221 may construct a first reference picture list (List 0) and a second reference picture list (List 1) based on syntax elements parsed from the codestream. Furthermore, if a PU is encoded using inter-frame prediction, the entropy decoding module 210 may parse the motion information of the PU. The inter-frame prediction module 221 may determine one or more reference blocks for the PU based on the motion information of the PU. The inter-frame prediction module 221 may generate a prediction block for the PU based on the one or more reference blocks of the PU.
[0062] The inverse quantization / transform module 230 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU. The inverse quantization / transform module 230 may use the QP value associated with the CU of the TU to determine the degree of quantization.
[0063] After inverse quantizing the transform coefficients, inverse quantization / transform module 230 may apply one or more inverse transforms to the inverse quantized transform coefficients in order to generate a residual block associated with the TU.
[0064] Reconstruction module 240 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, reconstruction module 240 can add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.
[0065] The loop filtering module 250 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.
[0066] The video decoder 200 may store the reconstructed image of the CU in the decoded image buffer 260. The video decoder 200 may use the reconstructed image in the decoded image buffer 260 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
[0067] The basic process of video encoding and decoding is as follows: At the encoder end, an image is divided into blocks. For the current block, the prediction module 110 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block. The residual module 120 calculates a residual block based on the predicted block and the original block of the current block. This residual block is the difference between the predicted block and the original block of the current block. This residual block can also be referred to as residual information. This residual block undergoes transformation and quantization by the transform / quantization module 130, removing information that is insensitive to the human eye and eliminating visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization module 130 can be referred to as a time-domain residual block, and the time-domain residual block after transformation and quantization by the transform / quantization module 130 can be referred to as a frequency residual block or a frequency-domain residual block. The entropy coding module 180 receives the quantized transform coefficients output by the transform / quantization module 130 and performs entropy coding on these quantized transform coefficients to output a bitstream. For example, the entropy coding module 180 can eliminate character redundancy based on the target context model and probability information of the binary bitstream.
[0068] At the decoding end, the entropy decoding module 210 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block. The prediction module 220 uses intra-frame prediction or inter-frame prediction on the current block based on the prediction information to generate a prediction block for the current block. The inverse quantization / transformation module 230 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction module 240 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the loop filtering module 250 performs loop filtering on the reconstructed image based on the image or block to obtain a decoded image. The encoding end also requires similar operations as the decoding end to obtain a decoded image. The decoded image can also be called a reconstructed image, and the reconstructed image can be used as a reference image for inter-frame prediction of subsequent images.
[0069] It should be noted that the block division information determined by the encoder, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and analyzes the existing information to determine the same block division information, prediction, transform, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder, thereby ensuring that the decoded image obtained by the encoder and the decoder are identical.
[0070] It is understandable that the "inverse transformation" of the transform coefficients at the decoding end may also be referred to as "transformation" in the standard text. The "transformation" and "inverse transformation" in the embodiments of the present application correspond to two opposite processes. For example, if the "transformation" converts the numerical values in the spatial domain to the coefficients in the frequency domain, then the "inverse transformation" converts the coefficients in the frequency domain to the numerical values in the spatial domain. If the standard only stipulates decoding, then the "transformation" in the standard text is the decoding part, which refers to the "inverse transformation" in this article. The "inverse transformation" of the transform coefficients at the decoding end may also be referred to as "transformation" in the standard text.
[0071] The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. This application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.
[0072] The preceding text describes in detail the codec framework provided by the embodiments of this application. This application relates to filtering technology. This filtering technology can be applied to the loop filtering module in the codec framework. The filtering technology involved in this application is introduced below.
[0073] During the encoding process, the transform and quantization processes for each block are performed independently. Furthermore, in motion-compensated prediction, the predicted values for adjacent blocks come from different locations in different images. Consequently, distinct discontinuous pixels appear at block boundaries, severely impacting the subjective quality of the image. This phenomenon is also known as blocking artifacts. The deblocking filter module (also known as the deblocking filter module) can remove these blocking artifacts. The following describes the deblocking filtering process, which applies equally to both the decoder and encoder.
[0074] As shown in Figure 3, the deblocking filtering process includes three steps: determining the boundary to be filtered (S310), filtering decision (S320), and filtering operation (S330). Before determining the boundary to be filtered, a pre-filtering reconstruction operation can also be performed. After performing the filtering operation, a post-filtering reconstruction operation can also be performed.
[0075] Get the boundary to be filtered
[0076] When filtering, first determine the boundaries to be filtered to ensure that the deblocking filter process can be applied to all sub-block boundaries and CU boundaries. However, the following exceptions are made:
[0077] (1) The boundary of the entire image;
[0078] (2) When sps_loop_filter_across_subpic_enabled_flag is 0, it cannot be applied to sub-block boundaries;
[0079] (3) When VirtualBoundariesPresentFlag is 1, it cannot be applied to virtual boundaries;
[0080] (4) When pps_loop_filter_across_tiles_enabled_flag is 0, it cannot be applied to Tile boundaries;
[0081] (5) When pps_loop_filter_across_slices_enabled_flag is equal to 0, it cannot be applied to the Silce boundary;
[0082] (6) When sh_deblocking_filter_disabled_flag equals 1, it cannot be applied to the upper boundary, left boundary and all boundaries inside the slice;
[0083] (7) The luminance component is not applied to the 4×4 pixel grid boundary;
[0084] (8) The chroma components are not applied to the 8×8 pixel grid boundaries;
[0085] (9) No filtering is performed on the boundaries where intra_bdpcm_luma_flag equal to 1 is set on both sides of the luminance component;
[0086] (10) No filtering is performed on the boundaries where intra_bdpcm_chroma_flag equals 1 on both sides of the chroma component;
[0087] (11) Chroma subblock boundary and the boundary is not the boundary of the related transform block.
[0088] Filtering Decision
[0089] Filtering decision-making involves determining the maximum filter length, boundary filter strength (BS), and filter parameters for all CUs, TUs, and sub-block boundaries that meet the filtering conditions, based on the video content and encoding parameters, and thus selecting the appropriate filter strength. As shown in Figure 4, the filtering decision process can include obtaining the maximum filter length (S322), obtaining the boundary filter strength (S324), and selecting the filter strength (S326). The following describes these three processes separately.
[0090] Get the maximum filter length
[0091] The maximum filter length is obtained by preliminarily determining the maximum number of pixels that can be modified in each row and / or the maximum number of pixels that can be modified in each column of adjacent blocks based on the size of the CU, the size of the sub-block, and the distance between the sub-block and the CU boundary. The pixel positions at the block boundary are shown in Figure 5. The P block and Q block are 4×4 blocks on both sides of the boundary. For vertical boundaries, the P block represents the block on the left side of the boundary, and the Q block represents the block on the right side of the boundary. For horizontal boundaries, the P block represents the block on the upper side of the boundary, and the Q block represents the block on the lower side of the boundary. The number of pixels filtered in each row (or column) within the P block and Q block is called the filter length. The filter length corresponding to the P block is denoted as SP, and the filter length corresponding to the Q block is denoted as SQ. SP and SQ can be determined based on the size of the CU, the size of the sub-block, and the distance between the sub-block and the CU boundary.
[0092] For the luma component, the initial values of SP and SQ are set as follows:
[0093] (1) If the CU or TU boundary size (the number of pixels from the CU or TU boundary to the block boundary) is greater than or equal to 32, the values of SP and SQ are set to 7;
[0094] (2) If the CU or TU boundary size is less than or equal to 4, the SP and SQ values are set to 1;
[0095] (3) In other cases, the SP and SQ values are set to 3;
[0096] If a CU contains sub-blocks, then:
[0097] If the CU boundary is 8 pixels away from the sub-block boundary, the SQ value of the CU boundary is limited to less than or equal to 5; if the inter_affine_flag or merge_subblock_flag of the left CU or the upper CU of the CU is 1, the SP value of the CU boundary is limited to less than or equal to 5; the SP and SQ values of the TU boundary are limited to less than or equal to 5.
[0098] The SP and SQ values at the sub-block boundary are:
[0099] (1) If the sub-block boundary is 8 pixels away from the CU or TU boundary, the SP and SQ values are limited to less than or equal to 2.
[0100] (2) If the sub-block boundary is 4 pixels away from the CU or TU boundary, the SP and SQ values are set to 1.
[0101] (3) In other cases, the SP and SQ values are set to 3.
[0102] Above the horizontal boundary of the CTU, the SP is limited to less than or equal to 3. When the maximum filter length is greater than 3, the current block is marked as a large block, that is, the flag sidePisLargeBlk or sideQisLargeBlk is set to 1. When making switching decisions for large blocks, more boundary pixels are considered.
[0103] The initial values of the filter lengths SP and SQ of the chrominance components are set to:
[0104] (1) If the CU or TU block boundary size is greater than or equal to 8 pixels, the SP and SQ values are set to 3;
[0105] (2) In other cases, the SP and SQ values are set to 1;
[0106] (3) Above the horizontal boundary of the CTU, the SP is limited to be less than or equal to 1.
[0107] Get the filter strength of the boundary
[0108] The filtering strength of the boundary can also be called the boundary strength. Obtaining the boundary strength is to preliminarily judge whether the block boundary needs filtering and the filtering parameters based on the coding parameters of the boundary block. Since adjacent blocks are encoded using different coding parameters (such as different prediction methods, different reference images, different motion vectors, etc.), it is easy to cause discontinuity of pixel values at the block boundary, resulting in block effects. After obtaining the boundary strength module, all boundaries allowed to be filtered obtain boundary strength (boundary strength, BS), and the boundary strength value is 0, 1 or 2. When the boundary strength value is 0, it means that the boundary does not need to be filtered, and no subsequent processing (such as filter strength selection and filtering operation) will be performed. When the boundary strength value is 1 or 2, subsequent module processing will be performed, and its value will affect the threshold in the subsequent "filter strength selection".
[0109] The inputs and outputs of the boundary strength module are as follows:
[0110] Input: reconstructed image recPicture before deblocking filter (DBF);
[0111] The position of the upper left corner of the current CU relative to the upper left corner of the image (xCb, yCb);
[0112] The width of the current CU is nCbW, and the height of the current CU is nCbH;
[0113] Edge type edgeType, specifies whether the current edge is a vertical edge (EDGE_VER, edgeType = 0) or a horizontal edge (EDGE_HOR, edgeType = 1) to be filtered;
[0114] The variable cIdx indicates the color component of the current CU;
[0115] A two-dimensional array edgeIdc of size (nCbW) x (nCbH) indicating whether the boundary is a transform block boundary or a sub-block boundary.
[0116] Output: The output of this process is a two-dimensional array bS that stores the boundary filter strength, with an array size of (nCbW)x(nCbH).
[0117] The process of obtaining boundary strength is described in detail below.
[0118] Set gridSize=cIdx==0?4:8.
[0119] Set xN and yN: When edgeType is EDGE_VER, set xN = Max(0, (nCbW / gridSize)-1), yN = cIdx == 0? (nCbH / 4)-1:(nCbH / 2)-1; when edgeType is EDGE_HOR, set xN = cIdx == 0? (nCbW / 4)-1:(nCbW / 2)-1, yN = Max(0, (nCbH / gridSize)-1).
[0120] Set xDi (i=0..xN) and yDj (j=0..yN): When edgeType is EDGE_VER, set xDi=(i*gridSize), yDj=cIdx==0?(j<<2):(j<<1); when edgeType is EDGE_HOR, set xDi=cIdx==0?(i<<2):(i<<1), yDj=j*gridSize.
[0121] The boundary strength is obtained for all boundaries at xDi (i=0..xN) and yDj (j=0..yN). The order of acquisition is as follows:
[0122] (1) If edgeIdc[xDi][yDj] is 0, the boundary strength bS[xDi][yDj] is set to 0.
[0123] (2) If the virtual boundary VirtualBoundariesPresentFlag is 1 and the boundary (xCb+xDi) or (yCb+yDj) is on the virtual boundary, bS[xDi][yDj] is set to 0.
[0124] (3) In other cases, the acquisition order is as follows:
[0125] Set p0 and q0 to the pixels at the boundary. For a vertical boundary, p0 is the pixel on the left side of the boundary, that is, recPicture[xCb+xDi-1][yCb+yDj], and q0 is the pixel on the right side of the boundary, that is, recPicture[xCb+xDi][yCb+yDj]. For a horizontal boundary, p0 is the pixel on the upper side of the boundary, that is, recPicture[xCb+xDi][yCb+yDj-1], and q0 is the pixel on the lower side of the boundary, that is, recPicture[xCb+xDi][yCb+yDj].
[0126] ① For the luminance component, the intra_bdpcm_luma_flag of the CU at the p0 position and the CU at the q0 position is 1, and bS[xDi][yDj] is set to 0; for the chrominance component, the intra_bdpcm_chroma_flag of the CU at the p0 position and the CU at the q0 position is 1, and bS[xDi][yDj] is set to 0.
[0127] ②The encoding mode CuPredMode[cIdx==0?0:1][x0][y0] of the CU corresponding to the p0 position is MODE_INTRA or the encoding mode CuPredMode[cIdx==0?0:1][x1][y1] of the CU corresponding to the q0 position is MODE_INTRA, bS[xDi][yDj] is set to 2, where (x0, y0) is the upper left corner sample position of the CU corresponding to the p0 position, and (x1, y1) is the upper left corner sample position of the CU corresponding to the q0 position.
[0128] ③The ciip_flag of the corresponding CU at the p0 or q0 position is equal to 1, and bS[xDi][yDj] is set to 2.
[0129] ④ The gpm_intra_Flag of the CU corresponding to the p0 or q0 position is equal to 1, and the sub-block corresponding to the p0 or q0 position is not predicted by the inter-frame mode, and bS[xDi][yDj] is set to 2.
[0130] ⑤ Boundary is the transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
[0131] a) When cIdx is 0, the sum of tu_y_coded_flag[x0][y0] and tu_y_coded_flag[x1][y1] is greater than 0, where (x0, y0) is the top-left corner sample position of the luma transform block at position p0, and (x1, y1) is the top-left corner sample position of the luma transform block at position q0. This means that there is at least one non-zero transform coefficient for the luma component.
[0132] b) When cIdx is 1, the sum of tu_cb_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cb_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the upper-left sample of the Cb component transform block at position p0, and (x1, y1) is the luma position corresponding to the upper-left sample of the Cb component transform block at position q0. That is, there is at least one non-zero transform coefficient of the Cb component.
[0133] c) When cIdx is 2, the sum of tu_cr_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cr_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the upper-left sample of the Cr component transform block at position p0, and (x1, y1) is the luma position corresponding to the upper-left sample of the Cr component transform block at position q0. That is, there is at least one non-zero Cr component transform coefficient.
[0134] ⑥cIdx is equal to 0, edgeIdc[xDi][yDj] is equal to 2, that is, the boundary is the predicted sub-block boundary. When one or more of the following conditions are met, bS[xDi][yDj] is set to 1:
[0135] a) The prediction mode CuPredMode[cIdx==0?0:1][xp0][yp0] of the sub-block at position p0 is different from the prediction mode CuPredMode[cIdx==0?0:1][xq0][yq0] of the sub-block at position q0, where (xp0, yp0) is the luminance position corresponding to the upper left sample of the sub-block at position p0, and (xq0, yq0) is the luminance position corresponding to the upper left sample of the sub-block at position q0.
[0136] b) The prediction mode of the sub-block at position p0 and the prediction mode of the sub-block at position q0 both adopt the intra block copy (IBC) mode, and the horizontal or vertical absolute difference of the motion vector is greater than or equal to half a pixel.
[0137] c) The prediction of the sub-block at the p0 position uses a different reference picture or a different number of motion vectors than the prediction of the sub-block at the q0 position.
[0138] Note 1: Whether the reference pictures used by two coding sub-blocks are the same is determined only based on which pictures are referenced, regardless of whether the prediction uses the index of the reference picture list RPL_0 or the index of RPL_1, and regardless of whether the position of the index within the reference picture list RPL is different.
[0139] Note 2: The number of coded sub-block motion vectors is PredFlagL0[xSb][ySb]+PredFlagL1[xSb][ySb], where (xSb, ySb) represents the position of the upper left corner sample of the sub-block, and PredFlagL0 and PredFlagL1 are flags for using the prediction list.
[0140] Note 3: The reference picture and motion vector used to predict the sub-block containing the sample at position (xS, yS) are RefPicList[X][RefIdxLX[xS][yS]] and MvLX[xS][yS] respectively. The reference picture and motion vector may be different from the reference picture and motion vector in sub-pixel interpolation.
[0141] d) The number of motion vectors of the sub-block at position p0 and the number of motion vectors of the sub-block at position q0 are both 1, and the horizontal or vertical absolute difference between the two motion vectors is greater than or equal to half a pixel.
[0142] e) The sub-block at position p0 and the sub-block at position q0 both use two motion vectors and two different reference images, and the sub-block at position q0 uses the same two reference images as the sub-block at position p0, and the absolute difference in the horizontal or vertical direction between the motion vector used by the sub-block at position p0 and the motion vector used by the sub-block at position q0 in the same reference image is greater than or equal to half a pixel.
[0143] f) The sub-block at position p0 uses two motion vectors from a reference picture, and the sub-block at position q0 uses two motion vectors from the same reference picture, and both of the following conditions are true:
[0144] -The sub-block at position p0 and the sub-block at position q0 are both predicted using the motion vectors in list 0, and the horizontal or vertical absolute difference of the motion vectors is greater than or equal to half a pixel, or the sub-block at position p0 and the sub-block at position q0 are both predicted using the motion vectors in list 1, and the horizontal or vertical absolute difference of the motion vectors is greater than or equal to half a pixel;
[0145] -The sub-block at position p0 is predicted using the motion vector of list 0, the sub-block at position q0 is predicted using the motion vector of list 1, and the horizontal or vertical absolute difference of the motion vector is greater than or equal to half a pixel; or the sub-block at position p0 is predicted using the motion vector of list 1, the sub-block at position q0 is predicted using the motion vector of list 0, and the horizontal or vertical absolute difference of the motion vector is greater than or equal to half a pixel.
[0146] ⑦ Otherwise, the boundary intensities of the luma and chroma components are set to 0.
[0147] For example, if a P block or a Q block uses intra-frame coding, the above process will proceed to operation step ②, and the determined BS value is 2. If the P block and the Q block have non-zero coefficients, the determined BS value is 1. If the P block and the Q block use different reference frames, the determined BS value is 1. If the number of motion vectors in the P block is different from the number of motion vectors in the Q block, the determined BS value is 1.
[0148] Compared with the inter-frame coding and IBC coding methods, the discontinuity of pixels at the boundaries of blocks encoded using the intra-frame coding method is more obvious. Therefore, the BS value corresponding to the coding block using the intra-frame coding method is higher.
[0149] Filter strength selection
[0150] The filter strength selection further analyzes the video content, primarily based on the changes in pixel values within blocks on both sides of the boundary and the encoding parameters (quantization parameters) to determine whether the boundary requires filtering. Discontinuous block boundaries in flat areas are the target of filtering. The need for filtering and the appropriate filter strength are further determined based on the video content (changes in pixel values at block boundaries and within blocks) and encoding parameters (quantization parameters). Discontinuities in boundaries can also be caused by the video content itself.
[0151] First, set qj,k and pi,k. When edgeType is EDGE_VER, qj,k = recPicture[xCb+xBl+j][yCb+yBl+k], pi,k = recPicture[xCb+xBl-i-1][yCb+yBl+k]; when edgeType is EDGE_HOR, qj,k = recPicture[xCb+xBl+k][yCb+yBl+j], pi,k = recPicture[xCb+xBl+k][yCb+yBl-i-1].
[0152] In some codecs (such as H.266 / VVC), a luma-adaptive deblocking filter (ladf) has been added. This technology adds an offset (qpOffset) to the QPA based on the average luminance level (LumaLevel) of the reconstructed pixels to adjust the deblocking filter strength. This is used to compensate for the distortion introduced by using nonlinear transfer functions (such as the optoelectronic transfer function (EOTF)) in the linear light domain.
[0153] When sps_ladf_enabled_flag is 1, set lumaLevel = ((p0,0+p0,3+q0,0+q0,3)>>2, set qpOffset to sps_ladf_lowest_interval_qp_offset and modify as follows:
[0154] When sps_ladf_enabled_flag is 0, qpOffset is set to 0.
[0155] Set qP=((QpQ+QpP+1)>>1)+qpOffset, where QpP is the quantization parameter of the P block and QpQ is the quantization parameter of the Q block.
[0156] Set the filter on / off threshold β. The value of β is related to the pixel values of the blocks on both sides of the boundary and the quantization parameter Q. Set Q = Clip3(0, 63, qP + (sh_luma_beta_offset_div2 << 1)). From Table 1, we can find β′ based on the value of Q. Therefore, the on / off threshold β is set to β = β′ * (1 << (BitDepth - 8)).
[0157] Set the decision threshold tC for pixel value differences at the filter boundary. The value of threshold tC is related to the quantization parameter. Set Q = Clip3(0, 65, qP + 2*(bS-1) + (sh_luma_tc_offset_div2<<1)). According to Table 1, tC′ can be obtained based on the value of Q. Therefore, the intensity threshold tC is set to: when the encoding bit depth is less than 10, tC = (tC′ + (1<<(9-BitDepth)))>>(10-BitDepth); when the encoding bit depth is greater than or equal to 10, tC = tC′*(1<<(BitDepth-10)).
[0158] For block boundaries with boundary strength greater than 0, the filter strength selection module determines the content characteristics of the boundary area based on the degree of change in pixel values within the boundary block. Based on the content characteristics of the boundary area, it then determines whether filtering is required and further selects the filtering strength. Filtering strength is divided into no filtering, short tap filtering, and long tap filtering. Short tap filtering is further divided into strong filtering and weak filtering. In other words, the filtering strength can include no filtering, short tap strong filtering, short tap weak filtering, and long tap filtering.
[0159] Table 1. Relationship between threshold variables β′, tC′ and variable Q
[0160] Filtering operation
[0161] According to the luminance component type, chrominance component type and the result of filtering decision, the filtering operation includes 5 types: long tap filtering of luminance component, short tap strong filtering of luminance component, short tap weak filtering of luminance component, strong filtering of chrominance component, and weak filtering of chrominance component.
[0162] For the filtering operation, its input and output are as follows.
[0163] enter:
[0164] The reconstructed image recPicture before filtering;
[0165] The position of the upper left corner of the current CU relative to the upper left corner of the image (xCb, yCb);
[0166] The position of the upper left corner of the current filtering block relative to the position of the upper left corner of the current coding block (xBl, yBl);
[0167] Edge type edgeType, specifies whether the current edge is a vertical edge (EDGE_VER, edgeType = 0) or a horizontal edge (EDGE_HOR, edgeType = 1) to be filtered;
[0168] The variables dE, dEp, and dEq are the filtering decision results;
[0169] Variables maxFilterLengthP and maxFilterLengthQ are the maximum filter lengths;
[0170] Threshold tC.
[0171] The output is the modified reconstructed image recPicture.
[0172] For the brightness component, take edgeType equal to EDGE_VER as an example, and perform the following steps in sequence:
[0173] ① The pixel values pi,k and qj,k, where i = 0..maxFilterLengthP, j = 0..maxFilterLengthQ, k = 0..3 are set to:
[0174] qj,k=recPicture[xCb+xBl+j][yCb+yBl+k]
[0175] pi,k=recPicture[xCb+xBl-i-1][yCb+yBl+k]
[0176] ② When dE is not equal to 0 and dE is not equal to 3, for each sample position (xCb+xBl,yCb+yBl+k), k=0..3, perform the following steps in sequence:
[0177] a. Perform short-tap filtering on the luminance component, including short-tap strong filtering on the luminance component and short-tap weak filtering on the luminance component, and output the filtered samples pi′ and qj′.
[0178] b. When the number of filtered samples nDp is greater than 0, replace the samples at the corresponding positions in the reconstructed image with the filtered samples pi′, i = 0..nDp–1: recPicture[xCb+xBl-i-1][yCb+yBl+k] = pi′.
[0179] c. When the number of filtered samples nDq is greater than 0, replace the samples at the corresponding positions in the reconstructed image with the filtered samples qj′, j = 0..nDq–1: recPicture[xCb+xBl+j][yCb+yBl+k] = qj′.
[0180] ③ When dE is equal to 3, for each sample position (xCb+xBl, yCb+yBl+k), k=0..3, perform the following steps in sequence:
[0181] a. Perform long tap filtering on the luminance component and output the filtered samples pi′ and qj′.
[0182] b. Replace the samples at the corresponding positions in the reconstructed image with the filtered samples pi′, i = 0..maxFilterLengthP–1: recPicture[xCb+xBl-i-1][yCb+yBl+k] = pi′.
[0183] c. Replace the samples at the corresponding positions in the reconstructed image with the filtered samples qj′, j=0..maxFilterLengthQ–1: recPicture[xCb+xBl+j][yCb+yBl+k]=qj′.
[0184] For the chroma component, first set the variable maxK.
[0185] For edgeType equal to EDGE_VER: maxK=(SubHeightC==1)? 3:1
[0186] For edgeType equal to EDGE_HOR: maxK=(SubWidthC==1)?3:1
[0187] Then set the sample values pi,k and qj,k where i = 0..maxFilterLengthP, j = 0..maxFilterLengthQ, k = 0..3:
[0188] For edgeType equal to EDGE_VER:
[0189] qj,k=recPicture[xCb+xBl+j][yCb+yBl+k]
[0190] pi,k=recPicture[xCb+xBl-i-1][yCb+yBl+k]
[0191] For edgeType equal to EDGE_HOR:
[0192] qj,k=recPicture[xCb+xBl+k][yCb+yBl+j]
[0193] pi,k=recPicture[xCb+xBl+k][yCb+yBl-i-1]
[0194] Taking edgeType equal to EDGE_VER as an example, for each sample position (xCb+xBl, yCb+yBl+k), k=0..maxK, perform the following steps in sequence:
[0195] a. Perform chroma component filtering, including strong filtering and weak filtering of chroma components, and output filtered samples pi′ and qj′, where i = 0..maxFilterLengthP–1, j = 0..maxFilterLengthQ–1.
[0196] b. Replace the samples at the corresponding positions in the reconstructed image with the filtered samples pi′ and qj′, i = 0..maxFilterLengthP–1, j = 0..maxFilterLengthQ-1: recPicture[xCb+xBl+j][yCb+yBl+k] = qj′ recPicture[xCb+xBl-i-1][yCb+yBl+k] = pi′.
[0197] The following describes four prediction modes: direct block vector (DBV), intra template matching prediction (IntraTMP), combined intra block copy and intra prediction (IBC-CIIP), and intra block copy with geometry partitioning (IBC-GPM). Different modes require different methods for determining the BS.
[0198] DBV mode
[0199] The DBV mode predefines five locations in the co-located luma region corresponding to the current chroma block, as shown in Figure 6. These five locations are searched sequentially to determine whether the corresponding luma block is in IBC mode or IntraTMP mode. If the corresponding luma block is in IBC mode or IntraTMP mode, its luma BV (i.e., luma bvL) is obtained. If flipping is present, perceptual adjustment is performed to obtain bvL', which is then scaled and the scaled BV (i.e., chroma bvC) is determined to be usable for chroma.
[0200] Taking Figure 7 as an example, the flip perception process is as follows:
[0201] Perform flip perception on the acquired luminance bvL to obtain bvL'. Assume that the luminance bvL is obtained from the TL position of the co-located luminance region of the current chrominance block. For example, horizontal flipping: the center coordinates of the luminance block at the TL position are (Refx, Refy), and the center coordinates of the co-located luminance region of the current chrominance block are (Curx, Cury). bvL = (bvLhor, 0) bvL' = (bvLhor + 2*(Refx - Curx), 0)
[0202] The scaling process is as follows:
[0203] Scale the brightness bvL' to get bvC. Taking YUV420 format as an example: bvL'=(bvLhor,bvLver) bvC=(bvLhor>>1,bvLver>>1)
[0204] Taking Figure 8 as an example, the following method can be used to correct bvC and obtain the chrominance bvC candidates in the following way: bvC0=(bvLhor>>1,bvLver>>1) bvC1=((bvLhor+1)>>1,bvLver>>1) bvC2=(bvLhor>>1,(bvLver+1)>>1) bvC3=((bvLhor+1)>>1,(bvLver+1)>>1)
[0205] The sum of absolute differences (SAD) between the reconstructed chroma values of the templates of the reference blocks pointed to by these chroma bvC candidates and the reconstructed chroma values of the template of the current chroma block are calculated. The SADs of these candidates are compared, and the bvC candidate with the smallest SAD is used as the BV for the chroma BV prediction process. This decision-making process is performed by both the codec and the encoder, and does not require the transmission of signaling identifiers.
[0206] Through the above process, after obtaining the first available chroma bvC, BV prediction is performed on the current chroma block, that is, the position of the current chroma block (xCb, yCb) and its corresponding bvC is obtained, thereby deriving the corresponding offset position (xCb+bvC[0], yCb+bvC[1]) to perform block copy prediction, as shown in Figure 9.
[0207] The DBV mode is suitable for scenes where luma and chroma are partitioned together, that is, the DBV mode is suitable for scenes with single tree partitioning. By pre-defining the co-located luma block corresponding to the current chroma block, it is determined whether the corresponding luma block is in IntraTMP mode. If so, its luma bvL is obtained, the chroma sampling format is scaled, and the scaled BV (i.e., chroma bvC) is determined to be available for chroma. If available, block copy prediction is performed.
[0208] For DBV mode, the following steps can be used to obtain the filter strength of the boundary:
[0209] ① For the chroma component, the intra_bdpcm_chroma_flag of the CU at the p0 position and the CU at the q0 position are both 1, and bS[xDi][yDj] is set to 0.
[0210] ② Otherwise, the coding mode CuPredMode[cIdx==0?0:1][x0][y0] of the CU corresponding to position p0 is MODE_INTRA or the coding mode CuPredMode[cIdx==0?0:1][x1][y1] of the CU corresponding to position q0 is MODE_INTRA, and bS[xDi][yDj] is set to 2, where (x0, y0) is the top left corner sample position of the CU corresponding to position p0, and (x1, y1) is the top left corner sample position of the CU corresponding to position q0. The variable cIdx indicates the color component of the current CU.
[0211] Since the DBV mode is a prediction mode for chroma blocks, currently the DBV mode is only studied for the filtering intensity process of obtaining the boundary of the chroma component.
[0212] IntraTMP mode
[0213] IntraTMP mode is a special intra-frame prediction mode that copies the best prediction block from the reconstructed portion of the current frame, whose L-shaped template matches the current template. For a predefined search range, the encoder searches for the template most similar to the current template in the reconstructed portion of the current frame and uses the corresponding block as the prediction block. The encoder identifies the use of this mode with syntax elements, and the same prediction operation is performed on the decoder side.
[0214] The prediction is generated by matching the current block's L-shaped, top-only, or left-only neighbors against another block in predefined search regions in Figure 10. There are six predefined search regions, R1 to R6 in Figure 10, which contain reconstructed samples from the top and left CTUs, as well as partial reconstructed samples within the current CTU located above, to the left, below, and above the current block. The sum of absolute differences (SAD) is used as the cost function. A given search order is used for the six regions: R4, R5, R6, R1, R2, and R3. Within each region, the decoder constructs a candidate list of up to 19 template matching block vectors, sorted in ascending order by template cost (SAD). The dimensions of all regions (SearchRange_w, SearchRange_h) are set proportional to the block dimensions (BlkW, BlkH) to ensure a fixed number of SAD comparisons per pixel. That is: SearchRange_w = minimum (64, a*BlkW) SearchRange_h = minimum (64, a*BlkH)
[0215] Where "a" is a constant that controls the gain / complexity tradeoff. In the current version, "a" is equal to 5.
[0216] IntraTMP mode supports the following modes:
[0217] Single prediction: Selects a single block vector prediction from a candidate list.
[0218] Fusion of multiple predictions: Multiple block vector predictions are mixed to obtain the final prediction block. The blending weights are calculated based on the template matching cost of each prediction, or using a weight derivation method based on the Wiener filter.
[0219] Sub-pixel precision: When using a single block vector prediction, sub-pixel precision is available for 1 / 2 pixel accuracy, 1 / 4 pixel accuracy, and 3 / 4 pixel accuracy, each with 8 possible directions.
[0220] Linear filter model: A linear filter can be fitted between the reference template and the current template, and the linear model is applied to the reference block. This mode can be used for prediction when sub-pixel accuracy is not used.
[0221] To speed up the template matching process, the search range of all search areas is subsampled by a factor of 3. After the best match is found, a refinement process is performed. This refinement is done by performing a second template matching search with a narrowed range around the best match.
[0222] The template matching tool works on CUs with width and height less than or equal to 64. The maximum CU size for template matching is configurable.
[0223] For the IntraTMP mode, the following steps can be used to obtain the filter strength of the boundary:
[0224] ① For the luminance component, the intra_bdpcm_luma_flag of the CU at the p0 position and the CU at the q0 position are both 1, and bS[xDi][yDj] is set to 0.
[0225] ② Otherwise, the coding mode CuPredMode[cIdx==0?0:1][x0][y0] of the CU corresponding to position p0 is MODE_INTRA or the coding mode CuPredMode[cIdx==0?0:1][x1][y1] of the CU corresponding to position q0 is MODE_INTRA, and bS[xDi][yDj] is set to 2, where (x0, y0) is the top left corner sample position of the CU corresponding to position p0, and (x1, y1) is the top left corner sample position of the CU corresponding to position q0. The variable cIdx indicates the color component of the current CU.
[0226] IBC-CIIP model
[0227] The IBC-CIIP mode is a coding tool for CU, which uses IBC and intra-frame prediction to obtain two prediction signals and performs weighted summation on the two prediction blocks to generate the following final prediction block: P = (w ibc *P ibc +((1<<shift)-w ibc )*P intra +(1<<(shift-1)))>>shift
[0228] Among them, P ibc represents the IBC prediction signal, P intra Indicates the intra-frame prediction signal. For IBC MERGE mode and IBC AMVP mode, (w ibc ,shift) is set equal to (13, 4) and (1, 1).
[0229] An intra prediction mode (IPM) candidate list is used to generate an intra prediction signal, and the IPM candidate list size is predefined as 2. The syntax element IPM index is used to indicate which IPM to use.
[0230] For the IBC-CIIP mode, the following steps can be used to obtain the filter strength of the boundary:
[0231] For the luma component:
[0232] ① The boundary is a transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
[0233] When cIdx is 0, the sum of tu_y_coded_flag[x0][y0] and tu_y_coded_flag[x1][y1] is greater than 0, where (x0, y0) is the top-left corner sample position of the luma transform block at position p0, and (x1, y1) is the top-left corner sample position of the luma transform block at position q0. This means that there is at least one non-zero transform coefficient for the luma component.
[0234] ② Otherwise, cIdx is equal to 0, edgeIdc[xDi][yDj] is equal to 2, that is, the boundary is the predicted sub-block boundary, and bS[xDi][yDj] is set to 1 when one or more of the following conditions are met:
[0235] a. The prediction mode CuPredMode[cIdx==0?0:1][xp0][yp0] of the sub-block at position p0 is different from the prediction mode CuPredMode[cIdx==0?0:1][xq0][yq0] of the sub-block at position q0, where (xp0, yp0) is the luminance position corresponding to the upper left sample of the sub-block at position p0, and (xq0, yq0) is the luminance position corresponding to the upper left sample of the sub-block at position q0.
[0236] b. The prediction mode of the sub-block at position p0 and the prediction mode of the sub-block at position q0 both adopt the IBC mode, and the horizontal or vertical absolute difference of the motion vector is greater than or equal to half a pixel.
[0237] Currently, IBC chroma is not performed in dual-tree mode, and all modes do not filter the chroma components in a single tree. If both single and dual trees perform chroma and both enable chroma filtering, the following steps can be used to obtain the filter strength of the boundary of the chroma component:
[0238] ① The boundary is a transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
[0239] a. When cIdx is 1, tu_cb_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0],
[0240] The sum of tu_cb_coded_flag[x1][y1] and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the upper-left sample of the Cb component transform block at position p0, and (x1, y1) is the luma position corresponding to the upper-left sample of the Cb component transform block at position q0. That is, there is at least one non-zero transform coefficient for the Cb component.
[0241] b. When cIdx is 2, the sum of tu_cr_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cr_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the top-left sample of the Cr component transform block at position p0, and (x1, y1) is the luma position corresponding to the top-left sample of the Cr component transform block at position q0. That is, there is at least one non-zero Cr component transform coefficient.
[0242] IBC-GPM model
[0243] IBC-GPM mode is a coding tool that geometrically partitions the CU into two subpartitions. Prediction signals for the two subpartitions are generated using IBC and intra prediction. IBC-GPM can be applied to either the regular IBC MERGE mode or the IBC-TM MERGE mode. The intra prediction mode (IPM) candidate list is constructed using the same method as inter-GPM, and the IPM candidate list size is predefined to be 3. There are 48 geometric partition modes, divided into two geometric partition mode sets, as shown in Tables 2 and 3.
[0244] Table 2 IBC-GPM partitioning pattern set (group 1)
[0245] Table 3 IBC-GPM partitioning pattern set (second group)
[0246] When IBC-GPM is used, the IBC-GPM geometry partitioning mode set is identified by a syntax element to indicate whether the first or second geometry partitioning mode set is selected, and then the geometry partitioning mode index is selected. The IBC-GPM intra flag is signaled to indicate whether intra prediction is used for the first subpartition. When intra prediction is used for the subpartition, the intra prediction mode index is signaled. When IBC is used for the subpartition, the MERGE index is signaled.
[0247] In bi-predictive IBC-GPM, two flags are signaled to indicate the prediction mode of the two partitions, a first flag indicating whether the first partition is intra predicted, if not, a second flag is signaled to indicate whether intra prediction is used for the second partition.
[0248] For the IBC-GPM mode, the following steps can be used to obtain the filter strength of the boundary:
[0249] For the luminance component, the following steps can be used to obtain the filter strength of the boundary.
[0250] ① The boundary is a transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
[0251] When cIdx is 0, the sum of tu_y_coded_flag[x0][y0] and tu_y_coded_flag[x1][y1] is greater than 0, where (x0, y0) is the top-left corner sample position of the luma transform block at position p0, and (x1, y1) is the top-left corner sample position of the luma transform block at position q0. This means that there is at least one non-zero transform coefficient for the luma component.
[0252] ② Otherwise, cIdx is equal to 0, edgeIdc[xDi][yDj] is equal to 2, that is, the boundary is the predicted sub-block boundary, and bS[xDi][yDj] is set to 1 when one or more of the following conditions are met:
[0253] a. The prediction mode CuPredMode[cIdx==0?0:1][xp0][yp0] of the sub-block at position p0 is different from the prediction mode CuPredMode[cIdx==0?0:1][xq0][yq0] of the sub-block at position q0, where (xp0, yp0) is the luminance position corresponding to the upper left sample of the sub-block at position p0, and (xq0, yq0) is the luminance position corresponding to the upper left sample of the sub-block at position q0.
[0254] b. The prediction mode of the sub-block at position p0 and the prediction mode of the sub-block at position q0 both adopt the IBC mode, and the horizontal or vertical absolute difference of the motion vector is greater than or equal to half a pixel.
[0255] Currently, IBC chroma is not performed in dual-tree mode, and all modes do not filter the chroma components in a single tree. If both single and dual trees perform chroma and both enable chroma filtering, the following steps can be used to obtain the filter strength of the boundary of the chroma component:
[0256] ① The boundary is a transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
[0257] When a.cIdx is 1, the sum of tu_cb_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cb_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the top-left sample of the Cb component transform block at position p0, and (x1, y1) is the luma position corresponding to the top-left sample of the Cb component transform block at position q0. That is, there is at least one non-zero transform coefficient for the Cb component.
[0258] b. When cIdx is 2, the sum of tu_cr_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cr_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the top-left sample of the Cr component transform block at position p0, and (x1, y1) is the luma position corresponding to the top-left sample of the Cr component transform block at position q0. That is, there is at least one non-zero Cr component transform coefficient.
[0259] Currently, when determining the filter parameter (BS) corresponding to the deblocking filter, the BS value is determined according to the process described above. However, in some scenarios, there are some unreasonable aspects when using the above method to determine the BS value, resulting in poor filtering effect.
[0260] For example, for prediction modes using block vector prediction (such as DBV and IntraTMP), their BS values are the same as those corresponding to ordinary intra-frame modes, which can cause excessive smoothing at boundaries and loss of texture. For prediction modes that include intra-frame prediction (such as IBC-CIIP and IBC-GPM), their BS values are the same as those corresponding to ordinary IBC modes, which can cause insufficient smoothing at boundaries and severe blocking artifacts.
[0261] When determining the filtering parameters corresponding to the current block, the embodiments of the present application may consider the prediction mode of the current block and / or adjacent blocks, that is, the filtering parameters corresponding to the current block may be determined based on the prediction mode of the current block and / or adjacent blocks. Since the blocking effect at the boundary is closely related to the prediction mode used by the blocks on both sides of the boundary, determining the filtering parameters based on the prediction mode can make the determined filtering parameters more reasonable, thereby achieving a better filtering effect.
[0262] The following first describes the decoding method of the embodiment of the present application in detail with examples.
[0263] Figure 11 is a flowchart of a decoding method provided by an embodiment of the present application. The method of Figure 11 can be applied to a decoder.
[0264] Referring to FIG. 11 , in step S1110, neighboring blocks of a current block are determined. The current block may be a block to be decoded. The current block may be a CU, TU, PU, or subblock. The current block may be a luminance block or a chrominance block. The current block may be an intra block or an inter block.
[0265] A neighboring block can be a block adjacent to the current block. The current block and the neighboring block can be adjacent to each other in the left and right directions, or in the top and bottom directions. The neighboring block can be located above, below, to the left, or to the right of the current block. The neighboring block and the current block can be of the same type.
[0266] Continuing with FIG. 11 , in step S1120, a first filter parameter corresponding to the current block is determined based on the prediction mode of the current block and / or the neighboring blocks. The first filter parameter may be the BS described above. Determining the first filter parameter corresponding to the current block can be understood as determining the value of the first filter parameter corresponding to the current block (i.e., the value of BS).
[0267] There are many types of prediction modes. For example, the prediction mode may include one of the following: DBV mode, IntraTMP mode, IBC-CIIP mode, and IBC-GPM mode.
[0268] Continuing to refer to FIG. 11 , in step S1130 , deblocking filtering is performed on the current block based on the first filtering parameters.
[0269] Based on the first filtering parameter, performing deblocking filtering on the current block may include: selecting a filtering strength based on the first filtering parameter, and performing a filtering operation based on the selected filtering strength. The filtering strength may include one of the following: no filtering, short tap strong filtering, short tap weak filtering, and long tap filtering. For the luminance component and the chrominance component, the corresponding filtering operations are different. For the luminance component, the filtering operation may include long tap filtering of the luminance component, short tap strong filtering of the luminance component, and short tap weak filtering of the luminance component. For the chrominance component, the filtering operation may include strong filtering of the chrominance component and weak filtering of the chrominance component.
[0270] The following describes the values of the first filtering parameter for different prediction modes.
[0271] DBV mode and IntraTMP mode
[0272] If the prediction mode of the current block and the adjacent block is block vector prediction, the value of the first filter parameter is smaller than the value of the second filter parameter. The second filter parameter is the filter parameter corresponding to the block based on intra-frame prediction, or in other words, the second filter parameter is the filter parameter corresponding to the ordinary intra-frame mode. In other words, the value of the filter parameter corresponding to the block based on block vector prediction is smaller than the value of the filter parameter corresponding to the block based on intra-frame prediction. Since the prediction principle of the block based on block vector prediction is similar to that of the inter-frame prediction or IBC prediction mode, a smaller filter strength can meet the filtering requirements of the block based on block vector prediction, avoiding the phenomenon of excessive smoothing at the boundary and disappearance of texture. The above-mentioned prediction mode based on block vector prediction can include DBV mode and / or IntraTMP mode.
[0273] If the prediction mode of the current block and the adjacent block is block vector prediction, then if a first condition is satisfied, the value of the first filter parameter is set to be smaller than the value of the second filter parameter. The first condition is determined based on one or more of the following information: a boundary between the current block and the adjacent block, a transform coefficient corresponding to the current block, and a transform coefficient corresponding to the adjacent block.
[0274] The boundary between the current block and the adjacent block may include a transform block boundary and / or a subblock boundary. If the boundary between the current block and the adjacent block is a transform block boundary, it may indicate that both the current block and the adjacent block are transform blocks. If the boundary between the current block and the adjacent block is a subblock boundary, it may indicate that both the current block and the adjacent block are subblocks.
[0275] The transformation coefficient corresponding to the current block may include a transformation coefficient on a luminance component and / or a transformation coefficient on a chrominance component of the current block.
[0276] The transformation coefficients corresponding to the adjacent blocks may include transformation coefficients on the luminance components and / or transformation coefficients on the chrominance components of the adjacent blocks.
[0277] The first condition may be different for different prediction modes. The first condition is introduced below for the DBV mode and the IntraTMP mode respectively.
[0278] If the prediction mode of the current block and the adjacent block is DBV mode, the first condition may include: the boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of chrominance components. In other words, if the boundary between the current block and the adjacent block is a transform block boundary, and at least one of the transform coefficients for the luminance component of the current block and the transform coefficients for the luminance component of the adjacent block is non-zero, then the value of the first filter parameter is less than the value of the second filter parameter.
[0279] If the prediction mode of the current transform block and the adjacent block is the IntraTMP mode, the first condition includes one or more of the following: the boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of the luminance component; the current block and the adjacent block belong to the luminance component, the boundary between the current block and the adjacent block is a sub-block boundary, and the prediction modes of the current block and the adjacent block are different; the current block and the adjacent block belong to the luminance component, the boundary between the current block and the adjacent block is a sub-block boundary, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, and the first direction is the horizontal direction or the vertical direction. The content of the first condition is described in detail below.
[0280] For example, for the luminance component, if the boundary between the current block and the adjacent block is a transform block boundary, and at least one of the transform coefficient of the luminance component corresponding to the current block and the transform coefficient of the luminance component corresponding to the adjacent block is non-zero (or, the current block and the adjacent block have at least one non-zero transform coefficient on the luminance component), then the value of the first filtering parameter is less than the value of the second filtering parameter.
[0281] For another example, for the luminance component, the boundary between the current transform block and the adjacent transform block is a subblock (or predicted subblock) boundary, and the prediction modes of the current block and the adjacent block are different, then the value of the first filter parameter is smaller than the value of the second filter parameter.
[0282] For another example, for the luminance component, the boundary between the current block and the adjacent block is a sub-block (predicted sub-block) boundary, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in the horizontal direction is greater than or equal to half a pixel, or the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in the vertical direction is greater than or equal to half a pixel, then the value of the first filtering parameter is less than the value of the second filtering parameter.
[0283] The value of the first filter parameter can be less than or equal to the product of the first value and the first ratio, where the first value is the maximum value of the filter parameter corresponding to the deblocking filter, and the first ratio is less than or equal to 50%. Taking the first ratio as 50% as an example, the value of the first filter parameter can be set to a value within the first 50% of the filter parameter values. For example, if the maximum value of the filter parameter is 10, the value of the first filter parameter can be any one of 1, 2, 3, 4, and 5.
[0284] The first ratio may be less than or equal to 30%. Taking the first ratio being 30% as an example, the value of the first filtering parameter may be set to the first 30% of the values of the filtering parameter. For example, if the maximum value of the filtering parameter is 10, the value of the first filtering parameter may be any one of 1, 2, and 3.
[0285] The value of the first filtering parameter may be 1. For example, if the values of the filtering parameter corresponding to the deblocking filter include 0, 1, and 2, the value of the first filtering parameter may be set to 1. In other words, if the value of the second filtering parameter is 2, the value of the first filtering parameter may be 1.
[0286] If the second condition is met, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. The second condition includes one or more of the following: the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not DBV mode; the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not DBV mode. For example, if the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not DBV mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. For another example, if the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not DBV mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. For another example, if the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not DBV mode, the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not DBV mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter.
[0287] The value of the first filtering parameter being greater than the value of the second filtering parameter may include the value of the first filtering parameter being equal to the value of the second filtering parameter. For example, the value of the first filtering parameter and the value of the second filtering parameter are both 2.
[0288] If the third condition is met, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. The third condition includes one or more of the following: the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not intra-frame TMP mode; the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not intra-frame TMP mode. For example, if the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not intra-frame TMP mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. For another example, if the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not intra-frame TMP mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. For another example, if the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not intra-frame TMP mode, if the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not intra-frame TMP mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter.
[0289] The value of the first filtering parameter being greater than the value of the second filtering parameter may include the value of the first filtering parameter being equal to the value of the second filtering parameter. For example, the value of the first filtering parameter and the value of the second filtering parameter are both 2.
[0290] IBC-GPM model and IBC-CIIP model
[0291] If the prediction mode of the current block and / or the adjacent block includes intra-frame prediction, the value of the first filter parameter is greater than the value of the third filter parameter. The third filter parameter is the filter parameter corresponding to the block based on IBC prediction, or in other words, the third filter parameter is the filter parameter corresponding to the IBC block. That is to say, the value of the filter parameter corresponding to the block including intra-frame prediction is greater than the value of the filter parameter corresponding to the block based on IBC prediction. If the prediction mode of the current block and / or the adjacent block includes intra-frame prediction, the discontinuity of pixels at the boundary will be more obvious. Therefore, a larger filtering strength is required to achieve a better filtering effect. The above-mentioned prediction mode including the intra-frame prediction mode may include the IBC-GPM mode and / or the IBC-CIIP mode.
[0292] If the coding blocks corresponding to the current block and / or the adjacent blocks are based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter. For example, if the coding block corresponding to the current block is based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter. For another example, if the coding block corresponding to the adjacent block is based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter. For another example, if the coding blocks corresponding to the current block and the adjacent blocks are based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter.
[0293] If the coding blocks corresponding to the current block and / or the adjacent blocks are based on IBC-GPM coding, then when the fourth condition is met, the value of the first filter parameter is greater than the value of the third filter parameter. The fourth condition includes one or more of the following: the current block is not based on IBC prediction, and the adjacent blocks are not based on IBC prediction. That is, when the current block and / or the adjacent blocks are not based on IBC prediction, the value of the first filter parameter is greater than the value of the third filter parameter. The current block and the adjacent blocks may be the blocks corresponding to the subpartitions described above. The blocks corresponding to the subpartitions may use IBC prediction or intra-frame prediction.
[0294] The value of the first filter parameter can be less than or equal to the product of the first value and the second ratio, where the first value is the maximum value of the filter parameter corresponding to the deblocking filter, and the second ratio is greater than or equal to 50%. Taking the second ratio of 50% as an example, the value of the first filter parameter can be set to a value 50% lower than the value of the filter parameter. For example, if the maximum value of the filter parameter is 10, the value of the first filter parameter can be any one of 5, 6, 7, 8, 9, and 10.
[0295] The first ratio may be greater than or equal to 80%. Taking the first ratio being 30% as an example, the value of the first filtering parameter may be set to the first 30% of the values of the filtering parameter. For example, if the maximum value of the filtering parameter is 10, the value of the first filtering parameter may be any one of 8, 9, and 10.
[0296] The value of the first filtering parameter may be 2. For example, if the values of the filtering parameter corresponding to the deblocking filter include 0, 1, and 2, the value of the first filtering parameter may be set to 2. In other words, if the value of the second filtering parameter is 1, the value of the first filtering parameter may be 2.
[0297] If the coding block corresponding to the current block and / or the adjacent block is encoded based on IBC-GPM, and the boundary between the current block and the adjacent block is a transform block boundary, then when the fifth condition is met, the value of the first filter parameter is less than or equal to the value of the third filter parameter. The fifth condition includes: at least one of the transform coefficient corresponding to the current block and the transform coefficient corresponding to the adjacent block is non-zero. The above-mentioned transform coefficients include the transform coefficients of the luminance component and / or the transform coefficients of the chrominance component. For example, the fifth condition includes: at least one of the transform coefficients of the current block on the luminance component and the transform coefficients of the adjacent block on the luminance component is non-zero, and / or at least one of the transform coefficients of the current block on the chrominance component and the transform coefficients of the adjacent block on the chrominance component is non-zero.
[0298] The value of the first filtering parameter may be equal to the value of the third filtering parameter. For example, the value of the first filtering parameter and the value of the third filtering parameter are both 1.
[0299] If the coding blocks corresponding to the current block and / or the adjacent blocks are coded based on IBC-GPM, the current block and the adjacent blocks belong to the luminance component, and the boundary between the current block and the adjacent blocks is a sub-block boundary, then if the sixth condition is satisfied, the value of the first filtering parameter is less than or equal to the value of the third filtering parameter. The sixth condition includes one or more of the following: the prediction mode of the current block and the adjacent blocks is different; the prediction mode of the current block and the adjacent blocks adopts the IBC mode, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, where the first direction is the horizontal direction or the vertical direction.
[0300] The value of the first filtering parameter may be equal to the value of the third filtering parameter. For example, the value of the first filtering parameter and the value of the third filtering parameter are both 1.
[0301] The decoding method provided by the embodiment of the present application is described in detail above in conjunction with Figure 11. The encoding method provided by the embodiment of the present application is described in detail below in conjunction with Figure 12.
[0302] Figure 12 is a flow chart of an encoding method provided by an embodiment of the present application. The method of Figure 12 can be applied to an encoder.
[0303] Referring to FIG. 12 , in step S1210 , adjacent blocks of a current block are determined. The current block may be a block to be decoded. The current block may be a CU, TU, PU, or subblock. The current block may be a luminance block or a chrominance block. The current block may be an intra block or an inter block.
[0304] A neighboring block can be a block adjacent to the current block. The current block and the neighboring block can be adjacent to each other in the left and right directions, or in the top and bottom directions. The neighboring block can be located above, below, to the left, or to the right of the current block. The neighboring block and the current block can be of the same type.
[0305] Continuing with FIG. 12 , in step S1220, a first filter parameter corresponding to the current block is determined based on the prediction mode of the current block and / or the neighboring blocks. The first filter parameter may be the BS described above. Determining the first filter parameter corresponding to the current block can be understood as determining the value of the first filter parameter corresponding to the current block (i.e., the value of BS).
[0306] There are many types of prediction modes. For example, the prediction mode may include one of the following: DBV mode, IntraTMP mode, IBC-CIIP mode, and IBC-GPM mode.
[0307] Continuing to refer to FIG. 12 , in step S1230 , deblocking filtering is performed on the current block based on the first filtering parameters.
[0308] Based on the first filtering parameter, performing deblocking filtering on the current block may include: selecting a filtering strength based on the first filtering parameter, and performing a filtering operation based on the selected filtering strength. The filtering strength may include one of the following: no filtering, short tap strong filtering, short tap weak filtering, and long tap filtering. For the luminance component and the chrominance component, the corresponding filtering operations are different. For the luminance component, the filtering operation may include long tap filtering of the luminance component, short tap strong filtering of the luminance component, and short tap weak filtering of the luminance component. For the chrominance component, the filtering operation may include strong filtering of the chrominance component and weak filtering of the chrominance component.
[0309] The following describes the values of the first filtering parameter for different prediction modes.
[0310] DBV mode and IntraTMP mode
[0311] If the prediction mode of the current block and the adjacent block is block vector prediction, the value of the first filter parameter is smaller than the value of the second filter parameter. The second filter parameter is the filter parameter corresponding to the block based on intra-frame prediction, or in other words, the second filter parameter is the filter parameter corresponding to the ordinary intra-frame mode. In other words, the value of the filter parameter corresponding to the block based on block vector prediction is smaller than the value of the filter parameter corresponding to the block based on intra-frame prediction. Since the prediction principle of the block based on block vector prediction is similar to that of the inter-frame prediction or IBC prediction mode, a smaller filter strength can meet the filtering requirements of the block based on block vector prediction, avoiding the phenomenon of excessive smoothing at the boundary and disappearance of texture. The above-mentioned prediction mode based on block vector prediction can include DBV mode and / or IntraTMP mode.
[0312] If the prediction mode of the current block and the adjacent block is block vector prediction, then if a first condition is satisfied, the value of the first filter parameter is set to be smaller than the value of the second filter parameter. The first condition is determined based on one or more of the following information: a boundary between the current block and the adjacent block, a transform coefficient corresponding to the current block, and a transform coefficient corresponding to the adjacent block.
[0313] The boundary between the current block and the adjacent block may include a transform block boundary and / or a subblock boundary. If the boundary between the current block and the adjacent block is a transform block boundary, it may indicate that both the current block and the adjacent block are transform blocks. If the boundary between the current block and the adjacent block is a subblock boundary, it may indicate that both the current block and the adjacent block are subblocks.
[0314] The transformation coefficient corresponding to the current block may include a transformation coefficient on a luminance component and / or a transformation coefficient on a chrominance component of the current block.
[0315] The transformation coefficients corresponding to the adjacent blocks may include transformation coefficients on the luminance components and / or transformation coefficients on the chrominance components of the adjacent blocks.
[0316] The first condition may be different for different prediction modes. The first condition is introduced below for the DBV mode and the IntraTMP mode respectively.
[0317] If the prediction mode of the current block and the adjacent block is DBV mode, the first condition may include: the boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of chrominance components. In other words, if the boundary between the current block and the adjacent block is a transform block boundary, and at least one of the transform coefficients for the luminance component of the current block and the transform coefficients for the luminance component of the adjacent block is non-zero, then the value of the first filter parameter is less than the value of the second filter parameter.
[0318] If the prediction mode of the current transform block and the adjacent block is the IntraTMP mode, the first condition includes one or more of the following: the boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of the luminance component; the current block and the adjacent block belong to the luminance component, the boundary between the current block and the adjacent block is a sub-block boundary, and the prediction modes of the current block and the adjacent block are different; the current block and the adjacent block belong to the luminance component, the boundary between the current block and the adjacent block is a sub-block boundary, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, and the first direction is the horizontal direction or the vertical direction. The content of the first condition is described in detail below.
[0319] For example, for the luminance component, if the boundary between the current block and the adjacent block is a transform block boundary, and at least one of the transform coefficient of the luminance component corresponding to the current block and the transform coefficient of the luminance component corresponding to the adjacent block is non-zero (or, the current block and the adjacent block have at least one non-zero transform coefficient on the luminance component), then the value of the first filtering parameter is less than the value of the second filtering parameter.
[0320] For another example, for the luminance component, the boundary between the current transform block and the adjacent transform block is a subblock (or predicted subblock) boundary, and the prediction modes of the current block and the adjacent block are different, then the value of the first filter parameter is smaller than the value of the second filter parameter.
[0321] For another example, for the luminance component, the boundary between the current block and the adjacent block is a sub-block (predicted sub-block) boundary, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in the horizontal direction is greater than or equal to half a pixel, or the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in the vertical direction is greater than or equal to half a pixel, then the value of the first filtering parameter is less than the value of the second filtering parameter.
[0322] The value of the first filter parameter can be less than or equal to the product of the first value and the first ratio, where the first value is the maximum value of the filter parameter corresponding to the deblocking filter, and the first ratio is less than or equal to 50%. Taking the first ratio as 50% as an example, the value of the first filter parameter can be set to a value within the first 50% of the filter parameter values. For example, if the maximum value of the filter parameter is 10, the value of the first filter parameter can be any one of 1, 2, 3, 4, and 5.
[0323] The first ratio may be less than or equal to 30%. Taking the first ratio being 30% as an example, the value of the first filtering parameter may be set to the first 30% of the values of the filtering parameter. For example, if the maximum value of the filtering parameter is 10, the value of the first filtering parameter may be any one of 1, 2, and 3.
[0324] The value of the first filtering parameter may be 1. For example, if the values of the filtering parameter corresponding to the deblocking filter include 0, 1, and 2, the value of the first filtering parameter may be set to 1. In other words, if the value of the second filtering parameter is 2, the value of the first filtering parameter may be 1.
[0325] If the second condition is met, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. The second condition includes one or more of the following: the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not DBV mode; the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not DBV mode. For example, if the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not DBV mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. For another example, if the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not DBV mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. For another example, if the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not DBV mode, the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not DBV mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter.
[0326] The value of the first filtering parameter being greater than the value of the second filtering parameter may include the value of the first filtering parameter being equal to the value of the second filtering parameter. For example, the value of the first filtering parameter and the value of the second filtering parameter are both 2.
[0327] If the third condition is met, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. The third condition includes one or more of the following: the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not intra-frame TMP mode; the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not intra-frame TMP mode. For example, if the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not intra-frame TMP mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. For another example, if the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not intra-frame TMP mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter. For another example, if the coding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not intra-frame TMP mode, if the coding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not intra-frame TMP mode, the value of the first filter parameter is greater than or equal to the value of the second filter parameter.
[0328] The value of the first filtering parameter being greater than the value of the second filtering parameter may include the value of the first filtering parameter being equal to the value of the second filtering parameter. For example, the value of the first filtering parameter and the value of the second filtering parameter are both 2.
[0329] IBC-GPM model and IBC-CIIP model
[0330] If the prediction mode of the current block and / or the adjacent block includes intra-frame prediction, the value of the first filter parameter is greater than the value of the third filter parameter. The third filter parameter is the filter parameter corresponding to the block based on IBC prediction, or in other words, the third filter parameter is the filter parameter corresponding to the IBC block. That is to say, the value of the filter parameter corresponding to the block including intra-frame prediction is greater than the value of the filter parameter corresponding to the block based on IBC prediction. If the prediction mode of the current block and / or the adjacent block includes intra-frame prediction, the discontinuity of pixels at the boundary will be more obvious. Therefore, a larger filtering strength is required to achieve a better filtering effect. The above-mentioned prediction mode including the intra-frame prediction mode may include the IBC-GPM mode and / or the IBC-CIIP mode.
[0331] If the coding blocks corresponding to the current block and / or the adjacent blocks are based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter. For example, if the coding block corresponding to the current block is based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter. For another example, if the coding block corresponding to the adjacent block is based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter. For another example, if the coding blocks corresponding to the current block and the adjacent blocks are based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter.
[0332] If the coding blocks corresponding to the current block and / or the adjacent blocks are based on IBC-GPM coding, then when the fourth condition is met, the value of the first filter parameter is greater than the value of the third filter parameter. The fourth condition includes one or more of the following: the current block is not based on IBC prediction, and the adjacent blocks are not based on IBC prediction. That is, when the current block and / or the adjacent blocks are not based on IBC prediction, the value of the first filter parameter is greater than the value of the third filter parameter. The current block and the adjacent blocks may be the blocks corresponding to the subpartitions described above. The blocks corresponding to the subpartitions may use IBC prediction or intra-frame prediction.
[0333] The value of the first filter parameter can be less than or equal to the product of the first value and the second ratio, where the first value is the maximum value of the filter parameter corresponding to the deblocking filter, and the second ratio is greater than or equal to 50%. Taking the second ratio of 50% as an example, the value of the first filter parameter can be set to a value 50% lower than the value of the filter parameter. For example, if the maximum value of the filter parameter is 10, the value of the first filter parameter can be any one of 5, 6, 7, 8, 9, and 10.
[0334] The first ratio may be greater than or equal to 80%. Taking the first ratio being 30% as an example, the value of the first filtering parameter may be set to the first 30% of the values of the filtering parameter. For example, if the maximum value of the filtering parameter is 10, the value of the first filtering parameter may be any one of 8, 9, and 10.
[0335] The value of the first filtering parameter may be 2. For example, if the values of the filtering parameter corresponding to the deblocking filter include 0, 1, and 2, the value of the first filtering parameter may be set to 2. In other words, if the value of the second filtering parameter is 1, the value of the first filtering parameter may be 2.
[0336] If the coding block corresponding to the current block and / or the adjacent block is encoded based on IBC-GPM, and the boundary between the current block and the adjacent block is a transform block boundary, then when the fifth condition is met, the value of the first filter parameter is less than or equal to the value of the third filter parameter. The fifth condition includes: at least one of the transform coefficient corresponding to the current block and the transform coefficient corresponding to the adjacent block is non-zero. The above-mentioned transform coefficients include the transform coefficients of the luminance component and / or the transform coefficients of the chrominance component. For example, the fifth condition includes: at least one of the transform coefficients of the current block on the luminance component and the transform coefficients of the adjacent block on the luminance component is non-zero, and / or at least one of the transform coefficients of the current block on the chrominance component and the transform coefficients of the adjacent block on the chrominance component is non-zero.
[0337] The value of the first filtering parameter may be equal to the value of the third filtering parameter. For example, the value of the first filtering parameter and the value of the third filtering parameter are both 1.
[0338] If the coding blocks corresponding to the current block and / or the adjacent blocks are coded based on IBC-GPM, the current block and the adjacent blocks belong to the luminance component, and the boundary between the current block and the adjacent blocks is a sub-block boundary, then if the sixth condition is satisfied, the value of the first filtering parameter is less than or equal to the value of the third filtering parameter. The sixth condition includes one or more of the following: the prediction mode of the current block and the adjacent blocks is different; the prediction mode of the current block and the adjacent blocks adopts the IBC mode, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, where the first direction is the horizontal direction or the vertical direction.
[0339] The value of the first filtering parameter may be equal to the value of the third filtering parameter. For example, the value of the first filtering parameter and the value of the third filtering parameter are both 1.
[0340] The following examples are used to describe the embodiments of the present application in more detail. It should be noted that the examples below are only intended to help those skilled in the art understand the embodiments of the present application, rather than to limit the embodiments of the present application to the specific numerical values or specific scenarios illustrated. It is apparent that those skilled in the art can make various equivalent modifications or changes based on the examples given below, and such modifications or changes also fall within the scope of the embodiments of the present application.
[0341] For DBV mode, when determining BS, you can follow the following steps:
[0342] ① For the chroma component, the intra_bdpcm_chroma_flag of the CU at the p0 position and the CU at the q0 position are both 1, and bS[xDi][yDj] is set to 0.
[0343] ② If the coding mode CuPredMode[cIdx==0?0:1][x0][y0] of the CU corresponding to position p0 is MODE_INTRA and IntraPredModeC[xCb][yCb] is not DBV mode, or if the coding mode CuPredMode[cIdx==0?0:1][x1][y1] of the CU corresponding to position q0 is MODE_INTRA and IntraPredModeC[xCb][yCb] is not DBV mode, bS[xDi][yDj] is set to 2, where (x0, y0) is the sample position of the upper left corner of the CU corresponding to position p0, and (x1, y1) is the sample position of the upper left corner of the CU corresponding to position q0. The variable cIdx is used to indicate the color component of the current CU.
[0344] ③ Otherwise, the boundary is a transform block boundary, and bS[xDi][yDj] is set to 1 when one of the following conditions is met:
[0345] When a.cIdx is 1, the sum of tu_cb_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cb_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the top-left sample of the Cb component transform block at position p0, and (x1, y1) is the luma position corresponding to the top-left sample of the Cb component transform block at position q0. That is, there is at least one non-zero transform coefficient for the Cb component.
[0346] b. When cIdx is 2, the sum of tu_cr_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cr_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the top-left sample of the Cr component transform block at position p0, and (x1, y1) is the luma position corresponding to the top-left sample of the Cr component transform block at position q0. That is, there is at least one non-zero Cr component transform coefficient.
[0347] For the IntraTMP mode, when determining the BS, you can follow the following steps:
[0348] ① For the luminance component, the intra_bdpcm_luma_flag of the CU at the p0 position and the CU at the q0 position are both 1, and bS[xDi][yDj] is set to 0.
[0349] ② The coding mode CuPredMode[cIdx==0?0:1][x0][y0] of the CU corresponding to the p0 position is MODE_INTRA and intraTmpFlag is 0, or the coding mode CuPredMode[cIdx==0?0:1][x1][y1] of the CU corresponding to the q0 position is MODE_INTRA and intraTmpFlag is 0, and bS[xDi][yDj] is set to 2, where (x0, y0) is the sample position of the upper left corner of the CU corresponding to the p0 position, and (x1, y1) is the sample position of the upper left corner of the CU corresponding to the q0 position. The variable cIdx indicates the color component of the current CU.
[0350] Otherwise, the boundary is a transform block boundary, and bS[xDi][yDj] is set to 1 if the following conditions are met:
[0351] When -cIdx is 0, the sum of tu_y_coded_flag[x0][y0] and tu_y_coded_flag[x1][y1] is greater than 0, where (x0, y0) is the top-left corner sample position of the luma transform block at position p0, and (x1, y1) is the top-left corner sample position of the luma transform block at position q0. This means that there is at least one non-zero transform coefficient for the luma component.
[0352] ④ Otherwise, cIdx is equal to 0, edgeIdc[xDi][yDj] is equal to 2, that is, the boundary is the predicted sub-block boundary, and bS[xDi][yDj] is set to 1 when one or more of the following conditions are met:
[0353] a. The prediction mode CuPredMode[cIdx==0?0:1][xp0][yp0] of the sub-block at position p0 is different from the prediction mode CuPredMode[cIdx==0?0:1][xq0][yq0] of the sub-block at position q0, where (xp0, yp0) is the luminance position corresponding to the upper left sample of the sub-block at position p0, and (xq0, yq0) is the luminance position corresponding to the upper left sample of the sub-block at position q0.
[0354] b. The intraTmpFlag of the sub-block at position p0 and the intraTmpFlag of the sub-block at position q0 are both 1, and the horizontal or vertical absolute difference of the motion vector is greater than or equal to half a pixel.
[0355] For the IBC-CIIP model, when determining BS, you can follow the following steps:
[0356] ① For the luminance and chrominance components (currently IBC chrominance is not performed in dual-tree mode, and all modes do not filter the chrominance components in a single tree. The following shows the situation where both single and dual trees perform chrominance and both enable chrominance filtering), the ibc_ciip_flag of the corresponding CU at the p0 or q0 position is equal to 1, and bS[xDi][yDj] is set to 2.
[0357] For the IBC-GPM mode, when determining the BS, you can follow the following steps:
[0358] Luminance component:
[0359] ① The ibc_gpm_intra_Flag of the CU corresponding to the p0 or q0 position is equal to 1, and the sub-block corresponding to the p0 or q0 position is not predicted by the IBC block vector, and bS[xDi][yDj] is set to 2.
[0360] Otherwise, the boundary is a transform block boundary, and bS[xDi][yDj] is set to 1 when one of the following conditions is met:
[0361] When -cIdx is 0, the sum of tu_y_coded_flag[x0][y0] and tu_y_coded_flag[x1][y1] is greater than 0, where (x0, y0) is the top-left corner sample position of the luma transform block at position p0, and (x1, y1) is the top-left corner sample position of the luma transform block at position q0. This means that there is at least one non-zero transform coefficient for the luma component.
[0362] ③ Otherwise, cIdx is equal to 0, edgeIdc[xDi][yDj] is equal to 2, that is, the boundary is the predicted sub-block boundary, and bS[xDi][yDj] is set to 1 when one or more of the following conditions are met:
[0363] a. The prediction mode CuPredMode[cIdx==0?0:1][xp0][yp0] of the sub-block at position p0 is different from the prediction mode CuPredMode[cIdx==0?0:1][xq0][yq0] of the sub-block at position q0, where (xp0, yp0) is the luminance position corresponding to the upper left sample of the sub-block at position p0, and (xq0, yq0) is the luminance position corresponding to the upper left sample of the sub-block at position q0.
[0364] b. The prediction mode of the sub-block at position p0 and the prediction mode of the sub-block at position q0 both adopt the IBC mode, and the horizontal or vertical absolute difference of the motion vector is greater than or equal to half a pixel.
[0365] Chroma component:
[0366] (Currently, IBC chroma is not performed in dual-tree mode, and all modes do not filter the chroma components in a single tree. The following shows the situation when both single and dual trees perform chroma and both enable chroma filtering):
[0367] ① The ibc_gpm_intra_Flag of the CU corresponding to the p0 or q0 position is equal to 1, and the sub-block corresponding to the p0 or q0 position is not predicted by the IBC block vector, and bS[xDi][yDj] is set to 2.
[0368] ② The boundary is the transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
[0369] When a.cIdx is 1, the sum of tu_cb_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cb_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the top-left sample of the Cb component transform block at position p0, and (x1, y1) is the luma position corresponding to the top-left sample of the Cb component transform block at position q0. That is, there is at least one non-zero transform coefficient for the Cb component.
[0370] b. When cIdx is 2, the sum of tu_cr_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], tu_cr_coded_flag[x1][y1], and tu_joint_cbcr_residual_flag[x1][y1] is greater than 0, where (x0, y0) is the luma position corresponding to the top-left sample of the Cr component transform block at position p0, and (x1, y1) is the luma position corresponding to the top-left sample of the Cr component transform block at position q0. That is, there is at least one non-zero Cr component transform coefficient.
[0371] This application fully considers the prediction characteristics of different prediction modes and designs a suitable DBF filter strength (BS), giving full play to the role of DBF and effectively removing the blocking effect. The subjective and objective quality is effectively improved.
[0372] 13 to 16 show the filtering effect diagrams after filtering based on the solution of the embodiment of the present application and based on the traditional solution.
[0373] Figure 13 (a) shows the original image, Figure 13 (b) shows the image filtered using a traditional method, and Figure 13 (c) shows the image filtered using the solution of the embodiment of the present application. Comparing Figures (b) and (c), it can be seen that the solution of the embodiment of the present application can achieve a good filtering effect. Furthermore, Figure (c) is quite close to Figure (a) and can essentially restore the original image.
[0374] Figure 14 (a) shows the original image, Figure 14 (b) shows the image filtered using a traditional method, and Figure 14 (c) shows the image filtered using the method according to the embodiment of the present application. Comparing Figures (b) and (c), it can be seen that the method according to the embodiment of the present application can achieve a good filtering effect. Furthermore, Figure (c) is quite close to Figure (a) and can essentially restore the original image.
[0375] Figure 15 (a) shows the original image, Figure 15 (b) shows the image filtered using a traditional method, and Figure 15 (c) shows the image filtered using the solution of the embodiment of the present application. Comparing Figures (b) and (c), it can be seen that the solution of the embodiment of the present application can achieve a good filtering effect. Furthermore, Figure (c) is quite close to Figure (a), and can essentially restore the original image.
[0376] The method embodiment of the present application is described in detail above in conjunction with Figures 1 to 15 . The device embodiment of the present application is described in detail below in conjunction with Figures 16 to 19 . It should be understood that the description of the method embodiment corresponds to the description of the device embodiment. Therefore, for portions not described in detail, reference can be made to the above method embodiment.
[0377] Figure 16 is a schematic diagram of the structure of a decoder provided by one embodiment of the present application. As shown in Figure 16, decoder 1600 includes a first determination unit 1610, a second determination unit 1620, and a filtering unit 1630. First determination unit 1610 is configured to determine neighboring blocks of a current block; second determination unit 1620 is configured to determine first filtering parameters corresponding to the current block based on the prediction mode of the current block and / or the neighboring blocks; and filtering unit 1630 is configured to perform deblocking filtering on the current block based on the first filtering parameters.
[0378] In some implementations, if the prediction mode of the current block and the neighboring block is block vector prediction, the value of the first filtering parameter is less than the value of the second filtering parameter, and the second filtering parameter is the filtering parameter corresponding to the block based on intra-frame prediction.
[0379] In some implementations, if the prediction mode of the current block and the adjacent block is block vector prediction, then when a first condition is met, the value of the first filtering parameter is less than the value of the second filtering parameter, and the first condition is determined based on one or more of the following information: the boundary between the current block and the adjacent block; the transform coefficient corresponding to the current block; and the transform coefficient corresponding to the adjacent block.
[0380] In some implementations, the block vector prediction mode is a direct block vector DBV mode, and the first condition includes: the boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of chrominance components.
[0381] In some implementations, the block vector prediction mode is an intra template matching prediction TMP mode, and the first condition includes one or more of the following: the boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of the luminance component; the current block and the adjacent block belong to the luminance component, the boundary between the current block and the adjacent block is a sub-block boundary, and the prediction mode of the current block is different from that of the adjacent block; the current block and the adjacent block belong to the luminance component, the boundary between the current block and the adjacent block is a sub-block boundary, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, and the first direction is the horizontal direction or the vertical direction.
[0382] In some implementations, the block vector prediction mode is a DBV mode or an intra-frame TMP mode.
[0383] In some implementations, the first filtering parameter satisfies one or more of the following: the value of the first filtering parameter is 1; the value of the first filtering parameter is less than or equal to the product of the first value and the first ratio, the first value is the maximum value of the filtering parameter corresponding to the deblocking filter, and the first ratio is less than or equal to 50%.
[0384] In some implementations, if the second condition is met, the value of the first filtering parameter is greater than or equal to the value of the second filtering parameter, the second filtering parameter is the filtering parameter corresponding to the block based on intra-frame prediction, and the second condition includes one or more of the following: the encoding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not DBV mode; the encoding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not DBV mode.
[0385] In some implementations, if the third condition is met, the value of the first filtering parameter is greater than or equal to the value of the second filtering parameter, the second filtering parameter is the filtering parameter corresponding to the block based on intra-frame prediction, and the third condition includes one or more of the following: the encoding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not the intra-frame TMP mode; the encoding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not the intra-frame TMP mode.
[0386] In some implementations, if the prediction mode of the current block and / or the neighboring block includes intra-frame prediction, the value of the first filtering parameter is greater than the value of the third filtering parameter, and the third filtering parameter is the filtering parameter corresponding to the block predicted based on intra-frame block copy IBC.
[0387] In some implementations, if the coding blocks corresponding to the current block and / or the neighboring blocks are encoded based on combined intra block copy and intra prediction IBC-CIIP, the value of the first filtering parameter is greater than the value of the third filtering parameter.
[0388] In some implementations, if the coding blocks corresponding to the current block and / or the adjacent block are encoded based on geometric partitioned intra-frame block copy IBC-GPM, when a fourth condition is met, the value of the first filtering parameter is greater than the value of the third filtering parameter, and the fourth condition includes one or more of the following: the current block is not based on IBC prediction; the adjacent block is not based on IBC prediction.
[0389] In some implementations, the first filtering parameter satisfies one or more of the following: the value of the first filtering parameter is 2; the value of the first filtering parameter is less than or equal to the product of a first value and a second ratio, the first value is the maximum value of the filtering parameter corresponding to the deblocking filter, and the second ratio is greater than or equal to 50%.
[0390] In some implementations, if the coding blocks corresponding to the current block and / or the adjacent blocks are encoded based on IBC-GPM, and the boundary between the current block and the adjacent blocks is a transform block boundary, then when the fifth condition is met, the value of the first filter parameter is less than or equal to the value of the third filter parameter, and the third filter parameter is the filter parameter corresponding to the block based on IBC prediction, and the fifth condition includes: at least one of the transform coefficient corresponding to the current block and the transform coefficient corresponding to the adjacent block is non-zero, and the transform coefficient includes the transform coefficient of the luminance component and / or the transform coefficient of the chrominance component.
[0391] In some implementations, if the coding blocks corresponding to the current block and / or the adjacent blocks are encoded based on IBC-GPM, the current block and the adjacent blocks belong to the luminance component, and the boundary between the current block and the adjacent block is a sub-block boundary, then when the sixth condition is met, the value of the first filtering parameter is less than or equal to the value of the third filtering parameter, and the third filtering parameter is the filtering parameter corresponding to the block based on IBC prediction, and the sixth condition includes one or more of the following: the prediction mode of the current block and the adjacent block is different; the prediction mode of the current block and the adjacent block adopts the IBC mode, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in the first direction is greater than or equal to half a pixel, and the first direction is the horizontal direction or the vertical direction.
[0392] In some implementations, the current block is a transform block, a coding block, or a sub-block.
[0393] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.
[0394] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0395] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the decoder 1600. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned decoding method is implemented.
[0396] Based on the composition of the above-mentioned decoder 1600 and the computer-readable storage medium, refer to Figure 17, which shows a specific hardware structure diagram of the decoder provided by an embodiment of the present application. As shown in Figure 17, the decoder 1700 may include: a communication interface 1710, a memory 1720 and a processor 1730; each component is coupled together through a bus system 1740. It can be understood that the bus system 1740 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1740 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 1740 in Figure 17. Among them,
[0397] The communication interface 1710 is used to receive and send signals when sending and receiving information with other external network elements.
[0398] The memory 1720 is used to store computer programs.
[0399] The processor 1730 is configured to, when running the computer program, execute:
[0400] Determine adjacent blocks adjacent to the current block;
[0401] Determining a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the neighboring block;
[0402] Performing deblocking filtering on the current block based on the first filtering parameters.
[0403] It is understood that the memory 1720 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 1720 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0404] The processor 1730 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the processor 1730. The above-mentioned processor 1730 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 1720 , and the processor 1730 reads the information in the memory 1720 and completes the steps of the above method in combination with its hardware.
[0405] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0406] Optionally, as another embodiment, the processor 1730 is further configured to execute the decoding method described in the above embodiment when running the computer program.
[0407] Figure 18 is a schematic diagram of the structure of an encoder provided by one embodiment of the present application. As shown in Figure 18, encoder 1800 includes: a first determination unit 1810, a second determination unit 1820, and a filtering unit 1830. First determination unit 1810 is configured to determine adjacent blocks adjacent to a current block; second determination unit 1820 is configured to determine first filtering parameters corresponding to the current block based on the prediction mode of the current block and / or the adjacent blocks; and filtering unit 1830 is configured to perform deblocking filtering on the current block based on the first filtering parameters.
[0408] In some implementations, if the prediction mode of the current block and the neighboring block is block vector prediction, the value of the first filtering parameter is less than the value of the second filtering parameter, and the second filtering parameter is the filtering parameter corresponding to the block based on intra-frame prediction.
[0409] In some implementations, if the prediction mode of the current block and the adjacent block is block vector prediction, then when a first condition is met, the value of the first filtering parameter is less than the value of the second filtering parameter, and the first condition is determined based on one or more of the following information: the boundary between the current block and the adjacent block; the transform coefficient corresponding to the current block; and the transform coefficient corresponding to the adjacent block.
[0410] In some implementations, the block vector prediction mode is a direct block vector DBV mode, and the first condition includes: the boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of chrominance components.
[0411] In some implementations, the block vector prediction mode is an intra template matching prediction TMP mode, and the first condition includes one or more of the following: the boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of the luminance component; the current block and the adjacent block belong to the luminance component, the boundary between the current block and the adjacent block is a sub-block boundary, and the prediction mode of the current block is different from that of the adjacent block; the current block and the adjacent block belong to the luminance component, the boundary between the current block and the adjacent block is a sub-block boundary, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, and the first direction is the horizontal direction or the vertical direction.
[0412] In some implementations, the block vector prediction mode is a DBV mode or an intra-frame TMP mode.
[0413] In some implementations, the first filtering parameter satisfies one or more of the following: the value of the first filtering parameter is 1; the value of the first filtering parameter is less than or equal to the product of the first value and the first ratio, the first value is the maximum value of the filtering parameter corresponding to the deblocking filter, and the first ratio is less than or equal to 50%.
[0414] In some implementations, if the second condition is met, the value of the first filtering parameter is greater than or equal to the value of the second filtering parameter, the second filtering parameter is the filtering parameter corresponding to the block based on intra-frame prediction, and the second condition includes one or more of the following: the encoding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not DBV mode; the encoding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not DBV mode.
[0415] In some implementations, if the third condition is met, the value of the first filtering parameter is greater than or equal to the value of the second filtering parameter, the second filtering parameter is the filtering parameter corresponding to the block based on intra-frame prediction, and the third condition includes one or more of the following: the encoding mode of the current block is intra-frame coding, and the intra-frame prediction mode of the current block is not the intra-frame TMP mode; the encoding mode of the adjacent block is intra-frame coding, and the intra-frame prediction mode of the adjacent block is not the intra-frame TMP mode.
[0416] In some implementations, if the prediction mode of the current block and / or the neighboring block includes intra-frame prediction, the value of the first filtering parameter is greater than the value of the third filtering parameter, and the third filtering parameter is the filtering parameter corresponding to the block predicted based on intra-frame block copy IBC.
[0417] In some implementations, if the coding blocks corresponding to the current block and / or the neighboring blocks are encoded based on combined intra block copy and intra prediction IBC-CIIP, the value of the first filtering parameter is greater than the value of the third filtering parameter.
[0418] In some implementations, if the coding blocks corresponding to the current block and / or the adjacent block are encoded based on geometric partitioned intra-frame block copy IBC-GPM, when a fourth condition is met, the value of the first filtering parameter is greater than the value of the third filtering parameter, and the fourth condition includes one or more of the following: the current block is not based on IBC prediction; the adjacent block is not based on IBC prediction.
[0419] In some implementations, the first filtering parameter satisfies one or more of the following: the value of the first filtering parameter is 2; the value of the first filtering parameter is less than or equal to the product of a first value and a second ratio, the first value is the maximum value of the filtering parameter corresponding to the deblocking filter, and the second ratio is greater than or equal to 50%.
[0420] In some implementations, if the coding blocks corresponding to the current block and / or the adjacent blocks are encoded based on IBC-GPM, and the boundary between the current block and the adjacent blocks is a transform block boundary, then when the fifth condition is met, the value of the first filter parameter is less than or equal to the value of the third filter parameter, and the third filter parameter is the filter parameter corresponding to the block based on IBC prediction, and the fifth condition includes: at least one of the transform coefficient corresponding to the current block and the transform coefficient corresponding to the adjacent block is non-zero, and the transform coefficient includes the transform coefficient of the luminance component and / or the transform coefficient of the chrominance component.
[0421] In some implementations, if the coding blocks corresponding to the current block and / or the adjacent blocks are encoded based on IBC-GPM, the current block and the adjacent blocks belong to the luminance component, and the boundary between the current block and the adjacent block is a sub-block boundary, then when the sixth condition is met, the value of the first filtering parameter is less than or equal to the value of the third filtering parameter, and the third filtering parameter is the filtering parameter corresponding to the block based on IBC prediction, and the sixth condition includes one or more of the following: the prediction mode of the current block and the adjacent block is different; the prediction mode of the current block and the adjacent block adopts the IBC mode, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in the first direction is greater than or equal to half a pixel, and the first direction is the horizontal direction or the vertical direction.
[0422] In some implementations, the current block is a transform block, a coding block, or a sub-block. It is understandable that in the embodiments of the present application, a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module or a non-modular one. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.
[0423] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0424] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 1800. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the encoding method in the aforementioned embodiment is implemented.
[0425] Based on the composition of the above-mentioned encoder 1800 and the computer-readable storage medium, refer to Figure 19, which shows a specific hardware structure diagram of the encoder provided by an embodiment of the present application. As shown in Figure 19, the encoder 1900 may include: a communication interface 1919, a memory 1920 and a processor 1930; each component is coupled together through a bus system 1940. It can be understood that the bus system 1940 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1940 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 1940 in Figure 19. Among them,
[0426] The communication interface 1919 is used to receive and send signals when sending and receiving information with other external network elements.
[0427] The memory 1920 is used to store computer programs.
[0428] Processor 1930 is configured to, when running the computer program, execute:
[0429] Determine the neighboring blocks of the current block;
[0430] Determining a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the neighboring block;
[0431] Performing deblocking filtering on the current block based on the first filtering parameters.
[0432] It is understood that the memory 1920 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 1920 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0433] Processor 1930 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in processor 1930. The above-mentioned processor 1930 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 1920, and the processor 1930 reads the information in the memory 1920 and completes the steps of the above method in combination with its hardware.
[0434] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0435] Optionally, as another embodiment, the processor 1930 is further configured to execute the encoding method described in the above embodiment when running the computer program.
[0436] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0437] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0438] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0439] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0440] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0441] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A decoding method, applied to a decoder, comprising: Determine the neighboring blocks of the current block; Determining a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the neighboring block; Performing deblocking filtering on the current block based on the first filtering parameters.
2. The method according to claim 1, wherein If the prediction mode of the current block and the adjacent block is block vector prediction, the value of the first filtering parameter is smaller than the value of the second filtering parameter, and the second filtering parameter is a filtering parameter corresponding to a block based on intra-frame prediction.
3. The method according to claim 2, wherein: If the prediction mode of the current block and the neighboring block is block vector prediction, then when a first condition is met, the value of the first filtering parameter is less than the value of the second filtering parameter, and the first condition is determined based on one or more of the following information: a boundary between the current block and the adjacent block; The transform coefficient corresponding to the current block; The transform coefficients corresponding to the adjacent blocks.
4. The method according to claim 3, wherein: The block vector prediction mode is a direct block vector (DBV) mode, and the first condition includes: The boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of chrominance components.
5. The method according to claim 3, wherein The block vector prediction mode is an intra template matching prediction (TMP) mode, and the first condition includes one or more of the following: The boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of luminance components; The current block and the adjacent block belong to luminance components, a boundary between the current block and the adjacent block is a sub-block boundary, and the current block and the adjacent block have different prediction modes; The current block and the adjacent block belong to a luminance component, a boundary between the current block and the adjacent block is a sub-block boundary, and a difference between a block vector corresponding to the current block and a block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, where the first direction is a horizontal direction or a vertical direction.
6. The method according to claim 2 or 3, wherein: The block vector prediction mode is a DBV mode or an intra-frame TMP mode.
7. The method according to any one of claims 3 to 6, wherein The first filtering parameters satisfy one or more of the following: The value of the first filtering parameter is 1; The value of the first filtering parameter is less than or equal to the product of a first value and a first ratio, the first value is the maximum value of the filtering parameter corresponding to the deblocking filter, and the first ratio is less than or equal to 50%.
8. The method according to claim 1, wherein If the second condition is met, the value of the first filtering parameter is greater than or equal to the value of the second filtering parameter, the second filtering parameter is a filtering parameter corresponding to the block based on intra-frame prediction, and the second condition includes one or more of the following: The coding mode of the current block is intra coding, and the intra prediction mode of the current block is not DBV mode; The coding mode of the neighboring block is intra coding, and the intra prediction mode of the neighboring block is not DBV mode.
9. The method according to claim 1, wherein: If the third condition is met, the value of the first filtering parameter is greater than or equal to the value of the second filtering parameter, the second filtering parameter is a filtering parameter corresponding to a block based on intra-frame prediction, and the third condition includes one or more of the following: The coding mode of the current block is intra coding, and the intra prediction mode of the current block is not intra TMP mode; The coding mode of the neighboring block is intra coding, and the intra prediction mode of the neighboring block is not intra TMP mode.
10. The method according to claim 1, wherein If the prediction mode of the current block and / or the adjacent block includes intra prediction, the value of the first filtering parameter is greater than the value of the third filtering parameter, and the third filtering parameter is the filtering parameter corresponding to the block predicted based on intra block copy IBC.
11. The method according to claim 10, wherein: If the coding blocks corresponding to the current block and / or the adjacent blocks are coded based on combined intra block copy and intra prediction IBC-CIIP, the value of the first filtering parameter is greater than the value of the third filtering parameter.
12. The method according to claim 10, wherein: If the coding blocks corresponding to the current block and / or the neighboring blocks are coded based on geometric partitioned intra block copying (IBC-GPM), the value of the first filtering parameter is greater than the value of the third filtering parameter when a fourth condition is satisfied, and the fourth condition includes one or more of the following: The current block is not based on IBC prediction; The neighboring blocks are not based on IBC prediction.
13. The method according to any one of claims 10 to 12, wherein: The first filtering parameters satisfy one or more of the following: The value of the first filtering parameter is 2; The value of the first filtering parameter is less than or equal to the product of a first value and a second ratio, the first value is the maximum value of the filtering parameter corresponding to the deblocking filter, and the second ratio is greater than or equal to 50%.
14. The method according to claim 1, wherein If the coding block corresponding to the current block and / or the adjacent block is coded based on IBC-GPM, and the boundary between the current block and the adjacent block is a transform block boundary, then when a fifth condition is met, the value of the first filter parameter is less than or equal to the value of the third filter parameter, and the third filter parameter is a filter parameter corresponding to a block based on IBC prediction. The fifth condition includes: At least one of the transformation coefficient corresponding to the current block and the transformation coefficient corresponding to the adjacent block is non-zero, and the transformation coefficient includes a transformation coefficient of a luminance component and / or a transformation coefficient of a chrominance component.
15. The method according to claim 1, wherein If the coding block corresponding to the current block and / or the adjacent block is encoded based on IBC-GPM, the current block and the adjacent block belong to the luminance component, and the boundary between the current block and the adjacent block is a sub-block boundary, then when the sixth condition is met, the value of the first filtering parameter is less than or equal to the value of the third filtering parameter, and the third filtering parameter is a filtering parameter corresponding to a block based on IBC prediction. The sixth condition includes one or more of the following: The prediction mode of the current block is different from that of the adjacent block; The prediction mode of the current block and the adjacent block adopts the IBC mode, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, and the first direction is a horizontal direction or a vertical direction.
16. The method according to any one of claims 1 to 15, wherein The current block is a transform block, a coding block or a sub-block.
17. A coding method, applied to an encoder, comprising: Determine adjacent blocks adjacent to the current block; Determining a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the neighboring block; Performing deblocking filtering on the current block based on the first filtering parameters.
18. The method according to claim 17, wherein If the prediction mode of the current block and the neighboring block is block vector prediction, the first filtering parameter is smaller than a second filtering parameter, and the second filtering parameter is a filtering parameter corresponding to a block based on intra-frame prediction.
19. The method according to claim 18, wherein If the prediction mode of the current block and the neighboring block is block vector prediction, then when a first condition is satisfied, the first filtering parameter is less than the second filtering parameter, and the first condition is determined based on one or more of the following information: a boundary between the current block and the adjacent block; The transform coefficient corresponding to the current block; The transform coefficients corresponding to the adjacent blocks.
20. The method according to claim 19, wherein The block vector prediction mode is a direct block vector (DBV) mode, and the first condition includes: The boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of chrominance components.
21. The method according to claim 19, wherein The block vector prediction mode is an intra template matching prediction (TMP) mode, and the first condition includes one or more of the following: The boundary between the current block and the adjacent block is a transform block boundary, at least one of the transform coefficients corresponding to the current block and the transform coefficients corresponding to the adjacent block is non-zero, and the transform coefficients include transform coefficients of luminance components; The current block and the adjacent block belong to luminance components, a boundary between the current block and the adjacent block is a sub-block boundary, and the current block and the adjacent block have different prediction modes; The current block and the adjacent block belong to a luminance component, a boundary between the current block and the adjacent block is a sub-block boundary, and a difference between a block vector corresponding to the current block and a block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, where the first direction is a horizontal direction or a vertical direction.
22. The method according to claim 18 or 19, wherein The block vector prediction mode is a DBV mode or an intra-frame TMP mode.
23. The method according to any one of claims 19 to 22, wherein: The first filtering parameters satisfy one or more of the following: The value of the first filtering parameter is 1; The first filtering parameter is less than or equal to a product of a first value and a first ratio, the first value is a maximum filtering parameter corresponding to the deblocking filter, and the first ratio is less than or equal to 50%.
24. The method according to claim 17, wherein If the second condition is met, the first filtering parameter is greater than or equal to the second filtering parameter, where the second filtering parameter is a filtering parameter corresponding to a block based on intra-frame prediction, and the second condition includes one or more of the following: The coding mode of the current block is intra coding, and the intra prediction mode of the current block is not DBV mode; The coding mode of the neighboring block is intra coding, and the intra prediction mode of the neighboring block is not DBV mode.
25. The method according to claim 17, wherein If a third condition is met, the first filtering parameter is greater than or equal to the second filtering parameter, and the second filtering parameter is a filtering parameter corresponding to a block based on intra-frame prediction. The third condition includes one or more of the following: The coding mode of the current block is intra coding, and the intra prediction mode of the current block is not intra TMP mode; The coding mode of the neighboring block is intra coding, and the intra prediction mode of the neighboring block is not intra TMP mode.
26. The method according to claim 17, wherein If the prediction mode of the current block and / or the neighboring block includes intra prediction, the first filtering parameter is greater than a third filtering parameter, and the third filtering parameter is a filtering parameter corresponding to a block predicted based on intra block copy (IBC).
27. The method according to claim 26, wherein If the coding blocks corresponding to the current block and / or the neighboring blocks are coded based on combined intra block copy and intra prediction IBC-CIIP, the first filtering parameter is greater than the third filtering parameter.
28. The method according to claim 26, wherein If the coding blocks corresponding to the current block and / or the neighboring blocks are coded based on geometric partitioned intra block copying (IBC-GPM), the first filtering parameter is greater than the third filtering parameter when a fourth condition is met, and the fourth condition includes one or more of the following: The current block is not based on IBC prediction; The neighboring blocks are not based on IBC prediction.
29. The method according to claim 27 or 28, wherein The first filtering parameters satisfy one or more of the following: The value of the first filtering parameter is 2; The value of the first filtering parameter is less than or equal to the product of a first value and a second ratio, the first value is a maximum filtering parameter corresponding to the deblocking filter, and the second ratio is greater than or equal to 50%.
30. The method of claim 17, wherein: If the coding block corresponding to the current block and / or the neighboring block is coded based on IBC-GPM, and the boundary between the current block and the neighboring block is a transform block boundary, then if a fifth condition is met, the first filter parameter is less than or equal to the third filter parameter, and the third filter parameter is a filter parameter corresponding to a block based on IBC prediction, and the fifth condition includes: At least one of the transformation coefficient corresponding to the current block and the transformation coefficient corresponding to the adjacent block is non-zero, and the transformation coefficient includes a transformation coefficient of a luminance component and / or a transformation coefficient of a chrominance component.
31. The method of claim 17, wherein: If the coding block corresponding to the current block and / or the adjacent block is encoded based on IBC-GPM, the current block and the adjacent block belong to the luminance component, and the boundary between the current block and the adjacent block is a sub-block boundary, then if a sixth condition is met, the first filtering parameter is less than or equal to the third filtering parameter, and the third filtering parameter is a filtering parameter corresponding to a block based on IBC prediction, and the sixth condition includes one or more of the following: The prediction mode of the current block is different from that of the adjacent block; The prediction mode of the current block and the adjacent block adopts the IBC mode, and the difference between the block vector corresponding to the current block and the block vector corresponding to the adjacent block in a first direction is greater than or equal to half a pixel, and the first direction is a horizontal direction or a vertical direction.
32. The method according to any one of claims 17 to 31, wherein the current block is a transform block, a coding block or a sub-block.
33. A decoder comprising: A first determining unit configured to determine adjacent blocks of a current block; a second determining unit configured to determine a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the neighboring block; The filtering unit is configured to perform deblocking filtering on the current block based on the first filtering parameter.
34. A decoder comprising: memory for storing computer programs; A processor, configured to execute the method according to any one of claims 1 to 16 when running the computer program.
35. An encoder comprising: A first determining unit configured to determine a neighboring block adjacent to the current block; a second determining unit configured to determine a first filtering parameter corresponding to the current block based on a prediction mode of the current block and / or the neighboring block; The filtering unit is configured to perform deblocking filtering on the current block based on the first filtering parameter.
36. An encoder comprising: memory for storing computer programs; A processor, configured to execute the method according to any one of claims 17 to 32 when running the computer program.
37. A non-volatile computer-readable storage medium storing a bit stream, wherein the bit stream is generated by an encoding method using an encoder, or the bit stream is decoded by a decoding method using a decoder, wherein: The decoding method is the method according to any one of claims 1 to 16, and the encoding method is the method according to any one of claims 17 to 32.
38. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 16 or 17 to 32 is implemented.
39. A code stream, comprising a code stream generated by the method according to any one of claims 17 to 32.
Citation Information
Patent Citations
System and method for deblocking hdr content
CN112119639A
Deblocking filter for video coding and processing
CN112313953A
Chroma deblocking harmonization for video coding
CN113906763A
Real-time video coding / decoding
US20050276323A1
Image coding method, image decoding method, image coding apparatus, image decoding apparatus, and image coding-decoding apparatus
US20130142255A1