WO2025166744A1 - Encoding method, decoding method, encoder, decoder, bitstream, and storage medium - Google Patents
Encoding method, decoding method, encoder, decoder, bitstream, and storage mediumInfo
- Publication number
- WO2025166744A1 WO2025166744A1 PCT/CN2024/076981 CN2024076981W WO2025166744A1 WO 2025166744 A1 WO2025166744 A1 WO 2025166744A1 CN 2024076981 W CN2024076981 W CN 2024076981W WO 2025166744 A1 WO2025166744 A1 WO 2025166744A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- block
- current block
- filtering parameter
- value
- intra
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/117—Filters, e.g. for pre-processing or post-processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
Definitions
- 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.
- a decoding method 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.
- a coding method 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.
- a decoder 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.
- an encoder 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.
- an encoder comprising: a memory for storing a computer program; and a processor for executing the method of the second aspect when running the computer program.
- a non-volatile computer-readable storage medium for storing a bit stream, 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.
- a 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.
- FIG1 is a structural diagram illustrating an example of a video encoder to which an embodiment of the present application may be applied.
- FIG3 is a schematic diagram of a filtering process of deblocking filtering.
- FIG4 is a schematic diagram of a filtering decision process.
- FIG5 is a schematic diagram of pixel relationships at boundary positions.
- FIG6 is a schematic diagram of a DBV search position.
- FIG7 is a schematic diagram of the flip perception process for the DBV mode.
- FIG8 is a schematic diagram of a SAD decision process.
- FIG10 is a schematic diagram of an intra-frame TMP.
- 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.
- FIG1 is a schematic block diagram of a video encoder according to an embodiment of the present application.
- 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.
- 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.
- the filter length corresponding to the P block is denoted as SP
- 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.
- 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.
- the initial values of the filter lengths SP and SQ of the chrominance components are set to:
- the filter strength of the boundary can also be called the boundary strength.
- Obtaining the boundary strength is to preliminarily determine whether the block boundary requires 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 blocking effects.
- BS boundary strength
- the boundary strength value is 0, 1, or 2.
- the boundary strength value is 0, it means that the boundary does not require filtering and no subsequent processing (such as filter strength selection and filtering operation) will be performed.
- subsequent module processing will be performed, and its value will affect the threshold in the subsequent "filter strength selection”.
- p0 is the pixel on the left side of the boundary, that is, recPicture[xCb+xDi-1][yCb+yDj]
- q0 is the pixel on the right side of the boundary, that is, recPicture[xCb+xDi][yCb+yDj].
- p0 is the pixel on the upper side of the boundary, that is, recPicture[xCb+xDi][yCb+yDj-1]
- q0 is the pixel on the lower side of the boundary, that is, recPicture[xCb+xDi][yCb+yDj].
- 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.
- 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.
- 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.
- 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.
- variables dE, dEp, and dEq are the filtering decision results
- Variables maxFilterLengthP and maxFilterLengthQ are the maximum filter lengths
- Threshold tC Threshold
- the output is the modified reconstructed image recPicture.
- edgeType equal to EDGE_VER as an example, and perform the following steps in sequence:
- pi,k recPicture[xCb+xBl-i-1][yCb+yBl+k]
- pi,k recPicture[xCb+xBl-i-1][yCb+yBl+k]
- DBV direct block vector
- IBC-CIIP combined intra block copy and intra prediction
- IBC-GPM intra block copy with geometry partitioning mode
- 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, a 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.
- the obtained luminance bvL is flipped to obtain bvL'.
- the luminance bvL is obtained from the TL position of the co-located luminance region of the current chrominance block.
- the center position coordinates of the luminance block at the TL position are (Refx, Refy)
- the center position coordinates of the co-located luminance region of the current chrominance block are (Curx, Cury).
- bvL (bvLhor,0)
- bvL' (bvLhor+2*(Refx-Curx),0)
- the scaling process is as follows:
- bvC0 (bvLhor>>1,bvLver>>1)
- bvC1 ((bvLhor+1)>>1,bvLver>>1)
- bvC2 (bvLhor>>1,(bvLver+1)>>1)
- bvC3 ((bvLhor+1)>>1,(bvLver+1)>>1)
- SADs sum of absolute differences
- 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.
- 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.
- 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.
- the DBV mode is suitable for scenes with single tree partitioning.
- the variable cIdx indicates the color component of the current CU.
- the DBV mode is a prediction mode for chroma blocks
- the DBV mode is only studied for the filtering intensity process of obtaining the boundary of the chroma component.
- the prediction is generated by matching the L-shaped, top-only, or left-only neighbor of the current block with another block in the predefined search areas in Figure 10.
- predefined search areas namely R1 to R6 in Figure 10
- R1 to R6 which contain reconstructed samples from the top and left CTUs, as well as partially reconstructed samples within the current CTU located above, to the left, below, and above the right of the current block.
- SAD sum of absolute differences
- a given search order of 6 areas is used, namely R4, R5, R6, R1, R2, and R3.
- the decoder builds a candidate list of up to 19 template matching block vectors, which are sorted in ascending order according to the template cost (SAD).
- SearchRange_w minimum(64, a*BlkW)
- SearchRange_h minimum(64, a*BlkH)
- IntraTMP mode supports the following modes:
- Single prediction Selects a single block vector prediction from a candidate list.
- 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.
- 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.
- 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.
- the search range of all search areas is subsampled by a factor of 3.
- a refinement process is performed. This refinement is done by performing a second template matching search with a narrowed range around the best match.
- 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.
- 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.
- the variable cIdx indicates the color component of the current CU.
- Pibc represents an IBC prediction signal
- Pintra represents an intra-frame prediction signal
- the intra prediction mode (IPM) candidate list is used to generate the 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.
- the following steps can be used to obtain the filter strength of the boundary:
- the boundary is a transform block boundary.
- bS[xDi][yDj] is set to 1 when any of the following conditions is met:
- 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:
- 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.
- 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:
- the boundary is a transform block boundary.
- bS[xDi][yDj] is set to 1 when any of the following conditions is met:
- 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.
- 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 regular IBC MERGE mode or 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.
- the IBC-GPM geometry partitioning mode set is identified with a syntax element to indicate whether the first geometry partitioning mode set or the 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 sub-partition.
- intra prediction mode index is signaled.
- IBC is used A MERGE index is signaled when the subpartition is created.
- 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.
- the following steps can be used to obtain the filter strength of the boundary:
- the following steps can be used to obtain the filter strength of the boundary.
- the boundary is a transform block boundary.
- bS[xDi][yDj] is set to 1 when any of the following conditions is met:
- 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:
- 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.
- 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:
- the boundary is a transform block boundary.
- bS[xDi][yDj] is set to 1 when any of the following conditions is met:
- the filter parameter (BS) corresponding to the deblocking filter the BS value is determined according to the process described above.
- BS filter parameter
- 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.
- 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.
- 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.
- 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.
- 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).
- the prediction mode may include one of the following: DBV mode, IntraTMP mode, IBC-CIIP mode, and IBC-GPM mode.
- step S1130 deblocking filtering is performed on the current block based on the first filtering parameters.
- 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 strong filtering,
- the filtering operations for the luminance component and the chrominance component are different.
- the filtering operation may include long tap filtering for the luminance component, short tap strong filtering for the luminance component, and short tap weak filtering for the luminance component.
- the filtering operation may include strong filtering for the chrominance component and weak filtering for the chrominance component.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- the boundary between the current block and the adjacent block is a sub-block (predicted sub-block) boundary
- 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
- 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
- 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%.
- 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.
- 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.
- 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.
- the value of the first filter parameter is greater than or equal to the value of the second filter parameter.
- the second condition includes the following: One or more of: 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 adjacent block is intra-coding, and the intra-prediction mode of the adjacent block is not DBV mode. For example, if the coding mode of the current block is intra-coding, and the intra-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.
- the value of the first filter parameter is greater than or equal to the value of the second filter parameter.
- 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 adjacent block is intra-coding
- the intra-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.
- 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.
- the value of the first filtering parameter and the value of the second filtering parameter are both 2.
- the value of the first filter parameter is greater than or equal to the value of the second filter parameter.
- 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.
- 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.
- the value of the first filtering parameter and the value of the second filtering parameter are both 2.
- 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.
- 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.
- 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.
- 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%.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- the prediction mode of the current block and the adjacent block is block vector prediction
- 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.
- 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.
- 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.
- 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.
- 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.
- the value of the first filtering parameter is less than the value of the second filtering parameter.
- 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.
- 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%.
- 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.
- 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.
- 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.
- 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.
- the value of the first filtering parameter may be equal to the value of the third filtering parameter.
- the value of the first filtering parameter and the value of the third filtering parameter are both 1.
- 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.
- the value of the first filtering parameter may be equal to the value of the third filtering parameter.
- the value of the first filtering parameter and the value of the third filtering parameter are both 1.
- the variable cIdx indicates the color component of the current CU.
- 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:
- 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.
- the ibc_ciip_flag of the corresponding CU at the p0 or q0 position is equal to 1
- bS[xDi][yDj] is set to 2.
- 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.
- boundary is a transform block boundary
- bS[xDi][yDj] is set to 1 when one of the following conditions is met:
- 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:
- 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.
- 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.
- the boundary is the transform block boundary.
- bS[xDi][yDj] is set to 1 when any of the following conditions is met:
- the value of the first filtering parameter is less than the value of the second filtering parameter
- the second filtering parameter is the filtering parameter corresponding to the block based on intra-frame prediction.
- the prediction mode of the current block and the adjacent block is block vector prediction
- the value of the first filtering parameter is less than the value of the second filtering parameter
- 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.
- the block vector prediction mode is a direct block vector DBV mode
- 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.
- the block vector prediction mode is an intra template matching prediction TMP 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 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.
- the block vector prediction mode is a DBV mode or an intra-frame TMP mode.
- 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
- 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 adjacent The coding mode of the block is intra coding, and the intra prediction mode of the neighboring block is not intra TMP mode.
- the value of the first filtering parameter is greater than the value of the third filtering parameter.
- 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.
- the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
- the computer software product is stored in a storage medium and includes several instructions for enabling 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 disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
- 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.
- 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,
- the memory 1720 is used to store computer programs.
- the processor 1730 is configured to, when running the computer program, execute:
- 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.
- 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). Random Access Memory (RAM) used as an external cache.
- RAM Static RAM
- DRAM Dynamic RAM
- SDRAM Synchronous DRAM
- DDRSDRAM Double Data Rate SDRAM
- ESDRAM Enhanced SDRAM
- SLDRAM Synchronous Link DRAM
- DRRAM Direct Rambus RAM
- 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.
- Figure 18 is a schematic diagram of the structure of an encoder provided by one embodiment of the present application.
- 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;
- filtering unit 1830 is configured to perform deblocking filtering on the current block based on the first filtering parameters.
- the value of the first filtering parameter is less than the value of the second filtering parameter
- the second filtering parameter is the filtering parameter corresponding to the block based on intra-frame prediction.
- the prediction mode of the current block and the adjacent block is block vector prediction
- the value of the first filtering parameter is less than the value of the second filtering parameter
- 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.
- the block vector prediction mode is a DBV mode or an intra-frame TMP mode.
- 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%.
- the value of the first filtering parameter is greater than the value of the third filtering parameter
- the third filtering parameter is the filtering parameter corresponding to the block predicted based on intra-frame block copy IBC.
- 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.
- 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.
- the bus system 1940 also includes a power bus, a control bus and a status signal bus.
- various buses are labeled as bus system 1940 in Figure 19. Among them,
- the communication interface 1919 is used to receive and send signals when sending and receiving information with other external network elements.
- Processor 1930 is configured to, when running the computer program, execute:
- 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.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
本申请涉及视频编解码技术领域,尤其涉及一种编解码方法、编解码器、码流以及存储介质。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.
在编解码过程中,由于相邻的块在编码的过程中使用的编码方式可能不同,会造成边界处像素的不连续,这种现象也称为块效应。因此,需要利用去方块滤波去除块效应。但是,在确定去方块滤波对应的滤波参数有时候不合理,降低了滤波效果。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.
发明内容Summary of the Invention
本申请提供一种编解码方法、编解码器、码流以及存储介质。下面对本申请涉及的各个方面进行介绍。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.
第一方面,提供了一种解码方法,该解码方法应用于解码器,该解码方法包括:确定当前块的相邻块;基于所述当前块和/或所述相邻块的预测模式,确定所述当前块对应的第一滤波参数;基于所述第一滤波参数,对所述当前块进行去方块滤波。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.
第二方面,提供了一种编码方法,该编码方法应用于编码器,该编码方法包括:确定当前块的相邻块;基于所述当前块和/或所述相邻块的预测模式,确定所述当前块对应的第一滤波参数;基于所述第一滤波参数,对所述当前块进行去方块滤波。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.
第三方面,提供了一种解码器,包括:第一确定单元,配置为确定当前块的相邻块;第二确定单元,配置为基于所述当前块和/或所述相邻块的预测模式,确定所述当前块对应的第一滤波参数;滤波单元,配置为基于所述第一滤波参数,对所述当前块进行去方块滤波。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.
第四方面,提供了一种解码器,包括:存储器,用于存储计算机程序;处理器,用于在运行计算机程序时,执行如第一方面的方法。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.
第五方面,提供了一种编码器,包括:第一确定单元,配置为确定当前块的相邻块;第二确定单元,配置为基于所述当前块和/或所述相邻块的预测模式,确定所述当前块对应的第一滤波参数;滤波单元,配置为基于所述第一滤波参数,对所述当前块进行去方块滤波。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.
第六方面,提供了一种编码器,包括:存储器,用于存储计算机程序;处理器,用于在运行计算机程序时,执行如第二方面的方法。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.
第七方面,提供了一种计算机可读存储介质,其中,计算机可读存储介质存储有计算机程序,计算机程序被执行时实现如第一方面或者第二方面的方法。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.
第八方面,提供一种计算机程序产品,包括计算机程序,计算机程序被执行时实现如第一方面或第二方面的方法。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.
第九方面,提供一种存储比特流的非易失性计算机可读存储介质,比特流通过利用编码器的编码方法而生成,或者,比特流通过利用解码器的解码方法而解码,其中,解码方法为第一方面所述的方法、编码方法为第二方面所述的方法。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.
第十方面,提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被执行时实现如第一方面,或第二方面所述的方法。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.
第十一方面,提供一种码流,包括根据第二方面所述的方法生成的码流。According to an eleventh aspect, a code stream is provided, including a code stream generated according to the method described in the second aspect.
本申请实施例基于当前块和/或相邻块的预测模式,确定去方块滤波对应的滤波参数。由于当前块和相邻块在边界处的块效应与块的预测模式息息相关,因此,基于预测模式确定出的滤波参数更合理,从而可以达到较好的滤波效果。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.
图1为可应用本申请实施例的视频编码器的结构示例图。FIG1 is a structural diagram illustrating an example of a video encoder to which an embodiment of the present application may be applied.
图2为可应用本申请实施例的视频解码器的结构示例图。FIG2 is a diagram showing an example structure of a video decoder to which an embodiment of the present application can be applied.
图3为一种去方块滤波的滤波过程的示意图。FIG3 is a schematic diagram of a filtering process of deblocking filtering.
图4为一种滤波决策过程的示意图。FIG4 is a schematic diagram of a filtering decision process.
图5为边界位置处像素关系的示意图。FIG5 is a schematic diagram of pixel relationships at boundary positions.
图6为一种DBV搜索位置的示意图。FIG6 is a schematic diagram of a DBV search position.
图7为针对DBV模式的翻转感知过程的示意图。 FIG7 is a schematic diagram of the flip perception process for the DBV mode.
图8为一种SAD决策过程的示意图。FIG8 is a schematic diagram of a SAD decision process.
图9为DBV的色度预测过程的示意图。FIG9 is a schematic diagram of the chroma prediction process of DBV.
图10为一种帧内TMP的示意图。FIG10 is a schematic diagram of an intra-frame TMP.
图11为本申请实施例提供的解码方法的流程示意图。FIG11 is a flow chart of a decoding method provided in an embodiment of the present application.
图12为本申请实施例提供的编码方法的流程示意图。FIG12 is a flow chart of the encoding method provided in an embodiment of the present application.
图13为基于本申请实施例提供的方案和基于传统方案进行滤波后的效果图。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.
图14为基于本申请实施例提供的方案和基于传统方案进行滤波后的效果图。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.
图15为基于本申请实施例提供的方案和基于传统方案进行滤波后的效果图。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.
图16为本申请一个实施例提供的解码器的结构示意图。FIG16 is a schematic diagram of the structure of a decoder provided in one embodiment of the present application.
图17为本申请另一实施例提供的解码器的结构示意图。FIG17 is a schematic diagram of the structure of a decoder provided in another embodiment of the present application.
图18为本申请一个实施例提供的编码器的结构示意图。FIG18 is a schematic diagram of the structure of an encoder provided in one embodiment of the present application.
图19为本申请另一实施例提供的编码器的结构示意图。FIG19 is a schematic diagram of the structure of an encoder provided in another embodiment of the present application.
下面将结合附图,对本申请中的技术方案进行描述。The technical solution in this application will be described below with reference to the accompanying drawings.
图1是本申请实施例涉及的视频编码器的示意性框图。FIG1 is a schematic block diagram of a video encoder according to an embodiment of the present application.
应理解,该视频编码器100可用于对图像进行有损压缩(lossy compression),也可用于对图像进行无损压缩(lossless compression)。该无损压缩可以是视觉无损压缩(visually lossless compression),也可以是数学无损压缩(mathematically lossless compression)。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.
该视频编码器100可应用于亮度色度(YCbCr,YUV)格式的图像数据上。例如,YUV比例可以为4:2:0、4:2:2或者4:4:4,Y表示明亮度(Luma),Cb(U)表示蓝色色度,Cr(V)表示红色色度,U和V表示为色度(Chroma)用于描述色彩及饱和度。例如,在颜色格式上,4:2:0表示每4个像素有4个亮度分量,2个色度分量(YYYYCbCr),4:2:2表示每4个像素有4个亮度分量,4个色度分量(YYYYCbCrCbCr),4:4:4表示全像素显示(YYYYCbCrCbCrCbCrCbCr)。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).
例如,该视频编码器100读取视频数据,针对视频数据中的每个图像,将一个图像划分成若干个编码树单元(coding tree unit,CTU),在一些例子中,CTU可被称作“树型块”、“最大编码单元”(Largest Coding unit,简称LCU)或“编码树型块”(coding tree block,简称CTB)。每一个CTU可以与图像内的具有相等大小的像素块相关联。每一像素可对应一个亮度(luminance或luma)采样及两个色度(chrominance或chroma)采样。因此,每一个CTU可与一个亮度采样块及两个色度采样块相关联。一个CTU大小例如为128×128、64×64、32×32等。一个CTU又可以继续被划分成若干个编码单元(coding unit,CU)进行编码,CU可以为矩形块也可以为方形块。CU可以对应预测单元(prediction unit,简称PU)和变换单元(transform unit,简称TU)。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," "largest coding unit" (LCU), or "coding tree block" (CTB). Each CTU may be associated with a pixel block of equal size within an image. Each pixel may correspond to one luminance (luma) sample and two chrominance (chroma) samples. Therefore, each CTU may be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU may be, 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).
在一些实施例中,如图1所示,该视频编码器100可包括:预测模块110、残差模块120、变换/量化模块130、反变换/量化模块140、重建模块150、环路滤波模块160、解码图像缓存170和熵编码模块180。需要说明的是,视频编码器100可包含更多、更少或不同的功能组件。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.
可选地,在本申请中,当前块可以称为当前编码单元(CU)。预测块也可称为预测图像块或图像预测块,重建图像块也可称为重建块或图像重建块。由于并行处理的需要,图像可以被划分成片(slice)。同一个图像中的slice可以并行处理,也就是说它们之间没有数据依赖。而“帧”是一种常用的说法,一般可以理解为一帧是一个图像。在本文中所述帧也可以替换为图像或slice等。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.
在一些实施例中,预测模块110包括帧间预测模块111和帧内预测模块112。由于视频的一个图像中的相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测的方法消除相邻像素之间的空间冗余。由于视频中的相邻图像之间存在着很强的相似性,在视频编解码技术中使用帧间预测方法消除相邻图像之间的时间冗余,从而提高编码效率。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.
帧间预测模块111可用于帧间预测,帧间预测可以包括运动估计(motion estimation)和运动补偿(motion compensation),可以参考不同图像的图像信息,帧间预测使用运动信息从参考图像中找到参考块,根据参考块生成预测块,用于消除时间冗余。帧间预测使用运动信息从参考图像中找到参考块,根据参考块生成预测块。运动信息包括参考图像所在的参考图像列表,参考图像索引,以及运动矢量。运动矢量可以是整像素的或者是分像素的,如果运动矢量是分像素的,那么需要在参考图像中使用插值滤波做出所需的分像素的块,这里把根据运动矢量找到的参考图像中的整像素或者分像素的块叫参考块。有的技术会直接把参考块作为预测块,有的技术会在参考块的基础上再处理生成预测块。在参考块的基础上再处理生成预测块也可以理解为把参考块作为预测块然后再在预测块的基础上处理生成新的预测块。 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.
帧内预测模块112只参考同一图像的信息,预测当前图像块内的像素信息,用于消除空间冗余。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.
帧内预测有多种预测模式,以国际数字视频编码标准H系列为例,H.264/AVC标准有8种角度预测模式和1种非角度预测模式,H.265/HEVC扩展到33种角度预测模式和2种非角度预测模式。(high efficiency video coding,HEVC)使用的帧内预测模式有平面模式(Planar)、直流模式(DC)和33种角度模式,共35种预测模式。多功能视频编码(versatile video coding,VVC)使用的帧内模式有Planar、DC和65种角度模式,共67种预测模式。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.
需要说明的是,随着角度模式的增加,帧内预测将会更加精确,也更加符合对高清以及超高清数字视频发展的需求。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.
残差模块120可基于CU的像素块及CU的预测块来产生CU的残差块。举例来说,残差模块120可产生CU的残差块,使得残差块中的每一采样具有等于以下两者之间的差的值:CU的像素块中的采样,及CU的预测块中的对应采样。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.
变换/量化模块130可量化变换系数。变换/量化模块130可基于与CU相关联的量化参数(QP)值来量化与CU相关联的变换系数。视频编码器100可通过调整与CU相关联的QP值来调整应用于与CU相关联的变换系数的量化程度。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.
反变换/量化模块140可分别将逆量化及逆变换应用于量化后的变换系数,以从量化后的变换系数重建残差块。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.
重建模块150可将重建后的残差块的采样加到预测模块110产生的一个或多个预测块的对应采样,以产生与CU相关联的重建图像块。通过此方式重建CU的每一个采样块,视频编码器100可重建CU的像素块。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.
环路滤波模块160用于对反变换与反量化后的像素进行处理,弥补失真信息,为后续编码像素提供更好的参考,例如可执行消块滤波操作以减少与CU相关联的像素块的块效应。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.
在一些实施例中,环路滤波模块160包括去块滤波模块和样点自适应补偿/自适应环路滤波(SAO/ALF)模块,其中去块滤波模块用于去方块效应,SAO/ALF模块元用于去除振铃效应。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.
解码图像缓存170可存储重建后的像素块。帧间预测模块111可使用含有重建后的像素块的参考图像来对其它图像的PU执行帧间预测。另外,帧内预测模块112可使用解码图像缓存170中的重建后的像素块来对在与CU相同的图像中的其它PU执行帧内预测。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.
熵编码模块180可接收来自变换/量化模块130的量化后的变换系数。熵编码模块180可对量化后的变换系数执行一个或多个熵编码操作以产生熵编码后的数据。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.
图2是本申请实施例涉及的视频解码器的示意性框图。FIG2 is a schematic block diagram of a video decoder according to an embodiment of the present application.
如图2所示,视频解码器200包含:熵解码模块210、预测模块220、反量化/变换模块230、重建模块240、环路滤波模块250及解码图像缓存260。需要说明的是,视频解码器200可包含更多、更少或不同的功能组件。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.
视频解码器200可接收码流。熵解码模块210可解析码流以从码流提取语法元素。作为解析码流的一部分,熵解码模块210可解析码流中的经熵编码后的语法元素。预测模块220、反量化/变换模块230、重建模块240及环路滤波模块250可根据从码流中提取的语法元素来解码视频数据,即产生解码后的视频数据。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.
在一些实施例中,预测模块220包括帧内预测模块222和帧间预测模块221。In some embodiments, the prediction module 220 includes an intra-frame prediction module 222 and an inter-frame prediction module 221 .
帧内预测模块222可执行帧内预测以产生PU的预测块。帧内预测模块222可使用帧内预测模式以基于空间相邻PU的像素块来产生PU的预测块。帧内预测模块222还可根据从码流解析的一个或多个语法元素来确定PU的帧内预测模式。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.
帧间预测模块221可根据从码流解析的语法元素来构造第一参考图像列表(列表0)及第二参考图像列表(列表1)。此外,如果PU使用帧间预测编码,则熵解码模块210可解析PU的运动信息。帧间预测模块221可根据PU的运动信息来确定PU的一个或多个参考块。帧间预测模块221可根据PU的一个或多个参考块来产生PU的预测块。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.
反量化/变换模块230可逆量化(即,解量化)与TU相关联的变换系数。反量化/变换模块230可使用与TU的CU相关联的QP值来确定量化程度。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.
在逆量化变换系数之后,反量化/变换模块230可将一个或多个逆变换应用于逆量化变换系数,以便产生与TU相关联的残差块。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.
重建模块240使用与CU的TU相关联的残差块及CU的PU的预测块以重建CU的像素块。例如,重建模块240可将残差块的采样加到预测块的对应采样以重建CU的像素块,得到重建图像块。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.
环路滤波模块250可执行消块滤波操作以减少与CU相关联的像素块的块效应。The loop filtering module 250 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.
视频解码器200可将CU的重建图像存储于解码图像缓存260中。视频解码器200可将解码图像缓 存260中的重建图像作为参考图像用于后续预测,或者,将重建图像传输给显示装置呈现。The video decoder 200 may store the reconstructed image of the CU in the decoded image buffer 260. The video decoder 200 may store the decoded image buffer 260. The reconstructed image stored in 260 is used as a reference image for subsequent prediction, or the reconstructed image is transmitted to a display device for presentation.
视频编解码的基本流程如下:在编码端,将一个图像划分成块,针对当前块,预测模块110使用帧内预测或帧间预测产生当前块的预测块。残差模块120可基于预测块与当前块的原始块计算残差块,即预测块和当前块的原始块的差值,该残差块也可称为残差信息。该残差块经由变换/量化模块130变换与量化等过程,可以去除人眼不敏感的信息,以消除视觉冗余。可选的,经过变换/量化模块130变换与量化之前的残差块可称为时域残差块,经过变换/量化模块130变换与量化之后的时域残差块可称为频率残差块或频域残差块。熵编码模块180接收到变换/量化模块130输出的量化后的变换系数,可对该量化后的变换系数进行熵编码,输出码流。例如,熵编码模块180可根据目标上下文模型以及二进制码流的概率信息消除字符冗余。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.
在解码端,熵解码模块210可解析码流得到当前块的预测信息、量化系数矩阵等,预测模块220基于预测信息对当前块使用帧内预测或帧间预测产生当前块的预测块。反量化/变换模块230使用从码流得到的量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块。重建模块240将预测块和残差块相加得到重建块。重建块组成重建图像,环路滤波模块250基于图像或基于块对重建图像进行环路滤波,得到解码图像。编码端同样需要和解码端类似的操作获得解码图像。该解码图像也可以称为重建图像,重建图像可以为后续的图像作为帧间预测的参考图像。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.
需要说明的是,编码端确定的块划分信息,以及预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息等在必要时携带在码流中。解码端通过解析码流及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。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.
可以理解的是,解码端对变换系数的“反变换”,在标准文本中也可称为“变换”。本申请实施例中的“变换”和“反变换”对应的是两个相反的过程,如“变换”将空间域的数值转换到频率域的系数,那么“反变换”将频率域的系数转换到空间域的数值。标准如果只规定解码,那么标准文本中的“变换”是解码的部分,指的是本文中的“反变换”。解码端对变换系数的“反变换”,在标准文本中也可称为“变换”。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.
上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。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.
前文详细描述了本申请实施例提供的编解码框架。本申请涉及滤波技术。滤波技术可应用于编解码框架中的环路滤波模块。下面对本申请涉及的滤波技术进行介绍。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.
在编码过程中,各个块的变换量化过程相互独立进行,另外,在运动补偿预测中,相邻块的预测值来自于不同图像的不同位置,因此,在块与块的边界处会出现清晰的不连续像素,严重影响图像的主观质量。这种现象也称为块效应。去块滤波模块(或称为去方块滤波模块)可以去除上述块效应。下面对去方块滤波的滤波过程进行介绍。下文中的去方块滤波的滤波过程对于解码端和编码端同样适用。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.
如图3所示,去方块滤波的滤波过程包括确定待滤波边界(S310)、滤波决策(S320)和滤波操作(S330)三个过程。在确定待滤波边界之前,还可以进行滤波前重建操作。在执行完滤波操作之后,还可以进行滤波后重建操作。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.
获取待滤波边界Get the boundary to be filtered
滤波时首先确定待滤波的边界,确保去方块滤波过程可以应用于所有子块边界和CU边界。但是,以下情况除外: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:
(1)整幅图像的边界;(1) The boundary of the entire image;
(2)当sps_loop_filter_across_subpic_enabled_flag为0时,不可应用于子块边界;(2) When sps_loop_filter_across_subpic_enabled_flag is 0, it cannot be applied to sub-block boundaries;
(3)当VirtualBoundariesPresentFlag为1时,不可应用于虚拟边界;(3) When VirtualBoundariesPresentFlag is 1, it cannot be applied to virtual boundaries;
(4)当pps_loop_filter_across_tiles_enabled_flag为0时,不可应用于Tile边界;(4) When pps_loop_filter_across_tiles_enabled_flag is 0, it cannot be applied to Tile boundaries;
(5)当pps_loop_filter_across_slices_enabled_flag is equal为0时,不可应用于Silce边界;(5) When pps_loop_filter_across_slices_enabled_flag is equal to 0, it cannot be applied to the Silce boundary;
(6)当sh_deblocking_filter_disabled_flag equal为1时,不可应用于Slice的上边界、左边界和Slice内部的所有边界;(6) When sh_deblocking_filter_disabled_flag equal is 1, it cannot be applied to the upper boundary, left boundary and all boundaries inside the slice;
(7)亮度分量不对4×4的像素格边界应用;(7) The luminance component is not applied to the 4×4 pixel grid boundary;
(8)色度分量不对8×8的像素格边界应用;(8) The chroma components are not applied to the 8×8 pixel grid boundaries;
(9)亮度分量两侧intra_bdpcm_luma_flag equal都为1的边界不进行滤波;(9) No filtering is performed on the boundaries where intra_bdpcm_luma_flag equal is 1 on both sides of the luminance component;
(10)色度分量两侧intra_bdpcm_chroma_flag equal都为1的边界不进行滤波;(10) No filtering is performed on the boundaries where intra_bdpcm_chroma_flag equal is 1 on both sides of the chroma component;
(11)色度子块边界且该边界不是相关变换块的边界。(11) Chroma subblock boundary and the boundary is not the boundary of the related transform block.
滤波决策Filtering Decision
滤波决策是对所有满足滤波条件的CU、TU、子块的边界,根据视频内容和编码参数,确定最大滤波长度、边界的滤波强度(boundary strength,BS)及滤波参数,从而选择合适的滤波强度。如图4所示,滤波决策过程可以包括获取最大滤波长度(S322)、获取边界滤波强度(S324)以及滤波强弱选择(S326)。下面对上述三个过程分别进行介绍。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, thereby selecting an appropriate filter strength. As shown in Figure 4, the filtering decision-making process includes 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.
获取最大滤波长度Get the maximum filter length
获取最大滤波长度是根据CU的大小、子块的大小、子块与CU边界的距离初步确定相邻块的每行最多可修改的像素的个数和/或每列最多可修改的像素的个数。块边界处的像素位置如图5所示,P块和Q块为边界两侧4×4大小的块。对于垂直边界,P块表示边界左侧的块,Q表示边界右侧的块。对于水平边界,P块表示边界上侧的块,Q块表示边界下侧的块。P块和Q块内每行(或每列)被滤波的像素数称为滤波长度。与P块对应的滤波长度记为SP,与Q块对应的滤波长度记为SQ。SP和SQ可以根据CU的大小、子块的大小、子块与CU边界的距离确定。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.
对于亮度分量,SP和SQ的初始值设置如下:For the luma component, the initial values of SP and SQ are set as follows:
(1)如果CU或TU边界尺寸(CU或TU边界距离块边界的像素数)大于或等于32,则SP和SQ的值设置为7;(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;
(2)如果CU或TU边界尺寸小于等于4,则SP和SQ值设为1;(2) If the CU or TU boundary size is less than or equal to 4, the SP and SQ values are set to 1;
(3)其余情况下,SP和SQ值设为3;(3) In other cases, the SP and SQ values are set to 3;
如果一个CU里面包含子块,则:If a CU contains sub-blocks, then:
如果CU边界距离子块边界8个像素,则CU边界的SQ值限制为小于等于5;若CU的左侧CU或上侧CU的inter_affine_flag或merge_subblock_flag为1,则CU边界的SP值限制为小于等于5;TU边界的SP和SQ值限制为小于等于5。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.
子块边界的SP和SQ值为:The SP and SQ values at the sub-block boundary are:
(1)如果子块边界距离CU或TU边界8个像素,SP和SQ值限制为小于等于2。(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.
(2)如果子块边界距离CU或TU边界4个像素,SP和SQ值设置为1。(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.
(3)其余情况下,SP和SQ值设为3。(3) In other cases, the SP and SQ values are set to 3.
对于CTU水平边界的上方,SP限制为小于等于3。当最大滤波长度大于3时,会将当前块标记为大块,即将标志位sidePisLargeBlk或sideQisLargeBlk设为1。对大块进行开关决策时,会考虑更多的边界像素。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.
色度分量的滤波长度SP和SQ的初始值设置为:The initial values of the filter lengths SP and SQ of the chrominance components are set to:
(1)如果CU或TU块边界尺寸都大于等于8个像素,SP和SQ值设为3;(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;
(2)其余情况下,SP和SQ值都设为1;(2) In other cases, the SP and SQ values are set to 1;
(3)对于CTU水平边界的上方,SP限制为小于等于1。(3) Above the horizontal boundary of the CTU, the SP is limited to be less than or equal to 1.
获取边界的滤波强度Get the filter strength of the boundary
边界的滤波强度也可以称为边界强度。获取边界强度是根据边界块的编码参数初步判断块边界是否需要滤波及滤波参数。由于相邻块采用不同的编码参数(如采用不同预测方式、不同的参考图像、不同的运动矢量等)进行编码,容易造成像素值在块边界的不连续,从而产生块效应。经过获取边界强度模块后,所有允许滤波的边界获得边界强度(boundary strength,BS),边界强度的取值为0、1或2。边界强度值为0时,表示该边界不需要滤波,并不再进行后续处理(如滤波强弱选择以及滤波操作)。边界强度值为1或2时,会进行后续模块处理,并且其值会影响后续“滤波强弱选择”中的阈值。The filter strength of the boundary can also be called the boundary strength. Obtaining the boundary strength is to preliminarily determine whether the block boundary requires 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 blocking effects. After passing through the boundary strength acquisition module, all boundaries allowed for filtering obtain the 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 require filtering 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".
边界强度模块的输入和输出如下:The inputs and outputs of the boundary strength module are as follows:
输入:去方块滤波(de-blocking filter,DBF)前的重建图像recPicture;Input: reconstructed image recPicture before deblocking filter (DBF);
当前CU左上角相对于图像左上角的位置(xCb,yCb);The position of the upper left corner of the current CU relative to the upper left corner of the image (xCb, yCb);
当前CU的宽度nCbW,当前CU的高度nCbH;The width of the current CU is nCbW, and the height of the current CU is nCbH;
边缘类型edgeType,指定当前是垂直边界(EDGE_VER,edgeType=0)还是水平边界(EDGE_HOR,edgeType=1)进行滤波;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;
变量cIdx,指示当前CU的颜色分量;The variable cIdx indicates the color component of the current CU;
一个大小为(nCbW)x(nCbH)二维数组edgeIdc,指示边界为变换块边界或是子块边界。A two-dimensional array edgeIdc of size (nCbW) x (nCbH) indicating whether the boundary is a transform block boundary or a sub-block boundary.
输出:该过程的输出是存储边界滤波强度的二维数组bS,数组大小为(nCbW)x(nCbH)。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).
下面详细介绍获取边界强度的过程。The process of obtaining boundary strength is described in detail below.
设置gridSize=cIdx==0?4:8。Set gridSize=cIdx==0?4:8.
设置xN和yN:当edgeType为EDGE_VER时设置xN=Max(0,(nCbW/gridSize)-1),yN=cIdx==0?(nCbH/4)-1:(nCbH/2)–1;当edgeType为EDGE_HOR时设置xN=cIdx==0?(nCbW/4)-1:(nCbW/2)–1,yN=Max(0,(nCbH/gridSize)-1)。 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).
设置xDi(i=0..xN)和yDj(j=0..yN):当edgeType为EDGE_VER时设置xDi=(i*gridSize),yDj=cIdx==0?(j<<2):(j<<1);当edgeType为EDGE_HOR时设置xDi=cIdx==0?(i<<2):(i<<1),yDj=j*gridSize。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.
对所有xDi(i=0..xN)和yDj(j=0..yN)处的边界获取边界强度,获取的顺序如下: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:
(1)如果edgeIdc[xDi][yDj]为0,边界强度bS[xDi][yDj]设置为0。(1) If edgeIdc[xDi][yDj] is 0, the boundary strength bS[xDi][yDj] is set to 0.
(2)如果虚拟边界VirtualBoundariesPresentFlag为1,并且边界(xCb+xDi)或者(yCb+yDj)处于虚拟边界上时,bS[xDi][yDj]设置为0。(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.
(3)在其他情况下,获取顺序如下:(3) In other cases, the acquisition order is as follows:
设置p0和q0为边界处像素,对于垂直边界,p0为边界左侧像素,即recPicture[xCb+xDi-1][yCb+yDj],q0为边界右侧像素,即recPicture[xCb+xDi][yCb+yDj];对于水平边界,p0为边界上侧像素,即recPicture[xCb+xDi][yCb+yDj-1],q0为边界下侧像素,即recPicture[xCb+xDi][yCb+yDj]。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].
①对于亮度分量,p0位置处CU和q0位置处CU的intra_bdpcm_luma_flag都为1,bS[xDi][yDj]设置为0;对于色度分量,p0位置处CU和q0位置处CU的intra_bdpcm_chroma_flag都为1,bS[xDi][yDj]设置为0。① 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.
②p0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x0][y0]为MODE_INTRA或q0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x1][y1]为MODE_INTRA,bS[xDi][yDj]设置为2,其中(x0,y0)为p0位置处对应CU左上角样本位置,(x1,y1)为q0位置处对应CU左上角样本位置。②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.
③p0或q0位置处对应CU的ciip_flag等于1,bS[xDi][yDj]设置为2。③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.
④p0或q0位置处对应CU的gpm_intra_Flag等于1,且p0或q0位置处对应子块不是由帧间模式预测,bS[xDi][yDj]设置为2。④ 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.
⑤边界是变换块边界,下面条件满足其一时,bS[xDi][yDj]设置为1:⑤ Boundary is the transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
a)cIdx为0时,tu_y_coded_flag[x0][y0]与tu_y_coded_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处亮度变换块的左上角样本位置,(x1,y1)是q0位置处的亮度变换块的左上角样本位置。即亮度分量至少一个非零变换系数。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.
b)cIdx为1时,tu_cb_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、tu_cb_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cb分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cb分量变换块的左上样本对应的亮度位置。即Cb分量至少一个非零变换系数。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.
c)cIdx为2时,tu_cr_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、tu_cr_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cr分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cr分量变换块的左上样本对应的亮度位置。即Cr分量至少一个非零变换系数。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.
⑥cIdx等于0,edgeIdc[xDi][yDj]等于2,即边界为预测子块边界,下面条件满足一个或多个时,bS[xDi][yDj]设置为1:⑥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:
a)p0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xp0][yp0]与q0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xq0][yq0]不同,其中(xp0,yp0)是p0位置处子块左上样本对应的亮度位置,(xq0,yq0)是q0位置处子块左上样本对应的亮度位置。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.
b)p0位置处子块的预测模式和q0位置处子块的预测模式都采用帧内块拷贝(intra block copy,IBC)模式,并且运动矢量的水平或垂直绝对差值大于等于半像素。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.
c)p0位置处子块的预测使用与q0位置处子块的预测不同的参考图片或不同数量的运动矢量。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.
注意1:两个编码子块使用的参考图片是否相同的判断仅基于参考了那些图像,不考虑预测是使用参考图像列表RPL_0的索引还是RPL_1的索引,不考虑参考图像列表RPL内索引的位置是否不同。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.
注意2:编码子块运动矢量的数量为PredFlagL0[xSb][ySb]+PredFlagL1[xSb][ySb],其中(xSb,ySb)表示子块左上角样本位置,PredFlagL0和PredFlagL1为预测列表使用标志。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.
注意3:用于预测包含位置(xS,yS)处样本的子块的参考图片和运动矢量分别为RefPicList[X][RefIdxLX[xS][yS]]、MvLX[xS][yS],参考图片和运动矢量可能不同于亚像素插值中的参考图片和运动矢量。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.
d)p0位置处子块的运动矢量数量和q0位置处子块的运动矢量数量都为1,并且两个运动矢量的水平或垂直绝对差值大于等于半像素。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.
e)p0位置处子块和q0位置处子块都使用两个运动矢量和两个不同的参考图像,且q0位置处子 块使用与p0位置处子块相同的两个参考图像,同一参考图像p0位置处子块使用的运动矢量和q0位置处子块使用的运动矢量在水平或垂直方向上的绝对差值大于等于半像素。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 The block uses the same two reference images as the sub-block at position p0, and the absolute difference 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 in the horizontal or vertical direction is greater than or equal to half a pixel.
f)p0位置处子块使用一个参考图片的两个运动矢量,q0位置处子块使用同一参考图片的两个运动矢量,并且以下两个条件都为真: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:
-p0位置处子块和q0位置处子块均使用列表0的运动矢量进行预测,并且运动矢量的水平或垂直绝对差值大于等于半像素,或p0位置处子块和q0位置处子块均使用列表1的运动矢量进行预测,并且运动矢量的水平或垂直绝对差值大于等于半像素;-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;
-p0位置处子块使用列表0的运动矢量进行预测,q0位置处子块使用列表1的运动矢量进行预测,并且运动矢量的水平或垂直绝对差值大于等于半像素;或者p0位置处子块使用列表1的运动矢量进行预测,q0位置处子块使用列表0的运动矢量进行预测,并且运动矢量的水平或垂直绝对差值大于等于半像素。-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.
⑦否则,亮度和色度分量的边界强度设置为0。⑦ Otherwise, the boundary intensities of the luma and chroma components are set to 0.
举例说明,对于如果P块或Q块采用帧内编码,按照上述流程,会进入操作流程②,从而确定的BS的取值为2。如果P块和Q块有非零系数,则确定的BS的取值为1。如果P块和Q块使用不同的参考帧,则确定的BS的取值为1。如果P块的运动矢量的数量和Q块的运动矢量的数量不同,则确定的BS的取值为1。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.
与帧间编码方式和IBC编码方式相比,采用帧内编码方式进行编码的块在边界处像素的不连续性更加明显,因此,采用帧内编码方式的编码块对应的BS的取值较高。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.
滤波强弱选择Filter strength selection
滤波强弱选择是进一步对视频内容进行分析,主要根据边界两侧块内像素值的变化及编码参数(量化参数)确定边界是否需要滤波,因为平坦区域的不连续块边界才是滤波对象。再根据视频内容(块边界及块内部像素值的变化)及编码参数(量化参数)进一步判断边界是否需要滤波以及选择合适的滤波强度,因为边界的不连续也可能是视频自身内容所致。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.
首先设置qj,k和pi,k。edgeType为EDGE_VER时,qj,k=recPicture[xCb+xBl+j][yCb+yBl+k],pi,k=recPicture[xCb+xBl-i-1][yCb+yBl+k];edgeType为EDGE_HOR时,qj,k=recPicture[xCb+xBl+k][yCb+yBl+j],pi,k=recPicture[xCb+xBl+k][yCb+yBl-i-1]。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].
在一些编解码技术(如H.266/VVC)中,增加了基于亮度的自适应去方块滤波(Luma-adaptive deblocking filter,ladf)。该技术根据重建像素的平均亮度水平LumaLevel为QPA添加一个偏移量qpOffset调整去方块滤波的滤波强度,以用来补偿在线性光域使用非线性转换函数(例如光电转换函数(EOTF)等)引入的失真。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.
sps_ladf_enabled_flag为1时,设置lumaLevel=((p0,0+p0,3+q0,0+q0,3)>>2,qpOffset设置为为sps_ladf_lowest_interval_qp_offset并进行如下修改:
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:
sps_ladf_enabled_flag为0时,qpOffset设置为0。When sps_ladf_enabled_flag is 0, qpOffset is set to 0.
设置qP=((QpQ+QpP+1)>>1)+qpOffset,QpP为P块的量化参数,QpQ为Q块的量化参数。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.
设置滤波开关的判决门限β,阈值β取值与边界两侧块的像素值和量化参数Q相关。设置Q=Clip3(0,63,qP+(sh_luma_beta_offset_div2<<1)),查表1,根据Q的取值可以得到β′,从而开关阈值β设置为β=β′*(1<<(BitDepth-8))。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)).
设置滤波边界处像素值差别的判决门限tC,阈值tC的取值与量化参数有关。设置Q=Clip3(0,65,qP+2*(bS-1)+(sh_luma_tc_offset_div2<<1)),查表1,根据Q的取值可以得到tC′,从而强度阈值tC设置为:编码位深BitDepth小于10时,tC=(tC′+(1<<(9-BitDepth)))>>(10-BitDepth);编码位深BitDepth大于等于10时,tC=tC′*(1<<(BitDepth-10))。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)).
对边界强度大于0的块边界,滤波强弱选择模块根据边界块内像素值的变化程度判断该边界区域的内容特性,然后根据边界区域的内容特性确定是否需要进行滤波操作以及进一步选择滤波的强度。滤波强度分为不滤波、短抽头滤波和长抽头滤波,短抽头滤波又分为强滤波和弱滤波。也就是说,滤波强度可以包括不滤波、短抽头强滤波、短抽头弱滤波、长抽头滤波。 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.
表1.阈值变量β′、tC′与变量Q的关系
Table 1. Relationship between threshold variables β′, tC′ and variable Q
滤波操作Filtering operation
根据亮度分量类型、色度分量类型以及滤波决策的结果,滤波操作包括5种类型:亮度分量的长抽头滤波、亮度分量的短抽头强滤波、亮度分量的短抽头弱滤波、色度分量的强滤波、色度分量的弱滤波。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.
对于滤波操作,其输入和输出如下。For the filtering operation, its input and output are as follows.
输入:enter:
滤波前的重建图像recPicture;The reconstructed image recPicture before filtering;
当前CU左上角相对于图像左上角的位置(xCb,yCb);The position of the upper left corner of the current CU relative to the upper left corner of the image (xCb, yCb);
当前滤波小块的左上角位置相对于当前编码块左上角的位置(xBl,yBl);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);
边缘类型edgeType,指定当前是垂直边界(EDGE_VER,edgeType=0)还是水平边界(EDGE_HOR,edgeType=1)进行滤波;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;
变量dE、dEp和dEq,为滤波决策结果;The variables dE, dEp, and dEq are the filtering decision results;
变量maxFilterLengthP和maxFilterLengthQ,为最大滤波长度;Variables maxFilterLengthP and maxFilterLengthQ are the maximum filter lengths;
阈值tC。Threshold tC.
输出为修改后的重建图像recPicture。The output is the modified reconstructed image recPicture.
对于亮度分量,以edgeType等于EDGE_VER为例,依次执行以下步骤:For the brightness component, take edgeType equal to EDGE_VER as an example, and perform the following steps in sequence:
①像素值pi,k和qj,k,其中i=0..maxFilterLengthP,j=0..maxFilterLengthQ,k=0..3设置为:① The pixel values pi,k and qj,k, where i = 0..maxFilterLengthP, j = 0..maxFilterLengthQ, k = 0..3 are set to:
qj,k=recPicture[xCb+xBl+j][yCb+yBl+k]qj,k=recPicture[xCb+xBl+j][yCb+yBl+k]
pi,k=recPicture[xCb+xBl-i-1][yCb+yBl+k]pi,k=recPicture[xCb+xBl-i-1][yCb+yBl+k]
②当dE不等于0并且dE不等于3,对每个样本位置(xCb+xBl,yCb+yBl+k),k=0..3,依次执行以下步骤:② 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:
a.进行亮度分量的短抽头滤波,包括亮度分量的短抽头强滤波和亮度分量的短抽头弱滤波,输出为滤波后的样本pi′和qj′。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′.
b.当滤波后的样本数nDp大于0,将重建图像中相应位置的样本替换为滤波后的样本pi′,i=0..nDp–1:recPicture[xCb+xBl-i-1][yCb+yBl+k]=pi′。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′.
c.当滤波后的样本数nDq大于0,将重建图像中相应位置的样本替换为滤波后的样本qj′,j=0..nDq–1:recPicture[xCb+xBl+j][yCb+yBl+k]=qj′。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′.
③当dE等于3时,对每个样本位置(xCb+xBl,yCb+yBl+k),k=0..3,依次执行以下步骤:③ When dE is equal to 3, for each sample position (xCb+xBl,yCb+yBl+k), k=0..3, perform the following steps in sequence:
a.进行亮度分量的长抽头滤波,输出为滤波后的样本pi′和qj′。a. Perform long tap filtering on the luminance component and output the filtered samples pi′ and qj′.
b.将重建图像中相应位置的样本替换为滤波后的样本pi′,i=0..maxFilterLengthP–1:recPicture[xCb+xBl-i-1][yCb+yBl+k]=pi′。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′.
c.将重建图像中相应位置的样本替换为滤波后的样本qj′,j=0..maxFilterLengthQ–1: recPicture[xCb+xBl+j][yCb+yBl+k]=qj′。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′.
对色度分量,首先设置变量maxK。For the chroma component, first set the variable maxK.
对于edgeType等于EDGE_VER:maxK=(SubHeightC==1)?3:1For edgeType equal to EDGE_VER: maxK=(SubHeightC==1)? 3:1
对于edgeType等于EDGE_HOR:maxK=(SubWidthC==1)?3:1For edgeType equal to EDGE_HOR: maxK=(SubWidthC==1)?3:1
然后设置样本值pi,k和qj,k其中i=0..maxFilterLengthP,j=0..maxFilterLengthQ,k=0..3:Then set the sample values pi,k and qj,k where i = 0..maxFilterLengthP, j = 0..maxFilterLengthQ, k = 0..3:
对于edgeType等于EDGE_VER:For edgeType equal to EDGE_VER:
qj,k=recPicture[xCb+xBl+j][yCb+yBl+k]qj,k=recPicture[xCb+xBl+j][yCb+yBl+k]
pi,k=recPicture[xCb+xBl-i-1][yCb+yBl+k]pi,k=recPicture[xCb+xBl-i-1][yCb+yBl+k]
对于edgeType等于EDGE_HOR:For edgeType equal to EDGE_HOR:
qj,k=recPicture[xCb+xBl+k][yCb+yBl+j]qj,k=recPicture[xCb+xBl+k][yCb+yBl+j]
pi,k=recPicture[xCb+xBl+k][yCb+yBl-i-1]pi,k=recPicture[xCb+xBl+k][yCb+yBl-i-1]
以edgeType等于EDGE_VER为例,对每个样本位置(xCb+xBl,yCb+yBl+k),k=0..maxK,依次执行以下步骤: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:
a.进行色度分量的滤波,包括色度分量的强滤波和色度分量的弱滤波,输出为滤波后的样本pi′和qj′,其中i=0..maxFilterLengthP–1,j=0..maxFilterLengthQ–1。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.
b.将重建图像中相应位置的样本替换为滤波后的样本pi′和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′。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′.
下面介绍四种预测模式,分别为直接块矢量(direct block vector,DBV)模式、帧内模板匹配预测(Intra template matching prediction,IntraTMP)模式、组合帧内块复制和帧内预测(combined intra block copy and intra prediction,IBC-CIIP)模式、几何分区块复制(intra block copy with geometry partitioning mode,IBC-GPM)模式。针对不同的模式,其对应的确定BS的方式也不同。The following four prediction modes are introduced: direct block vector (DBV) mode, intra template matching prediction (IntraTMP) mode, combined intra block copy and intra prediction (IBC-CIIP) mode, and intra block copy with geometry partitioning mode (IBC-GPM) mode. Different modes have different corresponding methods for determining the BS.
DBV模式DBV mode
DBV模式预定义当前色度块对应的同位亮度区域的五个位置,如图6所示。依次搜索这五个位置,判断对应的亮度块是否为IBC模式或者IntraTMP模式。如果对应的亮度块为IBC模式或者IntraTMP模式,则获取其亮度BV(即亮度bvL)。其中,若存在翻转,则进行翻转感知调整得到bvL’,将其进行缩放并判断缩放后的BV(即色度bvC)是否对于色度可用。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, a 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.
以图7为例,翻转感知过程如下:Taking Figure 7 as an example, the flip perception process is as follows:
对获取的亮度bvL进行翻转感知,得到bvL’。假设从当前色度块的同位亮度区域的TL位置获得亮度bvL,以水平翻转举例:TL位置处的亮度块的中心位置坐标为(Refx,Refy),当前色度块的同位亮度区域的中心位置坐标为(Curx,Cury)。
bvL=(bvLhor,0)
bvL’=(bvLhor+2*(Refx-Curx),0)The obtained luminance bvL is flipped 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 is used: the center position coordinates of the luminance block at the TL position are (Refx, Refy), and the center position coordinates of the co-located luminance region of the current chrominance block are (Curx, Cury).
bvL=(bvLhor,0)
bvL'=(bvLhor+2*(Refx-Curx),0)
缩放过程如下:The scaling process is as follows:
对亮度bvL’进行缩放,得到bvC。以YUV420格式举例:
bvL’=(bvLhor,bvLver)
bvC=(bvLhor>>1,bvLver>>1)Scale the brightness bvL' to get bvC. Take the YUV420 format as an example:
bvL'=(bvLhor,bvLver)
bvC=(bvLhor>>1,bvLver>>1)
以图8为例,可以采用以下方法对bvC进行修正,按照以下方式,获取色度bvC候选:
bvC0=(bvLhor>>1,bvLver>>1)
bvC1=((bvLhor+1)>>1,bvLver>>1)
bvC2=(bvLhor>>1,(bvLver+1)>>1)
bvC3=((bvLhor+1)>>1,(bvLver+1)>>1)Taking Figure 8 as an example, the following method can be used to correct bvC and obtain chroma 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)
对这几个色度bvC候选指向的参考块的模板的重建色度值与当前色度块的模板的重建色度值计算绝对误差和(sum of absolute difference,SAD);比较上述候选的SAD,将与最小SAD对应的bvC候选作为色度BV预测过程所使用的BV。上述的决策过程,编解码都需要执行,不需要传输信令标识。The sum of absolute differences (SADs) 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.
通过上述过程,得到第一个可用的色度bvC后,对当前色度块进行BV预测,即获取当前色度块(xCb、yCb)及其相应bvC的位置,从而导出相应的偏移位置(xCb+bvC[0],yCb+bvC[1]),以执行块复制预测,如图9所示。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.
DBV模式适用于亮度色度一起划分的场景,即DBV模式适用于单树划分的场景。通过预定义当前色度块对应的同位亮度块,判断对应的亮度块是否为IntraTMP模式,若是,则获取其亮度bvL,将其进行色度采样格式缩放并判断缩放后的BV(即色度bvC)是否对于色度可用。如果可用,执行块复制预测。 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.
对于DBV模式,获取边界的滤波强度过程可以采用如下步骤:For DBV mode, the following steps can be used to obtain the filter strength of the boundary:
①对于色度分量,p0位置处CU和q0位置处CU的intra_bdpcm_chroma_flag都为1,bS[xDi][yDj]设置为0。① 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.
②否则,p0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x0][y0]为MODE_INTRA或q0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x1][y1]为MODE_INTRA,bS[xDi][yDj]设置为2,其中(x0,y0)为p0位置处对应CU左上角样本位置,(x1,y1)为q0位置处对应CU左上角样本位置。其中变量cIdx,指示当前CU的颜色分量。② 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.
由于DBV模式是一种针对色度块的预测模式,因此,目前DBV模式仅针对色度分量的获取边界的滤波强度过程进行了研究。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.
IntraTMP模式IntraTMP mode
IntraTMP模式是一种特殊的帧内预测模式,它从当前帧的重建部分复制最佳预测块,其L形模板与当前模板匹配。对于预定义的搜索范围,编码器在当前帧的重构部分中搜索与当前模板最相似的模板,并使用相应的块作为预测块。编码器用语法元素标识该模式的使用,并且在解码器侧执行相同的预测操作。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.
预测是通过将当前块的L形、仅顶部或仅左侧邻居与图10中预定义搜索区域中的另一个块进行匹配来生成的。有6个预定义的搜索区域,即图10中的R1至R6,其中包含来自顶部和左侧CTU的重建样本,以及当前CTU内位于当前块上方、左侧、左下和右上的部分重建样本。绝对差之和(SAD)被用作代价函数。使用6个区域的给定搜索顺序,即R4、R5、R6、R1、R2和R3。在每个区域内,解码器构建最多19个模板匹配块矢量的候选列表,这些矢量根据模板代价(SAD)按升序排列。将所有区域的维度(SearchRange_w、SearchRange_h)设置为与块维度(BlkW、BlkH)成比例,以使每个像素具有固定数量的SAD比较。即:
SearchRange_w=最小值(64,a*BlkW)
SearchRange_h=最小值(64,a*BlkH)The prediction is generated by matching the L-shaped, top-only, or left-only neighbor of the current block with another block in the predefined search areas in Figure 10. There are 6 predefined search areas, namely R1 to R6 in Figure 10, which contain reconstructed samples from the top and left CTUs, as well as partially reconstructed samples within the current CTU located above, to the left, below, and above the right of the current block. The sum of absolute differences (SAD) is used as the cost function. A given search order of 6 areas is used, namely R4, R5, R6, R1, R2, and R3. Within each area, the decoder builds a candidate list of up to 19 template matching block vectors, which are sorted in ascending order according to the template cost (SAD). The dimensions of all areas (SearchRange_w, SearchRange_h) are set proportional to the block dimensions (BlkW, BlkH) so that each pixel has a fixed number of SAD comparisons. That is:
SearchRange_w = minimum(64, a*BlkW)
SearchRange_h = minimum(64, a*BlkH)
其中“a”是控制增益/复杂性权衡的常数。在目前版本中,“a”等于5。Where "a" is a constant that controls the gain/complexity tradeoff. In the current version, "a" is equal to 5.
IntraTMP模式支持以下模式:IntraTMP mode supports the following modes:
单个预测:从候选列表中选择单个块矢量预测。Single prediction: Selects a single block vector prediction from a candidate list.
多个预测的融合:将多个块矢量预测进行多重混合,得到最终的预测块。混合权重根据每个预测的模板匹配成本计算,或者使用基于维纳滤波器的权重推导方法计算。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.
亚像素精度:当使用单个块矢量预测时,亚像素精度可用于1/2像素精度、1/4像素精度和3/4像素精度,每个精度都有8个可能的方向。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.
线性滤波器模型:可以在参考模板和当前模板之间拟合线性滤波器,并将线性模型应用于参考块。当不使用子像素精度时,此模式可用于预测。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.
为了加快模板匹配过程,对所有搜索区域的搜索范围进行因子为3的二次采样。在找到最佳匹配后,执行细化过程。该细化是通过第二次模板匹配搜索以缩小的范围围绕最佳匹配来完成的。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.
模板匹配工具适用于宽度和高度小于或等于64的CU。模板匹配的最大CU大小是可配置的。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.
对于IntraTMP模式,获取边界的滤波强度过程可以采用如下步骤:For the IntraTMP mode, the following steps can be used to obtain the filter strength of the boundary:
①对于亮度分量,p0位置处CU和q0位置处CU的intra_bdpcm_luma_flag都为1,bS[xDi][yDj]设置为0。① 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.
②否则,p0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x0][y0]为MODE_INTRA或q0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x1][y1]为MODE_INTRA,bS[xDi][yDj]设置为2,其中(x0,y0)为p0位置处对应CU左上角样本位置,(x1,y1)为q0位置处对应CU左上角样本位置。其中变量cIdx,指示当前CU的颜色分量。② 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.
IBC-CIIP模式IBC-CIIP model
IBC-CIIP模式是CU的一种编码工具,它使用IBC和帧内预测来获得两个预测信号,并对这两个预测块进行加权求和,以生成如下的最终预测块:
P=(wibc*Pibc+((1<<shift)-wibc)*Pintra+(1<<(shift-1)))>>shiftThe IBC-CIIP mode is a coding tool for CU that uses IBC and intra-frame prediction to obtain two prediction signals and performs a weighted summation on the two prediction blocks to generate the final prediction block as follows:
P=(w ibc *P ibc +((1<<shift)-w ibc )*P intra +(1<<(shift-1)))>>shift
其中,Pibc表示IBC预测信号,Pintra表示帧内预测信号。对于IBC MERGE模式和IBC AMVP模式,(wibc,shift)被设置为等于(13,4)和(1,1)。Wherein, Pibc represents an IBC prediction signal, and Pintra represents an intra-frame prediction signal. For the IBC MERGE mode and the IBC AMVP mode, ( wibc , shift) is set equal to (13, 4) and (1, 1).
帧内预测模式(intra prediction mode,IPM)候选列表用于生成帧内预测信号,并且IPM候选列表大小被预定义为2。用语法元素IPM索引以指示使用哪个IPM。The intra prediction mode (IPM) candidate list is used to generate the 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.
对于IBC-CIIP模式,获取边界的滤波强度过程可以采用如下步骤:For the IBC-CIIP mode, the following steps can be used to obtain the filter strength of the boundary:
对于亮度分量: For the luma component:
①边界是变换块边界,下面条件满足其一时,bS[xDi][yDj]设置为1:① The boundary is a transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
cIdx为0时,tu_y_coded_flag[x0][y0]与tu_y_coded_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处亮度变换块的左上角样本位置,(x1,y1)是q0位置处的亮度变换块的左上角样本位置。即亮度分量至少一个非零变换系数。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.
②否则,cIdx等于0,edgeIdc[xDi][yDj]等于2,即边界为预测子块边界,下面条件满足一个或多个时,bS[xDi][yDj]设置为1:② 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:
a.p0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xp0][yp0]与q0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xq0][yq0]不同,其中(xp0,yp0)是p0位置处子块左上样本对应的亮度位置,(xq0,yq0)是q0位置处子块左上样本对应的亮度位置。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.
b.p0位置处子块的预测模式和q0位置处子块的预测模式都采用IBC模式,并且运动矢量的水平或垂直绝对差值大于等于半像素。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.
目前,IBC色度在双树下不做,所有模式在单树色度分量不滤波。如果单树和双树均做色度且均开启色度滤波时,对于色度分量,获取边界的滤波强度过程可以采用如下步骤: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:
①边界是变换块边界,下面条件满足其一时,bS[xDi][yDj]设置为1:① The boundary is a transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
a.cIdx为1时,tu_cb_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、a. When cIdx is 1, tu_cb_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0],
tu_cb_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cb分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cb分量变换块的左上样本对应的亮度位置。即Cb分量至少一个非零变换系数。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.
b.cIdx为2时,tu_cr_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、tu_cr_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cr分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cr分量变换块的左上样本对应的亮度位置。即Cr分量至少一个非零变换系数。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.
IBC-GPM模式IBC-GPM model
IBC-GPM模式是一种将CU几何划分为两个子分区的编码工具。使用IBC和帧内预测来生成两个子分区的预测信号。IBC-GPM可以应用于常规IBC MERGE模式或IBC-TM MERGE模式。帧内预测模式(IPM)候选列表是使用与帧间GPM相同的方法构造的,并且IPM候选列表大小被预定义为3。共有48种几何划分模式,分为两个几何划分模式集,如表2和表3所示。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 regular IBC MERGE mode or 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.
表2 IBC-GPM划分模式集第一组
Table 2 IBC-GPM partitioning pattern set (group 1)
表3 IBC-GPM划分模式集第二组
Table 3 IBC-GPM partitioning pattern set (second group)
当使用IBC-GPM时,用语法元素标识IBC-GPM几何划分模式集合,以指示是选择第一几何划分模式集还是第二几何划分模式集,然后选择几何划分模式索引。用信号通知IBC-GPM帧内标志以指示帧内预测是否用于第一子分区。当帧内预测用于子分区时,用信号通知帧内预测模式索引。当IBC用 于子分区时,会发出MERGE索引的信号。When IBC-GPM is used, the IBC-GPM geometry partitioning mode set is identified with a syntax element to indicate whether the first geometry partitioning mode set or the 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 sub-partition. When intra prediction is used for the sub-partition, the intra prediction mode index is signaled. When IBC is used A MERGE index is signaled when the subpartition is created.
在双预测IBC-GPM中,用信号通知两个标志以指示两个分区的预测模式,第一标志指示第一分区是否为帧内预测,如果不是,则用信号通知第二标志以指示帧内预测是否用于第二分区。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.
对于IBC-GPM模式,获取边界的滤波强度过程可以采用如下步骤:For the IBC-GPM mode, the following steps can be used to obtain the filter strength of the boundary:
对于亮度分量,可以采用如下步骤获取边界的滤波强度。For the luminance component, the following steps can be used to obtain the filter strength of the boundary.
①边界是变换块边界,下面条件满足其一时,bS[xDi][yDj]设置为1:① The boundary is a transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
cIdx为0时,tu_y_coded_flag[x0][y0]与tu_y_coded_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处亮度变换块的左上角样本位置,(x1,y1)是q0位置处的亮度变换块的左上角样本位置。即亮度分量至少一个非零变换系数。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.
②否则,cIdx等于0,edgeIdc[xDi][yDj]等于2,即边界为预测子块边界,下面条件满足一个或多个时,bS[xDi][yDj]设置为1:② 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:
a.p0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xp0][yp0]与q0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xq0][yq0]不同,其中(xp0,yp0)是p0位置处子块左上样本对应的亮度位置,(xq0,yq0)是q0位置处子块左上样本对应的亮度位置。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.
b.p0位置处子块的预测模式和q0位置处子块的预测模式都采用IBC模式,并且运动矢量的水平或垂直绝对差值大于等于半像素。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.
目前,IBC色度在双树下不做,所有模式在单树色度分量不滤波。如果单树和双树均做色度且均开启色度滤波时,对于色度分量,获取边界的滤波强度过程可以采用如下步骤: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:
①边界是变换块边界,下面条件满足其一时,bS[xDi][yDj]设置为1:① The boundary is a transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
a.cIdx为1时,tu_cb_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、tu_cb_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cb分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cb分量变换块的左上样本对应的亮度位置。即Cb分量至少一个非零变换系数。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.
b.cIdx为2时,tu_cr_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、tu_cr_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cr分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cr分量变换块的左上样本对应的亮度位置。即Cr分量至少一个非零变换系数。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.
目前,在确定去方块滤波对应的滤波参数(BS)时,是按照上文描述的过程来确定BS的取值。但是,对于某些场景,使用上述模式确定BS的取值时,存在一些不合理之处,导致滤波效果较差。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.
举例说明,对于使用块矢量预测的预测模式(如DBV模式和IntraTMP等),其BS值与普通帧内模式对应的BS值相同,这会造成边界处过度平滑、纹理消失的现象。对于包含帧内预测的预测模式(如IBC-CIIP模式和IBC-GPM模式等),其BS值与普通IBC模式对应的BS值相同,这会造成边界处平滑强度不足,块效应严重的问题。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.
本申请实施例在确定当前块对应的滤波参数时,可以考虑当前块和/或相邻块的预测模式,即基于当前块和/或相邻块的预测模式,确定当前块对应的滤波参数,由于边界处的块效应与边界两侧的块所使用的预测模式息息相关,因此,通过基于预测模式确定滤波参数,可以使得确定的滤波参数更合理,从而可以达到较好的滤波效果。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.
下文先对本申请实施例的解码方法进行详细地举例说明。The following first describes the decoding method of the embodiment of the present application in detail with examples.
图11为本申请实施例提供的解码方法的流程示意图。图11的方法可应用于解码器。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.
参见图11,在步骤S1110,确定当前块的相邻块。当前块可以为待解码的当前块。当前块可以为CU、TU、PU或子块等。当前块可以为亮度块,也可以为色度块。当前块可以为帧内块,也可以为帧间块。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.
相邻块可以为与当前块相邻的块。当前块与相邻块可以是左右相邻,也可以是上下相邻。相邻块可以位于当前块的上方、下方、左侧或右侧。相邻块与当前块的类型可以相同。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.
继续参见图11,在步骤S1120,基于当前块和/或相邻块的预测模式,确定当前块对应的第一滤波参数。第一滤波参数可以为上文描述的BS。确定当前块对应的第一滤波参数可以理解为,确定当前块对应的第一滤波参数的取值(即BS的取值)。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).
预测模式的种类有多种。例如,预测模式可以包括以下中的一种:DBV模式、IntraTMP模式、IBC-CIIP模式和IBC-GPM模式等。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.
继续参见图11,在步骤S1130,基于第一滤波参数,对当前块进行去方块滤波。Continuing to refer to FIG. 11 , in step S1130 , deblocking filtering is performed on the current block based on the first filtering parameters.
基于第一滤波参数,对当前块进行去方块滤波可以包括:基于第一滤波参数,进行滤波强弱选择,基于选择的滤波强度,执行滤波操作。滤波强度可以包括以下中的一种:不滤波、短抽头强滤波、短抽 头弱滤波、长抽头滤波。对于亮度分量和色度分量,其对应的滤波操作不同。对于亮度分量,滤波操作可以包括亮度分量的长抽头滤波、亮度分量的短抽头强滤波、亮度分量的短抽头弱滤波。对于色度分量,滤波操作可以包括色度分量的强滤波、色度分量的弱滤波。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 strong filtering, The filtering operations for the luminance component and the chrominance component are different. For the luminance component, the filtering operation may include long tap filtering for the luminance component, short tap strong filtering for the luminance component, and short tap weak filtering for the luminance component. For the chrominance component, the filtering operation may include strong filtering for the chrominance component and weak filtering for the chrominance component.
下面针对不同的预测模式,对第一滤波参数的取值进行介绍。The following describes the values of the first filtering parameter for different prediction modes.
DBV模式和IntraTMP模式DBV mode and IntraTMP mode
如果当前块和相邻块的预测模式为块矢量预测,则第一滤波参数的取值小于第二滤波参数的取值。第二滤波参数为基于帧内预测的块对应的滤波参数,或者说,第二滤波参数为普通帧内模式对应的滤波参数。也就是说,基于块矢量预测的块对应的滤波参数的取值小于基于帧内预测的块对应的滤波参数的取值。由于基于块矢量预测的块,其预测原理和帧间预测或IBC预测模式类似,因此,采用较小的滤波强度即可满足基于块矢量预测的块的滤波要求,避免造成边界处过度平滑、纹理消失的现象。上述基于块矢量预测的预测模式可以包括DBV模式和/或IntraTMP模式。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.
如果当前块和相邻块的预测模式为块矢量预测,则在满足第一条件的情况下,将第一滤波参数的取值设置为小于第二滤波参数的取值。第一条件基于以下信息中的一种或多种确定:当前块与相邻块的边界,当前块对应的变换系数,相邻块对应的变换系数。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.
当前块与相邻块的边界可以包括变换块边界和/或子块边界。如果当前块与相邻块的边界为变换块边界,则可以表示当前块和相邻块均为变换块。如果当前块和相邻块的边界为子块边界,则可以表示当前块和相邻块均为子块。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.
当前块对应的变换系数可以包括当前块在亮度分量上的变换系数和/或在色度分量上的变换系数。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.
相邻块对应的变换系数可以包括相邻块在亮度分量上的变换系数和/或在色度分量上的变换系数。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.
针对不同的预测模式,第一条件可以不同。下面针对DBV模式和IntraTMP模式,分别对第一条件进行介绍。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.
如果当前块和相邻块的预测模式为DBV模式,则第一条件可以包括:当前块和相邻块的边界为变换块边界,当前块对应的变换系数和相邻块对应的变换系数中至少有一个为非零,且变换系数包括色度分量的变换系数。换句话说,如果当前块和相邻块的边界为变换块边界,且当前块在亮度分量上的变换系数和相邻块在亮度分量上的变换系数中至少有一个为非零,则第一滤波参数的取值小于第二滤波参数的取值。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.
如果当前变换块和相邻块的预测模式为IntraTMP模式,则第一条件包括以下中的一种或多种:当前块和相邻块的边界为变换块边界,当前块对应的变换系数和相邻块对应的变换系数中至少有一个为非零,变换系数包括亮度分量的变换系数;当前块和相邻块属于亮度分量,当前块和相邻块的边界为子块边界,且当前块和相邻块的预测模式不同;当前块和相邻块属于亮度分量,当前块和相邻块的边界为子块边界,且当前块对应的块矢量和相邻块对应的块矢量在第一方向上的差值大于或等于半个像素,第一方向为水平方向或垂直方向。下面对第一条件的内容进行展开介绍。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.
例如,对于亮度分量,如果当前块和相邻块的边界为变换块边界,且当前块对应的亮度分量的变换系数和相邻块对应的亮度分量的变换系数中至少有一个为非零(或者说,当前块和相邻块在亮度分量上至少有一个非零变换系数),则第一滤波参数的取值小于第二滤波参数的取值。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.
又例如,对于亮度分量,当前变换块和相邻变换块的边界为子块(或预测子块)边界,当前块和相邻块的预测模式不同,则第一滤波参数的取值小于第二滤波参数的取值。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.
又例如,对于亮度分量,当前块和相邻块的边界为子块(预测子块)边界,且当前块对应的块矢量和相邻块对应的块矢量在水平方向上的差值大于或等于半个像素,或当前块对应的块矢量和相邻块对应的块矢量在垂直方向上的差值大于或等于半个像素,则第一滤波参数的取值小于第二滤波参数的取值。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.
上述第一滤波参数的取值可以小于或等于第一值与第一比值的乘积,其中,第一值为去方块滤波对应的滤波参数的最大值,第一比值小于或等于50%。以第一比值为50%为例,可以将第一滤波参数的取值设置在滤波参数的取值前50%的数值。举例说明,如果滤波参数的最大值为10,则第一滤波参数的取值可以为1、2、3、4、5中的任意一个。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.
第一比值可以小于或等于30%。以第一比值为30%为例,可以将第一滤波参数的取值设置为滤波参数的取值的前30%的数值。举例说明,如果滤波参数的最大值为10,则第一滤波参数的取值可以为1、2、3中的任意一个。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.
上述第一滤波参数的取值可以为1。例如,如果去方块滤波对应的滤波参数的取值包括0、1、2,则可以将第一滤波参数的取值设置为1。或者说,如果第二滤波参数的取值为2,则第一滤波参数的取值为1。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.
如果第二条件满足,则第一滤波参数的取值大于或等于第二滤波参数的取值。第二条件包括以下中 的一种或多种:当前块的编码模式为帧内编码,且当前块的帧内预测模式不是DBV模式;相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是DBV模式。例如,如果当前块的编码模式为帧内编码,且当前块的帧内预测模式不是DBV模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。又例如,如果相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是DBV模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。又例如,如果当前块的编码模式为帧内编码,且当前块的帧内预测模式不是DBV模式,相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是DBV模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。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 the following: One or more of: 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 adjacent block is intra-coding, and the intra-prediction mode of the adjacent block is not DBV mode. For example, if the coding mode of the current block is intra-coding, and the intra-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-coding, and the intra-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-coding, and the intra-prediction mode of the current block is not DBV mode, the coding mode of the adjacent block is intra-coding, and the intra-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.
第一滤波参数的取值大于第二滤波参数的取值,可以包括第一滤波参数的取值等于第二滤波参数的取值。例如,第一滤波参数的取值和第二滤波参数的取值均为2。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.
如果第三条件满足,则第一滤波参数的取值大于或等于第二滤波参数的取值。第三条件包括以下中的一种或多种:当前块的编码模式为帧内编码,且当前块的帧内预测模式不是帧内TMP模式;相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是帧内TMP模式。例如,如果当前块的编码模式为帧内编码,且当前块的帧内预测模式不是帧内TMP模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。又例如,如果相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是帧内TMP模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。又例如,如果当前块的编码模式为帧内编码,且当前块的帧内预测模式不是帧内TMP模式,如果相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是帧内TMP模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。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.
第一滤波参数的取值大于第二滤波参数的取值,可以包括第一滤波参数的取值等于第二滤波参数的取值。例如,第一滤波参数的取值和第二滤波参数的取值均为2。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.
IBC-GPM模式和IBC-CIIP模式IBC-GPM model and IBC-CIIP model
如果当前块和/或相邻块的预测模式包括帧内预测,则第一滤波参数的取值大于第三滤波参数的取值。第三滤波参数为基于IBC预测的块对应的滤波参数,或者说,第三滤波参数为IBC块对应的滤波参数。也就是说,包括帧内预测的块对应的滤波参数的取值大于基于IBC预测的块对应的滤波参数的取值。如果当前块和/或相邻块的预测模式包括帧内预测,则在边界处的像素的不连续现象会更加明显,因此,需要采用较大的滤波强度才能达到较好的滤波效果。上述包括帧内预测模式的预测模式可以包括IBC-GPM模式和/或IBC-CIIP模式。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.
如果当前块和/或相邻块对应的编码块基于IBC-CIIP编码,则第一滤波参数的取值大于第三滤波参数的取值。例如,如果当前块对应的编码块基于IBC-CIIP编码,则第一滤波参数的取值大于第三滤波参数的取值。又例如,如果相邻块对应的编码块基于IBC-CIIP编码,则第一滤波参数的取值大于第三滤波参数的取值。又例如,如果当前块和相邻块对应的编码块基于IBC-CIIP编码,则第一滤波参数的取值大于第三滤波参数的取值。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.
如果当前块和/或相邻块对应的编码块基于IBC-GPM编码,则在满足第四条件的情况下,第一滤波参数的取值大于第三滤波参数的取值。第四条件包括以下中的一种或多种:当前块不是基于IBC预测,相邻块不是基于IBC预测。也就是说,在当前块和/或相邻块不是基于IBC预测的情况下,第一滤波参数的取值大于第三滤波参数的取值。当前块和相邻块可以为上文描述的与子分区对应的块。子分区对应的块可能采用的是IBC预测,也可能采用的是帧内预测。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.
上述第一滤波参数的取值可以小于或等于第一值与第二比值的乘积,其中,第一值为去方块滤波对应的滤波参数的最大值,第二比值大于或等于50%。以第二比值为50%为例,可以将第一滤波参数的取值设置在滤波参数的取值后50%的数值。举例说明,如果滤波参数的最大值为10,则第一滤波参数的取值可以为5、6、7、8、9、10中的任意一个。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.
第一比值可以大于或等于80%。以第一比值为30%为例,可以将第一滤波参数的取值设置为滤波参数的取值的前30%的数值。举例说明,如果滤波参数的最大值为10,则第一滤波参数的取值可以为8、9、10中的任意一个。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.
上述第一滤波参数的取值可以为2。例如,如果去方块滤波对应的滤波参数的取值包括0、1、2,则可以将第一滤波参数的取值设置为2。或者说,如果第二滤波参数的取值为1,则第一滤波参数的取值为2。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.
如果当前块和/或相邻块对应的编码块基于IBC-GPM编码,且当前块和相邻块的边界为变换块边界,则在满足第五条件的情况下,第一滤波参数的取值小于或等于第三滤波参数的取值。第五条件包括:当前块对应的变换系数和相邻块对应的变换系数中至少有一个为非零。上述变换系数包括亮度分量的变换系数和/或色度分量的变换系数。例如,第五条件包括:当前块在亮度分量上的变换系数和相邻块在亮度分量上的变换系数中至少有一个为非零,和/或当前块在色度分量上的变换系数和相邻块在色度分量上的变换系数中至少有一个为非零。 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.
上述第一滤波参数的取值可以与第三滤波参数的取值相等。例如,第一滤波参数的取值和第三滤波参数的取值均为1。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.
如果当前块和/或相邻块对应的编码块基于IBC-GPM编码,当前块和相邻块属于亮度分量,且当前块和相邻块的边界为子块边界,则在满足第六条件的情况下,第一滤波参数的取值小于或等于第三滤波参数的取值。第六条件包括以下中的一种或多种:当前块与相邻块的预测模式不同;当前块和相邻块的预测模式采用IBC模式,且当前块对应的块矢量和相邻块对应的块矢量在第一方向上的差值大于或等于半个像素,第一方向为水平方向或垂直方向。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.
上述第一滤波参数的取值可以与第三滤波参数的取值相等。例如,第一滤波参数的取值和第三滤波参数的取值均为1。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.
上文结合图11,详细描述了本申请实施例提供的解码方法。下面结合图12,详细描述本申请实施例提供的编码方法。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.
图12是本申请实施例提供的编码方法的流程示意图。图12的方法可应用于编码器。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.
参见图12,在步骤S1210,确定当前块的相邻块。当前块可以为待解码的当前块。当前块可以为CU、TU、PU或子块等。当前块可以为亮度块,也可以为色度块。当前块可以为帧内块,也可以为帧间块。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.
相邻块可以为与当前块相邻的块。当前块与相邻块可以是左右相邻,也可以是上下相邻。相邻块可以位于当前块的上方、下方、左侧或右侧。相邻块与当前块的类型可以相同。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.
继续参见图12,在步骤S1220,基于当前块和/或相邻块的预测模式,确定当前块对应的第一滤波参数。第一滤波参数可以为上文描述的BS。确定当前块对应的第一滤波参数可以理解为,确定当前块对应的第一滤波参数的取值(即BS的取值)。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).
预测模式的种类有多种。例如,预测模式可以包括以下中的一种:DBV模式、IntraTMP模式、IBC-CIIP模式和IBC-GPM模式等。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.
继续参见图12,在步骤S1230,基于第一滤波参数,对当前块进行去方块滤波。Continuing to refer to FIG. 12 , in step S1230 , deblocking filtering is performed on the current block based on the first filtering parameters.
基于第一滤波参数,对当前块进行去方块滤波可以包括:基于第一滤波参数,进行滤波强弱选择,基于选择的滤波强度,执行滤波操作。滤波强度可以包括以下中的一种:不滤波、短抽头强滤波、短抽头弱滤波、长抽头滤波。对于亮度分量和色度分量,其对应的滤波操作不同。对于亮度分量,滤波操作可以包括亮度分量的长抽头滤波、亮度分量的短抽头强滤波、亮度分量的短抽头弱滤波。对于色度分量,滤波操作可以包括色度分量的强滤波、色度分量的弱滤波。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.
下面针对不同的预测模式,对第一滤波参数的取值进行介绍。The following describes the values of the first filtering parameter for different prediction modes.
DBV模式和IntraTMP模式DBV mode and IntraTMP mode
如果当前块和相邻块的预测模式为块矢量预测,则第一滤波参数的取值小于第二滤波参数的取值。第二滤波参数为基于帧内预测的块对应的滤波参数,或者说,第二滤波参数为普通帧内模式对应的滤波参数。也就是说,基于块矢量预测的块对应的滤波参数的取值小于基于帧内预测的块对应的滤波参数的取值。由于基于块矢量预测的块,其预测原理和帧间预测或IBC预测模式类似,因此,采用较小的滤波强度即可满足基于块矢量预测的块的滤波要求,避免造成边界处过度平滑、纹理消失的现象。上述基于块矢量预测的预测模式可以包括DBV模式和/或IntraTMP模式。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.
如果当前块和相邻块的预测模式为块矢量预测,则在满足第一条件的情况下,将第一滤波参数的取值设置为小于第二滤波参数的取值。第一条件基于以下信息中的一种或多种确定:当前块与相邻块的边界,当前块对应的变换系数,相邻块对应的变换系数。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.
当前块与相邻块的边界可以包括变换块边界和/或子块边界。如果当前块与相邻块的边界为变换块边界,则可以表示当前块和相邻块均为变换块。如果当前块和相邻块的边界为子块边界,则可以表示当前块和相邻块均为子块。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.
当前块对应的变换系数可以包括当前块在亮度分量上的变换系数和/或在色度分量上的变换系数。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.
相邻块对应的变换系数可以包括相邻块在亮度分量上的变换系数和/或在色度分量上的变换系数。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.
针对不同的预测模式,第一条件可以不同。下面针对DBV模式和IntraTMP模式,分别对第一条件进行介绍。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.
如果当前块和相邻块的预测模式为DBV模式,则第一条件可以包括:当前块和相邻块的边界为变换块边界,当前块对应的变换系数和相邻块对应的变换系数中至少有一个为非零,且变换系数包括色度分量的变换系数。换句话说,如果当前块和相邻块的边界为变换块边界,且当前块在亮度分量上的变换系数和相邻块在亮度分量上的变换系数中至少有一个为非零,则第一滤波参数的取值小于第二滤波参数的取值。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.
如果当前变换块和相邻块的预测模式为IntraTMP模式,则第一条件包括以下中的一种或多种:当 前块和相邻块的边界为变换块边界,当前块对应的变换系数和相邻块对应的变换系数中至少有一个为非零,变换系数包括亮度分量的变换系数;当前块和相邻块属于亮度分量,当前块和相邻块的边界为子块边界,且当前块和相邻块的预测模式不同;当前块和相邻块属于亮度分量,当前块和相邻块的边界为子块边界,且当前块对应的块矢量和相邻块对应的块矢量在第一方向上的差值大于或等于半个像素,第一方向为水平方向或垂直方向。下面对第一条件的内容进行展开介绍。If the prediction mode of the current transform block and the adjacent block is IntraTMP mode, the first condition includes one or more of the following: The boundary between the previous 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 the 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 following is an expanded introduction to the content of the first condition.
例如,对于亮度分量,如果当前块和相邻块的边界为变换块边界,且当前块对应的亮度分量的变换系数和相邻块对应的亮度分量的变换系数中至少有一个为非零(或者说,当前块和相邻块在亮度分量上至少有一个非零变换系数),则第一滤波参数的取值小于第二滤波参数的取值。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.
又例如,对于亮度分量,当前变换块和相邻变换块的边界为子块(或预测子块)边界,当前块和相邻块的预测模式不同,则第一滤波参数的取值小于第二滤波参数的取值。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.
又例如,对于亮度分量,当前块和相邻块的边界为子块(预测子块)边界,且当前块对应的块矢量和相邻块对应的块矢量在水平方向上的差值大于或等于半个像素,或当前块对应的块矢量和相邻块对应的块矢量在垂直方向上的差值大于或等于半个像素,则第一滤波参数的取值小于第二滤波参数的取值。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.
上述第一滤波参数的取值可以小于或等于第一值与第一比值的乘积,其中,第一值为去方块滤波对应的滤波参数的最大值,第一比值小于或等于50%。以第一比值为50%为例,可以将第一滤波参数的取值设置在滤波参数的取值前50%的数值。举例说明,如果滤波参数的最大值为10,则第一滤波参数的取值可以为1、2、3、4、5中的任意一个。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.
第一比值可以小于或等于30%。以第一比值为30%为例,可以将第一滤波参数的取值设置为滤波参数的取值的前30%的数值。举例说明,如果滤波参数的最大值为10,则第一滤波参数的取值可以为1、2、3中的任意一个。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.
上述第一滤波参数的取值可以为1。例如,如果去方块滤波对应的滤波参数的取值包括0、1、2,则可以将第一滤波参数的取值设置为1。或者说,如果第二滤波参数的取值为2,则第一滤波参数的取值为1。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.
如果第二条件满足,则第一滤波参数的取值大于或等于第二滤波参数的取值。第二条件包括以下中的一种或多种:当前块的编码模式为帧内编码,且当前块的帧内预测模式不是DBV模式;相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是DBV模式。例如,如果当前块的编码模式为帧内编码,且当前块的帧内预测模式不是DBV模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。又例如,如果相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是DBV模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。又例如,如果当前块的编码模式为帧内编码,且当前块的帧内预测模式不是DBV模式,相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是DBV模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。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.
第一滤波参数的取值大于第二滤波参数的取值,可以包括第一滤波参数的取值等于第二滤波参数的取值。例如,第一滤波参数的取值和第二滤波参数的取值均为2。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.
如果第三条件满足,则第一滤波参数的取值大于或等于第二滤波参数的取值。第三条件包括以下中的一种或多种:当前块的编码模式为帧内编码,且当前块的帧内预测模式不是帧内TMP模式;相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是帧内TMP模式。例如,如果当前块的编码模式为帧内编码,且当前块的帧内预测模式不是帧内TMP模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。又例如,如果相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是帧内TMP模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。又例如,如果当前块的编码模式为帧内编码,且当前块的帧内预测模式不是帧内TMP模式,如果相邻块的编码模式为帧内编码,且相邻块的帧内预测模式不是帧内TMP模式,则第一滤波参数的取值大于或等于第二滤波参数的取值。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.
第一滤波参数的取值大于第二滤波参数的取值,可以包括第一滤波参数的取值等于第二滤波参数的取值。例如,第一滤波参数的取值和第二滤波参数的取值均为2。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.
IBC-GPM模式和IBC-CIIP模式IBC-GPM model and IBC-CIIP model
如果当前块和/或相邻块的预测模式包括帧内预测,则第一滤波参数的取值大于第三滤波参数的取值。第三滤波参数为基于IBC预测的块对应的滤波参数,或者说,第三滤波参数为IBC块对应的滤波参数。也就是说,包括帧内预测的块对应的滤波参数的取值大于基于IBC预测的块对应的滤波参数的取值。如果当前块和/或相邻块的预测模式包括帧内预测,则在边界处的像素的不连续现象会更加明显,因此,需要采用较大的滤波强度才能达到较好的滤波效果。上述包括帧内预测模式的预测模式可以包括IBC-GPM模式和/或IBC-CIIP模式。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.
如果当前块和/或相邻块对应的编码块基于IBC-CIIP编码,则第一滤波参数的取值大于第三滤波参 数的取值。例如,如果当前块对应的编码块基于IBC-CIIP编码,则第一滤波参数的取值大于第三滤波参数的取值。又例如,如果相邻块对应的编码块基于IBC-CIIP编码,则第一滤波参数的取值大于第三滤波参数的取值。又例如,如果当前块和相邻块对应的编码块基于IBC-CIIP编码,则第一滤波参数的取值大于第三滤波参数的取值。If the coding block corresponding to the current block and/or the adjacent block is based on IBC-CIIP coding, the value of the first filtering parameter is greater than the value of the third filtering 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 block are based on IBC-CIIP coding, the value of the first filter parameter is greater than the value of the third filter parameter.
如果当前块和/或相邻块对应的编码块基于IBC-GPM编码,则在满足第四条件的情况下,第一滤波参数的取值大于第三滤波参数的取值。第四条件包括以下中的一种或多种:当前块不是基于IBC预测,相邻块不是基于IBC预测。也就是说,在当前块和/或相邻块不是基于IBC预测的情况下,第一滤波参数的取值大于第三滤波参数的取值。当前块和相邻块可以为上文描述的与子分区对应的块。子分区对应的块可能采用的是IBC预测,也可能采用的是帧内预测。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.
上述第一滤波参数的取值可以小于或等于第一值与第二比值的乘积,其中,第一值为去方块滤波对应的滤波参数的最大值,第二比值大于或等于50%。以第二比值为50%为例,可以将第一滤波参数的取值设置在滤波参数的取值后50%的数值。举例说明,如果滤波参数的最大值为10,则第一滤波参数的取值可以为5、6、7、8、9、10中的任意一个。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.
第一比值可以大于或等于80%。以第一比值为30%为例,可以将第一滤波参数的取值设置为滤波参数的取值的前30%的数值。举例说明,如果滤波参数的最大值为10,则第一滤波参数的取值可以为8、9、10中的任意一个。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.
上述第一滤波参数的取值可以为2。例如,如果去方块滤波对应的滤波参数的取值包括0、1、2,则可以将第一滤波参数的取值设置为2。或者说,如果第二滤波参数的取值为1,则第一滤波参数的取值为2。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.
如果当前块和/或相邻块对应的编码块基于IBC-GPM编码,且当前块和相邻块的边界为变换块边界,则在满足第五条件的情况下,第一滤波参数的取值小于或等于第三滤波参数的取值。第五条件包括:当前块对应的变换系数和相邻块对应的变换系数中至少有一个为非零。上述变换系数包括亮度分量的变换系数和/或色度分量的变换系数。例如,第五条件包括:当前块在亮度分量上的变换系数和相邻块在亮度分量上的变换系数中至少有一个为非零,和/或当前块在色度分量上的变换系数和相邻块在色度分量上的变换系数中至少有一个为非零。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.
上述第一滤波参数的取值可以与第三滤波参数的取值相等。例如,第一滤波参数的取值和第三滤波参数的取值均为1。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.
如果当前块和/或相邻块对应的编码块基于IBC-GPM编码,当前块和相邻块属于亮度分量,且当前块和相邻块的边界为子块边界,则在满足第六条件的情况下,第一滤波参数的取值小于或等于第三滤波参数的取值。第六条件包括以下中的一种或多种:当前块与相邻块的预测模式不同;当前块和相邻块的预测模式采用IBC模式,且当前块对应的块矢量和相邻块对应的块矢量在第一方向上的差值大于或等于半个像素,第一方向为水平方向或垂直方向。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.
上述第一滤波参数的取值可以与第三滤波参数的取值相等。例如,第一滤波参数的取值和第三滤波参数的取值均为1。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.
下面结合具体例子,更加详细地描述本申请实施例。应注意,下文中的例子仅仅是为了帮助本领域技术人员理解本申请实施例,而非要将本申请实施例限于所例示的具体数值或具体场景。本领域技术人员根据所给出的下文中的例子,显然可以进行各种等价的修改或变化,这样的修改或变化也落入本申请实施例的范围内。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.
对于DBV模式,在确定BS时,可以按照如下步骤进行确定:For DBV mode, when determining BS, you can follow the following steps:
①对于色度分量,p0位置处CU和q0位置处CU的intra_bdpcm_chroma_flag都为1,bS[xDi][yDj]设置为0。① 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.
②p0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x0][y0]为MODE_INTRA且IntraPredModeC[xCb][yCb]不是DBV模式或q0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x1][y1]为MODE_INTRA且IntraPredModeC[xCb][yCb]不是DBV模式,bS[xDi][yDj]设置为2,其中(x0,y0)为p0位置处对应CU左上角样本位置,(x1,y1)为q0位置处对应CU左上角样本位置。其中变量cIdx用于指示当前CU的颜色分量。② 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.
③否则,边界是变换块边界,下面条件满足其一时,bS[xDi][yDj]设置为1:Otherwise, the boundary is a transform block boundary, and bS[xDi][yDj] is set to 1 when one of the following conditions is met:
a.cIdx为1时,tu_cb_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、tu_cb_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cb分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cb分量变换块的左上样本对应的亮度位置。即Cb分量至少一个非零变换系数。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.
b.cIdx为2时,tu_cr_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、 tu_cr_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cr分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cr分量变换块的左上样本对应的亮度位置。即Cr分量至少一个非零变换系数。b. When cIdx is 2, tu_cr_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], The sum of 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.
对于IntraTMP模式,在确定BS时,可以按照如下步骤进行确定:For the IntraTMP mode, when determining the BS, you can follow the following steps:
①对于亮度分量,p0位置处CU和q0位置处CU的intra_bdpcm_luma_flag都为1,bS[xDi][yDj]设置为0。① 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.
②p0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x0][y0]为MODE_INTRA且intraTmpFlag为0或q0位置处对应CU的编码模式CuPredMode[cIdx==0?0:1][x1][y1]为MODE_INTRA且intraTmpFlag为0,bS[xDi][yDj]设置为2,其中(x0,y0)为p0位置处对应CU左上角样本位置,(x1,y1)为q0位置处对应CU左上角样本位置。其中变量cIdx,指示当前CU的颜色分量。② 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.
③否则,边界是变换块边界,下面条件满足时,bS[xDi][yDj]设置为1:Otherwise, the boundary is a transform block boundary, and bS[xDi][yDj] is set to 1 if the following conditions are met:
-cIdx为0时,tu_y_coded_flag[x0][y0]与tu_y_coded_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处亮度变换块的左上角样本位置,(x1,y1)是q0位置处的亮度变换块的左上角样本位置。即亮度分量至少一个非零变换系数。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.
④否则,cIdx等于0,edgeIdc[xDi][yDj]等于2,即边界为预测子块边界,下面条件满足一个或多个时,bS[xDi][yDj]设置为1:④ 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:
a.p0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xp0][yp0]与q0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xq0][yq0]不同,其中(xp0,yp0)是p0位置处子块左上样本对应的亮度位置,(xq0,yq0)是q0位置处子块左上样本对应的亮度位置。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.
b.p0位置处子块的intraTmpFlag和q0位置处子块的intraTmpFlag均为1,并且运动矢量的水平或垂直绝对差值大于等于半像素。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.
对于IBC-CIIP模式,在确定BS时,可以按照如下步骤进行确定:For the IBC-CIIP model, when determining BS, you can follow the following steps:
①对于亮度和色度分量(目前IBC色度在双树下不做,所有模式在单树色度分量不滤波,下面给出的是如果单树和双树均做色度且均开启色度滤波的情况),p0或q0位置处对应CU的ibc_ciip_flag等于1,bS[xDi][yDj]设置为2。① 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.
对于IBC-GPM模式,在确定BS时,可以按照如下步骤进行确定:For the IBC-GPM mode, when determining the BS, you can follow the following steps:
亮度分量:Luminance component:
①p0或q0位置处对应CU的ibc_gpm_intra_Flag等于1,且p0或q0位置处对应子块不是由IBC块矢量预测,bS[xDi][yDj]设置为2。① 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.
②否则,边界是变换块边界,下面条件满足其一时,bS[xDi][yDj]设置为1:Otherwise, the boundary is a transform block boundary, and bS[xDi][yDj] is set to 1 when one of the following conditions is met:
-cIdx为0时,tu_y_coded_flag[x0][y0]与tu_y_coded_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处亮度变换块的左上角样本位置,(x1,y1)是q0位置处的亮度变换块的左上角样本位置。即亮度分量至少一个非零变换系数。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.
③否则,cIdx等于0,edgeIdc[xDi][yDj]等于2,即边界为预测子块边界,下面条件满足一个或多个时,bS[xDi][yDj]设置为1:③ 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:
a.p0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xp0][yp0]与q0位置处子块的预测模式CuPredMode[cIdx==0?0:1][xq0][yq0]不同,其中(xp0,yp0)是p0位置处子块左上样本对应的亮度位置,(xq0,yq0)是q0位置处子块左上样本对应的亮度位置。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.
b.p0位置处子块的预测模式和q0位置处子块的预测模式都采用IBC模式,并且运动矢量的水平或垂直绝对差值大于等于半像素。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.
色度分量:Chroma component:
(目前IBC色度在双树下不做,所有模式在单树色度分量不滤波,下面给出的是如果单树和双树均做色度且均开启色度滤波的情况):(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):
①p0或q0位置处对应CU的ibc_gpm_intra_Flag等于1,且p0或q0位置处对应子块不是由IBC块矢量预测,bS[xDi][yDj]设置为2。① 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.
②边界是变换块边界,下面条件满足其一时,bS[xDi][yDj]设置为1:② The boundary is the transform block boundary. bS[xDi][yDj] is set to 1 when any of the following conditions is met:
a.cIdx为1时,tu_cb_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、tu_cb_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cb分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cb分量变换块的左上样本对应的亮度位置。即Cb分量至少一个非零变换系数。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.
b.cIdx为2时,tu_cr_coded_flag[x0][y0]、tu_joint_cbcr_residual_flag[x0][y0]、 tu_cr_coded_flag[x1][y1]和tu_joint_cbcr_residual_flag[x1][y1]之和大于0,其中(x0,y0)是p0位置处Cr分量变换块的左上样本对应的亮度位置,(x1,y1)是q0位置处Cr分量变换块的左上样本对应的亮度位置。即Cr分量至少一个非零变换系数。b. When cIdx is 2, tu_cr_coded_flag[x0][y0], tu_joint_cbcr_residual_flag[x0][y0], The sum of 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.
本申请充分考虑了不同预测模式的预测特性,设计适合的DBF滤波强度(BS),充分发挥DBF的作用,有效去除块效应。主观、客观质量得到了有效提高。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.
图13-图16示出了基于本申请实施例的方案和基于传统方案进行滤波后的滤波效果图。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.
图13中的(a)图示出的是原始图像,图13中的(b)图示出的是基于传统方式滤波后的图像,图13中的(c)图示出的是基于本申请实施例的方案进行滤波后的图像。通过(b)图和(c)图比较,可以看出本申请实施例的方案可以达到较好的滤波效果。另外,(c)图和(a)图比较接近,能够基本上还原原始的图像。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.
图14中的(a)图示出的是原始图像,图14中的(b)图示出的是基于传统方式滤波后的图像,图14中的(c)图示出的是基于本申请实施例的方案进行滤波后的图像。通过(b)图和(c)图比较,可以看出本申请实施例的方案可以达到较好的滤波效果。另外,(c)图和(a)图比较接近,能够基本上还原原始的图像。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.
图15中的(a)图示出的是原始图像,图15中的(b)图示出的是基于传统方式滤波后的图像,图15中的(c)图示出的是基于本申请实施例的方案进行滤波后的图像。通过(b)图和(c)图比较,可以看出本申请实施例的方案可以达到较好的滤波效果。另外,(c)图和(a)图比较接近,能够基本上还原原始的图像。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.
上文结合图1至图15,详细描述了本申请的方法实施例,下面结合图16至图19,详细描述本申请的装置实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。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.
图16为本申请一个实施例提供的解码器的结构示意图。如图16所示,所述解码器1600包括:第一确定单元1610、第二确定单元1620和滤波单元1630。第一确定单元1610配置为确定当前块的相邻块;第二确定单元1620配置为基于所述当前块和/或所述相邻块的预测模式,确定所述当前块对应的第一滤波参数;滤波单元1630配置为基于所述第一滤波参数,对所述当前块进行去方块滤波。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.
在一些实现方式中,如果所述当前块和所述相邻块的预测模式为块矢量预测,则所述第一滤波参数的取值小于第二滤波参数的取值,所述第二滤波参数为基于帧内预测的块对应的滤波参数。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.
在一些实现方式中,如果所述当前块和所述相邻块的预测模式为块矢量预测,则在满足第一条件的情况下,所述第一滤波参数的取值小于所述第二滤波参数的取值,所述第一条件基于以下信息中的一种或多种确定:所述当前块与所述相邻块的边界;所述当前块对应的变换系数;所述相邻块对应的变换系数。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.
在一些实现方式中,所述块矢量预测的模式为直接块矢量DBV模式,所述第一条件包括:所述当前块和所述相邻块的边界为变换块边界,所述当前块对应的变换系数和所述相邻块对应的变换系数中至少有一个为非零,所述变换系数包括色度分量的变换系数。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.
在一些实现方式中,所述块矢量预测的模式为帧内模板匹配预测TMP模式,所述第一条件包括以下中的一种或多种:所述当前块和所述相邻块的边界为变换块边界,所述当前块对应的变换系数和所述相邻块对应的变换系数中至少有一个为非零,所述变换系数包括亮度分量的变换系数;所述当前块和所述相邻块属于亮度分量,所述当前块和所述相邻块的边界为子块边界,且所述当前块与所述相邻块的预测模式不同;所述当前块和所述相邻块属于亮度分量,所述当前块和所述相邻块的边界为子块边界,且所述当前块对应的块矢量和所述相邻块对应的块矢量在第一方向上的差值大于或等于半个像素,所述第一方向为水平方向或垂直方向。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.
在一些实现方式中,所述块矢量预测的模式为DBV模式或帧内TMP模式。In some implementations, the block vector prediction mode is a DBV mode or an intra-frame TMP mode.
在一些实现方式中,所述第一滤波参数满足以下中的一种或多种:所述第一滤波参数的值为1;所述第一滤波参数的取值小于或等于第一值与第一比值的乘积,所述第一值为所述去方块滤波对应的滤波参数的最大值,所述第一比值小于或等于50%。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%.
在一些实现方式中,如果第二条件满足,则所述第一滤波参数的取值大于或等于所述第二滤波参数的取值,所述第二滤波参数为基于帧内预测的块对应的滤波参数,所述第二条件包括以下中的一种或多种:所述当前块的编码模式为帧内编码,且所述当前块的帧内预测模式不是DBV模式;所述相邻块的编码模式为帧内编码,且所述相邻块的帧内预测模式不是DBV模式。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.
在一些实现方式中,如果第三条件满足,则所述第一滤波参数的取值大于或等于所述第二滤波参数的取值,所述第二滤波参数为基于帧内预测的块对应的滤波参数,所述第三条件包括以下中的一种或多种:所述当前块的编码模式为帧内编码,且所述当前块的帧内预测模式不是帧内TMP模式;所述相邻 块的编码模式为帧内编码,且所述相邻块的帧内预测模式不是帧内TMP模式。In some implementations, if a 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-frame coding, and the intra-frame prediction mode of the current block is not intra-frame TMP mode; the adjacent The coding mode of the block is intra coding, and the intra prediction mode of the neighboring block is not intra TMP mode.
在一些实现方式中,如果所述当前块和/或所述相邻块的预测模式包括帧内预测,则所述第一滤波参数的取值大于第三滤波参数的取值,所述第三滤波参数为基于帧内块拷贝IBC预测的块对应的滤波参数。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.
在一些实现方式中,如果所述当前块和/或所述相邻块对应的编码块基于组合帧内块复制和帧内预测IBC-CIIP编码,则所述第一滤波参数的取值大于所述第三滤波参数的取值。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.
在一些实现方式中,如果所述当前块和/或所述相邻块对应的编码块基于几何分区帧内块复制IBC-GPM编码,在满足第四条件的情况下,所述第一滤波参数的取值大于所述第三滤波参数的取值,所述第四条件包括以下中的一种或多种:所述当前块不是基于IBC预测;所述相邻块不是基于IBC预测。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.
在一些实现方式中,所述第一滤波参数满足以下中的一种或多种:所述第一滤波参数的取值为2;所述第一滤波参数的取值小于或等于第一值与第二比值的乘积,所述第一值为所述去方块滤波对应的滤波参数的最大值,所述第二比值大于或等于50%。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%.
在一些实现方式中,如果所述当前块和/或所述相邻块对应的编码块基于IBC-GPM编码,且所述当前块和所述相邻块的边界为变换块边界,则在满足第五条件的情况下,所述第一滤波参数的取值小于或等于所述第三滤波参数的取值,所述第三滤波参数为基于IBC预测的块对应的滤波参数,所述第五条件包括:所述当前块对应的变换系数和所述相邻块对应的变换系数中至少有一个为非零,所述变换系数包括亮度分量的变换系数和/或色度分量的变换系数。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.
在一些实现方式中,如果所述当前块和/或所述相邻块对应的编码块基于IBC-GPM编码,所述当前块和所述相邻块属于亮度分量,且所述当前块和所述相邻块的边界为子块边界,则在满足第六条件的情况下,所述第一滤波参数的取值小于或等于所述第三滤波参数的取值,所述第三滤波参数为基于IBC预测的块对应的滤波参数,所述第六条件包括以下中的一种或多种:所述当前块与所述相邻块的预测模式不同;所述当前块和所述相邻块的预测模式采用IBC模式,且所述当前块对应的块矢量和所述相邻块对应的块矢量在第一方向上的差值大于或等于半个像素,所述第一方向为水平方向或垂直方向。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.
在一些实现方式中,所述当前块为变换块、编码块或子块。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 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.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of 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 part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling 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 disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
因此,本申请实施例提供了一种计算机可读存储介质,应用于解码器1600,该计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现前述解码方法。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.
基于上述解码器1600的组成以及计算机可读存储介质,参见图17,其示出了本申请实施例提供的解码器的具体硬件结构示意图。如图17所示,解码器1700可以包括:通信接口1710、存储器1720和处理器1730;各个组件通过总线系统1740耦合在一起。可理解,总线系统1740用于实现这些组件之间的连接通信。总线系统1740除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图17中将各种总线都标为总线系统1740。其中,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,
通信接口1710,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送。The communication interface 1710 is used to receive and send signals when sending and receiving information with other external network elements.
存储器1720,用于存储计算机程序。The memory 1720 is used to store computer programs.
处理器1730,用于在运行所述计算机程序时,执行:The processor 1730 is configured to, when running the computer program, execute:
确定与当前块相邻的相邻块;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.
可以理解,本申请实施例中的存储器1720可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取 存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的存储器1720旨在包括但不限于这些和任意其它适合类型的存储器。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). Random Access Memory (RAM) 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 SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (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.
而处理器1730可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1730中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1730可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1720,处理器1730读取存储器1720中的信息,结合其硬件完成上述方法的步骤。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 in the processor 1730 or software instructions. 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 embodied as being executed by a hardware decoding processor, or can be executed 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.
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。It is understood that the embodiments described in this application can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or a combination thereof. For software implementation, the technology described in this application can be implemented by modules (such as processes, functions, etc.) that perform the functions described in this 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.
可选地,作为另一个实施例,处理器1730还配置为在运行所述计算机程序时,执行前述实施例所述的解码方法。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.
图18为本申请一个实施例提供的编码器的结构示意图。如图18所示,所述编码器1800包括:第一确定单元1810、第二确定单元1820和滤波单元1830。第一确定单元1810,配置为确定与当前块相邻的相邻块;第二确定单元1820,配置为基于所述当前块和/或所述相邻块的预测模式,确定所述当前块对应的第一滤波参数;滤波单元1830,配置为基于所述第一滤波参数,对所述当前块进行去方块滤波。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.
在一些实现方式中,如果所述当前块和所述相邻块的预测模式为块矢量预测,则所述第一滤波参数的取值小于第二滤波参数的取值,所述第二滤波参数为基于帧内预测的块对应的滤波参数。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.
在一些实现方式中,如果所述当前块和所述相邻块的预测模式为块矢量预测,则在满足第一条件的情况下,所述第一滤波参数的取值小于所述第二滤波参数的取值,所述第一条件基于以下信息中的一种或多种确定:所述当前块与所述相邻块的边界;所述当前块对应的变换系数;所述相邻块对应的变换系数。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.
在一些实现方式中,所述块矢量预测的模式为直接块矢量DBV模式,所述第一条件包括:所述当前块和所述相邻块的边界为变换块边界,所述当前块对应的变换系数和所述相邻块对应的变换系数中至少有一个为非零,所述变换系数包括色度分量的变换系数。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.
在一些实现方式中,所述块矢量预测的模式为帧内模板匹配预测TMP模式,所述第一条件包括以下中的一种或多种:所述当前块和所述相邻块的边界为变换块边界,所述当前块对应的变换系数和所述相邻块对应的变换系数中至少有一个为非零,所述变换系数包括亮度分量的变换系数;所述当前块和所述相邻块属于亮度分量,所述当前块和所述相邻块的边界为子块边界,且所述当前块与所述相邻块的预测模式不同;所述当前块和所述相邻块属于亮度分量,所述当前块和所述相邻块的边界为子块边界,且所述当前块对应的块矢量和所述相邻块对应的块矢量在第一方向上的差值大于或等于半个像素,所述第一方向为水平方向或垂直方向。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.
在一些实现方式中,所述块矢量预测的模式为DBV模式或帧内TMP模式。In some implementations, the block vector prediction mode is a DBV mode or an intra-frame TMP mode.
在一些实现方式中,所述第一滤波参数满足以下中的一种或多种:所述第一滤波参数的值为1;所述第一滤波参数的取值小于或等于第一值与第一比值的乘积,所述第一值为所述去方块滤波对应的滤波参数的最大值,所述第一比值小于或等于50%。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%.
在一些实现方式中,如果第二条件满足,则所述第一滤波参数的取值大于或等于所述第二滤波参数 的取值,所述第二滤波参数为基于帧内预测的块对应的滤波参数,所述第二条件包括以下中的一种或多种:所述当前块的编码模式为帧内编码,且所述当前块的帧内预测模式不是DBV模式;所述相邻块的编码模式为帧内编码,且所述相邻块的帧内预测模式不是DBV模式。In some implementations, if the second condition is met, the value of the first filtering parameter is greater than or equal to the second filtering parameter The value of 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 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.
在一些实现方式中,如果第三条件满足,则所述第一滤波参数的取值大于或等于所述第二滤波参数的取值,所述第二滤波参数为基于帧内预测的块对应的滤波参数,所述第三条件包括以下中的一种或多种:所述当前块的编码模式为帧内编码,且所述当前块的帧内预测模式不是帧内TMP模式;所述相邻块的编码模式为帧内编码,且所述相邻块的帧内预测模式不是帧内TMP模式。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.
在一些实现方式中,如果所述当前块和/或所述相邻块的预测模式包括帧内预测,则所述第一滤波参数的取值大于第三滤波参数的取值,所述第三滤波参数为基于帧内块拷贝IBC预测的块对应的滤波参数。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.
在一些实现方式中,如果所述当前块和/或所述相邻块对应的编码块基于组合帧内块复制和帧内预测IBC-CIIP编码,则所述第一滤波参数的取值大于所述第三滤波参数的取值。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.
在一些实现方式中,如果所述当前块和/或所述相邻块对应的编码块基于几何分区帧内块复制IBC-GPM编码,在满足第四条件的情况下,所述第一滤波参数的取值大于所述第三滤波参数的取值,所述第四条件包括以下中的一种或多种:所述当前块不是基于IBC预测;所述相邻块不是基于IBC预测。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.
在一些实现方式中,所述第一滤波参数满足以下中的一种或多种:所述第一滤波参数的取值为2;所述第一滤波参数的取值小于或等于第一值与第二比值的乘积,所述第一值为所述去方块滤波对应的滤波参数的最大值,所述第二比值大于或等于50%。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%.
在一些实现方式中,如果所述当前块和/或所述相邻块对应的编码块基于IBC-GPM编码,且所述当前块和所述相邻块的边界为变换块边界,则在满足第五条件的情况下,所述第一滤波参数的取值小于或等于所述第三滤波参数的取值,所述第三滤波参数为基于IBC预测的块对应的滤波参数,所述第五条件包括:所述当前块对应的变换系数和所述相邻块对应的变换系数中至少有一个为非零,所述变换系数包括亮度分量的变换系数和/或色度分量的变换系数。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.
在一些实现方式中,如果所述当前块和/或所述相邻块对应的编码块基于IBC-GPM编码,所述当前块和所述相邻块属于亮度分量,且所述当前块和所述相邻块的边界为子块边界,则在满足第六条件的情况下,所述第一滤波参数的取值小于或等于所述第三滤波参数的取值,所述第三滤波参数为基于IBC预测的块对应的滤波参数,所述第六条件包括以下中的一种或多种:所述当前块与所述相邻块的预测模式不同;所述当前块和所述相邻块的预测模式采用IBC模式,且所述当前块对应的块矢量和所述相邻块对应的块矢量在第一方向上的差值大于或等于半个像素,所述第一方向为水平方向或垂直方向。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.
在一些实现方式中,所述当前块为变换块、编码块或子块。可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。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.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of 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 part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling 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 disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
因此,本申请实施例提供了一种计算机可读存储介质,应用于编码器1800,该计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现前述实施例中的编码方法。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.
基于上述编码器1800的组成以及计算机可读存储介质,参见图19,其示出了本申请实施例提供的编码器的具体硬件结构示意图。如图19所示,编码器1900可以包括:通信接口1919、存储器1920和处理器1930;各个组件通过总线系统1940耦合在一起。可理解,总线系统1940用于实现这些组件之间的连接通信。总线系统1940除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图19中将各种总线都标为总线系统1940。其中,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,
通信接口1919,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送。The communication interface 1919 is used to receive and send signals when sending and receiving information with other external network elements.
存储器1920,用于存储计算机程序。The memory 1920 is used to store computer programs.
处理器1930,用于在运行所述计算机程序时,执行:Processor 1930 is configured to, when running the computer program, execute:
确定当前块的相邻块; 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.
可以理解,本申请实施例中的存储器1920可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的存储器1920旨在包括但不限于这些和任意其它适合类型的存储器。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 SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronized DRAM (SLDRAM), and direct RAM (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.
而处理器1930可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1930中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1930可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1920,处理器1930读取存储器1920中的信息,结合其硬件完成上述方法的步骤。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 in processor 1930 or software instructions. The above-mentioned processor 1930 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. A general-purpose processor can 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.
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。It is understood that the embodiments described in this application can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or a combination thereof. For software implementation, the technology described in this application can be implemented by modules (such as processes, functions, etc.) that perform the functions described in this 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.
可选地,作为另一个实施例,处理器1930还配置为在运行所述计算机程序时,执行前述实施例所述的编码方法。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.
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。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.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。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.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。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.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。 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 (39)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/076981 WO2025166744A1 (en) | 2024-02-08 | 2024-02-08 | Encoding method, decoding method, encoder, decoder, bitstream, and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/076981 WO2025166744A1 (en) | 2024-02-08 | 2024-02-08 | Encoding method, decoding method, encoder, decoder, bitstream, and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025166744A1 true WO2025166744A1 (en) | 2025-08-14 |
Family
ID=96699067
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/076981 Pending WO2025166744A1 (en) | 2024-02-08 | 2024-02-08 | Encoding method, decoding method, encoder, decoder, bitstream, and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2025166744A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050276323A1 (en) * | 2002-09-27 | 2005-12-15 | Vanguard Software Solutions, Inc. | Real-time video coding/decoding |
| US20130142255A1 (en) * | 2011-06-27 | 2013-06-06 | Toru Matsunobu | Image coding method, image decoding method, image coding apparatus, image decoding apparatus, and image coding-decoding apparatus |
| CN112119639A (en) * | 2018-03-29 | 2020-12-22 | 艾锐势有限责任公司 | System and method for deblocking HDR content |
| CN112313953A (en) * | 2018-04-02 | 2021-02-02 | 高通股份有限公司 | Deblocking filter for video encoding and decoding and processing |
| CN113906763A (en) * | 2019-05-05 | 2022-01-07 | 北京字节跳动网络技术有限公司 | Chroma deblocking coordination for video coding and decoding |
-
2024
- 2024-02-08 WO PCT/CN2024/076981 patent/WO2025166744A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050276323A1 (en) * | 2002-09-27 | 2005-12-15 | Vanguard Software Solutions, Inc. | Real-time video coding/decoding |
| US20130142255A1 (en) * | 2011-06-27 | 2013-06-06 | Toru Matsunobu | Image coding method, image decoding method, image coding apparatus, image decoding apparatus, and image coding-decoding apparatus |
| CN112119639A (en) * | 2018-03-29 | 2020-12-22 | 艾锐势有限责任公司 | System and method for deblocking HDR content |
| CN112313953A (en) * | 2018-04-02 | 2021-02-02 | 高通股份有限公司 | Deblocking filter for video encoding and decoding and processing |
| CN113906763A (en) * | 2019-05-05 | 2022-01-07 | 北京字节跳动网络技术有限公司 | Chroma deblocking coordination for video coding and decoding |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN114402601B (en) | Method and device for shifting quantization parameter of chroma deblocking filter | |
| JP2023090929A (en) | Video decoding method, video decoding device and storage medium | |
| US20200351511A1 (en) | Method and device for video coding using various transform techniques | |
| US20190335173A1 (en) | Image encoding method/device, image decoding method/device and recording medium having bitstream stored therein | |
| US20240291982A1 (en) | Inter-frame prediction method, coder, decoder, and storage medium | |
| CN118368415A (en) | Deblocking filter adaptive encoder, decoder and corresponding method | |
| TW202404370A (en) | Decoding methods, encoding methods, decoders, encoders, electronic equipment, computer-readable storage media, computer program products and code streams | |
| WO2023123398A1 (en) | Filtering method, filtering apparatus, and electronic device | |
| CN114556950B (en) | Video encoding and decoding method and device with BDPCM size constraint | |
| CN110771166B (en) | Intra-frame prediction device and method, encoding device, decoding device, and storage medium | |
| CN114175653B (en) | Method and apparatus for lossless codec mode in video codec | |
| TW202241132A (en) | Coefficient encoding/decoding method, encoder, decoder, and computer storage medium | |
| CN116711304A (en) | Prediction method, encoder, decoder and storage medium | |
| EP4510588A1 (en) | Decoding method, encoding method, decoders and encoders | |
| WO2025166744A1 (en) | Encoding method, decoding method, encoder, decoder, bitstream, and storage medium | |
| KR20240122515A (en) | Method and device for cross-component prediction for video coding | |
| CN117296323A (en) | Feature-based transformation selection | |
| EP4510572A9 (en) | Decoding methods, encoding methods, decoders and encoders | |
| US20260032260A1 (en) | Encoding/decoding method, code stream, encoder, decoder and storage medium | |
| EP4510571A1 (en) | Decoding method, encoding method, decoder and encoder | |
| WO2025145288A1 (en) | Encoding method, decoding method, bitstream, encoder, decoder, and storage medium | |
| WO2025236218A1 (en) | Encoding method, decoding method, code stream, encoder, decoder, and storage medium | |
| WO2025199802A1 (en) | Encoding method, decoding method, code stream, encoder, decoder, and storage medium | |
| WO2025148090A1 (en) | Encoding method, decoding method, encoder, decoder, code stream, and storage medium | |
| WO2025147924A1 (en) | Coding method, decoding method, code stream, coder, decoder and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24922979 Country of ref document: EP Kind code of ref document: A1 |