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

Video coding and decoding method and device Download PDF

Info

Publication number
CN112136329A
CN112136329A CN201980029796.4A CN201980029796A CN112136329A CN 112136329 A CN112136329 A CN 112136329A CN 201980029796 A CN201980029796 A CN 201980029796A CN 112136329 A CN112136329 A CN 112136329A
Authority
CN
China
Prior art keywords
image block
coding unit
boundary
image
prediction mode
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
CN201980029796.4A
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
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
Application filed by Peking University, SZ DJI Technology Co Ltd filed Critical Peking University
Publication of CN112136329A publication Critical patent/CN112136329A/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/117Filters, e.g. for pre-processing or post-processing
    • 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/124Quantisation
    • 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/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • 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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • 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
    • 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/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

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 triangle prediction mode and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block. According to the video coding and decoding method, if one of the adjacent image blocks in the reconstructed image adopts the triangular prediction mode and the image block is located on the diagonal 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
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 embodiment of the application provides a video coding and decoding method and device, which can effectively distinguish whether to carry out deblocking filtering on adjacent image blocks, thereby improving the subjective and objective quality of compressed videos.
In a first aspect, a method for video coding and decoding 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 triangle prediction mode and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
In the video encoding and decoding method provided by the embodiment of the application, if one of the adjacent image blocks in the reconstructed image adopts the triangular prediction mode and the image block is located on the diagonal line of the coding unit of the image block, the adjacent image block is deblock filtered, 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.
In a second aspect, a method for video coding and decoding is provided, including: 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.
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.
In a third aspect, a method for video encoding and decoding is provided, including: 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.
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.
In a fourth aspect, a method for video encoding and decoding 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 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 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.
In a fifth aspect, an apparatus for video encoding and decoding is provided, including: a processor 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 blocks; and if the first coding unit adopts a triangle prediction mode and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
In a sixth aspect, an apparatus for video encoding and decoding is provided, which includes: a processor configured to obtain a reconstructed image, where the reconstructed image includes a first encoding unit, where the first encoding unit includes 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.
In a seventh aspect, an apparatus for video encoding and decoding is provided, including: a processor configured to obtain a reconstructed image, where the reconstructed image includes a first encoding unit, where the first encoding unit includes 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.
In an eighth aspect, an apparatus for video encoding and decoding is provided, which includes: 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 image block neighboring 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.
In a ninth aspect, a video coding and decoding device is provided, which comprises 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 to the fourth aspect or each implementation manner thereof.
A tenth aspect provides a chip for implementing the methods of the first to fourth aspects or implementations thereof.
Specifically, the chip includes: a processor, configured to call and run a computer program from the memory, so that the device on which the chip is installed performs the method according to the first aspect to the fourth aspect or the implementation manners thereof.
In an eleventh aspect, there is provided a computer-readable storage medium for storing a computer program comprising instructions for performing the method of the first to fourth aspects or any possible implementation manner of the first to fourth aspects.
In a twelfth aspect, a computer program product is provided, which includes computer program instructions to make a computer execute the method in the implementation manners of the first to fourth aspects or the first to fourth aspects.
In a thirteenth aspect, there is provided a computer program which, when run on a computer, causes the computer to perform the method of any of the possible implementations of the first to fourth aspects or the first to fourth aspects described above.
Drawings
The drawings used in the embodiments will be briefly described below.
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. 4 is a schematic diagram of a partition manner of a triangle prediction manner in the embodiment of the present application;
FIG. 5 is a schematic diagram of MV storage in a triangle prediction mode in an embodiment of the present application;
FIG. 6a is a schematic diagram of deblocking filtering for triangle prediction according to an embodiment of the present application;
FIG. 6b is a schematic diagram of deblocking filtering for triangle prediction provided by another embodiment of the present application;
FIG. 7 is a schematic diagram of deblocking filtering for triangle prediction provided by yet another embodiment of the present application;
fig. 8 is a schematic flow chart of a video encoding and decoding method according to another embodiment of the present application;
FIG. 9 is a schematic diagram of deblocking filtering for triangle prediction according to yet another embodiment of the present application;
fig. 10 is a schematic flow chart of a video encoding and decoding method provided by another embodiment of the present application;
fig. 11 is a schematic flow chart of a video encoding and decoding method according to still another embodiment of the present application;
fig. 12 is a schematic diagram of deblocking filtering of BCW according to an embodiment of the present application;
fig. 13 is a schematic diagram of a video encoding and decoding apparatus provided by an embodiment of the present application;
fig. 14 is a schematic diagram of a video codec device provided in another embodiment of the present application;
fig. 15 is a schematic diagram of a video codec device provided in another embodiment of the present application;
fig. 16 is a schematic diagram of a video codec device according to still another embodiment of the present application;
fig. 17 is a schematic structural diagram of a video encoding and decoding device according to still another embodiment of the present application;
fig. 18 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 triangle prediction technology. In the triangle prediction technology, an image block to be encoded may be divided into two sub image blocks having a triangle shape, 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 boundary filtering strength
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 blocks on the left side of the boundary are denoted by P, the 4x4 blocks on the right side are denoted by Q, and the filter strength is denoted by BS, the boundary filter 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 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;
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 triangle prediction mode and the first image block is located on a diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
In the embodiment of the present application, the first encoding unit may include a plurality of image blocks, and the second encoding unit may also include a plurality of image blocks. For example, the first encoding unit and the second encoding unit may include 4 × 4 image blocks, wherein the first image block may be located on a diagonal of the first encoding unit.
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.
For example, in the embodiment of the present application, the first image block is located on a diagonal of the first encoding 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. 4, or the first coding unit 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.
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.
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 triangular prediction mode and the image block is located on the diagonal 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.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts the triangle prediction mode and the first image block is located on a diagonal of the first coding unit includes: and if the first coding unit adopts a triangular prediction mode, the second coding unit adopts a non-triangular prediction mode in an inter-prediction mode, and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block, wherein the inter-prediction mode comprises the triangular prediction mode.
The non-triangular prediction mode in the embodiment of the present application may be an affinity mode, a common merge mode, and the like, which is not specifically limited in the present application.
It should be understood that, in the embodiment of the present application, for the first coding unit and the second coding unit, the prediction modes adopted by the first coding unit and the second coding unit may also be: the first coding unit may employ a non-triangle prediction mode among inter prediction modes, and the second coding unit employs a triangle prediction mode. In this case, the first image block and the second image block may also be deblock filtered. This is not a particular limitation of the present application.
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-triangular prediction mode in the embodiment of the present application may adopt the above-mentioned forward prediction, may also adopt backward prediction, may also adopt bidirectional prediction, and 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).
In order to understand the scheme of the present application, a triangle prediction method and a storage method thereof are briefly introduced. 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. 5, 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. 5 (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. 5 (b), MV1 may be stored on the off-diagonal of the upper left corner and MV2 may be stored on the off-diagonal of 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 deblocking filtering the first image block and the second image block if the first coding unit adopts the triangle prediction mode and the first image block is located on a diagonal of the first coding unit includes:
and if the first coding unit adopts the triangle prediction mode and the second coding unit adopts the triangle prediction mode, and the first image block is positioned on the diagonal line of the first coding unit and/or the second image block is positioned on the diagonal line of the second coding unit, performing deblocking filtering on the first image block and the second image block.
In this embodiment of the present application, if the first coding unit and the second coding unit both use the triangle prediction mode, the deblocking filtering is performed on the first image block and the second image block if at least one of the first image block and the second image block is located on a diagonal of its corresponding coding unit.
It can be understood that it is assumed that the first coding unit and the second coding unit both adopt the triangle prediction mode, wherein the first coding unit is divided from the upper left corner to the lower right corner, and the second coding unit is divided from the upper right corner to the lower left corner. If the first image block is located at the lower right corner of the first coding unit and the second image block is located at the lower left corner of the second coding unit, in this case, 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 diagonal 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 triangles; and the second image block is located on the non-diagonal line of the second coding 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.
Therefore, in the case where the first coding unit and the second coding unit employ the triangle prediction mode, if the first image block is located on a diagonal of the first coding unit and/or the second image block is located on a diagonal of the second coding unit, the first image block and the second image block may be deblocking filtered.
It is noted that the division of the first coding unit may be performed from the upper left corner to the lower right corner, or may be performed from the lower left corner to the upper right corner, as shown in fig. 4. The corresponding first image blocks may be different for different division manners, which will be described in detail below.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from an upper left corner to a lower right corner, and the first image block is located at the upper left corner or the lower right corner of the first encoding unit.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from an upper right corner to a lower left corner, and the first image block is located at the upper right corner or the lower left corner of the first encoding unit.
In the embodiment of the present application, as shown in fig. 6a, the first encoding unit is divided from a diagonal line from an upper left corner to a lower right corner, so that the first image block may be 6-1, and the second image block may be 6-2; as shown in fig. 6b, the first coding unit is divided by a diagonal line from the upper right corner to the lower left corner, and the first image block may be 6-3 and the second image block may be 6-4.
For ease of understanding, the scheme of the embodiments of the present application is specifically described with reference to fig. 6 a. As shown in fig. 6a, 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, assume MVP1 and MVP2 are from two different reference frame lists and that the diagonal store is a double MV. For block 6-1 (the image block located at the lower right corner of the triangular prediction diagonal) and block 6-2 (the image block located at the lower left corner of the non-triangular prediction) in fig. 6a, in combination with the above-mentioned condition for calculating the boundary filtering strength, assuming that block 6-1 and block 6-2 in fig. 6a 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 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.
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) otherwise, (only for luma components, or for luma and chroma components) if P or Q is triangle prediction mode, and P, Q is located in two different CUs, and (is bottom-top left-top right (BL-TR) prediction mode (graphics is shown on the left side of fig. 4), and P or Q is located in the top left corner or bottom right corner of CU) or is top-bottom left-bottom right (TL-BR) prediction mode (graphics is shown on the right side of fig. 4), and P or Q is located in the top right corner or bottom left corner of CU), BS ═ 1 (also BS ═ 2);
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 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, and the first image block is located on the diagonal line of P, that is, "if P or Q is a triangle prediction mode, and P, Q is located in two different CUs and is a BL-TR prediction mode (as shown in the left side of fig. 4), and P or Q is located in the upper left corner or the lower right corner of the CU", so that condition 7) is satisfied, 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 the diagonal of the triangle 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.
As shown in fig. 7, in another embodiment, it is assumed that MVP1 and MVP2 are from the same reference frame list, and that stored diagonally is MVP 2. For block 7-1 in fig. 7 (the image block located at the lower right corner on the diagonal of the triangular prediction) and block 7-2 (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 block 7-1 and block 7-2 in fig. 7 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 using MVP1 and MVP2 and then weighted-averaged after each reconstructed block, and Q is predicted using MVQ, there may be a blocking effect between P and Q.
Based on the above rule two, it is assumed that neither P nor Q satisfies condition 1) -condition 6), it is determined whether condition 7) is satisfied, in this application, since P and Q are from different CUs, and P adopts a triangle prediction mode, and the first image block is located on the diagonal line of P, that is, condition 7) is satisfied, "if P or Q is a triangle prediction mode, and P, Q is located in two different CUs and is a BL-TR prediction mode (as shown in the left side of fig. 4), and P or Q is located in the upper left corner or the lower right corner of CU", BS is 1 or BS is 2, and further P and Q may be deblock filtered.
It should be understood that, in the embodiment of the present application, when the condition 7) is satisfied, the BS may be set to 1 or 2, or may be set to other values capable of performing filtering, so that the deblocking filtering may be performed on P and Q, which is not specifically 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 the triangle prediction mode and the first image block is located on a diagonal of the first coding unit includes: and for a brightness mode, if the first coding unit adopts a triangle prediction mode and the first image block is positioned on a diagonal line of the first coding unit, 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 triangle prediction mode and the first image block is located on the diagonal line of the first encoding unit, the deblocking filtering is performed on the first image block and the second image block.
Optionally, in some embodiments, the deblocking filtering the first image block and the second image block if the first coding unit adopts the triangle prediction mode and the first image block is located on a diagonal of the first coding unit includes: and for a luminance mode and a chrominance mode, if the first coding unit adopts a triangular prediction mode and the first image block is located on a diagonal line of the first coding unit, 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 triangle prediction mode, and the first image block is located on a diagonal line of the first encoding unit, 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 the triangle prediction mode and the first 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 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 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 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 strongly filtering the first image block and the second image block includes: 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.
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 the boundary of the connected blocks and pixels having a certain distance from the boundary.
Optionally, in some embodiments, if the first coding unit adopts the triangle prediction mode and the first image block is located on a diagonal of the first coding unit, deblocking filtering the first image block and the second image block, including: and if the first coding unit and the second coding unit use an inter prediction mode, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts a triangle prediction mode and the first image block is located on a diagonal line of the first coding unit. In this case, condition 7 in the above rule two is located between condition 6 and condition 8.
In the embodiment of the present application, if the first image block or the second image block is an intra-frame predicted adjacent block, according to rule one, 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; 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 both the first image block and the second image block are predicted using the inter prediction mode, assuming that the first image block and the second image block do not satisfy condition 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 can be made based on rule two, 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 triangle prediction mode, and P, Q is located in two different CUs, and is the BL-TR prediction mode (as the figure is shown on the left side of fig. 4), and P or Q is located in the upper left corner or the lower right corner of the CU" is satisfied, the first image block and the second image block can be deblock filtered, thereby improving the main visual quality of the compressed video.
Optionally, in some embodiments, if the first coding unit adopts the triangle prediction mode and the first image block is located on a diagonal of the first coding unit, deblocking filtering the first image block and the second image block, including: 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 a triangular prediction mode and the first image block is located on the diagonal line of the first coding unit. In this case, condition 7 in the above rule two is located between condition 5 and condition 6.
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 and second image blocks 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 triangle prediction mode, and P, Q is located on two different CUs, and is the BL-TR prediction mode (as shown in the left side of fig. 4), and P or Q is located in the upper left corner or the lower right corner of the CU", 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 triangle prediction mode, and the first image block is located on the diagonal of the first coding unit, and condition 7 in rule two is satisfied, the first image block and the second image block may be deblock filtered.
Fig. 8 is a schematic diagram of another video coding and decoding method 800 according to an embodiment of the present application, as shown in fig. 8, the method 800 may include steps 810 and 820.
And 810, 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.
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.
820, if the 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 the transform coefficients of the 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. 9.
As shown in fig. 9, 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 9-1 and 9-2 in FIG. 9, block 9-1 is denoted as P and block 9-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. 4, the division of the first coding unit may be performed in a manner from the top left corner to the bottom right corner of the quadrangle, as shown in the left graph shown in fig. 4, or may be performed in a manner from the bottom left corner to the top right corner of the quadrangle, as shown in the right graph shown in fig. 4.
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. 4 or the right image as shown in fig. 4, 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. 10 is a schematic diagram of another video coding and decoding method 1000 provided in the embodiment of the present application, and as shown in fig. 10, the method 1000 may include steps 1010 to 1020.
And 1010, 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.
And 1020, 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. 4, the division of the first coding unit may be performed in a manner from the top left corner to the bottom right corner of the quadrangle, as shown in the left graph shown in fig. 4, or may be performed in a manner from the bottom left corner to the top right corner of the quadrangle, as shown in the right graph shown in fig. 4.
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. 4 or the right image as shown in fig. 4, 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. 11 is a schematic diagram of another video coding and decoding method 1100 according to an embodiment of the present application, as shown in fig. 11, the method 1100 may include steps 1110 and 1120.
1110, obtaining 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.
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.
1120, 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. 12. The first image block is P in fig. 12, and the second image block is Q in fig. 12. 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. 12 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. 12.
Using different weights for different CUs may introduce blocking artifacts. For example, as shown in fig. 12, 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. 12, 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 the boundary of the connected blocks 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 12, and the apparatus embodiment of the present application is described below with reference to fig. 13 to 18, and the apparatus embodiment and the method embodiment correspond to each other, so that the parts not described in detail can be referred to the method embodiments of the previous parts.
Fig. 13 is a codec device 1300 according to an embodiment of the present application, where the codec device 1300 may include a processor 1310.
A processor 1310, the processor 1310 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 blocks; and if the first coding unit adopts a triangle prediction mode and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1310 is further configured to: and if the first coding unit adopts a triangular prediction mode, the second coding unit adopts a non-triangular prediction mode in an inter-frame prediction mode, and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block, wherein the inter-frame prediction mode comprises the triangular prediction mode.
Optionally, in some embodiments, the processor 1310 is further configured to: and if the first coding unit adopts the triangle prediction mode and the second coding unit adopts the triangle prediction mode, and the first image block is positioned on the diagonal line of the first coding unit and/or the second image block is positioned on the diagonal line of the second coding unit, performing 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 an upper left corner to a lower right corner, and the first image block is located at the upper left corner or the lower right corner of the first encoding unit.
Optionally, in some embodiments, the first encoding unit is divided by a diagonal line from an upper right corner to a lower left corner, and the first image block is located at the upper right corner or the lower left corner of the first encoding unit.
Optionally, in some embodiments, the processor 1310 is further configured to: and for a brightness mode, if the first coding unit adopts a triangle prediction mode and the first image block is positioned on a diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1310 is further configured to: and for a luminance mode and a chrominance mode, if the first coding unit adopts a triangular prediction mode and the first image block is located on a diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
Optionally, in some embodiments, the processor 1310 is further configured to: and if the first coding unit adopts a triangle prediction mode and the first 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 1 or 2.
Optionally, in some embodiments, the processor 1310 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 1310 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.
Optionally, in some embodiments, the processor 1310 is further configured to: and if the first coding unit and the second coding unit use an inter prediction mode, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts a triangle prediction mode and the first image block is located on a diagonal line of the first coding unit.
Optionally, in some embodiments, the processor 1310 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 a triangular prediction mode and the first image block is located on the diagonal line of the first coding unit.
Fig. 14 is a codec 1400 according to another embodiment of the present disclosure, where the codec 1400 may include a processor 1410.
A processor 1410, the processor 1410 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 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 1410 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 1410 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 1410 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 1410 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. 15 is a codec 1500 according to yet another embodiment of the present disclosure, where the codec 1500 may include a processor 1510.
A processor 1510, the processor 1510 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 1510 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 1510 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 1510 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. 16 is a codec 1600 according to still another embodiment of the present application, where the codec 1600 may include a processor 1610.
A processor 1610, said processor 1610 configured 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 1610 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 1610 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 1610 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 1610 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 1610 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. 17 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 1700 shown in fig. 17 includes a processor 1710, and the processor 1710 can call and run a computer program from a memory to implement the method described in fig. 3 to fig. 12 in the embodiment of the present application.
Optionally, as shown in fig. 17, the video codec apparatus 1700 may further include a memory 1720. From the memory 1720, the processor 1710 can call and run a computer program to implement the method in the embodiment of the present application.
The memory 1720 may be a separate device from the processor 1710 or may be integrated within the processor 1710.
Optionally, as shown in fig. 17, the video codec apparatus 1700 may further include a transceiver 1730, and the processor 1710 may control the transceiver 1730 to communicate with other apparatuses, and in particular, may transmit information or data to or receive information or data transmitted by other apparatuses.
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. 18 is a schematic structural diagram of a chip of an embodiment of the present application. The chip 1800 shown in fig. 18 includes a processor 1810, and the processor 1810 can call and run a computer program from a memory to implement the method in the embodiment of the present application.
Optionally, as shown in fig. 18, the chip 1800 may also include a memory 1818. From the memory 1818, the processor 1810 may call and run a computer program to implement the method in the embodiment of the present application.
The memory 1818 may be a separate device from the processor 1810 or may be integrated into the processor 1810.
Optionally, the chip 1800 may also include an input interface 1830. The processor 1810 may control the input interface 1830 to communicate with other devices or chips, and in particular, to obtain information or data transmitted by the other devices or chips.
Optionally, the chip 1800 may also include an output interface 1840. The processor 1810 may control the output interface 1840 to communicate with other devices or chips, and in particular, may 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 (68)

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 triangle prediction mode and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
2. The method of claim 1, wherein deblocking filtering the first block and the second block if the first coding unit employs a triangle prediction mode and the first block is located on a diagonal of the first coding unit comprises:
and if the first coding unit adopts a triangular prediction mode, the second coding unit adopts a non-triangular prediction mode in an inter-frame prediction mode, and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block, wherein the inter-frame prediction mode comprises the triangular prediction mode.
3. The method of claim 1, wherein deblocking filtering the first block and the second block if the first coding unit employs a triangle prediction mode and the first block is located on a diagonal of the first coding unit comprises:
and if the first coding unit adopts the triangle prediction mode and the second coding unit adopts the triangle prediction mode, and the first image block is positioned on the diagonal line of the first coding unit and/or the second image block is positioned on the diagonal line of the second coding unit, performing deblocking filtering on the first image block and the second image block.
4. The method according to any of claims 1-3, wherein the first coding unit is divided by a diagonal line from an upper left corner to a lower right corner, and wherein the first image block is located at the upper left corner or the lower right corner of the first coding unit.
5. The method according to any of claims 1-3, wherein the first coding unit is divided by a diagonal line from an upper right corner to a lower left corner, and wherein the first image block is located at the upper right corner or the lower left corner of the first coding unit.
6. The method according to any of claims 1-5, wherein said deblocking filtering said first image block and said second image block if said first coding unit employs triangle prediction mode and said first image block is located on a diagonal of said first coding unit, comprises:
and for a brightness mode, if the first coding unit adopts a triangle prediction mode and the first image block is positioned on a diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
7. The method according to any of claims 1-5, wherein said deblocking filtering said first image block and said second image block if said first coding unit employs triangle prediction mode and said first image block is located on a diagonal of said first coding unit, comprises:
and for a luminance mode and a chrominance mode, if the first coding unit adopts a triangular prediction mode and the first image block is located on a diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
8. The method according to any of claims 1-7, wherein said deblocking filtering said first image block and said second image block if said first coding unit employs triangle prediction mode and said first image block is located on a diagonal of said first coding unit, comprises:
and if the first coding unit adopts a triangle prediction mode and the first 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 1 or 2.
9. The method of claim 8, wherein deblocking filtering the first tile and the second tile comprises:
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.
10. The method of claim 8, wherein the strongly filtering the first tile and the second tile comprises:
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.
11. The method according to any of claims 1-10, wherein deblocking filtering the first image block and the second image block if the first coding unit employs a triangle prediction mode and the first image block is located on a diagonal of the first coding unit comprises:
and if the first coding unit and the second coding unit use an inter prediction mode, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts a triangle prediction mode and the first image block is located on a diagonal line of the first coding unit.
12. The method according to any of claims 1-10, wherein deblocking filtering the first image block and the second image block if the first coding unit employs a triangle prediction mode and the first image block is located on a diagonal of the first coding unit 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 a triangular prediction mode and the first image block is located on the diagonal line of the first coding unit.
13. A method of video encoding and decoding, comprising:
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.
14. The method of claim 13, wherein 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, 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 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.
15. The method according to claim 13 or 14, wherein 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 or the second image block is located on the diagonal line of the first coding unit.
16. The method according to claim 13 or 14, wherein the first coding unit is divided by a diagonal line from the top right corner to the bottom left corner, and the first image block or the second image block is located on the diagonal line of the first coding unit.
17. The method according to any of claims 13 to 16, wherein 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 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, setting the boundary filtering strength BS value of the first image block and the second image block to 0.
18. The method according to any of claims 13 to 16, wherein 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 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.
19. The method according to any of claims 13 to 16, wherein 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:
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.
20. A method of video encoding and decoding, comprising:
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.
21. The method of claim 20, wherein the first coding unit is divided by a diagonal line from a top left corner to a bottom right corner, and wherein the first image block or the second image block is located on the diagonal line of the first coding unit.
22. The method of claim 20, wherein the first coding unit is divided by a diagonal line from a top right corner to a bottom left corner, and wherein the first image block or the second image block is located on the diagonal line of the first coding unit.
23. The method of any of claims 20-22, wherein the determining not to deblock filter the first tile and the second tile if the first coding unit employs a triangle prediction mode and the first tile or the second tile is located on a diagonal of the first coding unit comprises:
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.
24. The method of any of claims 20-22, wherein the determining not to deblock filter the first tile and the second tile if the first coding unit employs a triangle prediction mode and the first tile or the second tile is located on a diagonal of the first coding unit comprises:
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.
25. The method of any of claims 20-22, wherein the determining not to deblock filter the first tile and the second tile if the first coding unit employs a triangle prediction mode and the first tile or the second tile is located on a diagonal of the first coding unit comprises:
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.
26. 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 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.
27. The method of claim 26, wherein the first image block uses different weights for bi-directional weighted prediction than the second image block uses for bi-directional weighted prediction, comprising:
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.
28. The method of claim 26, wherein the first image block uses different weights for bi-directional weighted prediction than the second image block uses for bi-directional weighted prediction, comprising:
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.
29. The method according to any of claims 26 to 28, wherein the deblocking filtering 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 a weight used by the first image block in the bidirectional weighted prediction is different from a weight used by the second image block in the bidirectional weighted prediction, comprises:
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.
30. The method according to any of claims 26 to 28, wherein the deblocking filtering 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 a weight used by the first image block in the bidirectional weighted prediction is different from a weight used by the second image block in the bidirectional weighted prediction, comprises:
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.
31. The method according to any of claims 26 to 30, wherein the 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 a weight used by the first image block in the bidirectional weighted prediction is different from a weight used by the second image block in the bidirectional weighted prediction mode comprises:
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.
32. The method of claim 31, wherein deblocking filtering the first image block and the second image block 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.
33. The method of claim 31, wherein the strongly filtering the first image block and the second image block 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.
34. An apparatus for video encoding and decoding, comprising:
a processor 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 blocks;
and if the first coding unit adopts a triangle prediction mode and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
35. The apparatus of claim 34, wherein the processor is further configured to:
and if the first coding unit adopts a triangular prediction mode, the second coding unit adopts a non-triangular prediction mode in an inter-frame prediction mode, and the first image block is positioned on the diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block, wherein the inter-frame prediction mode comprises the triangular prediction mode.
36. The apparatus of claim 34, wherein the processor is further configured to:
and if the first coding unit adopts the triangle prediction mode and the second coding unit adopts the triangle prediction mode, and the first image block is positioned on the diagonal line of the first coding unit and/or the second image block is positioned on the diagonal line of the second coding unit, performing deblocking filtering on the first image block and the second image block.
37. The apparatus according to any of claims 34-36, wherein the first coding unit is divided by a diagonal line from top left corner to bottom right corner, and the first image block is located at top left corner or bottom right corner of the first coding unit.
38. The apparatus according to any of claims 34-36, wherein the first coding unit is divided by a diagonal line from an upper right corner to a lower left corner, and the first image block is located at the upper right corner or the lower left corner of the first coding unit.
39. The apparatus of any of claims 34 to 38, wherein the processor is further configured to:
and for a brightness mode, if the first coding unit adopts a triangle prediction mode and the first image block is positioned on a diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
40. The apparatus of any of claims 34 to 38, wherein the processor is further configured to:
and for a luminance mode and a chrominance mode, if the first coding unit adopts a triangular prediction mode and the first image block is located on a diagonal line of the first coding unit, performing deblocking filtering on the first image block and the second image block.
41. The apparatus of any of claims 34 to 40, wherein the processor is further configured to:
and if the first coding unit adopts a triangle prediction mode and the first 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 1 or 2.
42. The apparatus of claim 41, wherein the processor 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.
43. The apparatus of claim 41, wherein the processor 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.
44. The apparatus of any one of claims 34 to 43, wherein the processor is further configured to:
and if the first coding unit and the second coding unit use an inter prediction mode, performing deblocking filtering on the first image block and the second image block if the first coding unit adopts a triangle prediction mode and the first image block is located on a diagonal line of the first coding unit.
45. The apparatus of any one of claims 34 to 43, 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 a triangular prediction mode and the first image block is located on the diagonal line of the first coding unit.
46. An apparatus for video encoding and decoding, comprising:
a processor 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.
47. The apparatus of claim 46, wherein the processor 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.
48. The apparatus of claim 46 or 47, wherein the first coding unit is divided by a diagonal line from the top left corner to the bottom right corner, and wherein the first image block or the second image block is located on the diagonal line of the first coding unit.
49. The apparatus of claim 46 or 47, wherein the first coding unit is divided by a diagonal line from a top right corner to a bottom left corner, and wherein the first image block or the second image block is located on the diagonal line of the first coding unit.
50. The apparatus of any one of claims 46 to 49, wherein the processor is further configured to:
and if 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, setting the boundary filtering strength BS value of the first image block and the second image block to 0.
51. The apparatus of any one of claims 46 to 49, wherein the processor 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.
52. The apparatus of any one of claims 46 to 49, wherein the processor is 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.
53. An apparatus for video encoding and decoding, comprising:
a processor 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.
54. The apparatus of claim 53, wherein the first coding unit is divided by a diagonal line from a top left corner to a bottom right corner, and wherein the first image block or the second image block is located on the diagonal line of the first coding unit.
55. The apparatus of claim 53, wherein the first coding unit is divided by a diagonal line from a top right corner to a bottom left corner, and wherein the first image block or the second image block is located on the diagonal line of the first coding unit.
56. The apparatus of any one of claims 53 to 55, wherein the processor 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.
57. The apparatus of any one of claims 53 to 55, wherein the processor 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.
58. The apparatus of any one of claims 53 to 55, wherein the processor 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.
59. An apparatus for video encoding and decoding, comprising:
a processor 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.
60. The apparatus of claim 59, wherein the weights used for the bi-directional weighted prediction for the first image block are different from the weights used for the bi-directional weighted prediction for the second image block, comprising:
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.
61. The apparatus of claim 59, wherein the weights used for the bi-directional weighted prediction for the first image block are different from the weights used for the bi-directional weighted prediction for the second image block, comprising:
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.
62. The apparatus of claim 59, wherein the processor 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 for a brightness mode.
63. The apparatus of claim 59, wherein the processor 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.
64. The apparatus of any one of claims 59 to 63, wherein the processor 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.
65. The apparatus of claim 64, wherein the processor 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.
66. The apparatus of claim 64, wherein the processor 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.
67. 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 33.
68. A computer-readable storage medium comprising instructions for performing the coding method of any one of claims 1 to 33.
CN201980029796.4A 2019-09-24 2019-09-24 Video coding and decoding method and device Pending CN112136329A (en)

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN112136329A true CN112136329A (en) 2020-12-25

Family

ID=73849774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980029796.4A Pending CN112136329A (en) 2019-09-24 2019-09-24 Video coding and decoding method and device

Country Status (2)

Country Link
CN (1) CN112136329A (en)
WO (2) WO2021056219A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130101024A1 (en) * 2011-10-25 2013-04-25 Qualcomm Incorporated Determining boundary strength values for deblocking filtering for video coding
CN103220529A (en) * 2013-04-15 2013-07-24 北京大学 Method for achieving video coding and decoding loop filtering
CN104067245A (en) * 2012-08-03 2014-09-24 联发科技股份有限公司 Video processing system with shared/configurable in-loop filter data buffer architecture and related video processing method thereof
US20180077414A1 (en) * 2016-09-14 2018-03-15 Microsoft Technology Licensing,Llc Boundary-intersection-based deblock filtering
WO2019039323A1 (en) * 2017-08-22 2019-02-28 Panasonic Intellectual Property Corporation Of America Image encoder, image decoder, image encoding method, and image decoding method
CN110063056A (en) * 2016-12-07 2019-07-26 株式会社Kt Method and apparatus for handling vision signal

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101457396B1 (en) * 2010-01-14 2014-11-03 삼성전자주식회사 Method and apparatus for video encoding using deblocking filtering, and method and apparatus for video decoding using the same
JP2013524730A (en) * 2010-04-12 2013-06-17 クゥアルコム・インコーポレイテッド Fixed point implementation for geometric motion segmentation
JP2012019490A (en) * 2010-07-09 2012-01-26 Sony Corp Image processing device and image processing method
JP2015173312A (en) * 2014-03-11 2015-10-01 ソニー株式会社 Image encoding device and method, and image decoding device and method
US10432961B2 (en) * 2015-03-10 2019-10-01 Apple Inc. Video encoding optimization of extended spaces including last stage processes
EP3451668A4 (en) * 2016-04-26 2020-04-15 Intellectual Discovery Co., Ltd. Method and device for encoding/decoding image
WO2017204532A1 (en) * 2016-05-24 2017-11-30 한국전자통신연구원 Image encoding/decoding method and recording medium for same
KR20180082330A (en) * 2017-01-09 2018-07-18 에스케이텔레콤 주식회사 Apparatus and Method for Video Encoding or Decoding
US10708591B2 (en) * 2017-03-20 2020-07-07 Qualcomm Incorporated Enhanced deblocking filtering design in video coding

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130101024A1 (en) * 2011-10-25 2013-04-25 Qualcomm Incorporated Determining boundary strength values for deblocking filtering for video coding
CN104067245A (en) * 2012-08-03 2014-09-24 联发科技股份有限公司 Video processing system with shared/configurable in-loop filter data buffer architecture and related video processing method thereof
CN103220529A (en) * 2013-04-15 2013-07-24 北京大学 Method for achieving video coding and decoding loop filtering
US20180077414A1 (en) * 2016-09-14 2018-03-15 Microsoft Technology Licensing,Llc Boundary-intersection-based deblock filtering
CN110063056A (en) * 2016-12-07 2019-07-26 株式会社Kt Method and apparatus for handling vision signal
WO2019039323A1 (en) * 2017-08-22 2019-02-28 Panasonic Intellectual Property Corporation Of America Image encoder, image decoder, image encoding method, and image decoding method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
K. REUZÉ; C.-C CHEN; W.-J. CHIEN; H. HUANG; M. KARCZEWICZ: "Non-CE4: Simplification of bi-prediction MV generation for triangle partition mode storage", 《JVET-O0411》 *

Also Published As

Publication number Publication date
WO2021056219A1 (en) 2021-04-01
WO2021056920A1 (en) 2021-04-01

Similar Documents

Publication Publication Date Title
EP3459245B1 (en) Confusion of multiple filters in adaptive loop filtering in video coding
US20220141462A1 (en) Apparatus and method for applying artificial neural network to image encoding or decoding
CN114363612B (en) Method and apparatus for bit width control of bi-directional optical flow
WO2017084577A1 (en) Method and apparatus for intra prediction mode using intra prediction filter in video and image compression
KR20240068078A (en) Method and apparatus for filtering with mode-aware deep learning
US11375199B2 (en) Interpolation filter for an inter prediction apparatus and method for video coding
US10412402B2 (en) Method and apparatus of intra prediction in video coding
EP3884667B1 (en) Video coding with triangular shape prediction units
CN113228638B (en) Method and apparatus for conditionally encoding or decoding video blocks in block partitioning
JP7351908B2 (en) Encoder, decoder, and corresponding method of deblocking filter adaptation
CN116800959B (en) Method, apparatus and storage medium for video encoding
CN114009033A (en) Method and apparatus for signaling symmetric motion vector difference mode
CN112514390B (en) Video coding method and device
CN114128263A (en) Method and apparatus for adaptive motion vector resolution in video coding and decoding
EP3942824A1 (en) Methods and apparatuses for prediction refinement with optical flow
CN112534824B (en) Method and apparatus for video encoding
CN112136329A (en) Video coding and decoding method and device
CN112204986A (en) Video coding and decoding method and device
CN112544079A (en) Video coding and decoding method and device
WO2024016955A1 (en) Out-of-boundary check in video coding
CN112970252A (en) Video coding and decoding method and device
CN114080807A (en) Method and device for video coding and decoding by utilizing triangular partition
CN113841406A (en) Method and apparatus for video coding and decoding using triangle partitioning
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: 20201225