CN112204986A - Video coding and decoding method and device - Google Patents

Video coding and decoding method and device Download PDF

Info

Publication number
CN112204986A
CN112204986A CN201980029834.6A CN201980029834A CN112204986A CN 112204986 A CN112204986 A CN 112204986A CN 201980029834 A CN201980029834 A CN 201980029834A CN 112204986 A CN112204986 A CN 112204986A
Authority
CN
China
Prior art keywords
image block
prediction mode
coding unit
partition
boundary
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
Application number
CN201980029834.6A
Other languages
Chinese (zh)
Inventor
马思伟
孟学苇
郑萧桢
王苫社
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
SZ DJI Technology Co Ltd
SZ DJI Innovations Technology Co Ltd
Original Assignee
Peking University
SZ DJI Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Priority claimed from PCT/CN2019/107606 external-priority patent/WO2021056219A1/en
Application filed by Peking University, SZ DJI Technology Co Ltd filed Critical Peking University
Publication of CN112204986A publication Critical patent/CN112204986A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods 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/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Abstract

A method and apparatus for video encoding and decoding, comprising: acquiring a reconstructed image, wherein the reconstructed image comprises a first coding unit and a second coding unit, the first coding unit comprises a first image block, the second coding unit comprises a second image block, and the first image block and the second image block are adjacent blocks; and if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block. According to the video coding and decoding method provided by the embodiment of the application, if one of the two adjacent image blocks in the reconstructed image adopts the geometric partition prediction mode and the image block is located on the partition boundary line of the coding unit of the image block, the adjacent image block is subjected to deblocking filtering, so that the blocking effect between the adjacent image blocks can be avoided as much as possible, and further, the subjective and objective quality of the compressed video can be improved.

Description

Video coding and decoding method and device
This application claims priority from the following applications, the entire contents of which are incorporated by reference in this application: and the PCT application with the application number of PCT/CN2019/107606 and the name of video coding and decoding method and device is submitted in 24.9.2019 by the Chinese patent office.
Copyright declaration
The disclosure of this patent document contains material which is subject to copyright protection. The copyright is owned by the copyright owner. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the patent and trademark office official records and records.
Technical Field
The present application relates to the field of image processing, and more particularly, to a method and apparatus for video encoding and decoding.
Background
Filtering is an important block in the video coding framework and may include bilateral filtering, adaptive loop filtering, adaptive sample compensation filtering, and deblocking filtering. Currently, with respect to the deblocking filtering technique, there may be blocking artifacts between adjacent image blocks without deblocking filtering the image block, or there may be no blocking artifacts between adjacent image blocks with deblocking filtering the adjacent image block, resulting in degradation of compressed video quality.
Therefore, how to effectively distinguish whether to perform deblocking filtering on adjacent image blocks is an urgent problem to be solved.
Disclosure of Invention
The video coding and decoding method and device provided by the embodiment of the application can avoid the blocking effect between the adjacent image blocks as much as possible, and further can improve the subjective and objective quality of the compressed video.
In a first aspect, a video coding and decoding method is provided, including: acquiring a reconstructed image, wherein the reconstructed image comprises a first coding unit and a second coding unit, the first coding unit comprises a first image block, the second coding unit comprises a second image block, and the first image block and the second image block are adjacent blocks; and if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
In a second aspect, there is provided a video coding and decoding device, including: a processor configured to obtain a reconstructed image, where the reconstructed image includes a first encoding unit and a second encoding unit, the first encoding unit includes a first image block, the second encoding unit includes a second image block, and the first image block and the second image block are adjacent blocks; and if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
In a third aspect, a video coding and decoding device is provided and includes a processor and a memory. The memory is used for storing a computer program, and the processor is used for calling and running the computer program stored in the memory, and executing the method in the first aspect or each implementation manner thereof.
In a fourth aspect, a chip is provided for implementing the method in the first aspect or its implementation manners.
Specifically, the chip includes: a processor configured to call and run the computer program from the memory, so that the device on which the chip is installed performs the method according to the first aspect or the implementation manner thereof.
In a fifth aspect, there is provided a computer readable storage medium for storing a computer program comprising instructions for performing the method of the first aspect or any possible implementation manner of the first aspect.
A sixth aspect provides a computer program product comprising computer program instructions to cause a computer to perform the method of the first aspect or the implementations of the first aspect.
According to the video coding and decoding method provided by the embodiment of the application, if one of the two adjacent image blocks in the reconstructed image adopts the geometric partition prediction mode and the image block is located on the partition boundary line of the coding unit of the image block, the adjacent image block is subjected to deblocking filtering, so that the blocking effect between the adjacent image blocks can be avoided as much as possible, and further, the subjective and objective quality of the compressed video can be improved.
Drawings
FIG. 1 is an architecture diagram of a solution applying an embodiment of the present application;
FIG. 2 is a schematic diagram of a video coding framework 2 according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a video encoding and decoding method according to an embodiment of the present application;
FIG. 4a is a schematic diagram of a partition of a triangle prediction mode in the embodiment of the present application;
FIG. 4b is a schematic diagram of a polygon partition prediction mode in the embodiment of the present application;
FIG. 5a is a schematic diagram of a geometric partition prediction approach provided by an embodiment of the present application;
FIG. 5b is a schematic diagram of a geometric partition prediction approach provided by another embodiment of the present application;
FIG. 6 is a schematic diagram of MV storage in a triangle prediction mode in an embodiment of the present application;
FIG. 7 is a schematic diagram of MV storage in a polygon partition prediction mode in the embodiment of the present application;
FIG. 8 is a schematic diagram of a geometric partition prediction approach provided by yet another embodiment of the present application;
FIG. 9 is a schematic diagram of a geometric partition prediction approach provided by yet another embodiment of the present application;
FIG. 10 is a schematic diagram of a geometric partition prediction approach provided by yet another embodiment of the present application;
FIG. 11 is a schematic diagram of a geometric partition prediction approach provided by yet another embodiment of the present application;
FIG. 12a is a schematic diagram of a geometric partition prediction approach provided by yet another embodiment of the present application;
FIG. 12b is a schematic diagram of a geometric partition prediction approach provided by yet another embodiment of the present application;
FIG. 13a is a schematic diagram of a geometric partition prediction approach provided by yet another embodiment of the present application;
FIG. 13b is a schematic diagram of a geometric partition prediction approach provided by yet another embodiment of the present application;
fig. 14 is a schematic flow chart of a video encoding and decoding method according to another embodiment of the present application;
FIG. 15 is a schematic diagram of deblocking filtering for triangle prediction according to an embodiment of the present application;
fig. 16 is a schematic flow chart of a video encoding and decoding method provided by another embodiment of the present application;
fig. 17 is a schematic flow chart of a video encoding and decoding method according to still another embodiment of the present application;
fig. 18 is a schematic diagram of deblocking filtering of BCW according to an embodiment of the present application;
fig. 19 is a schematic diagram of a video encoding and decoding apparatus provided by an embodiment of the present application;
fig. 20 is a schematic diagram of a video codec device provided in another embodiment of the present application;
fig. 21 is a schematic diagram of a video encoding and decoding device provided in another embodiment of the present application;
fig. 22 is a schematic diagram of a video codec device according to still another embodiment of the present application;
fig. 23 is a schematic diagram of a video codec device according to still another embodiment of the present application;
fig. 24 is a schematic structural diagram of a chip provided in an embodiment of the present application.
Detailed Description
The following describes technical solutions in the embodiments of the present application.
Unless otherwise defined, all technical and scientific terms used in the examples of this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to limit the scope of the present application.
Fig. 1 is an architecture diagram of a solution to which an embodiment of the present application is applied.
As shown in FIG. 1, the system 100 can receive the data 102 to be processed, process the data 102 to be processed, and generate processed data 108. For example, the system 100 may receive data to be encoded, encoding the data to be encoded to produce encoded data, or the system 100 may receive data to be decoded, decoding the data to be decoded to produce decoded data. In some embodiments, the components in system 100 may be implemented by one or more processors, which may be processors in a computing device or in a mobile device (e.g., a drone). The processor may be any kind of processor, which is not limited in this embodiment of the present invention. In some possible designs, the processor may include an encoder, a decoder, a codec, or the like. One or more memories may also be included in the system 100. The memory may be used to store instructions and data, such as computer-executable instructions to implement aspects of embodiments of the invention, pending data 102, processed data 108, and the like. The memory may be any kind of memory, which is not limited in this embodiment of the present invention.
The data to be encoded may include text, images, graphical objects, animation sequences, audio, video, or any other data that needs to be encoded. In some cases, the data to be encoded may include sensory data from sensors, which may be visual sensors (e.g., cameras, infrared sensors), microphones, near-field sensors (e.g., ultrasonic sensors, radar), position sensors, temperature sensors, touch sensors, and so forth. In some cases, the data to be encoded may include information from the user, e.g., biometric information, which may include facial features, fingerprint scans, retinal scans, voice recordings, DNA samples, and the like.
Fig. 2 is a schematic diagram of a video coding framework 2 according to an embodiment of the present application. As shown in fig. 2, after receiving the video to be encoded, each frame of the video to be encoded is encoded in turn, starting from the first frame of the video to be encoded. Wherein, the current coding frame mainly passes through: and (3) processing Prediction (Prediction), transformation (Transform), Quantization (Quantization), Entropy Coding (encoding) and the like, and finally outputting the code stream of the current Coding frame. Correspondingly, the decoding process generally decodes the received code stream according to the inverse process of the above process to recover the video frame information before decoding.
Specifically, as shown in fig. 2, the video coding framework 2 includes a coding control module 201 for performing decision control actions and parameter selection during the coding process. For example, as shown in fig. 2, the encoding control module 201 controls parameters used in transformation, quantization, inverse quantization, and inverse transformation, and controls the selection of intra-frame or inter-frame modes, and the parameter control of motion estimation and filtering, and the control parameters of the encoding control module 201 are also input to the entropy encoding module and encoded to form a part of the encoded code stream.
When the current coding frame is coded, the coding frame is divided 202, specifically, the coding frame is divided into slices (slices) and then divided into blocks. Optionally, in an example, the Coding frame is divided into a plurality of non-overlapping largest Coding Tree Units (CTUs), each CTU may be further iteratively divided into a series of smaller Coding Units (CUs) in a quadtree manner, a binary Tree manner, or a ternary Tree manner, and in some examples, a CU may further include a Prediction Unit (PU) and a Transform Unit (TU) associated therewith, where PU is a Prediction basic Unit and TU is a Transform and quantization basic Unit. In some examples, a PU and a TU are each divided into one or more blocks on a CU basis, where a PU includes multiple Prediction Blocks (PBs) and associated syntax elements. In some examples, the PU and TU may be the same or derived from the CU by different partitioning methods. In some examples, at least two of the CU, PU, and TU are the same, e.g., without distinguishing the CU, PU, and TU, all are predicted, quantized, and transformed in units of CUs. For convenience of description, a CTU, CU, or other formed data unit is hereinafter referred to as an encoded block.
It should be understood that in the embodiments of the present application, the data unit for video coding may be a frame, a slice, a coding tree unit, a coding block or a group of any of the above. The size of the data units may vary in different embodiments.
Specifically, as shown in fig. 2, after the encoded frame is divided into a plurality of encoded blocks, a prediction process is performed to remove redundant information in spatial domain and temporal domain of the current encoded frame. The currently used prediction coding methods include intra-frame prediction and inter-frame prediction. Intra-frame prediction uses only the reconstructed information in the current frame image to predict the current coding block, while inter-frame prediction uses information in other frame images (also called reference frames) that have been reconstructed before to predict the current coding block. Specifically, in the embodiment of the present application, the encoding control module 201 is configured to decide to select intra prediction or inter prediction.
When the intra-frame prediction mode is selected, the intra-frame prediction 203 includes obtaining reconstructed blocks of adjacent blocks coded around the current coding block as reference blocks, calculating predicted values to generate prediction blocks by adopting a prediction mode method based on pixel values of the reference blocks, subtracting corresponding pixel values of the current coding block and the prediction blocks to obtain residual errors of the current coding block, and transforming 204, quantizing 205 and entropy coding 210 the residual errors of the current coding block to form a code stream of the current coding block. Furthermore, after all the coding blocks of the current coding frame are subjected to the coding process, a part of the coding code stream of the coding frame is formed. In addition, the control and reference data generated in intra prediction 203 is also entropy encoded 210, forming part of the encoded code stream.
In particular, the transform 204 is used to remove correlation of the residuals of the image blocks in order to improve coding efficiency. For the transformation of the residual data of the current coding block, two-dimensional Discrete Cosine Transform (DCT) transformation and two-dimensional Discrete Sine Transform (DST) transformation are usually adopted, for example, at the encoding end, the residual information of the coding block is multiplied by an N × M transformation matrix and its transpose matrix, respectively, and the Transform coefficient of the current coding block is obtained after multiplication.
After the transform coefficients are generated, quantization 205 is used to further improve the compression efficiency, the transform coefficients are quantized to obtain quantized coefficients, and then entropy Coding 210 is performed on the quantized coefficients to obtain the residual code stream of the current Coding block, wherein the entropy Coding method includes, but is not limited to, Content Adaptive Binary Arithmetic Coding (CABAC) entropy Coding. And finally, storing the bit stream obtained by entropy coding and the coded coding mode information or sending the bit stream and the coded coding mode information to a decoding end. At the encoding end, the quantized result is also dequantized 206 and the dequantized result is inverse transformed 207. After the inverse transformation 207, the reconstructed pixel is obtained using the inverse transformation result and the motion compensation result. The reconstructed pixels are then filtered (i.e., loop filtered) 211. After 211, the filtered reconstructed image (belonging to the reconstructed video frame) is output. Subsequently, the reconstructed image can be used as a reference frame image of other frame images for inter-frame prediction. In the embodiment of the present application, the reconstructed image may also be referred to as a reconstructed image or a reconstructed image.
Specifically, the encoded neighboring blocks in the intra prediction 203 process are: before the current coding block is coded, the residual error generated in the coding process of the adjacent block is transformed 204, quantized 205, dequantized 206 and inverse transformed 207, and then is added to the prediction block of the adjacent block to obtain a reconstructed block. Correspondingly, inverse quantization 206 and inverse transform 207 are inverse processes of quantization 206 and transform 204, and are used to recover residual data prior to quantization and transformation.
As shown in fig. 2, when the inter prediction mode is selected, the inter prediction process includes Motion Estimation (ME) 208 and Motion Compensation (MC) 209. Specifically, Motion estimation 208 is performed according to a reference frame image in the reconstructed video frame, an image block most similar to the current coding block is searched in one or more reference frame images according to a certain matching criterion as a matching block, and a relative displacement between the matching block and the current coding block is a Motion Vector (MV) of the current coding block. The current coding block is then motion compensated 209 based on the motion vector and the reference frame to obtain a prediction block for the current coding block. And subtracting the original value of the pixel of the coding block from the corresponding pixel value of the prediction block to obtain the residual error of the coding block. The residual of the current coding block is transformed 204, quantized 205 and entropy coded 210 to form a part of the coded stream of the coded frame. In addition, the control and reference data generated in motion compensation 209 is also encoded by entropy coding 210, forming part of the encoded code stream.
As shown in fig. 2, the reconstructed video frame is a video frame obtained after being filtered 211. The reconstructed video frame includes one or more reconstructed images. The filtering 211 is used to reduce compression distortion such as blocking effect and ringing effect generated in the encoding process, the reconstructed video frame is used to provide a reference frame for inter-frame prediction in the encoding process, and the reconstructed video frame is output as a final decoded video after post-processing in the decoding process.
In particular, the inter Prediction mode may include an Advanced Motion Vector Prediction (AMVP) mode, a Merge (Merge) mode, or a skip (skip) mode.
For the AMVP mode, Motion Vector Prediction (MVP) may be determined first, after obtaining MVP, a start point of Motion estimation may be determined according to MVP, Motion search may be performed near the start point, an optimal MV may be obtained after the search is completed, a position of a reference block in a reference image is determined by the MV, a residual block is obtained by subtracting a current block from the reference block, a Motion Vector Difference (MVD) is obtained by subtracting MVP from the MV, and an index of the MVD and the MVP is transmitted to a decoding end through a code stream.
For the Merge mode, the MVP may be determined first, and directly determined as the MV of the current block. In order to obtain the MVP, a candidate MVP list (merge candidate list) may be first constructed, where the candidate MVP list may include at least one candidate MVP, each candidate MVP may correspond to an index, after selecting an MVP from the candidate MVP list, the encoding end may write the MVP index into the code stream, and then the decoding end may find the MVP corresponding to the index from the candidate MVP list according to the index, so as to implement decoding of the image block.
It should be understood that the above process is just one specific implementation of the Merge mode. The Merge mode may also have other implementations.
For example, Skip mode is a special case of Merge mode. After obtaining the MV according to the Merge mode, if the encoding side determines that the current block and the reference block are substantially the same, it is not necessary to transmit residual data, only the index of the MVP needs to be transmitted, and further, a flag may be transmitted, which may indicate that the current block may be directly obtained from the reference block.
That is, the Merge mode is characterized by: MV ═ MVP (MVD ═ 0); and Skip mode has one more feature, namely: the reconstructed value rec is the predicted value pred (residual value resi is 0).
The Merge mode can be applied to the geometric prediction technology. In the geometric prediction technology, an image block to be encoded may be divided into a plurality of sub image blocks having polygonal shapes, a motion vector may be determined for each sub image block from a motion information candidate list, a predictor block corresponding to each sub image block may be determined based on the motion vector of each sub image block, and a prediction block of a current image block may be constructed based on the predictor block corresponding to each sub image block, thereby implementing encoding of the current image block.
For the decoding end, the operation corresponding to the encoding end is performed. Firstly, residual error information is obtained by utilizing entropy decoding, inverse quantization and inverse transformation, and whether the current image block uses intra-frame prediction or inter-frame prediction is determined according to a decoded code stream. If the prediction is intra-frame prediction, the reconstructed image block in the current frame is utilized to construct prediction information according to an intra-frame prediction method; if the inter-frame prediction is carried out, motion information needs to be analyzed, and a reference block is determined in the reconstructed image by using the analyzed motion information to obtain prediction information; and then, superposing the prediction information and the residual information, and obtaining the reconstruction information through filtering operation.
However, since the current video coding frame performs coding in units of blocks, if the coding modes of adjacent blocks are different, discontinuity exists at the block boundary, which reduces the main and objective quality of video compression.
The application provides a video coding and decoding method which can improve the host and guest quality of video coding and decoding.
The subjective and objective quality in the embodiment of the present application may include subjective quality and objective quality. The subjective quality can be evaluated based on human senses, and the objective quality can be evaluated based on a specific model. By adopting the method in the embodiment of the application, the performance of video coding and decoding can be improved, and the video quality is improved.
In order to understand the scheme of the present application, a brief description of the filtering technique is given below.
Block-based loop filtering techniques may include bilateral filtering, adaptive loop filtering, adaptive sample compensation filtering, and deblocking filtering (Deblock). The basic idea of bilateral filtering is that the current pixel is calculated by the weighted average of the pixel values of the current pixel and the adjacent four points, so that edge-preserving denoising is realized.
Adaptive loop filtering is a wiener filter that is mainly used to minimize the mean square error between the original image and the reconstructed image.
The self-adaptive sample value compensation filtering classifies pixels in an image block, and then a reconstructed image is closer to an original image in a mode of adding the same compensation value to each type of pixels, so that the effect of suppressing the ringing effect is achieved.
Deblocking filtering is used for the boundary of a prediction unit and a transformation unit, and nonlinear weighting of boundary pixels is carried out by using a low-pass filter obtained by training, so that the blocking effect is reduced; wherein, the blocking effect means: current video coding frameworks code in units of blocks, and there may be discontinuities at block boundaries due to differences in coding schemes between adjacent blocks.
Deblocking filtering may include the following three steps: judging the boundary, calculating the filtering strength of the boundary and carrying out deblocking filtering operation.
(1) Determining boundaries
The luma component may be filtered with a 4x4 grid (a grid of 8x8 in the time of High Efficiency Video Coding (HEVC)), and the chroma component may be filtered with an 8x8 grid. The boundary determination may include the following two procedures, first, for each 4 × 4 luma block in the current CU, it needs to determine whether the four upper, lower, left, and right boundaries are TU boundaries, and mark them as "boundary"/"non-boundary". Next, for each 4x4 luma block, it is determined whether the current CU selects a radial Motion model (affinity) mode or a Sub-block Temporal Motion Vector Prediction (SbTMVP) mode, and if either mode is selected, the boundary of each 4x4 mesh inside the current CU is marked as "boundary". For blocks marked as "boundary", subsequent operations may be performed; for blocks marked as "non-boundary," no deblocking filtering operation may be performed.
In the Affine mode or the SbTMVP mode, a CU may be further divided into a plurality of Sub-CUs (Sub-CUs) of 4 × 4, and each Sub-CU may have a respective motion vector.
(2) Computing the Boundary Filter Strength (BS)
Before describing the calculation of the boundary filtering strength, a brief description will be given of components included in pixels of an image frame. Pixels in an image frame may generally include multiple components, for example, may include a luminance component and a chrominance component.
Taking a vertical boundary as an example, if the 4x4 block on the left side of the boundary is denoted by P and the 4x4 block on the right side is denoted by Q, the boundary filtering strength can be calculated according to rule one.
Rule one is as follows:
1) if the luminance component is, P, Q belongs to CU which is based on Block-based Pulse Code Modulation (BDPCM) mode, BS is 0;
2) otherwise, if P or Q is intra-predicted CU, BS ═ 2;
3) otherwise, if the boundary between P, Q is a TU boundary and P or Q is a Combined Inter Intra Prediction (CIIP) mode, BS is 2;
4) otherwise, if the boundary between P, Q is a TU boundary and the transform block of P or Q contains at least one non-zero transform coefficient, BS equals 1;
5) otherwise, if the boundary between P, Q is a TU boundary and is a chroma component, and the CU where P or Q is located uses chroma joint coding, BS is 1;
6) otherwise, if the CU in which P, Q is located uses a different coding mode (e.g., P uses inter-prediction mode, Q uses Intra Block Copy (IBC) mode), BS is 1;
7) otherwise, for the luminance component, if at least one of the following conditions is met, BS ═ 1;
firstly, P, Q are both in IBC mode, and the difference value of the MV of P, Q is more than or equal to 8 in the horizontal direction or the vertical direction;
p, Q refer to different reference frames or the number of MVs is different (for example, P is double MV, Q is single MV);
③ P, Q store single MV, and the difference value of the two single MVs is more than or equal to 8;
both r, P, Q store double MVs, and the double MVs of P are from different reference frames (MV1 is from reference frame 1, MV2 is from reference frame 2), the double MVs of Q are also from two different reference frames (MV3 is from reference frame 1, MV4 is from reference frame 2), and the reference frame referenced by P, Q is the same. Then the difference between the absolute values of MV1-MV3 and the absolute values of MV2-MV4 in the horizontal or vertical direction is greater than or equal to 8;
if P, Q stores double MVs and the double MVs are from the same reference frame, the following two conditions need to be satisfied at the same time (suppose P (MV0 from list0, MV1 from list1), Q (MV2 from list0, MV3 from list 1));
the absolute value of the difference between MV0 and MV2 in List0 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV3 in List1 is greater than or equal to 8 in the horizontal or numerical direction;
the absolute value of the difference between MV0 and MV3 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV2 is greater than or equal to 8 in the horizontal or numerical direction;
8) otherwise, BS is 0.
(3) Performing a deblocking filtering operation
For the case of BS 0, no filtering is performed;
for the case of BS ═ 1, weak filtering is performed;
for the BS-2 case, strong filtering is performed.
Among them, the above-mentioned list0 and list1 refer to a reference frame list.
The method 300 for video encoding and decoding provided by the embodiment of the present application will be described in detail below with reference to fig. 3.
As shown in fig. 3, a method 300 for video encoding and decoding according to an embodiment of the present application is provided, the method 300 may include steps 310 and 320.
And 310, acquiring a reconstructed image, wherein the reconstructed image comprises a first coding unit and a second coding unit, the first coding unit comprises a first image block, the second coding unit comprises a second image block, and the first image block and the second image block are adjacent blocks.
The first image block and the second image block in the embodiment of the present application may be graphic blocks after inverse transformation. For the encoding end, the steps may be to predict, transform, quantize, and encode the current image block, where the reference image block of the current image block may be an image block subjected to inverse quantization, inverse transform, and filtering; for the decoding end, inverse quantization and inverse transformation can be performed on bits corresponding to the residual in the code stream to obtain a residual, a reconstructed image can be obtained according to the reference image and the residual, and then the inverse reconstructed image is filtered.
In some embodiments, the first image block and the second image block in the present application may also be referred to as a first filtering block and a second filtering block.
And 320, if the first coding unit adopts a geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
The geometric partition prediction mode in the embodiment of the present application may include a triangle partition prediction mode and a polygon partition prediction mode.
Specifically, if the first coding unit adopts the triangle partition prediction mode, the first image block is located on a diagonal of the first coding unit. The first coding unit may be divided into two sub image blocks PU1 and PU2 from the top left corner to the bottom right corner (or from the bottom right corner to the top left corner) of the quadrangle, as shown in the left diagram of fig. 4a, or may be divided into two sub image blocks PU1 and PU2 from the bottom left corner to the top right corner (or from the top right corner to the bottom left corner) of the quadrangle, as shown in the right diagram of fig. 4 a.
If the first coding unit adopts the polygon partition prediction mode, the first image block is positioned on the partition boundary line. The two sub image blocks PU1 and PU2 may be obtained by dividing the first coding unit from the upper left to the lower right (or from the lower right to the upper left) of the quadrangle, as shown in the left diagram of fig. 4b, or PU1 and PU2 may be obtained by dividing the first coding unit from the lower left to the upper right (or from the upper right to the lower left) of the quadrangle, as shown in the right diagram of fig. 4 b.
The dividing boundary line in the embodiment of the present application may refer to an intersection of the dividing line and the first encoding unit, or may refer to both ends of the dividing line, which is not particularly limited in the present application.
In the embodiment of the present application, the performing deblocking filtering on the first image block and the second image block may be performing filtering on a boundary of the first image block and the second image block. In the embodiment of the present application, the Deblocking filtering may be referred to as Deblocking or Deblocking.
In some embodiments, the geometric partition prediction mode in the present application may also be referred to as a geometric partition prediction mode or a geometric prediction mode.
According to the video coding and decoding method provided by the embodiment of the application, if one of the two adjacent image blocks in the reconstructed image adopts the geometric partition prediction mode and the image block is located on the partition boundary line of the coding unit of the image block, the adjacent image block is subjected to deblocking filtering, so that the blocking effect between the adjacent image blocks can be avoided as much as possible, and further, the subjective and objective quality of the compressed video can be improved.
For the convenience of understanding the scheme of the present application, a brief description of the geometric partitioning prediction mode is provided.
The geometric partition prediction mode in the embodiment of the application can be further extension of a triangular prediction mode, and a plurality of partition modes are additionally introduced on the basis of the original 2 triangular prediction partitions. In other words, the geometric partition prediction mode may include a triangle partition prediction mode and a polygon prediction mode.
Optionally, in some embodiments, the geometric partitioning prediction mode partitions the first coding unit by using a distance offset and an angle, the distance offset being a distance between a center point of the first coding unit and a partition line, and the angle being an angle between a normal between the center point of the first coding unit and the partition line and a horizontal line.
As shown in fig. 5a, a schematic diagram of various geometric partition prediction modes provided for the embodiments of the present application is shown. It can be seen that the partition based on the geometric partition prediction mode may be various, and may be divided from a diagonal line of the CU, or may be divided from a non-diagonal line passing through a center of the CU, or may be divided from a non-diagonal line not passing through the center of the CU, which is not specifically limited in this application.
Alternatively, in the embodiment of the present application, the partition based on the geometric partition prediction mode may also be partitioned from two end points of a coding unit (e.g., a CU), and the two end points are respectively located on different boundaries of the CU.
Fig. 5b is a schematic diagram of a geometric partition prediction method provided in the embodiments of the present application. Fig. 5b illustrates the dividing lines mentioned in the present application by taking a certain coding unit, for example, the first coding unit as an example. The coding unit may be, for example, a CU. Wherein o is a central point of the first coding unit, h and w are height and width of the first coding unit, respectively, m and n points are vertices on a boundary on the first coding unit, and the boundary where the m point is located is different from the boundary where the n point is located. The line between m and n is understood as the dividing line in the embodiments of the present application, and the distance offset ρ is the distance, angle, between the center point o and the dividing line
Figure BDA0002756395330000121
Is the angle between the normal between the centre point and the dividing line and the horizontal line.
In the examples of the present application
Figure BDA0002756395330000122
Where ρ in the embodiment of the present application may be 0, 1/5 ρmax,2/5ρmax,3/5ρmax,4/5ρmax
In the embodiment of the application, if a connecting line between m and n is a straight line, the distance deviation ρ may be a normal distance between the central point o and the dividing line; if the line between m and n is a curve, the distance offset ρ may be other distances between the center point o and the dividing line.
Alternatively, in one embodiment, the boundary of the first image block and the second image block is deblock filtered as long as the condition of step 320 described above is satisfied.
Optionally, in some other embodiments, it may be further determined, in combination with the size of the distance offset, whether deblocking filtering is required to be performed, where for this case, if the first coding unit employs a geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode, the performing deblocking filtering on the first image block and the second image block further includes: if the distance offset is smaller than a preset threshold value, the first coding unit adopts a geometric partition prediction mode, and the first image block is located on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block; optionally, the method further includes: and if the distance offset is greater than or equal to the preset threshold, not performing deblocking filtering on the first image block and the second image block.
In the embodiment of the present application, if the value of the distance offset is smaller than the preset threshold, and the first coding unit adopts the geometric partition prediction mode, and the first image block is located on the partition boundary line based on the geometric partition prediction mode, the first image block and the second image block may be deblock filtered; if the value of the distance offset ρ is greater than or equal to the preset threshold, the first image block and the second image block may not be deblock filtered even if the first coding unit employs the geometric partition prediction mode and the first image block is located on the partition boundary line based on the geometric partition prediction mode. In this case, the deblocking filtering is not performed in order to avoid that a certain image block divided by a dividing line is small, and the image effect of the small block is affected when the deblocking filtering is performed, and therefore, the deblocking filtering is not performed for this special case special processing.
For example, if the preset threshold is 4, and if the value of the distance offset ρ is 2 or 3, and the first coding unit adopts the geometric partition prediction mode, and the first image block is located on the partition boundary line based on the geometric partition prediction mode, the first image block and the second image block may be deblock filtered; if the value of the distance offset ρ is 4.5, the first image block and the second image block may not be deblock filtered even if the first coding unit employs the geometric division prediction mode and the first image block is located on the division boundary line based on the geometric division prediction mode.
For example, the preset threshold in the embodiment of the present application may be determined based on h and w of the first coding unit, for example, if h is 3 and w is 4, the preset threshold in the embodiment of the present application may be 2.5, and in the case that the distance offset ρ is less than 2.5, the first image block and the second image block may be filtered; in case the distance offset p is larger than or equal to 2.5, the first image block and the second image block may not be filtered.
It should be understood that the above numerical values are only examples, and other numerical values are also possible, and the present application should not be particularly limited.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and if the first coding unit adopts the geometric partition prediction mode, the second coding unit adopts a non-geometric partition prediction mode, and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block. In this case, as long as one of the two adjacent blocks adopts the geometric partition prediction mode and the above-described condition of S320 is satisfied, the deblocking filtering needs to be performed on the boundaries of the two adjacent blocks.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and if the first coding unit adopts the geometric partition prediction mode and the second coding unit adopts the geometric partition prediction mode, and the first image block and the second image block are positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block. In this case, as long as the geometric partition prediction mode is adopted in both of the two adjacent blocks and the above-described condition of S320 is satisfied, the deblocking filtering needs to be performed on the boundaries of the two adjacent blocks.
The non-geometric partition prediction mode in the embodiment of the present application may be a square prediction mode, for example, the non-geometric partition prediction mode may be a square prediction mode in an inter prediction mode, and this is not particularly limited in the present application.
It is understood that, in the case where the first coding unit employs the geometric division prediction mode and the first image block is located on the division boundary line based on the geometric division prediction mode, the first image block and the second image block may be deblocking filtered regardless of which division prediction mode the second coding unit employs.
As noted above, prediction may include both intra-prediction and inter-prediction types. Inter prediction may include forward prediction, backward prediction, bi-directional prediction, and the like. The forward prediction is to predict the current frame by using the previous reconstructed frame (historical frame); backward prediction is to predict a current frame using a frame (future frame) subsequent to the current frame; bidirectional prediction is the prediction of a current frame using not only historical frames but also future frames.
The non-geometric partition prediction mode in the embodiment of the present application may adopt the above-mentioned forward prediction, may also adopt backward prediction, and may also adopt bidirectional prediction, which is not specifically limited in the present application.
For bi-directional prediction in inter-prediction, the current CU may be predicted based on forward and backward frame reference pictures, which may be stored in a reference frame list.
With respect to the reference frame lists, two reference frame lists are currently provided, namely List0 and List1, both of which may contain forward or backward encoded reference frames.
For example, if the current frame (reference numeral 100) includes three forward reference frames and three backward reference frames, reference numerals 97, 98, 99, 100, 101, 102, 103 are given in the order of natural images. The frames differ in index number in List0 and List 1.
In List0, the index of the frame immediately before the current frame may be index0, and the frame immediately before may be index1, and after sorting forward reference frames, backward reference frames are sorted in order; in List1, the flag of the frame immediately after the current frame is index0, and the frame after the frame is index1, and after the backward reference frame is sorted, the forward reference frames are sorted in order. Table 1 shows the reference frame index numbers corresponding to the different lists.
TABLE 1
Natural numbering 97 98 99 100 101 102 103
List0 index number 2 1 0 3 4 5
List1 index number 5 4 3 0 1 2
The forward reference frame in the embodiment of the present application is the above-mentioned historical frame, and the backward reference frame is the above-mentioned future frame (or future frame).
It is briefly explained above that the geometric partition prediction mode may include a triangle partition prediction mode and a polygon partition prediction mode, which will be described in detail below. However, it should be understood that the following description is only for better understanding of the present application and should not be taken as limiting the present application in particular.
In the triangle prediction mode, a CU may be divided into two triangular PUs, which may have independent MVs and reference frame indices, and both are uni-directional predicted, i.e., the motion vectors in the MV candidate list are uni-directional predicted motion vectors.
The MV candidate list may include a time domain candidate list and a spatial domain candidate list. The MVs in the candidate list may be from the coded CU in the current frame and the coded CU in the reference frame, respectively. In order to make the subsequent CUs capable of acquiring the MVs, after a CU obtains a final MV, the MV is stored for subsequent use. However, there are many possible cases in the size of each CU, and currently, spatial MVs of a CU are stored in units of 4x4, and temporal MVs are stored in units of 8x 8.
In other words, for a 16 × 16 CU, the motion vector is represented by MV0, and the MV is stored in units of 4 × 4, i.e. the CU needs to store MV at every position of multiple of 4 inside the CU, and a total of 16 MVs need to be stored, each position storing MV 0. The storage for the time-domain MV is similar to the spatial MV. For brevity, no further description is provided herein.
For non-triangular prediction modes, the MV can be stored directly in units of 4 × 4.
For the triangle prediction mode, a special storage mode is adopted due to the particularity of elements on the diagonal line. As shown in fig. 6, the triangle prediction still performs MV storage in units of 4 × 4. For diagonal elements, storing double MVs- "BI", if double MVs cannot be obtained, then single MVs may be stored; for off-diagonal elements, then a single MV may be stored. For example, as shown in fig. 6 (a), MV2 may be stored on the off-diagonal line in the lower left corner and MV1 may be stored on the off-diagonal line in the upper right corner; as shown in fig. 6 (b), MV1 may be stored on the off-diagonal line in the upper left corner and MV2 may be stored on the off-diagonal line in the lower right corner.
For MV storage on the diagonal may be: if MV1 and MV2 reference two different reference frame lists, e.g., MV1 from list0 and MV2 from list1, then MV1 and MV2 may be stored at diagonal positions, i.e., one 4x4 block in the diagonal would store two MVs (or dual MVs); if MV1 and MV2 refer to the same reference frame list, e.g., MV1 and MV2 are both from list0 or from list1, then MV1 or MV2 can be stored in a diagonal position, i.e., a 4x4 block in the diagonal would store an MV.
Optionally, in some embodiments, the first encoding unit obtains an image block of at least one polygon through partitioning in the geometric partition prediction mode.
In the embodiment of the present application, the partition via the geometrically partitioned prediction mode may partition the first coding unit into image blocks including at least one polygon, that is, may partition the first coding unit into PUs including two polygons or into one polygon and one triangle, where the two PUs may have independent MVs and reference frame indexes.
For the polygon prediction mode, a special storage mode is adopted due to the particularity of elements on the division. As shown in fig. 7, double MVs- "BI" are stored for elements on the division line, and if a double MV cannot be acquired, a single MV may be stored; for elements on non-dividing lines, then a single MV may be stored. For example, as shown in fig. 7 (a), MV2 may be stored on the non-dividing line in the lower left corner, and MV1 may be stored on the non-dividing line in the upper right corner; as shown in fig. 7 (b), MV1 can be stored on the non-divided line in the upper left corner, and MV2 can be stored on the non-divided line in the lower right corner.
For MV storage on the division line may be: if MV1 and MV2 refer to two different reference frame lists, e.g., MV1 from list0 and MV2 from list1, MV1 and MV2 may be stored at the partition line location, respectively, i.e., a 4x4 block on the partition line would store two MVs (or dual MVs); if MV1 and MV2 refer to the same reference frame list, e.g., MV1 and MV2 are both from list0 or from list1, then MV1 or MV2 can be stored at the partition line location, i.e., a 4x4 block in the diagonal would store an MV.
In some embodiments, the division may also be performed based on the division manner shown in (a) in fig. 8. The storage of the MV is shown in (b) of fig. 8, which is similar to the MV stored in fig. 7, and is not described herein again for brevity.
In the embodiment of the present application, for the partition based on the polygon prediction mode, the partition is not limited to the straight-line partition, and a polygonal line or a curved line partition may be adopted. For example, as shown in (a) of fig. 9, the first coding unit may be divided into two PUs, PU1 and PU2, respectively, by a polyline. Likewise, MV1 may be stored for the PU1 located in the upper right corner, and MV2 may be stored for the PU2 in the lower left corner. The storage of MVs on the division line may store one or two MVs according to actual circumstances. As shown in fig. 9 (b), the case where two MVs (or dual MVs) are stored on the division line. The storage manner is similar to that of the triangle prediction mode, and is not described herein again for brevity.
Likewise, as shown in (a) of fig. 10, the first coding unit may be divided into two PUs, PU1 and PU2, respectively, by a curve. Similarly, for PU1 located in the upper right corner, MV1 may be stored, and for PU2 in the lower left corner, MV2 may be stored. The storage of MVs on the division line may store one or two MVs according to actual circumstances. As shown in fig. 10 (b), the case where two MVs (or dual MVs) are stored on the dividing line. The storage manner is similar to that of the triangle prediction mode, and is not described herein again for brevity.
Of course, in some embodiments, the first encoding unit may be divided a plurality of times to obtain an image block including at least one polygon. For example, as shown in fig. 11 (a), the first coding unit may be divided twice into three PUs, PU1, PU2, and PU 3. Similarly, for MVs located on the dividing line between PU1 and PU2, one or two MVs may also be stored according to the actual situation. Likewise, for MVs located on the dividing line between PU2 and PU3, one or two MVs may also be stored according to the actual situation. As shown in fig. 11 (b), the case where two MVs (or dual MVs) are stored on the dividing line. The storage manner is similar to that of the triangle prediction mode, and is not described herein again for brevity.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block and the second image block adopt a bidirectional weighted prediction mode, and the weight used by the first image block and the second image block in bidirectional weighted prediction is different from the weight used by the second image block in bidirectional weighted prediction, performing deblocking filtering on the first image block and the second image block.
In the embodiment of the present application, it is assumed that the first coding unit adopts a geometric partition prediction mode and the second coding unit adopts a non-geometric partition prediction mode, wherein the first coding unit is partitioned from the upper left to the lower right. If the first image block is located at the lower right on the division boundary line and the second image block is located at a position adjacent to the first image block in the second coding unit, in this case, the first image block and the second image block do not satisfy the conditions 1) to 7) of the rule one, it is determined that the first image block and the second image block are not deblock filtered.
However, since the first image block is located on the partition boundary line of the first encoding unit, the first image block is predicted by performing weighted average after each reconstructed block is obtained by predicting using motion information of two polygon shapes; the second image block is located at a position adjacent to the first image block of the second coding unit, the second image block is predicted by adopting two pieces of motion information, the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction, and the motion compensation results of P and Q are possibly different due to the difference of the weight of MV, so that a blocking effect may exist between the first image block and the second image block.
For convenience of understanding, the present application takes a polygon partition prediction mode included in a geometric partition prediction mode as an example, and specifically describes the scheme of the embodiment of the present application with reference to fig. 12 a. As shown in fig. 12a, the first encoding unit is divided by a dividing line from the upper left to the lower right, and the first image block may be 12-1 and the second image block may be 12-2.
As shown in fig. 12a, the image blocks above the boundary may be denoted by P, and the image blocks below the boundary may be denoted by Q. If P is a polygon partition predicted image block and Q is a bi-directional predicted image block in merge mode, assuming MVPs 1 and MVP2 are from two different reference frame lists, the partition line stores dual MVs. For image block 12-1 in fig. 12a (the image block located at the lower right on the dividing line) and image block 12-2 (the image block located at the upper right of the non-geometrically divided prediction), in combination with the above-mentioned condition for calculating the boundary filtering strength, assuming that image block 12-1 and image block 12-2 in fig. 12a do not satisfy condition 1) -condition 7 in rule one, BS is set to 0, i.e., P and Q are not deblock filtered. However, since P is weighted-averaged after each reconstructed block is predicted by using MVP1 and MVP2, Q is weighted-averaged after each reconstructed block is predicted by using MVQ1 and MVQ2, and the weights weighted by both are different, the result of motion compensation of P and Q may be different, and thus, a blocking effect may exist between P and Q.
In other words, since P and Q use different MVs and motion compensation is a process of obtaining a predicted frame by using the MVs and a reference frame, the predicted block obtained by motion compensation of P and Q may be discontinuous, and thus block artifacts may exist.
The video coding and decoding method provided by the embodiment of the application can calculate the boundary filtering strength based on the rule two.
Rule two:
1) if the luminance component is the luminance component, P, Q belongs to the CU which is the BDPCM mode, and BS is equal to 0;
2) otherwise, if P or Q is intra-predicted CU, BS ═ 2;
3) otherwise, if the boundary between P, Q is a TU boundary and P or Q is CIIP mode, BS is 2;
4) otherwise, if the boundary between P, Q is a TU boundary and the transform block of P or Q contains at least one non-zero transform coefficient, BS equals 1;
5) otherwise, if the boundary between P, Q is a TU boundary and is a chroma component, and the CU where P or Q is located uses a Cb Cr joint coding scheme, BS equals 1;
6) otherwise, if the CU in which P, Q is located uses a different coding mode (e.g., P uses inter-frame prediction mode, Q uses IBC mode), BS is 1;
7) else, if P or Q is the geometric partition prediction mode and P, Q is located on two different CUs and P or Q is located on the partition boundary line of the geometric partition prediction, (only for the luma component, or for the luma component and the chroma components), BS ═ 1 (or BS ═ 2 is also possible);
8) otherwise, for the luminance component, if at least one of the following conditions is met, BS ═ 1;
firstly, P, Q are both in IBC mode, and the difference value of the MV of P, Q is more than or equal to 8 in the horizontal direction or the vertical direction;
p, Q refer to different reference frames or the number of MVs is different (for example, P is double MV, Q is single MV);
③ P, Q store single MV, and the difference value of the two single MVs is more than or equal to 8;
both r, P, Q store double MVs, and the double MVs of P are from different reference frames (MV1 is from reference frame 1, MV2 is from reference frame 2), the double MVs of Q are also from two different reference frames (MV3 is from reference frame 1, MV4 is from reference frame 2), and the reference frame referenced by P, Q is the same. Then the difference between the absolute values of MV1-MV3 and the absolute values of MV2-MV4 in the horizontal or vertical direction is greater than or equal to 8;
if P, Q stores double MVs and the double MVs are from the same reference frame, the following two conditions need to be satisfied at the same time (suppose P (MV0 from list0, MV1 from list1), Q (MV2 from list0, MV3 from list 1));
the absolute value of the difference between MV0 and MV2 in List0 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV3 in List1 is greater than or equal to 8 in the horizontal or numerical direction;
the absolute value of the difference between MV0 and MV3 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV2 is greater than or equal to 8 in the horizontal or numerical direction;
9) otherwise, BS is 0.
In the embodiment of the present application, based on the above conditions, it is assumed that neither P nor Q satisfies condition 1) -condition 6), it is determined whether condition 7) is satisfied, since P and Q in the present application are from different CUs, and P employs a geometric partition prediction mode, and the first image block is located on a partition boundary line of P, that is, condition 7) is satisfied, "if P or Q is the geometric partition prediction mode, and P, Q is located on two different CUs, and P or Q is located on a partition boundary line of the geometric partition prediction," BS is 1 or BS is 2, and further, P and Q may be deblock filtered.
In the embodiment of the present application, the condition 7) may be between 6) and 8), may be between 8) and 9), and may be between 5) and 6), which is not particularly limited in the present application.
If the condition 7) lies between the conditions 8) and 9), and if neither P nor Q satisfies the conditions 1) to 8), it is determined whether the condition 7) is satisfied, and since P in the present application is from a partition boundary line of geometric partition prediction, the condition 7) is satisfied, and BS becomes 1, and further, deblocking filtering can be performed on P and Q.
If the condition 8) is located between the conditions 5) and 6), similarly to the above case. For brevity, no further description is provided herein.
It should be understood that, in the embodiment of the present application, in the case that the condition 7) is satisfied, the BS may be set to 1 or 2, and may also be set to other values capable of performing filtering, so that the deblocking filtering may be performed on P and Q.
Similarly, for the triangle partition prediction modes included in the geometric partition prediction mode, the boundary filtering strength may also be calculated based on rule two.
As shown in fig. 12b, the first coding unit is divided by a diagonal line from the top left corner to the bottom right corner, and the first image block may be 12-3 and the second image block may be 12-4. The embodiment of the present application will be specifically described with reference to fig. 12 b. As shown in fig. 12b, the 4x4 blocks to the left of the boundary may be denoted by P, and the 4x4 blocks to the right of the boundary may be denoted by Q. If P is a triangle predicted block and Q is a bi-directionally predicted block in merge mode, assume MVP1 and MVP2 are from two different reference frame lists and that the diagonal store is a double MV. For image block 12-3 in fig. 12b (the image block located at the lower right corner on the diagonal of the triangular prediction) and image block 12-4 (the image block located at the lower left corner of the non-triangular prediction), in combination with the above-mentioned condition for calculating the boundary filtering strength, assuming that image block 12-3 and image block 12-4 in fig. 12b do not satisfy condition 1) -condition 7 in rule one, BS is set to 0, i.e., P and Q are not deblock filtered. However, since P is weighted-averaged after each reconstructed block is predicted using MVP1 and MVP2, and Q is equal-weighted-averaged after each reconstructed block is predicted using MVQ1 and MVQ2, the motion compensation results for P and Q may be different due to the difference in MV, and thus, a blocking effect may exist between P and Q.
In other words, since P and Q use different MVs and motion compensation is a process of obtaining a predicted frame by using the MVs and a reference frame, the predicted block obtained by motion compensation of P and Q may be discontinuous, and thus block artifacts may exist.
In the embodiment of the present application, based on rule two, it is assumed that neither P nor Q satisfies condition 1) -condition 6), it is determined whether condition 7) is satisfied, since P and Q in the present application are from different CUs, and P employs a triangle prediction mode included in the geometric partition prediction mode, and the first image block is located on a diagonal line of P, that is, condition 7) is satisfied, "if P or Q is the geometric partition prediction mode, and P, Q is located on two different CUs, and P or Q is located on a partition boundary line of the geometric partition prediction," BS is 1 or BS is 2, and further P and Q may be deblock filtered.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional weighted prediction mode, and the second image block adopts a bidirectional equal-weight prediction mode, then the first image block and the second image block are subjected to deblocking filtering.
In the embodiment of the present application, it is assumed that the first coding unit adopts a geometric partition prediction mode and the second coding unit adopts a non-geometric partition prediction mode, wherein the first coding unit is partitioned from the upper left to the lower right. If the first image block is located at the lower right on the division boundary line and the second image block is located at a position adjacent to the first image block in the second coding unit, in this case, if the first image block and the second image block do not satisfy condition 1) -condition 7 of rule one, it is determined that deblocking filtering is not performed on the first image block and the second image block.
However, since the first image block is located on the partition boundary line of the first encoding unit, the first image block is predicted by performing weighted average after each reconstructed block is obtained by predicting using motion information of two polygons; and the second image block is located at a position adjacent to the first image block of the second coding unit, the second image block is subjected to equal weight prediction by adopting two pieces of motion information, and the motion compensation results of P and Q may be different due to the difference of the weight of the MV, so that a blocking effect may exist between the first image block and the second image block.
Therefore, the boundary filtering strength can be calculated based on rule two in the embodiment of the present application. In the embodiment of the present application, based on the above conditions, it is assumed that neither P nor Q satisfies condition 1) -condition 6), it is determined whether condition 7) is satisfied, since P and Q in the present application are from different CUs, and P employs a geometric partition prediction mode, and the first image block is located on a partition boundary line of P, that is, condition 7) is satisfied, "if P or Q is the geometric partition prediction mode, and P, Q is located on two different CUs, and P or Q is located on a partition boundary line of the geometric partition prediction," BS is 1 or BS is 2, and further, P and Q may be deblock filtered.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional equal-weight prediction mode, and the second image block adopts a bidirectional weighted prediction mode, and then the first image block and the second image block are subjected to deblocking filtering.
In the embodiment of the present application, it is assumed that the first coding unit adopts a geometric partition prediction mode and the second coding unit adopts a non-geometric partition prediction mode, wherein the first coding unit is partitioned from the upper left to the lower right. If the first image block is located at the lower right on the division boundary line and the second image block is located at a position adjacent to the first image block in the second coding unit, in this case, if the first image block and the second image block do not satisfy condition 1) -condition 7 of rule one, it is determined that deblocking filtering is not performed on the first image block and the second image block.
However, since the first image block is located on the partition boundary line of the first coding unit, the first image block is predicted by performing equal weight averaging after each reconstructed block is obtained by predicting by using the motion information of two polygons; and the second image block is located at a position adjacent to the first image block of the second coding unit, and the second image block is weighted and predicted by using two pieces of motion information, and the result of motion compensation of P and Q may be different due to the difference of MV, so that a blocking effect may exist between the first image block and the second image block.
Therefore, the boundary filtering strength can be calculated based on rule two in the embodiment of the present application. In the embodiment of the present application, based on the above conditions, it is assumed that neither P nor Q satisfies condition 1) -condition 6), it is determined whether condition 7) is satisfied, since P and Q in the present application are from different CUs, and P employs a geometric partition prediction mode, and the first image block is located on a partition boundary line of P, that is, condition 7) is satisfied, "if P or Q is the geometric partition prediction mode, and P, Q is located on two different CUs, and P or Q is located on a partition boundary line of the geometric partition prediction," BS is 1 or BS is 2, and further, P and Q may be deblock filtered.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional weighted prediction mode, and the second image block adopts a unidirectional prediction mode, and then deblocking filtering is carried out on the first image block and the second image block.
In the embodiment of the present application, it is assumed that the first coding unit adopts a geometric partition prediction mode and the second coding unit adopts a non-geometric partition prediction mode, wherein the first coding unit is partitioned from the upper left to the lower right. If the first image block is located at the lower right on the division boundary line and the second image block is located at a position adjacent to the first image block in the second coding unit, in this case, if the first image block and the second image block do not satisfy condition 1) -condition 7 of rule one, it is determined that deblocking filtering is not performed on the first image block and the second image block.
However, since the first image block is located on the partition boundary line of the first encoding unit, the first image block is predicted by performing weighted average after each reconstructed block is obtained by predicting using motion information of two polygons; and the second image block is located at a position adjacent to the first image block in the second encoding unit, the second image block is predicted by using one motion information, and the motion compensation results of P and Q may be different due to the difference of MV, so that a blocking effect may exist between the first image block and the second image block.
For convenience of understanding, the present application takes a polygon partition prediction mode included in a geometric partition prediction mode as an example, and specifically describes the scheme of the embodiment of the present application with reference to fig. 13 a. As shown in fig. 13a, the first encoding unit is divided by a dividing line from the upper left to the lower right, and the first image block may be 13-1 and the second image block may be 13-2.
As shown in fig. 13a, the image blocks above the boundary may be denoted by P, and the image blocks below the boundary may be denoted by Q. If P is a polygon partition predicted block and Q is a uni-directionally predicted block in merge mode, assuming MVP1 and MVP2 are from the same reference frame list, the partition line stores a single MV, i.e., MVP 2. For image block 13-1 in fig. 13a (the image block located at the lower right on the dividing line) and image block 13-2 (the image block located at the upper right of the non-geometrically divided prediction), in combination with the above-mentioned condition for calculating the boundary filtering strength, assuming that image block 13-1 and image block 13-2 in fig. 13a do not satisfy condition 1) -condition 7 in rule one, BS is set to 0, i.e., P and Q are not deblock filtered. However, since P is predicted by MVP1 and MVP2 and then weighted-averaged after each reconstructed block is obtained in the actual prediction process, and Q is predicted by MVQ, the motion compensation results of P and Q may be different, and thus, a blocking effect may exist between P and Q.
In other words, since P and Q use different MVs and motion compensation is a process of obtaining a predicted frame by using the MVs and a reference frame, the predicted block obtained by motion compensation of P and Q may be discontinuous, and thus block artifacts may exist.
In the embodiment of the present application, based on rule two, it is assumed that neither P nor Q satisfies condition 1) -condition 6), it is determined whether condition 7) is satisfied, since P and Q in the present application are from different CUs, and P employs a geometric partition prediction mode, and the first image block is located on a partition boundary line of P, that is, condition 7) is satisfied, "if P or Q is the geometric partition prediction mode, and P, Q is located on two different CUs, and P or Q is located on a partition boundary line of the geometric partition prediction," BS equals 1 or BS equals 2, and further P and Q may be deblock filtered.
Similarly, for the triangle partition prediction modes included in the geometric partition prediction mode, the boundary filtering strength may also be calculated based on rule two.
As shown in fig. 13b, the first coding unit is divided by a diagonal line from the top left corner to the bottom right corner, and the first image block may be 13-3 and the second image block may be 13-4. The embodiment of the present application will be specifically described with reference to fig. 13 b. As shown in fig. 13b, the 4x4 blocks to the left of the boundary may be denoted by P, and the 4x4 blocks to the right of the boundary may be denoted by Q. If P is a triangle predicted block and Q is a bi-directional predicted block in merge mode, it is assumed that MVP1 and MVP2 are from the same reference frame list and that stored on the diagonal is MVP 2. For image block 13-3 in fig. 13b (the image block located at the lower right corner on the diagonal of the triangular prediction) and block image 13-4 (the image block located at the lower left corner of the non-triangular prediction), in combination with the above-mentioned condition for calculating the boundary filtering strength, assuming that image block 13-3 and image block 13-4 in fig. 13b do not satisfy condition 1) -condition 7 in rule one, the BS is set to 0, i.e., P and Q are not deblock filtered. However, since P is predicted by using MVP1 and MVP2 and then weighted-averaged after each reconstructed block is obtained in the actual prediction process, and Q is predicted by using MVQ, the motion compensation results of P and Q may be different due to the difference of MV, and therefore, a blocking effect may exist between P and Q.
In other words, since P and Q use different MVs and motion compensation is a process of obtaining a predicted frame by using the MVs and a reference frame, the predicted block obtained by motion compensation of P and Q may be discontinuous, and thus block artifacts may exist.
In the embodiment of the present application, based on rule two, it is assumed that neither P nor Q satisfies condition 1) -condition 6), it is determined whether condition 7) is satisfied, since P and Q in the present application are from different CUs, and P employs a triangle prediction mode included in the geometric partition prediction mode, and the first image block is located on a diagonal line of P, that is, condition 7) is satisfied, "if P or Q is the geometric partition prediction mode, and P, Q is located on two different CUs, and P or Q is located on a partition boundary line of the geometric partition prediction," BS is 1 or BS is 2, and further P and Q may be deblock filtered.
Optionally, in some embodiments, the first encoding unit is divided along a dividing line from a first boundary of the first encoding unit to a second boundary of the first encoding unit, the first image block is located at an intersection of the first boundary and the dividing boundary line or at an intersection of the second boundary and the dividing boundary line, and the first boundary and the second boundary do not belong to the same boundary.
Optionally, in some embodiments, the dividing line comprises at least one of: straight lines, broken lines or curved lines.
In the embodiment of the present application, the partition manner based on the geometric partition prediction may be divided along a partition line from a first boundary of the first coding unit to a second boundary of the first coding unit, where the partition line may be a diagonal line of the first coding unit. For example, the division may be performed from the upper left corner to the lower right corner (or from the lower right corner to the upper left corner) of the first coding unit, or the division may be performed from the upper right corner to the lower left corner (or from the lower left corner to the upper right corner) of the first coding unit.
In the embodiment of the present application, the partition manner based on the geometric partition prediction may be divided along a partition line from a first boundary of the first coding unit to a second boundary of the first coding unit, where the partition line may be any line in the first coding unit. For example, the division may be performed from the upper left to the lower right (or from the lower right to the upper left) of the first coding unit, or the division may be performed from the upper right to the lower left (or from the lower left to the upper right) of the first coding unit.
For the specific division, reference may be made to fig. 4 to fig. 11, and details are not described here for brevity.
It should be understood that the division manners in fig. 4 to 11 are merely exemplary to list several division manners, and other division manners are also possible, and should not be particularly limited in this application.
Generally, the format of the image block includes an image block based on a luminance mode and a chrominance mode, and for different formats, it is determined whether filtering on adjacent image blocks may be different, which will be described in detail below.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and for a brightness mode, if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
In the embodiment of the present application, for example, based on condition 1) in rule two mentioned above, it is defined that, in the case of the luminance mode, if the CU to which P and Q belong is the BDPCM mode, it is determined that BS is 0. In other words, assuming that P and Q are in chroma mode, if the CU to which P and Q belong is the BDPCM mode, the BS may be 0.
For another example, based on condition 2 in rule two mentioned above), it is not defined whether P and Q belong to a luma mode or a chroma mode, and BS is 0 as long as P or Q is an intra-predicted CU regardless of whether P and Q belong to a luma mode or a chroma mode.
In the embodiment of the present application, under the condition that the encoding unit belongs to the luminance mode, if the first encoding unit adopts the geometric partition prediction mode and the first image block is located on the partition boundary line, the first image block and the second image block are deblock filtered.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and for a luminance mode and a chrominance mode, if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
In this embodiment, if the encoding unit is in the luma mode or the chroma mode, and the first encoding unit adopts the geometric partition prediction mode and the first image block is located on the partition boundary line, the first image block and the second image block are deblock filtered.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: setting a boundary filtering strength BS value of the first image block and the second image block to 1 or 2 if the first encoding unit adopts a geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
In the embodiment of the present application, in the case where it is determined that the first image block and the second image block are deblock filtered, the boundary BS value of the first image block and the second image block may be set to 1 or 2.
Optionally, in some embodiments said deblock filtering said first image block and said second image block includes: and if the BS values of the first image block and the second image block are 1, performing weak filtering on the first image block and the second image block.
Optionally, in some embodiments said deblock filtering said first image block and said second image block includes: and if the BS value of the first image block and the second image block is 2, performing strong filtering on the first image block and the second image block.
In the embodiment of the application, the weak filtering may be to change two pixel points on the boundary of the adjacent block, and then determine whether to adjust other pixel points by using a threshold, where the other pixel points may be pixel points having a certain distance from the boundary; the strong filtering may be to change a plurality of pixels, wherein the plurality of pixels may include pixels on a boundary of an adjacent block and pixels having a certain distance from the boundary.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and if the first coding unit and the second coding unit do not use an intra-frame prediction mode, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts the geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode. In this case, the filter boundary strength may be calculated based on the above rule two.
In the embodiment of the present application, taking a polygon prediction mode included in a geometric partition prediction mode as an example, if a first image block or a second image block is an intra-frame predicted adjacent block, according to a rule one, the filtering strength of the first image block and the second image block is 2, and the first image block and the second image block are strongly filtered; if the first image block and the second image block use different predictive coding modes, assuming that the first image block uses an inter-frame prediction mode and the second image block uses an IBC mode, the filtering strength of the first image block and the second image block is 1, and the first image block and the second image block are weakly filtered.
However, in the case where neither the first image block nor the second image block is predicted using the intra prediction mode, assuming that the first image block and the second image block do not satisfy the conditions 1) -7 in rule one), the first image block and the second image block are not deblock filtered.
But due to the different MVs of the first and second image blocks, the result of motion compensation for P and Q may be different due to the difference of MVs, and thus, there may be a blocking effect between P and Q.
Therefore, the determination may be performed based on rule two, and since the first image block and the second image block are from different CUs, and the first image block adopts the polygon prediction mode, and the first image block is located on the partition boundary line of P, that is, the condition that "if P or Q is the geometric partition prediction mode, P, Q is located in two different CUs, and P or Q is located on the partition boundary line of the geometric partition prediction" is satisfied, the first image block and the second image block may be deblock filtered, so that the subjective objective quality of the compressed video may be improved.
Similarly, for the triangle partition prediction modes included in the geometric partition prediction mode, the boundary filtering strength may also be calculated based on rule two.
If the first image block or the second image block is an intra-frame predicted adjacent block, according to a rule one, the filtering strength of the first image block and the second image block is 2, and the first image block and the second image block are subjected to strong filtering; if the first image block and the second image block use different predictive coding modes, assuming that the first image block uses an inter-frame prediction mode and the second image block uses an IBC mode, the filtering strength of the first image block and the second image block is 1, and the first image block and the second image block are weakly filtered.
However, in the case where neither the first image block nor the second image block is predicted using the intra prediction mode, assuming that the first image block and the second image block do not satisfy the conditions 1) -7 in rule one), the first image block and the second image block are not deblock filtered.
But due to the different MVs of the first and second image blocks, the result of motion compensation for P and Q may be different due to the difference of MVs, and thus, there may be a blocking effect between P and Q.
Therefore, the determination may be performed based on rule two, and since the first image block and the second image block are from different CUs, and the first image block adopts the triangle prediction mode, and the first image block is located on the diagonal line of P, that is, the condition that "if P or Q is the geometric partition prediction mode, and P, Q is located on two different CUs, and P or Q is located on the partition boundary line of the geometric partition prediction" is satisfied, the first image block and the second image block may be deblock filtered, so that the subjective and objective quality of the compressed video may be improved.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode includes: and if the boundary between the first image block and the second image block is not the boundary of a transform unit TU and/or the transform coefficients of the transform block where the first image block or the second image block is located are all zero transform coefficients, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts the geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
In the embodiment of the present application, taking a polygon prediction mode included in a geometric partition prediction mode as an example, according to rule one, if a boundary between a first image block and a second image block is a TU boundary and a transform block where the first image block or the second image block is located at least includes one non-zero transform coefficient, performing deblocking filtering on the first image block and the second image block; if the boundary between the first image block and the second image block is a TU boundary and the transform coefficients of the transform block where the first image block or the second image block is located are zero transform coefficients, whether the subsequent conditions are met or not can be continuously judged, and if the first image block and the second image block do not meet the subsequent conditions, deblocking filtering cannot be performed on the first image block and the second image block.
However, since the MV of the first image block is different from that of the second image block, the result of motion compensation for P and Q may be different due to the difference of MV, and thus, there may be a blocking effect between P and Q.
Therefore, since the first and second image blocks are from different CUs and the first coding unit adopts the polygon prediction mode and the first image block is located on the partition boundary line of P, that is, the condition that "if P or Q is the geometric partition prediction mode, P, Q is located on two different CUs and P or Q is located on the partition boundary line of the geometric partition prediction" is satisfied, the first and second image blocks can be deblock-filtered.
Therefore, whether to deblock filter the first image block and the second image block may be determined based on rule two. In rule two, if it is determined that the boundary between the first image block and the second image block is not the boundary of the transform unit TU and/or the transform coefficients of the transform block in which the first image block or the second image block is located are all zero transform coefficients, although condition 4 is not satisfied), since the first coding unit employs the polygon prediction mode, and the first image block is located on the first coding unit partition boundary line, condition 7 in rule two is satisfied), the first image block and the second image block may be deblock filtered.
Similarly, for the triangle partition prediction modes included in the geometric partition prediction mode, the boundary filtering strength may also be calculated based on rule two.
In the embodiment of the application, according to a rule one, if a boundary between a first image block and a second image block is a TU boundary, and a transform block in which the first image block or the second image block is located at least includes one nonzero transform coefficient, performing deblocking filtering on the first image block and the second image block; if the boundary between the first image block and the second image block is a TU boundary and the transform coefficients of the transform block where the first image block or the second image block is located are zero transform coefficients, whether the subsequent conditions are met or not can be continuously judged, and if the first image block and the second image block do not meet the subsequent conditions, deblocking filtering cannot be performed on the first image block and the second image block.
However, since the MV of the first image block is different from that of the second image block, the result of motion compensation for P and Q may be different due to the difference of MV, and thus, there may be a blocking effect between P and Q.
Therefore, since the first image block and the second image block are from different CUs, and the first coding unit adopts the triangle prediction mode, and the first image block is located on the diagonal of P, that is, satisfying the condition that "if P or Q is the geometric partition prediction mode, and P, Q is located on two different CUs, and P or Q is located on the partition boundary line of the geometric partition prediction", the first image block and the second image block can be deblock filtered.
Therefore, whether to deblock filter the first image block and the second image block may be determined based on rule two. In rule two, if it is determined that the boundary between the first image block and the second image block is not the boundary of the transform unit TU and/or the transform coefficients of the transform block in which the first image block or the second image block is located are all zero transform coefficients, although condition 4 is not satisfied), since the first coding unit employs the triangle prediction mode, and the first image block is located on the diagonal line (division boundary line) of the first coding unit, and meets condition 7 in rule two, the first image block and the second image block may be deblock filtered.
Fig. 14 is a schematic diagram of another video encoding and decoding method 1400 according to an embodiment of the present application, as shown in fig. 14, the method 1400 may include steps 1410-1420.
And 1410, obtaining a reconstructed image, wherein the reconstructed image comprises a first coding unit, the first coding unit comprises a first image block and a second image block, and the first image block and the second image block are adjacent blocks.
The first image block and the second image block in the embodiment of the present application may be graphic blocks after inverse transformation. For the encoding end, the steps may be to predict, transform, quantize, and encode the current image block, where the reference image block of the current image block may be an image block subjected to inverse quantization, inverse transform, and filtering; for the decoding end, inverse quantization and inverse transformation can be performed on bits corresponding to the residual in the code stream to obtain a residual, a reconstructed image can be obtained according to the reference image and the residual, and then the inverse reconstructed image is filtered.
In some embodiments, the first image block and the second image block in this application may also be referred to as the first image block and the second image block.
1420, if a boundary between the first image block and the second image block is a TU boundary, and the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and transform coefficients of transform blocks where the first image block and the second image block are located are both zero transform coefficients, determining not to deblock filter the first image block and the second image block.
In the embodiment of the application, one CU can comprise a plurality of Sub-CUs. For a frame of picture, the frame of picture may be divided into large Coding Unit (CTU), each CTU may be divided into square or rectangular CUs, and a CU may be further divided into a plurality of Sub-CUs, where each Sub-CU may have its own motion information.
In the video encoding and decoding method provided by the embodiment of the present application, when a boundary between the first image block and the second image block is a TU boundary and is not a boundary of a CU or Sub-CU, and transform coefficients of transform blocks where the first image block and the second image block are both zero transform coefficients, it is determined that the first image block and the second image block are not filtered. The method provided by the embodiment of the application can avoid filtering the adjacent image block caused by judging the adjacent image block without the blocking effect as much as possible, and further can improve the subjective and objective quality of the compressed video.
Optionally, in some embodiments, determining not to deblock filter the first image block and the second image block if a boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and transform coefficients of transform blocks in which the first image block and the second image block are located are both zero transform coefficients, includes: and if the first coding unit adopts a triangular prediction mode, the boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and the transform coefficients of the transform blocks of the first image block and the second image block are both zero transform coefficients, determining not to deblock filter the first image block and the second image block.
Specifically, the detailed description is made with reference to fig. 15.
As shown in fig. 15, it is assumed that MV1 and MV2 are from different reference frame lists, and diagonally stored is a double MV (denoted by BI) that is a combination of MV1 and MV 2. For blocks 15-1 and 15-2 in FIG. 15, block 15-1 is denoted as P and block 15-2 is denoted as Q.
Based on rule one, assuming that the boundary between P and Q is a TU boundary, further calculation of the boundary strength is required, and if the transform blocks where P and Q are located are both zero transform coefficients, that is, condition 4 in rule one is not satisfied), the subsequent determination is continued. Assuming that P and Q do not satisfy condition 5) and condition 6) in rule one), it is continuously determined whether condition 7) is satisfied. At this time, since P is a dual MV and Q is a single MV, satisfying condition 7) in rule one, the BS may be set to 1, and P, Q may be deblock filtered. However, since prediction between P, Q is not performed using individual MVs alone, deblocking filtering may not be performed.
The method for encoding and decoding the video can calculate the boundary filtering strength based on the rule three.
Rule three:
1) if the luminance component is the luminance component, P, Q belongs to the CU which is the BDPCM mode, and BS is equal to 0;
2) otherwise, if P or Q is intra-predicted CU, BS ═ 2;
3) otherwise, if the boundary between P, Q is a TU boundary and P or Q is CIIP mode, BS is 2;
4) otherwise, if the boundary between P, Q is a TU boundary and the transform block of P or Q contains at least one non-zero transform coefficient, BS equals 1;
5) otherwise, if the boundary between P, Q is a TU boundary, and the boundary between P, Q is not a CU/Sub-CU boundary, and the transform blocks at P, Q are all zero transform coefficients, BS is 0;
6) otherwise, if the boundary between P, Q is a TU boundary and is a chroma component, and the CU where P or Q is located uses a Cb Cr joint coding scheme, BS equals 1;
7) otherwise, if the CU in which P, Q is located uses a different coding mode (e.g., P uses inter-frame prediction mode, Q uses IBC mode), BS is 1;
8) otherwise, for the luminance component, if at least one of the following conditions is met, BS ═ 1;
firstly, P, Q are both in IBC mode, and the difference value of the MV of P, Q is more than or equal to 8 in the horizontal direction or the vertical direction;
p, Q refer to different reference frames or the number of MVs is different (for example, P is double MV, Q is single MV);
③ P, Q both use single MV, and the difference value of the two single MVs is more than or equal to 8;
both four and P, Q use double MVs, and the double MVs of P are from different reference frames (MV1 is from reference frame 1, MV2 is from reference frame 2), the double MVs of Q are also from two different reference frames (MV3 is from reference frame 1, MV4 is from reference frame 2), and the reference frame referenced by P, Q is the same. Then the difference between the absolute values of MV1-MV3 and the absolute values of MV2-MV4 in the horizontal or vertical direction is greater than or equal to 8;
if P, Q uses dual MVs and the dual MVs are from the same reference frame, the following two conditions need to be satisfied simultaneously (suppose P (MV0 from list0, MV1 from list1), Q (MV2 from list0, MV3 from list 1));
the absolute value of the difference between MV0 and MV2 in List0 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV3 in List1 is greater than or equal to 8 in the horizontal or numerical direction;
the absolute value of the difference between MV0 and MV3 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV2 is greater than or equal to 8 in the horizontal or numerical direction;
9) otherwise, BS is 0.
In the embodiment of the present application, based on the above conditions, it is assumed that P and Q do not satisfy both of conditions 1) to 4), and then it is determined whether or not condition 5) is satisfied, in the embodiment of the present application, since the first coding unit adopts the triangle prediction mode, the boundary between P and Q is a TU boundary and is not a CU/Sub-CU boundary, and meanwhile, the transform coefficients of the transform blocks where P and Q are located are both zero transform coefficients, and therefore condition 5) is satisfied, BS may be set to 0, the determination of the subsequent condition is not continuously performed, and further, deblocking filtering may not be performed on P and Q.
It should be understood that, in rule two, the condition 5) may be between the conditions 4) and 6), between the conditions 6) and 7), and between the conditions 7) and 8), which is not specifically limited in this application.
If the condition 5) is between the condition 6) and the condition 7), if both P and Q do not satisfy the conditions 1) to 6), it is determined whether the condition 5) is satisfied, and since P and Q in the present application belong to the same image block and the image block adopts a triangle prediction method, the condition 5) is satisfied, BS is 0, the determination of the subsequent condition is not continuously performed, and further, it may be determined that P and Q are not deblock filtered.
If the condition 5) is located between the conditions 7) and 8), similarly to the above case. For brevity, no further description is provided herein.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from the top left corner to the bottom right corner, and the first image block or the second image block is located on the diagonal line of the first encoding unit.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from a top right corner to a bottom left corner, and the first image block or the second image block is located on the diagonal line of the first encoding unit.
Specifically, as shown in fig. 4a, the division of the first coding unit may be performed in a manner from the upper left corner to the lower right corner (or from the lower right corner to the upper left corner) of the quadrangle, as shown in the left graph shown in fig. 4a, or may be performed in a manner from the lower left corner to the upper right corner (or from the upper right corner to the lower left corner) of the quadrangle, as shown in the right graph shown in fig. 4 a.
In the embodiment of the present application, regardless of whether the division of the first encoding unit is divided according to the left image as shown in fig. 4a or the right image as shown in fig. 4a, one of the first image block and the second image block may be located on a diagonal line of the first encoding unit and the other image block may not be located on a diagonal line of the first encoding unit.
In other words, if the first image block is located on the diagonal of the first encoding unit, the second image block is not located on the diagonal of the first encoding unit; or the first image block is not located on the diagonal of the first encoding unit, then the second image block is located on the diagonal of the first encoding unit.
Optionally, in some embodiments, determining not to deblock filter the first image block and the second image block if a boundary between the first image block and the second image block is a Transform Unit (TU) boundary, and the boundary between the first image block and the second image block is not a Coding Unit (CU)/Sub-coding unit (Sub-CU) boundary, and transform coefficients of a transform block in which the first image block and the second image block are located are both zero transform coefficients comprises: and if the boundary between the first image block and the second image block is a Transform Unit (TU) boundary, the boundary between the first image block and the second image block is not a Coding Unit (CU)/Sub-coding unit (Sub-CU) boundary, and the transform coefficients of the transform blocks of the first image block and the second image block are both zero transform coefficients, setting the boundary filtering strength (BS) value of the first image block and the second image block to 0.
In the embodiment of the present application, in a case where it is determined that deblocking filtering is not performed on the first image block and the second image block, the boundary BS value of the first image block and the second image block may be set to 0.
Optionally, in some embodiments, determining not to deblock filter the first image block and the second image block if a boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and transform coefficients of transform blocks in which the first image block and the second image block are located are both zero transform coefficients, includes: and for a brightness mode, if a boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and transform coefficients of transform blocks where the first image block and the second image block are located are both zero transform coefficients, determining not to deblock filter the first image block and the second image block.
In the embodiment of the present application, for example, based on condition 1) in rule two mentioned above, it is defined that when P and Q are in the luminance mode, if the CU to which P and Q belong is the BDPCM mode, it is determined that BS is 0. In other words, assuming that P and Q are in chroma mode, if the CU to which P and Q belong is the BDPCM mode, the BS may be 0.
For another example, based on condition 2 in rule two mentioned above), it is not defined whether P and Q are in a luma mode or a chroma mode, and BS is 0 as long as P or Q is an intra-predicted CU, regardless of whether P and Q are in a luma mode or a chroma mode.
In the embodiment of the present application, when the partition format of the first encoding unit is the luma mode, if a boundary between the first image block and the second image block is a TU boundary and is not a CU/Sub-CU boundary, and transform coefficients of transform blocks in which the first image block and the second image block are located are both zero transform coefficients, the first image block and the second image block may not be deblock filtered.
Optionally, in some embodiments, determining not to deblock filter the first image block and the second image block if a boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and transform coefficients of transform blocks in which the first image block and the second image block are located are both zero transform coefficients, includes: for a luminance mode and a chrominance mode, if a boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and transform coefficients of transform blocks where the first image block and the second image block are both zero transform coefficients, determining not to deblock filter the first image block and the second image block.
In this embodiment, when the first coding unit is in the luma mode or the chroma mode, if a boundary between the first image block and the second image block is a TU boundary and is not a CU/Sub-CU boundary, and transform coefficients of transform blocks in which the first image block and the second image block are located are both zero transform coefficients, the first image block and the second image block may not be deblock filtered.
Fig. 16 is a schematic diagram of another video coding and decoding method 1600 provided in the embodiment of the present application, as shown in fig. 16, the method 1600 may include steps 1610 to 1620.
1610, obtaining a reconstructed image, wherein the reconstructed image comprises a first coding unit, the first coding unit comprises a first image block and a second image block, and the first image block and the second image block are adjacent blocks.
The first image block and the second image block in the embodiment of the present application may be graphic blocks after inverse transformation. For the encoding end, the steps may be to predict, transform, quantize, and encode the current image block, where the reference image block of the current image block may be an image block subjected to inverse quantization, inverse transform, and filtering; for the decoding end, inverse quantization and inverse transformation can be performed on bits corresponding to the residual in the code stream to obtain a residual, a reconstructed image can be obtained according to the reference image and the residual, and then the inverse reconstructed image is filtered.
1620, if the first coding unit adopts a triangle prediction mode and the first image block or the second image block is located on a diagonal of the first coding unit, determining not to deblock filter the first image block and the second image block.
In the method for video encoding and decoding provided by the embodiment of the present application, under the condition that the first encoding unit adopts the triangle prediction mode, if the first image block or the second image block included in the first encoding unit is located on the diagonal line of the first encoding unit, it is determined that the first image block and the second image block are not filtered. The method provided by the embodiment of the application can avoid filtering the adjacent image block caused by judging the adjacent image block without the blocking effect as much as possible, and further can improve the subjective and objective quality of the compressed video.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from the top left corner to the bottom right corner, and the first image block or the second image block is located on the diagonal line of the first encoding unit.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from a top right corner to a bottom left corner, and the first image block or the second image block is located on the diagonal line of the first encoding unit.
Specifically, as shown in fig. 4a, the division of the first coding unit may be performed in a manner from the upper left corner to the lower right corner (or from the lower right corner to the upper left corner) of the quadrangle, as shown in the left graph shown in fig. 4a, or may be performed in a manner from the lower left corner to the upper right corner (or from the upper right corner to the lower left corner) of the quadrangle, as shown in the right graph shown in fig. 4 a.
In the embodiment of the present application, regardless of whether the division of the first encoding unit is divided according to the left image as shown in fig. 4a or the right image as shown in fig. 4a, one of the first image block and the second image block may be located on a diagonal line of the first encoding unit and the other image block may not be located on a diagonal line of the first encoding unit.
In other words, if the first image block is located on the diagonal of the first encoding unit, the second image block is not located on the diagonal of the first encoding unit; or the first image block is not located on the diagonal of the first encoding unit, then the second image block is located on the diagonal of the first encoding unit.
Optionally, in some embodiments, the determining not to deblock filter the first image block and the second image block if the first coding unit adopts the triangle prediction mode and the first image block or the second image block is located on a diagonal of the first coding unit includes: and if the first coding unit adopts a triangle prediction mode and the first image block or the second image block is positioned on the diagonal line of the first coding unit, setting the boundary BS value of the first image block and the second image block to be 0.
In the embodiment of the present application, in a case where it is determined that deblocking filtering is not performed on the first image block and the second image block, the boundary BS value of the first image block and the second image block may be set to 0.
Optionally, in some embodiments, the determining not to deblock filter the first image block and the second image block if the first coding unit adopts the triangle prediction mode and the first image block or the second image block is located on a diagonal of the first coding unit includes: for the brightness mode, if the first coding unit adopts a triangle prediction mode and the first image block or the second image block is located on a diagonal of the first coding unit, determining not to deblock filter the first image block and the second image block.
In this embodiment, when the partition format of the first encoding unit is the luma mode, if the first encoding unit adopts the delta prediction mode and the first image block or the second image block is located on a diagonal line of the first encoding unit, the first image block and the second image block may not be deblock filtered.
Optionally, in some embodiments, the determining not to deblock filter the first image block and the second image block if the first coding unit adopts the triangle prediction mode and the first image block or the second image block is located on a diagonal of the first coding unit includes: for a luminance mode and a chrominance mode, if the first coding unit adopts a triangle prediction mode and the first image block or the second image block is located on a diagonal of the first coding unit, determining not to deblock filter the first image block and the second image block.
In this embodiment, if the first coding unit adopts the delta prediction mode and the first image block or the second image block is located on the diagonal line of the first coding unit, the first image block and the second image block may not be deblock filtered if the first coding unit is in the luma mode or the chroma mode.
Several video coding and decoding methods are introduced above, but none of them relate to the problem that different weights are used for different motion information in case of bi-prediction, which will be described in detail below.
For better understanding of the scheme of the present application, we first briefly introduce Bi-prediction with CU-level Weight (BCW).
Under BCW, a bidirectional predicted CU obtains a final reconstructed CU in a weighted average mode of two reconstructed blocks, and different CUs can take different weights; and under a non-BCW mode, the bidirectional prediction CU obtains a final reconstructed CU in a mode of averaging two reconstructed blocks.
Fig. 17 is a schematic diagram of another video encoding and decoding method 1700 according to an embodiment of the present application, as shown in fig. 17, the method 1700 may include steps 1710 and 1720.
1710, obtaining a reconstructed image, the reconstructed image comprising a first encoding unit and a second encoding unit, the first encoding unit comprising a first image block, the second encoding unit comprising a second image block, the first image block and the second image block being adjacent blocks.
The first image block and the second image block in the embodiment of the present application may be graphic blocks after inverse transformation. For the encoding end, the steps may be to predict, transform, quantize, and encode the current image block, where the reference image block of the current image block may be an image block subjected to inverse quantization, inverse transform, and filtering; for the decoding end, inverse quantization and inverse transformation can be performed on bits corresponding to the residual in the code stream to obtain a residual, a reconstructed image can be obtained according to the reference image and the residual, and then the inverse reconstructed image is filtered.
1720, if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction, performing deblocking filtering on the first image block and the second image block.
In the embodiment of the present application, for the first image block and the second image block, a bidirectional prediction mode may be adopted, that is, the current block is predicted by using a "historical frame" and a "future frame". Meanwhile, the prediction can be carried out by adopting a bidirectional weighted prediction mode on the basis of bidirectional prediction, namely the historical frame and the future frame can respectively occupy certain weight to predict the current block.
In the embodiment of the present application, the first image block adopts a weighted prediction manner, for example, the weights of the bidirectional motion information of the first image block may be 1/4 and 3/4; the second image block still adopts the bi-directional weighted prediction mode, but the weights of its bi-directional motion information may be different, for example, the weights of the bi-directional motion information of the second image block may be 2/5 and 3/5, respectively.
It should be understood that, in the embodiment of the present application, the above numerical values are only examples, and other numerical values may also be used for the bidirectional weighted prediction method, which should not be particularly limited in the present application.
In the video encoding and decoding method provided by the embodiment of the present application, under the condition that the respective weights occupied by the bidirectional motion information of the first image block and the respective weights occupied by the bidirectional motion information of the second image block are different, a blocking effect may exist between the first image block and the second image block, and therefore, the first image block and the second image block can be deblock filtered. In this case, by performing deblocking filtering on the first image block and the second image block, blocking artifacts caused by different motion information of the first image block and the second image block can be avoided as much as possible, and further, the subjective and objective quality of the compressed video can be improved.
Optionally, in some embodiments, the weights used by the first image block in the bidirectional weighted prediction are different from the weights used by the second image block in the bidirectional weighted prediction, including: the index of the weight used by the first image block in bidirectional weighted prediction is different from the index of the weight used by the second image block in bidirectional weighted prediction.
In the embodiment of the present application, different indexes may correspond to different weights, for example, index0 corresponds to weight-2, index1 corresponds to weight 3, index 2 corresponds to weight 4, index 3 corresponds to weight 5, index 4 corresponds to weight 6, and the like.
It should be understood that the correspondence relationship between the index and the weight is merely an example, and other correspondence relationships may also be provided, for example, the index0 corresponds to the weight 3, the index1 corresponds to the weight-2, the index 2 corresponds to the weight 5, the index 3 corresponds to the weight 4, the index 4 corresponds to the weight 6, and the like, which is not specifically limited in this application.
For example, assuming that the two reference blocks of the first image block are P0 and P1, respectively, the prediction block P of the first image block may be represented as:
P=((8-w)*P0+w*P1+4)
for a low-delay type frame, the value of w can be-2, 3, 4, 5, 10; for a frame of a non-low latency type, w may take on a value of 3, 4, 5.
In the embodiment of the present application, the frame of the low latency type may refer to that the reference frame of the current frame is a forward frame.
In this embodiment of the present application, if the frame to which the first image block and the second image block belong is a low latency type frame, it is assumed that an index of a weight used by the first image block in bidirectional weighted prediction is an index0, and an index of a weight used by the second image block in bidirectional weighted prediction is an index 1.
If the index0 corresponds to the weight-2, the index1 corresponds to the weight 3, the index 2 corresponds to the weight 4, the index 3 corresponds to the weight 5, and the index 4 corresponds to the weight 6, the prediction block of the first image block can be represented as P ═ P0-2 × P1+ 4; the prediction block of the second image block may be denoted as P (5 × P0+3 × P1+ 4). Then in this case the first image block and the second image block may be deblock filtered.
Optionally, in some embodiments, the weights used by the first image block in the bidirectional weighted prediction are different from the weights used by the second image block in the bidirectional weighted prediction, including: the absolute value of the difference between the weight used by the first image block in bidirectional weighted prediction and the weight used by the second image block in bidirectional weighted prediction is greater than or equal to a preset threshold.
Specifically, the description will be made with reference to fig. 18. The first image block is P in fig. 18 and the second image block is Q in fig. 18. It can be seen that the motion information of the first image block is MVP0 and MVP1, respectively, and the motion information of the second image block is MVQ0 and MVQ1, respectively.
If MVP0 and MVP1 are from different reference frames, MVQ0 and MVQ1 are also from different reference frames. Assuming that the preset threshold is 8, the sizes of the motion information MVP0 and MVP1 of P in fig. 18 are 5 and 3, respectively, and the sizes of the motion information MVQ0 and MVQ1 of Q are 6 and 2, respectively, although the difference between MVP0 and MVQ0, and the difference between MVP1 and MVQ1 are small, deblocking filtering may not be performed on P and Q. However, in some cases, since the dual motion information of P has a different weight from that of Q, there may be a blocking effect between P and Q, and thus, in this case, P and Q may be deblock filtered.
It should be understood that the above numerical values in the embodiments of the present application are only examples, and other numerical values may be used, and the present application should not be particularly limited.
In order to make the solution of the embodiment of the present application clearer, the following description will be made with reference to fig. 18.
Using different weights for different CUs may introduce blocking artifacts. For example, as shown in fig. 18, if the position coefficients of the block in which P, Q is located are all 0 and the MV difference is small, the BS may be set to 0 according to the above rule. However, due to the presence of BCW, P, Q may use different weights, for example, as shown in fig. 18, if P0 and P1 referred to by P are 5/4 and-1/4 respectively, and Q0 and Q1 referred to by Q are 1/4 and 3/4 respectively, so that blocking effect may be introduced between P and Q.
The video coding and decoding method provided by the embodiment of the application can calculate the boundary filtering strength based on the rule four.
Rule four:
1) if the luminance component is the luminance component, P, Q belongs to the CU which is the BDPCM mode, and BS is equal to 0;
2) otherwise, if P or Q is intra-predicted CU, BS ═ 2;
3) otherwise, if the boundary between P, Q is a TU boundary and P or Q is CIIP mode, BS is 2;
4) otherwise, if the boundary between P, Q is a TU boundary and the transform block of P or Q contains at least one non-zero transform coefficient, BS equals 1;
5) otherwise, if the boundary between P, Q is a TU boundary and is a chroma component, and the CU where P or Q is located uses a Cb Cr joint coding scheme, BS equals 1;
6) otherwise, if the CU in which P, Q is located uses a different coding mode (e.g., P uses inter-frame prediction mode, Q uses IBC mode), BS is 1;
7) otherwise, if the BCW indexes of P, Q are different (i.e., the BCW uses different weights), BS is 1 (or the absolute value of the BCW weight difference is greater than a certain threshold);
8) otherwise, for the luminance component, if at least one of the following conditions is met, BS ═ 1;
firstly, P, Q are both in IBC mode, and the difference value of the MV of P, Q is more than or equal to 8 in the horizontal direction or the vertical direction;
p, Q refer to different reference frames or the number of MVs is different (for example, P is double MV, Q is single MV);
③ P, Q both use single MV, and the difference value of the two single MVs is more than or equal to 8;
both four and P, Q use double MVs, and the double MVs of P are from different reference frames (MV1 is from reference frame 1, MV2 is from reference frame 2), the double MVs of Q are also from two different reference frames (MV3 is from reference frame 1, MV4 is from reference frame 2), and the reference frame referenced by P, Q is the same. Then the difference between the absolute values of MV1-MV3 and the absolute values of MV2-MV4 in the horizontal or vertical direction is greater than or equal to 8;
if P, Q uses dual MVs and the dual MVs are from the same reference frame, the following two conditions need to be satisfied simultaneously (suppose P (MV0 from list0, MV1 from list1), Q (MV2 from list0, MV3 from list 1));
the absolute value of the difference between MV0 and MV2 in List0 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV3 in List1 is greater than or equal to 8 in the horizontal or numerical direction;
the absolute value of the difference between MV0 and MV3 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV2 is greater than or equal to 8 in the horizontal or numerical direction;
9) otherwise, BS is 0.
In the embodiment of the present application, based on the above conditions, it is determined whether or not condition 7) is satisfied assuming that neither P nor Q satisfies condition 1) -condition 6), and in the present application, since the weights of BCWs of P and Q are different, condition 7) is satisfied, BS may be set to 1, and further, deblocking filtering may be performed on P and Q.
It should also be understood that, in the embodiment of the present application, condition 7) may be located between condition 6) and condition 8), may also be located between condition 5) and condition 6), and may also be located between conditions 8) and 9), which is not specifically limited in the present application.
If the condition 7) lies between the conditions 8) and 9), and if neither P nor Q satisfies the conditions 1) to 8), it is determined whether the condition 7) is satisfied, and since the weights of BCWs of P and Q in the present application are different, the condition 7) is satisfied, the BS becomes 1, and further, deblocking filtering can be performed on P and Q.
If the condition 8) is located between the conditions 5) and 6), similarly to the above case. For brevity, no further description is provided herein.
It should be understood that in the embodiment of the present application, when the weights of BCWs of P and Q are different, the BS may also be set to 2, and may also be set to other values capable of performing filtering, so that deblocking filtering may be performed on P and Q.
Optionally, in some embodiments, if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and a weight used in the bidirectional weighted prediction for the first image block is different from a weight used in the bidirectional weighted prediction for the second image block, performing deblocking filtering on the first image block and the second image block includes: and performing deblocking filtering on the first image block and the second image block if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction mode for a brightness mode.
In this embodiment, if the encoding unit belongs to the luminance mode, and if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and a weight used in the bidirectional weighted prediction of the first image block is different from a weight used in the bidirectional weighted prediction of the second image block, the first image block and the second image block may be deblock filtered.
Optionally, in some embodiments, if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and a weight used in the bidirectional weighted prediction for the first image block is different from a weight used in the bidirectional weighted prediction for the second image block, performing deblocking filtering on the first image block and the second image block includes: and performing deblocking filtering on the first image block and the second image block if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction mode according to a luminance mode and a chrominance mode.
In this embodiment, under the condition that the encoding unit belongs to the luminance mode or the chrominance mode, if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction, the first image block and the second image block may be deblock filtered.
Optionally, in some embodiments, if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and a weight used in the bidirectional weighted prediction for the first image block is different from a weight used in the bidirectional weighted prediction for the second image block, performing deblocking filtering on the first image block and the second image block includes: and if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction, setting the boundary filtering strength BS value of the first image block and the second image block to be 1 or 2.
In the embodiment of the present application, in the case where it is determined that the first image block and the second image block are deblock filtered, the boundary BS value of the first image block and the second image block may be set to 1 or 2.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block includes: and if the BS values of the first image block and the second image block are 1, performing weak filtering on the first image block and the second image block.
Optionally, in some embodiments, the strongly filtering the first image block and the second image block includes: and if the BS value of the first image block and the second image block is 2, performing strong filtering on the first image block and the second image block.
In the embodiment of the application, the weak filtering may be to change two pixel points on the boundary of the adjacent block, and then determine whether to adjust other pixel points by using a threshold, where the other pixel points may be pixel points having a certain distance from the boundary; the strong filtering may be to change a plurality of pixels, wherein the plurality of pixels may include pixels on a boundary of an adjacent block and pixels having a certain distance from the boundary.
The method embodiment of the present application is described in detail above with reference to fig. 3 to 18, and the apparatus embodiment of the present application is described below with reference to fig. 19 to 24, which correspond to the method embodiment, so that the method embodiment of the present application can be referred to for the parts not described in detail.
Fig. 19 is a codec 1900 according to an embodiment of the present application, where the codec 1900 may include a processor 1910.
A processor 1910 configured to obtain a reconstructed image, where the reconstructed image includes a first coding unit and a second coding unit, the first coding unit includes a first image block, the second coding unit includes a second image block, and the first image block and the second image block are neighboring blocks; and if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the first coding unit adopts the geometric partition prediction mode, the second coding unit adopts a non-geometric partition prediction mode, and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the first coding unit adopts the geometric partition prediction mode and the second coding unit adopts the geometric partition prediction mode, and the first image block and the second image block are positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the first encoding unit obtains an image block of at least one polygon through partitioning in the geometric partition prediction mode.
Optionally, in some embodiments, the geometric partitioning prediction mode partitions the first coding unit by using a distance offset and an angle, the distance offset being a distance between a center point of the first coding unit and a partition line, and the angle being an angle between a normal between the center point of the first coding unit and the partition line and a horizontal line.
Optionally, in some embodiments, the processor 1910 is further configured to: if the distance offset is smaller than a preset threshold value, the first coding unit adopts a geometric partition prediction mode, and the first image block is located on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block; and if the distance offset is greater than or equal to the preset threshold, not performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block and the second image block adopt a bidirectional weighted prediction mode, and the weight used by the first image block and the second image block in bidirectional weighted prediction is different from the weight used by the second image block in bidirectional weighted prediction, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional weighted prediction mode, and the second image block adopts a bidirectional equal-weight prediction mode, then the first image block and the second image block are subjected to deblocking filtering.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional equal-weight prediction mode, and the second image block adopts a bidirectional weighted prediction mode, and then the first image block and the second image block are subjected to deblocking filtering.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional weighted prediction mode, and the second image block adopts a unidirectional prediction mode, and then deblocking filtering is carried out on the first image block and the second image block.
Optionally, in some embodiments, the first encoding unit is divided along a dividing line from a first boundary of the first encoding unit to a second boundary of the first encoding unit, the first image block is located at an intersection of the first boundary and the dividing boundary line or at an intersection of the second boundary and the dividing boundary line, and the first boundary and the second boundary do not belong to the same boundary.
Optionally, in some embodiments, the dividing line comprises at least one of: straight lines, broken lines or curved lines.
Optionally, in some embodiments, the processor 1910 is further configured to: and for a brightness mode, if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1910 is further configured to: and for a luminance mode and a chrominance mode, if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1910 is further configured to: setting a boundary filtering strength BS value of the first image block and the second image block to 1 or 2 if the first encoding unit adopts a geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the BS values of the first image block and the second image block are 1, performing weak filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the BS value of the first image block and the second image block is 2, performing strong filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the first coding unit and the second coding unit do not use an intra-frame prediction mode, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts the geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
Optionally, in some embodiments, the processor 1910 is further configured to: and if the boundary between the first image block and the second image block is not the boundary of a transform unit TU and/or the transform coefficients of the transform block where the first image block or the second image block is located are all zero transform coefficients, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts the geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
Fig. 20 is a codec device 2000 according to another embodiment of the present disclosure, where the codec device 2000 may include a processor 2010.
A processor 2010, the processor 2010 to: acquiring a reconstructed image, wherein the reconstructed image comprises a first coding unit, the first coding unit comprises a first image block and a second image block, and the first image block and the second image block are adjacent blocks; and if the boundary between the first image block and the second image block is a transformation unit TU boundary, the boundary between the first image block and the second image block is not a coding unit CU/Sub-coding unit Sub-CU boundary, and the transformation coefficients of the transformation blocks of the first image block and the second image block are both zero transformation coefficients, determining not to deblock filter the first image block and the second image block.
Optionally, in some embodiments, the processor 2010 is further configured to: and if the first coding unit adopts a triangular prediction mode, the boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and the transform coefficients of the transform blocks of the first image block and the second image block are both zero transform coefficients, determining not to deblock filter the first image block and the second image block.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from the top left corner to the bottom right corner, and the first image block or the second image block is located on the diagonal line of the first encoding unit.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from a top right corner to a bottom left corner, and the first image block or the second image block is located on the diagonal line of the first encoding unit.
Optionally, in some embodiments, the processor 2010 is further configured to: and if the boundary between the first image block and the second image block is a Transform Unit (TU) boundary, the boundary between the first image block and the second image block is not a Coding Unit (CU)/Sub-coding unit (Sub-CU) boundary, and the transform coefficients of the transform blocks of the first image block and the second image block are both zero transform coefficients, setting the boundary filtering strength (BS) value of the first image block and the second image block to 0.
Optionally, in some embodiments, the processor 2010 is further configured to: and for a brightness mode, if a boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and transform coefficients of transform blocks where the first image block and the second image block are located are both zero transform coefficients, determining not to deblock filter the first image block and the second image block.
Optionally, in some embodiments, the processor 2010 is further configured to: for a luminance mode and a chrominance mode, if a boundary between the first image block and the second image block is a TU boundary, the boundary between the first image block and the second image block is not a CU/Sub-CU boundary, and transform coefficients of transform blocks where the first image block and the second image block are both zero transform coefficients, determining not to deblock filter the first image block and the second image block.
Fig. 21 is a codec 2100 according to yet another embodiment of the present application, where the codec 2100 may include a processor 2110.
A processor 2110, said processor 2110 configured to: acquiring a reconstructed image, wherein the reconstructed image comprises a first coding unit, the first coding unit comprises a first image block and a second image block, and the first image block and the second image block are adjacent blocks; and if the first coding unit adopts a triangle prediction mode and the first image block or the second image block is positioned on the diagonal line of the first coding unit, determining not to carry out deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from the top left corner to the bottom right corner, and the first image block or the second image block is located on the diagonal line of the first encoding unit.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from a top right corner to a bottom left corner, and the first image block or the second image block is located on the diagonal line of the first encoding unit.
Optionally, in some embodiments, the processor 2110 is further configured to: and if the first coding unit adopts a triangle prediction mode and the first image block or the second image block is positioned on the diagonal line of the first coding unit, setting the boundary filtering strength BS value of the first image block and the second image block to be 0.
Optionally, in some embodiments, the processor 2110 is further configured to: for the brightness mode, if the first coding unit adopts a triangle prediction mode and the first image block or the second image block is located on a diagonal of the first coding unit, determining not to deblock filter the first image block and the second image block.
Optionally, in some embodiments, the processor 2110 is further configured to: for a luminance mode and a chrominance mode, if the first coding unit adopts a triangle prediction mode and the first image block or the second image block is located on a diagonal of the first coding unit, determining not to deblock filter the first image block and the second image block.
Fig. 22 is a codec 2200 according to still another embodiment of the present disclosure, where the codec 2200 may include a processor 2210.
A processor 2210, the processor 2210 to: acquiring a reconstructed image, wherein the reconstructed image comprises a first coding unit and a second coding unit, the first coding unit comprises a first image block, the second coding unit comprises a second image block, and the first image block and the second image block are adjacent image blocks; and if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 2210 is further configured to: for a luminance mode, if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction, performing deblocking filtering on the first image block and the second image block
Optionally, in some embodiments, the processor 2210 is further configured to: and performing deblocking filtering on the first image block and the second image block if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction mode according to a luminance mode and a chrominance mode.
Optionally, in some embodiments, the processor 2210 is further configured to: and if the first image block and the second image block respectively adopt a bidirectional weighted prediction mode, and the weight used by the first image block in the bidirectional weighted prediction is different from the weight used by the second image block in the bidirectional weighted prediction, setting the boundary filtering strength BS value of the first image block and the second image block to be 1 or 2.
Optionally, in some embodiments, the processor 2210 is further configured to: and if the boundary BS value of the first image block and the second image block is 1, performing weak filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 2210 is further configured to: and if the boundary BS value of the first image block and the second image block is 2, performing strong filtering on the first image block and the second image block.
Fig. 23 is a schematic structural diagram of a video encoding and decoding device according to still another embodiment of the present application. The video codec device 2300 shown in fig. 23 includes a processor 2310, and the processor 2310 can call and run a computer program from a memory to implement the methods described in fig. 3 to fig. 18 in the embodiments of the present application.
Optionally, as shown in fig. 23, the video codec device 2300 may further include a memory 2320. From the memory 2320, the processor 2310 can call and run a computer program to implement the method in the embodiments of the present application.
The memory 2320 may be a separate device from the processor 2310 or may be integrated into the processor 2310.
Optionally, as shown in fig. 23, the video codec device 2300 may further include a transceiver 2330, and the processor 2310 may control the transceiver 2330 to communicate with other devices, and in particular, may transmit information or data to or receive information or data transmitted by other devices.
Optionally, the video encoding and decoding device may be, for example, an encoder, a decoder, a terminal (including but not limited to a mobile phone, a camera, an unmanned aerial vehicle, etc.), and the encoding and decoding device may implement corresponding processes in the methods of the embodiments of the present application, and for brevity, details are not repeated here.
Fig. 24 is a schematic structural diagram of a chip of an embodiment of the present application. The chip 2400 shown in fig. 24 includes a processor 2410, and the processor 2410 can call and execute a computer program from a memory to implement the method in the embodiment of the present application.
Optionally, as shown in fig. 24, the chip 2400 may further include a memory 2420. The processor 2410 may invoke and execute a computer program from the memory 2420 to implement the methods in the embodiments of the present application.
The memory 2420 may be a separate device from the processor 2410 or may be integrated into the processor 2410.
Optionally, the chip 2400 may further include an input interface 2430. The processor 2410 can control the input interface 2430 to communicate with other devices or chips, and can specifically obtain information or data transmitted by other devices or chips.
Optionally, the chip 2400 may further include an output interface 2440. The processor 2410 can control the output interface 2440 to communicate with other devices or chips, and can output information or data to the other devices or chips.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip or a system-on-chip, etc.
It should be understood that the processor of the embodiments of the present application may be an integrated circuit image processing system having signal processing capabilities. In implementation, the steps of the above method embodiments may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
It will be appreciated that the memory in the embodiments of the subject application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (DDR SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchronous link SDRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
It should be understood that the above memories are exemplary but not limiting illustrations, for example, the memories in the embodiments of the present application may also be Static Random Access Memory (SRAM), dynamic random access memory (dynamic RAM, DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (enhanced SDRAM, ESDRAM), Synchronous Link DRAM (SLDRAM), Direct Rambus RAM (DR RAM), and the like. That is, the memory in the embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory in embodiments of the present application may provide instructions and data to the processor. The portion of memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor may be configured to execute the instructions stored in the memory, and when the processor executes the instructions, the processor may perform the steps corresponding to the terminal device in the above method embodiment.
In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor executes instructions in the memory, in combination with hardware thereof, to perform the steps of the above-described method. To avoid repetition, it is not described in detail here.
It should also be understood that, in the embodiment of the present application, the pixel points in the image may be located in different rows and/or columns, where the length of a may correspond to the number of pixel points in the same row included in a, and the height of a may correspond to the number of pixel points in the same column included in a. In addition, the length and the height of a may also be referred to as the width and the depth of a, respectively, which is not limited in this application.
It should also be understood that, in this embodiment of the present application, the "boundary spaced from a" may refer to at least one pixel point spaced from the boundary of a, and may also be referred to as "not adjacent to the boundary of a" or "not located at the boundary of a", which is not limited in this embodiment of the present application, where a may be an image, a rectangular area, or a sub-image, etc.
It should also be understood that the foregoing descriptions of the embodiments of the present application focus on highlighting differences between the various embodiments, and that the same or similar elements that are not mentioned may be referred to one another and, for brevity, are not repeated herein.
The embodiment of the application also provides a computer readable storage medium for storing the computer program.
Optionally, the computer-readable storage medium may be applied to the encoding and decoding apparatus in the embodiment of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the encoding and decoding apparatus in the methods in the embodiment of the present application, which is not described herein again for brevity.
Embodiments of the present application also provide a computer program product comprising computer program instructions.
Optionally, the computer program product may be applied to the encoding and decoding apparatus in the embodiment of the present application, and the computer program instructions enable the computer to execute corresponding processes implemented by the encoding and decoding apparatus in the methods in the embodiment of the present application, which are not described herein again for brevity.
The embodiment of the application also provides a computer program.
Optionally, the computer program may be applied to the encoding and decoding apparatus in the embodiment of the present application, and when the computer program runs on a computer, the computer is enabled to execute corresponding processes implemented by the encoding and decoding apparatus in the methods in the embodiment of the present application, and for brevity, details are not described here again.
It should be understood that, in the embodiment of the present application, the term "and/or" is only one kind of association relation describing an associated object, and means that three kinds of relations may exist. For example, a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially or partially contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (42)

1. A method of video encoding and decoding, comprising:
acquiring a reconstructed image, wherein the reconstructed image comprises a first coding unit and a second coding unit, the first coding unit comprises a first image block, the second coding unit comprises a second image block, and the first image block and the second image block are adjacent blocks;
and if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
2. The method of claim 1, wherein deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the first coding unit adopts the geometric partition prediction mode, the second coding unit adopts a non-geometric partition prediction mode, and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
3. The method of claim 1, wherein deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the first coding unit adopts the geometric partition prediction mode and the second coding unit adopts the geometric partition prediction mode, and the first image block and the second image block are positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
4. The method according to any of claims 1 to 3, wherein the first coding unit obtains at least one image block of a polygon through the partitioning of the geometrically partitioned prediction mode.
5. The method of any of claims 1 to 4, wherein the geometrically partitioned prediction mode partitions the first coding unit by employing a distance offset and an angle, the distance offset being a distance between a center point of the first coding unit and a partition line, and the angle being an angle between a normal between the center point of the first coding unit and the partition line and a horizontal line.
6. The method of claim 5, wherein deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the distance offset is smaller than a preset threshold value, the first coding unit adopts a geometric partition prediction mode, and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
7. The method of claim 6, further comprising:
and if the distance offset is greater than or equal to the preset threshold, not performing deblocking filtering on the first image block and the second image block.
8. The method according to any of claims 1 to 7, wherein the deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block and the second image block adopt a bidirectional weighted prediction mode, and the weight used by the first image block and the second image block in bidirectional weighted prediction is different from the weight used by the second image block in bidirectional weighted prediction, performing deblocking filtering on the first image block and the second image block.
9. The method according to any of claims 1 to 7, wherein the deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional weighted prediction mode, and the second image block adopts a bidirectional equal-weight prediction mode, then the first image block and the second image block are subjected to deblocking filtering.
10. The method according to any of claims 1 to 7, wherein the deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional equal-weight prediction mode, and the second image block adopts a bidirectional weighted prediction mode, and then the first image block and the second image block are subjected to deblocking filtering.
11. The method according to any of claims 1 to 7, wherein the deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional weighted prediction mode, and the second image block adopts a unidirectional prediction mode, and then deblocking filtering is carried out on the first image block and the second image block.
12. The method according to any of claims 1 to 11, wherein the first coding unit is divided along a dividing line from a first boundary of the first coding unit to a second boundary of the first coding unit, wherein the first image block is located at an intersection of the first boundary and the dividing boundary line or at an intersection of the second boundary and the dividing boundary line, and wherein the first boundary and the second boundary do not belong to the same boundary.
13. The method of claim 12, wherein the dividing line comprises at least one of:
straight lines, broken lines or curved lines.
14. The method according to any of claims 1 to 13, wherein said deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and for a brightness mode, if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
15. The method according to any of claims 1 to 13, wherein said deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and for a luminance mode and a chrominance mode, if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
16. The method according to any of claims 1 to 15, wherein said deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
setting a boundary filtering strength BS value of the first image block and the second image block to 1 or 2 if the first encoding unit adopts a geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
17. The method of claim 16, wherein deblocking filtering the first tile and the second tile comprises:
and if the BS values of the first image block and the second image block are 1, performing weak filtering on the first image block and the second image block.
18. The method of claim 16, wherein deblocking filtering the first tile and the second tile comprises:
and if the BS value of the first image block and the second image block is 2, performing strong filtering on the first image block and the second image block.
19. The method according to any of claims 1 to 18, wherein said deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the first coding unit and the second coding unit do not use an intra-frame prediction mode, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts the geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
20. The method according to any of claims 1 to 18, wherein said deblocking filtering the first image block and the second image block if the first coding unit employs a geometrically partitioned prediction mode and the first image block is located on a partition boundary line based on the geometrically partitioned prediction mode comprises:
and if the boundary between the first image block and the second image block is not the boundary of a transform unit TU and/or the transform coefficients of the transform block where the first image block or the second image block is located are all zero transform coefficients, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts the geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
21. A video encoding and decoding apparatus, comprising:
a processor configured to obtain a reconstructed image, where the reconstructed image includes a first encoding unit and a second encoding unit, the first encoding unit includes a first image block, the second encoding unit includes a second image block, and the first image block and the second image block are adjacent blocks;
and if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
22. The apparatus of claim 21, wherein the processor is further configured to:
and if the first coding unit adopts the geometric partition prediction mode, the second coding unit adopts a non-geometric partition prediction mode, and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
23. The apparatus of claim 21, wherein the processor is further configured to:
and if the first coding unit adopts the geometric partition prediction mode and the second coding unit adopts the geometric partition prediction mode, and the first image block and the second image block are positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
24. The apparatus according to any of claims 21 to 23, wherein the first encoding unit obtains at least one image block of a polygon through the partitioning in the geometric partitioning prediction mode.
25. The apparatus according to any of claims 21-24, wherein the geometric partitioning prediction mode partitions the first coding unit by employing a distance offset and an angle, the distance offset being a distance between a center point of the first coding unit and a partition line, and the angle being an angle between a normal between the center point of the first coding unit and the partition line and a horizontal line.
26. The apparatus of claim 25, wherein the processor is further configured to:
and if the distance offset is smaller than a preset threshold value, the first coding unit adopts a geometric partition prediction mode, and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
27. The apparatus of claim 26, wherein the first tile and the second tile are deblock filtered if the distance offset is greater than or equal to the preset threshold.
28. The apparatus of any of claims 21-24, wherein the processor is further configured to:
and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block and the second image block adopt a bidirectional weighted prediction mode, and the weight used by the first image block and the second image block in bidirectional weighted prediction is different from the weight used by the second image block in bidirectional weighted prediction, performing deblocking filtering on the first image block and the second image block.
29. The apparatus of any of claims 21-24, wherein the processor is further configured to:
and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional weighted prediction mode, and the second image block adopts a bidirectional equal-weight prediction mode, then the first image block and the second image block are subjected to deblocking filtering.
30. The apparatus of any of claims 21-24, wherein the processor is further configured to:
and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional equal-weight prediction mode, and the second image block adopts a bidirectional weighted prediction mode, and then the first image block and the second image block are subjected to deblocking filtering.
31. The apparatus of any of claims 21-24, wherein the processor is further configured to:
and if the first coding unit adopts a geometric partition prediction mode, the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, the first image block adopts a bidirectional weighted prediction mode, and the second image block adopts a unidirectional prediction mode, and then deblocking filtering is carried out on the first image block and the second image block.
32. The apparatus according to any of claims 21 to 31, wherein the first coding unit is divided along a dividing line from a first boundary of the first coding unit to a second boundary of the first coding unit, the first image block is located at an intersection of the first boundary and the dividing boundary line or at an intersection of the second boundary and the dividing boundary line, and the first boundary and the second boundary do not belong to the same boundary.
33. The apparatus of claim 32, wherein the dividing line comprises at least one of:
straight lines, broken lines or curved lines.
34. The apparatus of any of claims 21-33, wherein the processor is further configured to:
and for a brightness mode, if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
35. The apparatus of any of claims 21-33, wherein the processor is further configured to:
and for a luminance mode and a chrominance mode, if the first coding unit adopts a geometric partition prediction mode and the first image block is positioned on a partition boundary line based on the geometric partition prediction mode, performing deblocking filtering on the first image block and the second image block.
36. The apparatus of any of claims 21-35, wherein the processor is further configured to:
setting a boundary filtering strength BS value of the first image block and the second image block to 1 or 2 if the first encoding unit adopts a geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
37. The apparatus of claim 36, wherein the processor is further configured to:
and if the BS values of the first image block and the second image block are 1, performing weak filtering on the first image block and the second image block.
38. The apparatus of claim 36, wherein the processor is further configured to:
and if the BS value of the first image block and the second image block is 2, performing strong filtering on the first image block and the second image block.
39. The apparatus of any of claims 21-38, wherein the processor is further configured to:
and if the first coding unit and the second coding unit do not use an intra-frame prediction mode, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts the geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
40. The apparatus of any of claims 21-38, wherein the processor is further configured to:
and if the boundary between the first image block and the second image block is not the boundary of a transform unit TU and/or the transform coefficients of the transform block where the first image block or the second image block is located are all zero transform coefficients, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts the geometric partition prediction mode and the first image block is located on a partition boundary line based on the geometric partition prediction mode.
41. A video encoding and decoding apparatus, comprising: a processor and a memory for storing a computer program, the processor being configured to invoke and execute the computer program stored in the memory to perform the method of any of claims 1 to 20.
42. A computer-readable storage medium comprising instructions for performing the coding method of any one of claims 1 to 20.
CN201980029834.6A 2019-09-24 2019-12-31 Video coding and decoding method and device Pending CN112204986A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
PCT/CN2019/107606 WO2021056219A1 (en) 2019-09-24 2019-09-24 Video coding and decoding method and device
CNPCT/CN2019/107606 2019-09-24
PCT/CN2019/130926 WO2021056920A1 (en) 2019-09-24 2019-12-31 Method and apparatus for video encoding and decoding

Publications (1)

Publication Number Publication Date
CN112204986A true CN112204986A (en) 2021-01-08

Family

ID=74004694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980029834.6A Pending CN112204986A (en) 2019-09-24 2019-12-31 Video coding and decoding method and device

Country Status (1)

Country Link
CN (1) CN112204986A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101822056A (en) * 2007-10-12 2010-09-01 汤姆逊许可公司 Methods and apparatus for video encoding and decoding geometrically partitioned bi-predictive mode partitions
CN101822064A (en) * 2007-10-16 2010-09-01 汤姆逊许可公司 Methods and apparatus for video encoding and decoding geometrically partitioned super blocks
CN102763415A (en) * 2010-02-18 2012-10-31 高通股份有限公司 Smoothing overlapped regions resulting from geometric motion partitioning
CN102792692A (en) * 2010-01-14 2012-11-21 三星电子株式会社 Method and apparatus for encoding video by using deblocking filtering, and method and apparatus for decoding video by using deblocking filtering
US20150163509A1 (en) * 2013-12-06 2015-06-11 Mediatek Inc. Method and Apparatus for Fine-grained Motion Boundary Processing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101822056A (en) * 2007-10-12 2010-09-01 汤姆逊许可公司 Methods and apparatus for video encoding and decoding geometrically partitioned bi-predictive mode partitions
CN101822064A (en) * 2007-10-16 2010-09-01 汤姆逊许可公司 Methods and apparatus for video encoding and decoding geometrically partitioned super blocks
CN102792692A (en) * 2010-01-14 2012-11-21 三星电子株式会社 Method and apparatus for encoding video by using deblocking filtering, and method and apparatus for decoding video by using deblocking filtering
CN102763415A (en) * 2010-02-18 2012-10-31 高通股份有限公司 Smoothing overlapped regions resulting from geometric motion partitioning
US20170201770A1 (en) * 2010-02-18 2017-07-13 Qualcomm Incorporated Adaptive transform size selection for geometric motion partitioning
US20150163509A1 (en) * 2013-12-06 2015-06-11 Mediatek Inc. Method and Apparatus for Fine-grained Motion Boundary Processing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李康顺: "基于快速边界强度判定的H.264去块滤波新算法", 《中南大学学报(自然科学版)》 *

Similar Documents

Publication Publication Date Title
KR20200040773A (en) Method and apparatus for filtering with mode-aware deep learning
US20160073107A1 (en) Method and apparatus for video encoding/decoding using intra prediction
US11350125B2 (en) Method and device for intra-prediction
WO2013042888A2 (en) Method for inducing a merge candidate block and device using same
JP2024012627A (en) Methods and devices for selectively applying bidirectional optical flow and decoder-side motion vector refinement for video coding
US10412402B2 (en) Method and apparatus of intra prediction in video coding
US11729410B2 (en) Image decoding method/apparatus, image encoding method/apparatus, and recording medium storing bitstream
EP3884667B1 (en) Video coding with triangular shape prediction units
CN117499638A (en) Method of encoding/decoding image and method of transmitting bitstream
CN110832854B (en) Method and apparatus for intra prediction using interpolation
US11706449B2 (en) Method and device for intra-prediction
CN113228638B (en) Method and apparatus for conditionally encoding or decoding video blocks in block partitioning
CN114009033A (en) Method and apparatus for signaling symmetric motion vector difference mode
EP3942824A1 (en) Methods and apparatuses for prediction refinement with optical flow
CN117880499A (en) Deblocking filtering adaptive encoder, decoder and corresponding methods
CN112514390A (en) Method and apparatus for video encoding
CN112534824B (en) Method and apparatus for video encoding
CN112204986A (en) Video coding and decoding method and device
CN112136329A (en) Video coding and decoding method and device
US11962803B2 (en) Method and device for intra-prediction
CN112544079A (en) Video coding and decoding method and device
CN112970252A (en) Video coding and decoding method and device
WO2023154574A1 (en) Methods and devices for geometric partitioning mode with adaptive blending
CN111699689A (en) Video processing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210108