CN111405277B - Inter-frame prediction method and device and corresponding encoder and decoder - Google Patents

Inter-frame prediction method and device and corresponding encoder and decoder Download PDF

Info

Publication number
CN111405277B
CN111405277B CN201910017363.9A CN201910017363A CN111405277B CN 111405277 B CN111405277 B CN 111405277B CN 201910017363 A CN201910017363 A CN 201910017363A CN 111405277 B CN111405277 B CN 111405277B
Authority
CN
China
Prior art keywords
prediction
vpdu
boundary
matrix
region
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.)
Active
Application number
CN201910017363.9A
Other languages
Chinese (zh)
Other versions
CN111405277A (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN111405277A publication Critical patent/CN111405277A/en
Application granted granted Critical
Publication of CN111405277B publication Critical patent/CN111405277B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/103Selection of coding mode or of prediction mode
    • 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/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • 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/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Abstract

The application discloses an inter-frame prediction method, an inter-frame prediction device and corresponding encoders and decoders, wherein the method comprises the following steps: acquiring a current image block, wherein the current image block comprises at least one Virtual Pipeline Data Unit (VPDU), and the VPDU comprises a first area and a second area; carrying out optical flow technology BIO processing based on bidirectional prediction on a first area of the VPDU to obtain modified motion vectors of one or more basic prediction units in the first area, and obtaining a prediction value of a corresponding basic prediction unit according to the modified motion vectors; and carrying out non-BIO processing on a second area of the VPDU to obtain a predicted value of one or more basic prediction units in the second area. When the method and the device are implemented to encode or decode the image block by adopting a fusion scheme of a bidirectional prediction based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), the implementation complexity can be reduced.

Description

Inter-frame prediction method and device and corresponding encoder and decoder
Technical Field
The present application relates to the field of video encoding and decoding, and in particular, to an inter-frame prediction method and apparatus, and a corresponding encoder and decoder.
Background
Digital video capabilities can be incorporated into a wide variety of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, Personal Digital Assistants (PDAs), laptop or desktop computers, tablet computers, electronic book readers, digital cameras, digital recording devices, digital media players, video gaming devices, video gaming consoles, cellular or satellite radio telephones (so-called "smart phones"), video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video compression techniques, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4 part 10 Advanced Video Coding (AVC), the video coding standard H.265/High Efficiency Video Coding (HEVC), and extensions of such standards. Video devices may transmit, receive, encode, decode, and/or store digital video information more efficiently by implementing such video compression techniques.
Video compression techniques perform spatial (intra-picture) prediction and/or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (i.e., a video frame or a portion of a video frame) may be partitioned into tiles, which may also be referred to as treeblocks, Coding Units (CUs), and/or coding nodes. An image block in a to-be-intra-coded (I) strip of an image is encoded using spatial prediction with respect to reference samples in neighboring blocks in the same image. An image block in a to-be-inter-coded (P or B) slice of an image may use spatial prediction with respect to reference samples in neighboring blocks in the same image or temporal prediction with respect to reference samples in other reference images. A picture may be referred to as a frame and a reference picture may be referred to as a reference frame.
In the prior art, when a fusion scheme of bi-directional prediction based optical flow technology (BIO) and Virtual Pipeline Data Unit (VPDU) is adopted to perform encoding or decoding processing (e.g., prediction) on an image block (e.g., CU), when the CU includes a plurality of VPDUs, the way of performing BIO processing on each VPDU refers to the existing way of performing BIO processing on the CU, for example, sampling and filling of pixel values are involved in the BIO processing process of each VPDU (as shown in fig. 9), thereby increasing the complexity of implementation.
Disclosure of Invention
The embodiment of the application provides an inter-frame prediction method and device, and a corresponding encoder and decoder, which can reduce implementation complexity when encoding or decoding an image block by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU).
In a first aspect, an embodiment of the present application provides an inter-frame prediction method, including: obtaining a current image block (e.g., a current CU), wherein the current image block includes at least one VPDU, the current image block may also include at least two VPDUs, and the VPDU includes a first area and a second area, the first area includes one or more basic prediction units, the second area includes one or more basic prediction units, and the size of the basic prediction unit is 4 × 4; performing BIO processing on a first region of the VPDU to obtain one or more basic prediction units in the first region, for example, each basic prediction unit and respective modified motion vector, and obtaining a prediction value of the corresponding basic prediction unit according to the modified motion vector; and carrying out non-BIO processing on the second area of the VPDU to obtain a predicted value of one or more basic prediction units in the second area, for example, each basic prediction unit. It should be understood that the inter prediction method of the present application can be used in both the process of encoding an image block and the process of decoding an image block.
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme of a bidirectional prediction based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, only the first region in the VPDU is subjected to BIO processing, instead of performing BIO processing on all regions in the VPDU in the prior art, which reduces the number of basic prediction units for performing BIO processing in the VPDU, thereby reducing implementation complexity without affecting encoding and decoding performance.
In a possible implementation manner of the first aspect, the second region is a pixel region where a column or a row of basic prediction units in the VPDU are located adjacent to a boundary, where the boundary includes one or more of a first boundary and a second boundary, where the first boundary is a VPDU boundary that is not overlapped with a third boundary; the second boundary is a VPDU boundary coincident with a third boundary; the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs; the third boundary is a boundary between the current image block and an adjacent image block, such as a CU boundary, i.e., a boundary between CUs and CUs; the first region is a region in the VPDU to be processed except the second region. In an embodiment of the present application, the second region includes basic prediction units (4 × 4 sub-blocks) adjacent to a boundary in the VPDU; or, the second region is a pixel region where a basic prediction unit adjacent to a boundary in the VPDU is located; alternatively, the second region covers basic prediction units (4 × 4 sub-blocks) adjacent to a boundary in the VPDU.
According to the embodiment of the application, various boundaries are distinguished according to a current image block and a VPDU (virtual private channel) therein, four boundaries of the current image block are third boundaries, a first boundary is a boundary which is not overlapped with the third boundary in the four boundaries of the VPDU, a second boundary is a boundary which is overlapped with the third boundary in the four boundaries of the VPDU, and on the basis, a second area in the VPDU has multiple conditions: one is the area of pixels in the VPDU where a column or row of basic prediction units is located adjacent to the first and second boundaries. The other is a pixel area where only one column or one row of basic prediction units adjacent to the first boundary in the VPDU is located, which can be divided into two cases, that is, a pixel area where one column or one row of basic prediction units adjacent to two mutually perpendicular first boundaries in the VPDU is located, and a pixel area where one column or one row of basic prediction units adjacent to one first boundary in the VPDU is located. The first region in the VPDU is a region other than the second region in the VPDU to be processed, and thus the first region may correspond to the second region in various cases: one is the pixel area in the VPDU except for the pixel areas where a column or a row of basic prediction units adjacent to the four boundaries are located. The other is the pixel area except the pixel area where the column or row of basic prediction units adjacent to the two mutually perpendicular first boundaries are located in the VPDU. Yet another is the pixel area in the VPDU except for the pixel areas where a column or a row of basic prediction units adjacent to a first boundary is located. In addition to this, the first region may be all pixel regions in the VPDU.
In a possible implementation manner of the first aspect, the obtaining modified motion vectors of one or more basic prediction units in the first region by performing BIO processing on the first region of the VPDU includes: and acquiring a predictive value matrix according to the motion information of the current image block, wherein the predictive value matrix corresponds to the VPDU, and the size of the predictive value matrix is larger than or equal to that of the VPDU. Based on the principle of BIO, to obtain a predicted value in a first region, it needs to be expanded outward based on the size of the first region to obtain a predicted value matrix corresponding to a larger region, and in the embodiment of the present application, based on the above-mentioned multiple cases of the first region and the second region, it is determined at which boundary or boundaries (not all boundaries of the VPDU) the predicted value matrix needs to be expanded outward according to the position of the first region when obtaining the predicted value matrix corresponding to the VPDU, or it is determined that the predicted value matrix does not need to be expanded outward at any boundary of the VPDU, so the size of the predicted value matrix is greater than or equal to the size of the VPDU; and calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than that of the first area. Similarly, based on the principle of BIO, when the predicted value in the first area is to be obtained, the horizontal prediction gradient matrix and the vertical prediction gradient matrix of the area also need to be expanded outward based on the size of the first area when the horizontal prediction gradient matrix and the vertical prediction gradient matrix of the area are calculated, and the horizontal prediction gradient matrix and the vertical prediction gradient matrix corresponding to a larger area are obtained, in the embodiment of the present application, which boundary or boundaries (not all boundaries of the first area) of the first area need to be expanded outward is determined according to the position of the first area, or it is determined that the horizontal prediction gradient matrix and the vertical prediction gradient matrix do not need to be expanded outward at any boundary of the first area, so the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first area; calculating a modified motion vector for one or more (e.g., each) basic prediction units in the first region based on the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix; and obtaining a predicted value of the corresponding basic prediction unit according to the corrected motion vector. In the embodiment of the present application, the size of the predictor matrix is greater than or equal to the size of the VPDU, and the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively greater than the size of the first region, where the greater size is understood to be greater in one direction (one dimension), for example, the W direction or the H direction, or may be understood to be greater in two directions (two dimensions), for example, the W direction and the H direction.
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme based on a bidirectional prediction optical flow technique (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, on the basis of reducing the number of basic prediction units for performing BIO processing in the VPDU, only the extension regions adjacent to three or less VPDU boundaries (not all boundaries of the current VPDU) of the current VPDU are subjected to pixel value sampling and padding during BIO processing, which not only is compatible with a BIO processing method, but also reduces the computation amount of pixel value sampling and padding during BIO processing, thereby further reducing the implementation complexity without affecting the coding and decoding performance.
In a possible implementation manner of the first aspect, when the second region is a pixel region where basic prediction units adjacent to the first boundary and the second boundary in the VPDU are located, the embodiment of the present application corresponds to a case where the first region is a pixel region except for a pixel region where a column or a row of basic prediction units adjacent to four boundaries in the VPDU are located, and the second region is a pixel region where a column or a row of basic prediction units adjacent to the first boundary and the second boundary in the VPDU are located. In this case, the prediction value matrix is represented by I (I, j), where I has a value range of [0, W-1], j has a value range of [0, H-1], and the horizontal prediction gradient matrix is represented by X (I, j), where I has a value range of [3, W-4], and j has a value range of [3, H-4 ]; the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU. It should be noted that the same coordinate system is adopted in the embodiments of the present application and all the embodiments described below, the coordinate system corresponds to the VPDU to be processed, and the position coordinate of the top left vertex of the VPDU to be processed is the origin of the coordinate system.
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme based on a bidirectional prediction optical flow technique (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, on the basis of reducing the number of basic prediction units for performing BIO processing in the VPDU, it is not necessary to sample and fill a pixel value in an extension area adjacent to a VPDU boundary of a current VPDU (that is, the prediction value matrix is directly determined by the whole current VPDU) in the BIO processing process, so that not only is the BIO processing method compatible, but also the computation amount of pixel value sampling and filling is greatly reduced, thereby further reducing the implementation complexity without affecting the coding and decoding performance.
In a possible implementation manner of the first aspect, when the second region is a pixel region in the VPDU adjacent to the first boundary, this embodiment of the present application corresponds to a case where the second region is a pixel region in the VPDU where only one column or one row of basic prediction units adjacent to the first boundary is located, and the first region is a region in the VPDU other than the second region. In this case, the prediction value matrix is represented by I (I, j), where I has a value range of [ W1, W2], j has a value range of [ H1, H2], where W1 is determined by LeftW, W2 is determined by the width W and RightW of the VPDU, H1 is determined by above H, and H2 is determined by the height H and BottomH of the VPDU; the horizontal prediction gradient matrix is represented by X (i, j), wherein i has a value range of [ W3, W4], j has a value range of [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by the height H of the VPDU and Bottomh; the vertical prediction gradient matrix is Y (i, j), wherein i has a value range of [ W5, W6], j has a value range of [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by the height H of the VPDU and Bottomh; LeftW represents a positional relationship between a basic prediction unit of the VPDU adjacent to a left boundary and one or more of the first boundary and the third boundary, RightW represents a positional relationship between a basic prediction unit of the VPDU adjacent to a right boundary and one or more of the first boundary and the third boundary, above represents a positional relationship between a basic prediction unit of the VPDU adjacent to an upper boundary and one or more of the first boundary and the third boundary, and bottom represents a positional relationship between a basic prediction unit of the VPDU adjacent to a lower boundary and one or more of the first boundary and the third boundary.
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme based on a bidirectional prediction optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, on the basis of reducing the number of basic prediction units for performing BIO processing in the VPDU, in the process of BIO processing, only pixel value sampling and filling are performed on extension areas adjacent to three, two, or one VPDU boundary (not all the current VPDU boundaries) of the current VPDU, so that not only is the BIO processing manner compatible, but also the amount of operations of pixel value sampling and filling in the process of BIO processing is reduced, thereby further reducing the implementation complexity without affecting the codec performance.
Optionally, LeftW may indicate a location relationship between the basic prediction unit adjacent to the left boundary in the VPDU or the left boundary and the first boundary and/or the third boundary, RightW indicates a location relationship between the basic prediction unit adjacent to the right boundary in the VPDU and the first boundary or/and the third boundary, above represents a location relationship between the basic prediction unit adjacent to the upper boundary in the VPDU and the first boundary or/and the third boundary, and bottom represents a location relationship between the basic prediction unit adjacent to the lower boundary in the VPDU and the first boundary or/and the third boundary.
In one possible embodiment of the first aspect, the W1 to W6 and the H1 to H6 are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)。
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)
in a possible implementation manner of the first aspect, when the second region is a pixel region in the VPDU adjacent to two mutually perpendicular first boundaries, or the second region is a pixel region in the VPDU adjacent to one first boundary, the embodiment of the present application corresponds to a case that the first region is a pixel region in the VPDU except for a pixel region where a column and a row of basic prediction units adjacent to the two mutually perpendicular first boundaries are located, or a case that the current image block includes two VPDUs, and the first region is a pixel region outside a pixel region where a column or a row of basic prediction units adjacent to one first boundary in the VPDU is located. In this case, if the left boundary of the VPDU is the second boundary, then LeftW is 1, otherwise LeftW is 0; if the right boundary of the VPDU is the second boundary, then the rightW is 1, otherwise the rightW is 0; if the upper boundary of the VPDU is the second boundary, the AboveH is 1, otherwise, the AboveH is 0; if the lower boundary of the VPDU is the second boundary, BottonH is 1, otherwise BottonH is 0.
In a possible implementation manner of the first aspect, when the second region is a pixel region in the VPDU adjacent to two or less first boundaries, the embodiment of the present application corresponds to a case where the first region is a pixel region in the VPDU except for a pixel region where a column or a row of basic prediction units adjacent to the two mutually perpendicular first boundaries are located, or a pixel region in the VPDU except for a pixel region where a column or a row of basic prediction units adjacent to one first boundary are located, or all pixel regions in the VPDU. In this case, if the left boundary of the VPDU is the second boundary, or if the basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise LeftW is 0. In other words, if the basic prediction unit adjacent to the left boundary in the VPDU is located to the left of the first boundary, then LeftW is 0, otherwise LeftW is 1; if the right boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0. In other words, if the basic prediction unit adjacent to the right boundary in the VPDU is located at the left of the first boundary, then RightW is 0, otherwise it is 1; if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0. In other words, if the basic prediction unit adjacent to the upper boundary in the VPDU is located above the first boundary, then the above is 0, otherwise the above is 1; if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0. In other words, if the basic prediction units in the VPDU adjacent to the lower boundary are above the first boundary, then BottonH is 0, otherwise BottonH is 1.
In a possible implementation of the first aspect, the method is used for bi-directional prediction (e.g. forward prediction and backward prediction); the motion information includes first motion information (e.g., forward motion information) corresponding to a first list of reference frames and second motion information (e.g., backward motion information) corresponding to a second list of reference frames; the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information; the horizontal prediction gradient matrix comprises a first horizontal prediction gradient matrix and a second horizontal prediction gradient matrix, the first horizontal prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second horizontal prediction gradient matrix is obtained through calculation according to the second prediction value matrix; the vertical prediction gradient matrix comprises a first vertical prediction gradient matrix and a second vertical prediction gradient matrix, the first vertical prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second vertical prediction gradient matrix is obtained through calculation according to the second prediction value matrix; the motion information correction amount includes a first motion information correction amount corresponding to a first reference frame list and a second motion information correction amount corresponding to a second reference frame list, the first motion information correction amount is calculated according to the first predictor matrix, the first horizontal prediction gradient matrix and the first vertical prediction gradient matrix, and the second motion information correction amount is calculated according to the second predictor matrix, the second horizontal prediction gradient matrix and the second vertical prediction gradient matrix. In the embodiment of the application, forward prediction and backward prediction are respectively performed on the current image block, and the corresponding prediction value matrix, horizontal prediction gradient matrix and vertical prediction gradient matrix obtained in the BIO processing process all include a forward matrix and a backward matrix, so that the calculated motion information correction quantity also includes a forward motion information correction quantity and a backward motion information correction quantity.
In a possible implementation manner of the first aspect, before the calculating the modified motion vector of the one or more basic prediction units in the first region according to the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix, the method further includes: judging whether the difference between a first predicted value and a second predicted value of each basic prediction unit in the first area is larger than a second preset threshold value, wherein the first predicted value is a pixel value corresponding to the basic prediction unit in the first predicted value matrix, and the second predicted value is a pixel value corresponding to the basic prediction unit in the second predicted value matrix; the calculating modified motion vectors of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix comprises: and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
It can be seen that, when an image block is encoded or decoded by using a fusion scheme based on a bidirectional prediction optical flow technique (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, on the basis of reducing the number of basic prediction units performing BIO processing in the VPDU, a modified motion vector is calculated only for the basic prediction unit in the first area where a difference between a first prediction value and a second prediction value is greater than a second preset threshold, so that an amount of computation for modifying the motion vector in the first area is further reduced, and complexity of implementation is further reduced.
In a possible implementation manner of the first aspect, the performing non-BIO processing on the second region of the VPDU to obtain a prediction value of one or more basic prediction units in the second region includes: acquiring a predicted value matrix according to the motion information of the current image block; and calculating the predicted values of one or more basic prediction units in the second area according to the predicted value matrix.
In a possible implementation of the first aspect, the method is used for bi-directional prediction (e.g. forward prediction and backward prediction); the motion information includes first motion information (e.g., forward motion information) corresponding to a first list of reference frames and second motion information (e.g., backward motion information) corresponding to a second list of reference frames; the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information; the calculating the prediction values of one or more basic prediction units in the second area according to the prediction value matrix comprises: and weighting and summing the pixel values corresponding to the same position of the second area in the first prediction value matrix and the second prediction value matrix to obtain the prediction values of one or more basic prediction units in the second area.
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme based on a bidirectional prediction optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, BIO processing is performed on a first region in the VPDU, and non-BIO processing (including weighted summation processing) is performed on a second region in the VPDU to obtain a pixel value of a basic prediction unit of the second region, so that the number of basic prediction units performing BIO processing in the VPDU is reduced, and complexity of implementation is reduced on the premise of not affecting encoding and decoding performance.
In a second aspect, an embodiment of the present application provides an inter-frame prediction method, including: judging whether the current image block comprises at least two VPDUs; when the current image block comprises at least two VPDUs, performing no BIO processing on the current image block, or performing inter-frame prediction on the current image block in a non-BIO mode to obtain a prediction value of one or more basic prediction units in the current image block; when the current image block only comprises one VPDU, carrying out BIO processing on the VPDU to obtain a corrected motion vector of one or more basic prediction units in the VPDU, and obtaining a prediction value of the corresponding basic prediction unit according to the corrected motion vector, wherein the size of the basic prediction unit is 4 multiplied by 4. In the embodiment of the present application, it needs to be determined whether there are at least two VPDUs included in the current image block, if yes, the entire image block may not be subjected to BIO processing, and is processed in a non-BIO manner, and if only one VPDU is included, it indicates that the current image block is the VPDU, and the VPDU is subjected to BIO processing.
In a third aspect, an embodiment of the present application provides an inter-frame prediction method, including: obtaining motion information of a current image block (e.g., a current CU), where the current image block includes at least one VPDU, and the current image block may also include at least two VPDUs, and the VPDU includes a first area and a second area, where the first area includes one or more basic prediction units, the second area includes one or more basic prediction units, and the size of the basic prediction unit is 4 × 4; and acquiring a predictive value matrix according to the motion information, wherein the predictive value matrix corresponds to the VPDU to be processed, and the size of the predictive value matrix is larger than or equal to that of the VPDU. Based on the principle of BIO, to obtain a predicted value in a first region, it needs to be expanded outward based on the size of the first region to obtain a predicted value matrix corresponding to a larger region, and in the embodiment of the present application, when obtaining the predicted value matrix corresponding to the VPDU, it is determined at which boundary or boundaries of the VPDU (not all boundaries of the VPDU) the predicted value matrix needs to be expanded outward according to the location of the first region, or it is determined that the predicted value matrix does not need to be expanded outward at any boundary of the VPDU, so the size of the predicted value matrix is greater than or equal to the size of the VPDU; and calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than that of the first area. Similarly, based on the principle of BIO, to obtain a predicted value in the first region, when calculating the horizontal prediction gradient matrix and the vertical prediction gradient matrix of the region, it is also necessary to expand outward on the basis of the size of the first region, and obtain the horizontal prediction gradient matrix and the vertical prediction gradient matrix corresponding to a larger region, in the embodiment of the present application, it is determined at which boundary or boundaries (not all boundaries of the first region) of the first region the expansion outward is required according to the position of the first region, or it is determined that the expansion outward is not required at any boundary of the first region, so the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first region; calculating a modified motion vector for one or more (e.g., each) basic prediction units in the first region based on the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix; and obtaining a predicted value of the corresponding basic prediction unit according to the corrected motion vector. In the embodiment of the present application, the size of the predictor matrix is greater than or equal to the size of the VPDU, and the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively greater than the size of the first region, where the greater size is understood to be greater in one direction (one dimension), for example, the W direction or the H direction, or may be understood to be greater in two directions (two dimensions), for example, the W direction and the H direction.
It can be seen that, when encoding or decoding is performed on an image block by using a fusion scheme of a bidirectional prediction based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, only a first region in the VPDU is subjected to BIO processing, instead of performing BIO processing on all regions in the VPDU in the prior art, which reduces the number of basic prediction units for performing BIO processing in the VPDU, and only the extension regions adjacent to three or less VPDU boundaries (not all VPDU boundaries) of the current VPDU are subjected to pixel value sampling and filling in the process of BIO processing, so that not only is the BIO processing mode compatible, but also the amount of pixel value sampling and filling is reduced, thereby further reducing the implementation complexity on the premise of not affecting the codec performance.
In one possible implementation of the third aspect, the method is used for bi-directional prediction (e.g., forward prediction and backward prediction); the motion information includes first motion information (e.g., forward motion information) corresponding to a first list of reference frames and second motion information (e.g., backward motion information) corresponding to a second list of reference frames; the predictor matrix includes a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information.
In a possible implementation manner of the third aspect, before the calculating the horizontal prediction gradient matrix of the first region and the vertical prediction gradient matrix of the first region according to the prediction value matrix, the method further includes: judging whether the difference between the first predicted value matrix and the second predicted value matrix is larger than a first preset threshold value or not; the calculating a horizontal prediction gradient matrix of the first region and a vertical prediction gradient matrix of the first region according to the prediction value matrix comprises: and under the condition that the difference is larger than the first preset threshold value, calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix. According to the embodiment of the application, whether the SAD between the forward and backward predicted values of each basic prediction unit is larger than a first preset threshold value or not can be judged, if so, the forward and backward predicted value matrix is continuously calculated to obtain the predicted value of the basic prediction unit. Otherwise, calculating the predicted value of the basic prediction unit by using a weighting method. The first preset threshold may be set to 1< < (BD-3 + shift).
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme based on a bidirectional prediction optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, whether a difference between a first predictor matrix and a second predictor matrix corresponding to the VPDU is greater than a first preset threshold is determined, and BIO processing is performed only on the VPDU that satisfies the condition, so that the number of basic prediction units performing BIO processing in the image block is further reduced, and thus implementation complexity is further reduced.
In a possible implementation manner of the third aspect, before the calculating a modified motion vector of one or more basic prediction units in the first area according to the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix, the method further includes: judging whether the difference between a first predicted value and a second predicted value of each basic prediction unit in the first area is larger than a second preset threshold value, wherein the first predicted value is a pixel value corresponding to the basic prediction unit in the first predicted value matrix, and the second predicted value is a pixel value corresponding to the basic prediction unit in the second predicted value matrix; the calculating modified motion vectors of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix comprises: and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
It can be seen that, when an image block is encoded or decoded by using a fusion scheme based on a bidirectional prediction optical flow technique (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, on the basis of reducing the number of basic prediction units performing BIO processing in the VPDU, a modified motion vector is calculated only for the basic prediction unit in the first area where a difference between a first prediction value and a second prediction value is greater than a second preset threshold, so that an amount of computation for modifying the motion vector in the first area is further reduced, and complexity of implementation is further reduced.
In a possible implementation manner of the third aspect, the second region is a pixel region where a column or a row of basic prediction units (4 × 4 sub-blocks) adjacent to a boundary in the VPDU are located, where the boundary includes one or more of a first boundary and a second boundary, where the first boundary is a VPDU boundary that is not overlapped with a third boundary; the second boundary is a VPDU boundary coincident with a third boundary; the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and neighboring VPDUs and/or vertical boundaries between the VPDU to be processed and neighboring VPDUs; the third boundary is a boundary between the current tile and an adjacent tile (e.g., a CU boundary: a boundary between CUs); the first region is a region in the VPDU to be processed except the second region.
In a possible implementation manner of the third aspect, when the second region is a pixel region where basic prediction units adjacent to the first boundary and the second boundary in the VPDU are located, the embodiment of the present application corresponds to a case where the first region is a pixel region except for a pixel region where a column or a row of basic prediction units adjacent to four boundaries in the VPDU are located, and the second region is a pixel region where a column or a row of basic prediction units adjacent to the first boundary and the second boundary in the VPDU are located. In this case, the prediction value matrix is represented by I (I, j), where I has a value range of [0, W-1], j has a value range of [0, H-1], and the horizontal prediction gradient matrix is represented by X (I, j), where I has a value range of [3, W-4], and j has a value range of [3, H-4 ]; the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; wherein W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU (the coordinate system refers to the position coordinates of the upper left vertex of the VPDU as the origin of coordinates).
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme based on a bidirectional prediction optical flow technique (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, on the basis of reducing the number of basic prediction units for performing BIO processing in the VPDU, it is not necessary to sample and fill a pixel value in an extension area adjacent to a VPDU boundary of a current VPDU (that is, the prediction value matrix is directly determined by the whole current VPDU) in the BIO processing process, so that not only is the BIO processing method compatible, but also the computation amount of pixel value sampling and filling is greatly reduced, thereby further reducing the implementation complexity without affecting the coding and decoding performance.
In a feasible implementation manner of the third aspect, when the second region is a pixel region in the VPDU, which is adjacent to the first boundary, the embodiment of the present application corresponds to a case where the second region is a pixel region in the VPDU, where only one column or one row of basic prediction units adjacent to the first boundary is located, and the first region is a region except the second region in the VPDU. In this case, the predictor matrix is represented by I (I, j), where I has a value in the range of [ W1, W2], ([ -LeftW, W-1+ RightW ]), j has a value in the range of [ H1, H2] ([ -above H, H-1+ BottonH ]), where W1 is determined by LeftW, W2 is determined by the width W and RightW of the VPDU, H1 is determined by above H, and H2 is determined by the height H and BottomH of the VPDU; the horizontal prediction gradient matrix is represented by X (i, j), wherein i has a value range of [ W3, W4], j has a value range of [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by the height H of the VPDU and Bottomh; the vertical prediction gradient matrix is Y (i, j), wherein i has a value range of [ W5, W6], j has a value range of [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by the height H of the VPDU and Bottomh; LeftW represents a positional relationship between a basic prediction unit of the VPDU adjacent to a left boundary and one or more of the first boundary and the third boundary, RightW represents a positional relationship between a basic prediction unit of the VPDU adjacent to a right boundary and one or more of the first boundary and the third boundary, above represents a positional relationship between a basic prediction unit of the VPDU adjacent to an upper boundary and one or more of the first boundary and the third boundary, and bottom represents a positional relationship between a basic prediction unit of the VPDU adjacent to a lower boundary and one or more of the first boundary and the third boundary.
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme of a bidirectional prediction based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, on the basis of reducing the number of basic prediction units for performing BIO processing in the VPDU, only pixel value sampling and filling are performed on extension areas adjacent to three, two, or one VPDU boundary (not all the current VPDU boundaries) of the current VPDU in the BIO processing process, so that not only is the BIO processing method compatible, but also the computation amount of pixel value sampling and filling in the BIO processing process is reduced, thereby further reducing the implementation complexity without affecting the encoding and decoding performance.
In one possible embodiment of the third aspect, the W1 to W6, H1 to H6 are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)。
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)
in a feasible implementation manner of the third aspect, when the second region is a pixel region in the VPDU adjacent to two mutually perpendicular first boundaries, or the second region is a pixel region in the VPDU adjacent to one first boundary, the embodiment of the present application corresponds to a case that the first region is a pixel region in the VPDU except for a pixel region where a column and a row of basic prediction units adjacent to the two mutually perpendicular first boundaries are located, or a case that the current image block includes two VPDUs, and the first region is a pixel region outside a pixel region where a column or a row of basic prediction units adjacent to one first boundary in the VPDU is located. In this case, if the left boundary of the VPDU is the second boundary, the LeftW is 1, otherwise, the left boundary is 0; if the right boundary of the VPDU is the second boundary, the Right W is 1, otherwise, the right W is 0; if the upper boundary of the VPDU is the second boundary, the AboveH is 1, otherwise, the AboveH is 0; if the lower boundary of the VPDU is the second boundary, BottonH is 1, otherwise, BottonH is 0.
In a possible implementation manner of the third aspect, when the second region is a pixel region adjacent to two or less first boundaries in the VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise LeftW is 0. In other words, if the basic prediction unit adjacent to the left boundary in the VPDU is located to the left of the first boundary, then LeftW is 0, otherwise LeftW is 1; if the right boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0. In other words, if the basic prediction unit adjacent to the right boundary in the VPDU is located at the left of the first boundary, then RightW is 0, otherwise it is 1; if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0. In other words, if the basic prediction unit adjacent to the upper boundary in the VPDU is located above the first boundary, then the above is 0, otherwise the above is 1; if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0. In other words, if the basic prediction unit adjacent to the lower boundary in the VPDU is located above the first boundary, BottonH is 0, otherwise BottonH is 1.
In a fourth aspect, an embodiment of the present application provides an inter-frame prediction apparatus, which includes several functional units for implementing any one of the methods of the first aspect. For example, the inter prediction apparatus may include: the image processing device comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a current image block, the current image block comprises at least one Virtual Pipeline Data Unit (VPDU), and the VPDU comprises a first area and a second area; the first processing module is used for carrying out optical flow technology BIO processing based on bidirectional prediction on a first area of the VPDU to obtain corrected motion vectors of one or more basic prediction units in the first area, and obtaining a prediction value corresponding to the basic prediction unit according to the corrected motion vectors; and the second processing module is used for carrying out non-BIO processing on the second area of the VPDU to obtain the predicted value of one or more basic prediction units in the second area.
In one possible implementation manner of the fourth aspect, the second region is a pixel region where basic prediction units adjacent to a boundary in the VPDU are located, where the boundary includes one or more of a first boundary and a second boundary,
wherein the first boundary is a VPDU boundary that is not coincident with a third boundary;
The second boundary is a VPDU boundary coincident with a third boundary;
the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs;
the third boundary is a boundary between the current image block and an adjacent image block;
the first region is a region in the VPDU to be processed except the second region.
In a feasible implementation manner of the fourth aspect, the first processing module is specifically configured to obtain a predictor matrix according to the motion information of the current image block, where a size of the predictor matrix is greater than or equal to a size of the VPDU; calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first area; and calculating the modified motion vector of one or more basic prediction units in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a possible implementation manner of the fourth aspect, in terms of calculating a modified motion vector of one or more basic prediction units in the first region according to the predictor matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix, the first processing module is specifically configured to calculate a modified motion vector of each basic prediction unit in the first region according to the predictor matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a possible implementation manner of the fourth aspect, when the second region is a pixel region where a basic prediction unit adjacent to the first boundary and the second boundary in the VPDU is located, the prediction value matrix is represented by I (I, j), where I has a value range of [0, W-1], and j has a value range of [0, H-1 ]; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
In a possible implementation manner of the fourth aspect, when the second region is a pixel region adjacent to the first boundary in the VPDU, the predictor matrix is represented by I (I, j), where I has a value range of [ W1, W2], and j has a value range of [ H1, H2], where W1 is determined by LeftW, W2 is determined by width W and RightW of the VPDU, H1 is determined by above H, and H2 is determined by height H and bottom H of the VPDU; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh; the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh; LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary in the VPDU and one or more of the first boundary and the third boundary, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary in the VPDU and one or more of the first boundary and the third boundary, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary in the VPDU and one or more of the first boundary and the third boundary, and bottom represents a positional relationship between a basic prediction unit adjacent to a lower boundary in the VPDU and one or more of the first boundary and the third boundary.
In one possible embodiment of the fourth aspect, the W1 to W6 and the H1 to H6 are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)。
in a possible implementation manner of the fourth aspect, when the second region is a pixel region in the VPDU adjacent to two mutually perpendicular first boundaries, or the second region is a pixel region in the VPDU adjacent to one first boundary, if a left boundary of the VPDU is the second boundary, then LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
In a possible implementation manner of the fourth aspect, when the second region is a pixel region adjacent to two or less first boundaries in the VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, BottonH is 1; otherwise, BottonH is 0.
In a possible implementation of the fourth aspect, the apparatus is configured to bi-directionally predict; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information; the horizontal prediction gradient matrix comprises a first horizontal prediction gradient matrix and a second horizontal prediction gradient matrix, the first horizontal prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second horizontal prediction gradient matrix is obtained through calculation according to the second prediction value matrix; the vertical prediction gradient matrix comprises a first vertical prediction gradient matrix and a second vertical prediction gradient matrix, wherein the first vertical prediction gradient matrix is obtained by calculation according to the first prediction value matrix, and the second vertical prediction gradient matrix is obtained by calculation according to the second prediction value matrix; the motion information correction amount includes a first motion information correction amount corresponding to the first reference frame list and a second motion information correction amount corresponding to the second reference frame list, the first motion information correction amount is calculated according to the first predictor matrix, the first horizontal prediction gradient matrix and the first vertical prediction gradient matrix, and the second motion information correction amount is calculated according to the second predictor matrix, the second horizontal prediction gradient matrix and the second vertical prediction gradient matrix.
In a feasible implementation manner of the fourth aspect, the first processing module is further configured to determine whether a difference between a first prediction value and a second prediction value of each basic prediction unit in the first area is greater than a second preset threshold, where the first prediction value is a pixel value corresponding to the basic prediction unit in the first prediction value matrix, and the second prediction value is a pixel value corresponding to the basic prediction unit in the second prediction value matrix; and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a feasible implementation manner of the fourth aspect, the second processing module is specifically configured to obtain a predictor matrix according to the motion information of the current image block; and calculating the predicted values of one or more basic prediction units in the second area according to the predicted value matrix.
In a possible implementation of the fourth aspect, the method is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information; the calculating the prediction values of one or more basic prediction units in the second area according to the prediction value matrix comprises: and weighting and summing pixel values corresponding to the same position of the second area in the first prediction value matrix and the second prediction value matrix to obtain the prediction values of one or more basic prediction units in the second area.
In a fifth aspect, an embodiment of the present application provides an inter-frame prediction apparatus, which includes several functional units for implementing any one of the methods of the second aspect. For example, the inter prediction apparatus may include: the judging module is used for judging whether the current image block comprises at least two VPDUs; a fourth processing module, configured to, when the current image block includes a VPDU, perform bi-directional prediction-based optical flow technique BIO processing on the VPDU to obtain a modified motion vector of one or more basic prediction units in the VPDU, and obtain a prediction value corresponding to the basic prediction unit according to the modified motion vector; and the third processing module is used for performing inter-frame prediction on the current image block in a non-BIO mode to obtain a prediction value of one or more basic prediction units in the current image block when the current image block comprises at least two VPDUs.
In a sixth aspect, an embodiment of the present application provides an inter-frame prediction apparatus, which includes several functional units for implementing any one of the methods in the third aspect. For example, the inter prediction apparatus may include: the image processing device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring motion information of a current image block, the current image block comprises at least one VPDU, and the VPDU comprises a first area and a second area; a predictor matrix module, configured to obtain a predictor matrix according to the motion information, where a size of the predictor matrix is greater than or equal to a size of the VPDU; a gradient matrix module, configured to calculate, according to the prediction value matrix, a horizontal prediction gradient matrix of the first region and a vertical prediction gradient matrix of the first region, where sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than a size of the first region; a calculation module, configured to calculate modified motion vectors of one or more basic prediction units in the first region according to the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix; and obtaining a predicted value of the corresponding basic prediction unit according to the corrected motion vector.
In a possible implementation manner of the sixth aspect, the calculating module is specifically configured to calculate a modified motion vector of each basic prediction unit in the first area according to the predictor matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a possible embodiment of the sixth aspect, the apparatus is for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix includes a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information.
In a feasible implementation manner of the sixth aspect, the gradient matrix module is further configured to determine whether a difference between the first predictive value matrix and the second predictive value matrix is greater than a preset threshold; and under the condition that the difference is larger than the preset threshold value, calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix.
In a feasible implementation manner of the sixth aspect, the calculating module is further configured to determine whether a difference between a first prediction value and a second prediction value of each basic prediction unit in the first area is greater than a second preset threshold, where the first prediction value is a pixel value corresponding to the basic prediction unit in the first prediction value matrix, and the second prediction value is a pixel value corresponding to the basic prediction unit in the second prediction value matrix; and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a possible implementation manner of the sixth aspect, the second region is a pixel region where basic prediction units adjacent to a boundary in the VPDU are located, where the boundary includes one or more of a first boundary and a second boundary, where the first boundary is a VPDU boundary that is not overlapped with a third boundary; the second boundary is a VPDU boundary coincident with a third boundary; the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs; the third boundary is a boundary between the current image block and an adjacent image block; the first region is a region in the VPDU to be processed except the second region.
In a possible implementation manner of the sixth aspect, when the second region is a pixel region where a basic prediction unit adjacent to the first boundary and the second boundary in the VPDU is located, the prediction value matrix is represented by I (I, j), where I has a value range of [0, W-1], and j has a value range of [0, H-1 ]; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
In a possible implementation manner of the sixth aspect, when the second region is a pixel region adjacent to the first boundary in the VPDU, the predictor matrix is represented by I (I, j), where I is in a range of [ W1, W2], and j is in a range of [ H1, H2], where W1 is determined by LeftW, W2 is determined by width W and RightW of the VPDU, H1 is determined by above H, and H2 is determined by height H and bottom H of the VPDU; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh; the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh; LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary in the VPDU and one or more of the first boundary and the third boundary, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary in the VPDU and one or more of the first boundary and the third boundary, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary in the VPDU and one or more of the first boundary and the third boundary, and bottom represents a positional relationship between a basic prediction unit adjacent to a lower boundary in the VPDU and one or more of the first boundary and the third boundary.
In a possible implementation manner of the sixth aspect, when the second region is a pixel region in the VPDU adjacent to two mutually perpendicular first boundaries, or the second region is a pixel region in the VPDU adjacent to one first boundary, if a left boundary of the VPDU is the second boundary, then LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise BottonH is 0.
In a possible implementation manner of the sixth aspect, when the second region is a pixel region adjacent to two or less first boundaries in the VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
In a seventh aspect, an embodiment of the present application provides an apparatus for decoding video data, where the apparatus includes:
the memory is used for storing video data in a code stream form;
a video decoder, configured to obtain a current image block, where the current image block includes at least one Virtual Pipeline Data Unit (VPDU), and the VPDU includes a first area and a second area; carrying out optical flow technology BIO processing based on bidirectional prediction on a first area of the VPDU to obtain a corrected motion vector of one or more basic prediction units in the first area, and obtaining a prediction value of a corresponding basic prediction unit according to the corrected motion vector; and carrying out non-BIO processing on a second area of the VPDU to obtain a predicted value of one or more basic prediction units in the second area.
In an eighth aspect, an embodiment of the present application provides an apparatus for decoding video data, the apparatus including:
a memory for storing video data, the video data comprising one or more image blocks;
the video decoder is used for judging whether the current image block comprises at least two VPDUs; when the current image block comprises at least two VPDUs, carrying out no bidirectional prediction-based optical flow technology BIO processing on the current image block; and when the current image block comprises a VPDU, carrying out BIO processing on the VPDU to obtain the corrected motion vectors of one or more basic prediction units in the VPDU, and obtaining the prediction value corresponding to the basic prediction unit according to the corrected motion vectors.
In a ninth aspect, an embodiment of the present application provides an apparatus for decoding video data, the apparatus including:
a memory for storing encoded video data;
the video decoder is used for acquiring motion information of a current image block, wherein the current image block comprises at least one VPDU (virtual private channel Unit), and the VPDU comprises a first area and a second area; obtaining a predictor matrix according to the motion information, wherein the size of the predictor matrix is larger than or equal to that of the VPDU; calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first area; and calculating the modified motion vector of one or more basic prediction units in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a tenth aspect, an embodiment of the present application provides a video encoding apparatus, including: a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to perform part or all of the steps of any one of the first to third aspects.
In an eleventh aspect, an embodiment of the present application provides a video decoding apparatus, including: a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to perform part or all of the steps of any one of the first to third aspects.
In a twelfth aspect, the present application provides a computer-readable storage medium storing program code, where the program code includes instructions for executing part or all of the steps of any one of the methods in the first to third aspects.
In a thirteenth aspect, the present application provides a computer program product, which when run on a computer, causes the computer to perform some or all of the steps of any one of the first to third aspects.
It should be understood that the second to thirteenth aspects of the present application are consistent with the technical solutions of the first aspect of the present application, and the beneficial effects obtained by the aspects and the corresponding possible implementations are similar, and are not described again.
It can be seen that, in the embodiment of the present application, when an image block is encoded or decoded by using a fusion scheme of a bidirectional prediction based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, only a first region in the VPDU is subjected to BIO processing, instead of performing BIO processing on all regions in the VPDU in the prior art, which reduces the number of basic prediction units for performing BIO processing in the VPDU and reduces implementation complexity;
In addition, in the process of the BIO processing, pixel value sampling and filling are performed only on the extension area adjacent to three or less VPDU boundaries (not all boundaries of the current VPDU, for example, zero or one or 2 VPDU boundaries) of the current VPDU, so that not only is the BIO processing mode compatible, but also the operation amount of pixel value sampling and filling in the process of the BIO processing is reduced, and therefore the implementation complexity is further reduced on the premise of not affecting the performance of encoding and decoding.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
FIG. 1A is a block diagram of an example of a video encoding and decoding system 10 for implementing embodiments of the present application;
FIG. 1B is a block diagram of an example of a video coding system 40 for implementing embodiments of the present application;
FIG. 2 is a block diagram of an example structure of an encoder 20 for implementing embodiments of the present application;
FIG. 3 is a block diagram of an example structure of a decoder 30 for implementing embodiments of the present application;
FIG. 4 is a block diagram of an example of a video coding apparatus 400 for implementing an embodiment of the present application;
FIG. 5 is a block diagram of another example of an encoding device or a decoding device for implementing embodiments of the present application;
FIG. 6 is a schematic diagram of a motion information candidate location for implementing an embodiment of the present application;
FIG. 7 is a diagram of motion information for inter prediction used to implement an embodiment of the present application;
FIG. 8 is a schematic diagram of bi-directional weighted prediction for implementing embodiments of the present application;
FIG. 9 is a diagram of an image block boundary padding for implementing an embodiment of the present application;
FIG. 10 is a schematic diagram of the boundaries of a VPDU for implementing an embodiment of the present application;
FIG. 11 is a diagram of a VPDU boundary for implementing the first embodiment of the present application;
FIG. 12 is a diagram of another VPDU boundary for implementing the first embodiment of the present application;
FIG. 13 is a diagram of another VPDU boundary for implementing the first embodiment of the present application;
FIG. 14 is a range diagram of a predictor matrix for implementing the first embodiment of the present application;
FIG. 15 is a schematic range diagram of a gradient matrix for implementing the first embodiment of the present application;
FIG. 16 is a schematic range diagram of a gradient matrix padding for implementing the first embodiment of the present application;
FIG. 17 is a range diagram of a first region for implementing the first embodiment of the present application;
FIG. 18 is a schematic diagram of a VPDU boundary for implementing a second embodiment of the present application;
FIG. 19 is a range diagram of a predictor matrix for implementing the second embodiment of the present application;
FIG. 20 is a schematic range diagram of a gradient matrix for implementing embodiment two of the present application;
FIG. 21 is a range diagram of a first region for implementing a second embodiment of the present application;
FIG. 22 is a schematic diagram of a VPDU boundary for implementing a third embodiment of the present application;
FIG. 23 is a flowchart illustrating an inter-frame prediction method for implementing embodiments of the present application;
FIG. 24 is another flow chart illustrating a method for inter-frame prediction for implementing embodiments of the present application;
FIG. 25 is a schematic flow chart of a method for inter-frame prediction according to an embodiment of the present application;
fig. 26 is a block diagram of an inter-frame prediction apparatus for implementing an embodiment of the present application;
fig. 27 is another block diagram of an inter prediction apparatus for implementing an embodiment of the present application;
fig. 28 is a block diagram of still another structure of an inter prediction apparatus for implementing an embodiment of the present application.
Detailed Description
The embodiments of the present application will be described below with reference to the drawings. In the following description, reference is made to the accompanying drawings which form a part hereof and in which is shown by way of illustration specific aspects of embodiments of the application or in which specific aspects of embodiments of the application may be employed. It should be understood that embodiments of the present application may be used in other ways and may include structural or logical changes not depicted in the drawings. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present application is defined by the appended claims. For example, it should be understood that the disclosure in connection with the described methods may equally apply to the corresponding apparatus or system for performing the methods, and vice versa. For example, if one or more particular method steps are described, the corresponding apparatus may comprise one or more units, such as functional units, to perform the described one or more method steps (e.g., a unit performs one or more steps, or multiple units, each of which performs one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated in the figures. On the other hand, for example, if a particular apparatus is described based on one or more units, such as functional units, the corresponding method may comprise one step to perform the functionality of the one or more units (e.g., one step performs the functionality of the one or more units, or multiple steps, each of which performs the functionality of one or more of the plurality of units), even if such one or more steps are not explicitly described or illustrated in the figures. Further, it is to be understood that features of the various exemplary embodiments and/or aspects described herein may be combined with each other, unless explicitly stated otherwise.
The technical scheme related to the embodiment of the application can be applied to the existing video coding standards (such as H.264, HEVC and the like), and can also be applied to the future video coding standards (such as H.266 standard). The terminology used in the description of the embodiments section of the present application is for the purpose of describing particular embodiments of the present application only and is not intended to be limiting of the present application. Some concepts that may be involved in embodiments of the present application are briefly described below.
Video coding generally refers to processing a sequence of pictures that form a video or video sequence. In the field of video coding, the terms "picture", "frame" or "image" may be used as synonyms. Video encoding as used herein means video encoding or video decoding. Video encoding is performed on the source side, typically including processing (e.g., by compressing) the original video picture to reduce the amount of data required to represent the video picture for more efficient storage and/or transmission. Video decoding is performed at the destination side, typically involving inverse processing with respect to the encoder, to reconstruct the video pictures. Embodiments are directed to video picture "encoding" to be understood as referring to "encoding" or "decoding" of a video sequence. The combination of the encoding part and the decoding part is also called codec (encoding and decoding).
A video sequence comprises a series of images (pictures) which are further divided into slices (slices) which are further divided into blocks (blocks). Video coding performs the coding process in units of blocks, and in some new video coding standards, the concept of blocks is further extended. For example, in the h.264 standard, there is a Macroblock (MB), which may be further divided into a plurality of prediction blocks (partitions) that can be used for predictive coding. In the High Efficiency Video Coding (HEVC) standard, basic concepts such as a Coding Unit (CU), a Prediction Unit (PU), and a Transform Unit (TU) are adopted, and various block units are functionally divided, and a brand new tree-based structure is adopted for description. For example, a CU may be partitioned into smaller CUs according to a quadtree, and the smaller CUs may be further partitioned to form a quadtree structure, where the CU is a basic unit for partitioning and encoding an encoded image. There is also a similar tree structure for PU and TU, and PU may correspond to a prediction block, which is the basic unit of predictive coding. The CU is further partitioned into PUs according to a partitioning pattern. A TU may correspond to a transform block, which is a basic unit for transforming a prediction residual. However, CU, PU and TU are basically concepts of blocks (or image blocks).
For example, in HEVC, a CTU is split into multiple CUs by using a quadtree structure represented as a coding tree. A decision is made at the CU level whether to encode a picture region using inter-picture (temporal) or intra-picture (spatial) prediction. Each CU may be further split into one, two, or four PUs according to the PU split type. The same prediction process is applied within one PU and the relevant information is transmitted to the decoder on a PU basis. After obtaining the residual block by applying a prediction process based on the PU split type, the CU may be partitioned into Transform Units (TUs) according to other quadtree structures similar to the coding tree used for the CU. In recent developments of video compression techniques, the coding blocks are partitioned using Quad-tree and binary tree (QTBT) partition frames. In the QTBT block structure, a CU may be square or rectangular in shape.
Herein, for convenience of description and understanding, an image block to be encoded in a currently encoded image may be referred to as a current block, e.g., in encoding, referring to a block currently being encoded; in decoding, refers to the block currently being decoded. A decoded image block in a reference picture used for predicting the current block is referred to as a reference block, i.e. a reference block is a block that provides a reference signal for the current block, wherein the reference signal represents pixel values within the image block. A block in the reference picture that provides a prediction signal for the current block may be a prediction block, wherein the prediction signal represents pixel values or sample values or a sampled signal within the prediction block. For example, after traversing multiple reference blocks, a best reference block is found that will provide prediction for the current block, which is called a prediction block.
In the case of lossless video coding, the original video picture can be reconstructed, i.e., the reconstructed video picture has the same quality as the original video picture (assuming no transmission loss or other data loss during storage or transmission). In the case of lossy video coding, the amount of data needed to represent the video picture is reduced by performing further compression, e.g., by quantization, while the decoder side cannot fully reconstruct the video picture, i.e., the quality of the reconstructed video picture is lower or worse than the quality of the original video picture.
Several video coding standards of h.261 belong to the "lossy hybrid video codec" (i.e., the combination of spatial and temporal prediction in the sample domain with 2D transform coding in the transform domain for applying quantization). Each picture of a video sequence is typically partitioned into non-overlapping sets of blocks, typically encoded at the block level. In other words, the encoder side typically processes, i.e., encodes, video at the block (video block) level, e.g., generates a prediction block by spatial (intra-picture) prediction and temporal (inter-picture) prediction, subtracts the prediction block from the current block (currently processed or block to be processed) to obtain a residual block, transforms the residual block and quantizes the residual block in the transform domain to reduce the amount of data to be transmitted (compressed), while the decoder side applies the inverse processing portion relative to the encoder to the encoded or compressed block to reconstruct the current block for representation. In addition, the encoder replicates the decoder processing loop such that the encoder and decoder generate the same prediction (e.g., intra-prediction and inter-prediction) and/or reconstruction for processing, i.e., encoding, subsequent blocks.
The system architecture to which the embodiments of the present application apply is described below. Referring to fig. 1A, fig. 1A schematically shows a block diagram of a video encoding and decoding system 10 to which an embodiment of the present application is applied. As shown in fig. 1A, video encoding and decoding system 10 may include a source device 12 and a destination device 14, source device 12 generating encoded video data, and thus source device 12 may be referred to as a video encoding apparatus. Destination device 14 may decode the encoded video data generated by source device 12, and thus destination device 14 may be referred to as a video decoding apparatus. Various implementations of source apparatus 12, destination apparatus 14, or both may include one or more processors and memory coupled to the one or more processors. The memory can include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures that can be accessed by a computer, as described herein. Source apparatus 12 and destination apparatus 14 may comprise a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, on-board computers, wireless communication devices, or the like.
Although fig. 1A depicts source apparatus 12 and destination apparatus 14 as separate apparatuses, an apparatus embodiment may also include the functionality of both source apparatus 12 and destination apparatus 14 or both, i.e., source apparatus 12 or corresponding functionality and destination apparatus 14 or corresponding functionality. In such embodiments, source device 12 or corresponding functionality and destination device 14 or corresponding functionality may be implemented using the same hardware and/or software, or using separate hardware and/or software, or any combination thereof.
A communication connection may be made between source device 12 and destination device 14 over link 13, and destination device 14 may receive encoded video data from source device 12 via link 13. Link 13 may comprise one or more media or devices capable of moving encoded video data from source apparatus 12 to destination apparatus 14. In one example, link 13 may include one or more communication media that enable source device 12 to transmit encoded video data directly to destination device 14 in real-time. In this example, source apparatus 12 may modulate the encoded video data according to a communication standard, such as a wireless communication protocol, and may transmit the modulated video data to destination apparatus 14. The one or more communication media may include wireless and/or wired communication media such as a Radio Frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the internet). The one or more communication media may include routers, switches, base stations, or other apparatuses that facilitate communication from source apparatus 12 to destination apparatus 14.
Source device 12 includes an encoder 20, and in the alternative, source device 12 may also include a picture source 16, a picture preprocessor 18, and a communication interface 22. In one implementation, the encoder 20, the picture source 16, the picture preprocessor 18, and the communication interface 22 may be hardware components of the source device 12 or may be software programs of the source device 12. Described below, respectively:
the picture source 16, which may include or be any type of picture capturing device, may be used, for example, to capture real-world pictures, and/or any type of picture or comment generating device (for screen content encoding, some text on the screen is also considered part of the picture or image to be encoded), such as a computer graphics processor for generating computer animated pictures, or any type of device for obtaining and/or providing real-world pictures, computer animated pictures (e.g., screen content, Virtual Reality (VR) pictures), and/or any combination thereof (e.g., Augmented Reality (AR) pictures). The picture source 16 may be a camera for capturing pictures or a memory for storing pictures, and the picture source 16 may also include any kind of (internal or external) interface for storing previously captured or generated pictures and/or for obtaining or receiving pictures. When picture source 16 is a camera, picture source 16 may be, for example, an integrated camera local or integrated in the source device; when the picture source 16 is a memory, the picture source 16 may be an integrated memory local or integrated, for example, in the source device. When the picture source 16 comprises an interface, the interface may for example be an external interface receiving pictures from an external video source, for example an external picture capturing device such as a camera, an external memory or an external picture generating device, for example an external computer graphics processor, a computer or a server. The interface may be any kind of interface according to any proprietary or standardized interface protocol, e.g. a wired or wireless interface, an optical interface.
The picture can be regarded as a two-dimensional array or matrix of pixel elements (picture elements). The pixels in the array may also be referred to as sampling points. The number of sampling points of the array or picture in the horizontal and vertical directions (or axes) defines the size and/or resolution of the picture. To represent color, three color components are typically employed, i.e., a picture may be represented as or contain three sample arrays. For example, in RBG format or color space, a picture includes corresponding arrays of red, green, and blue samples. However, in video coding, each pixel is typically represented in a luminance/chrominance format or color space, e.g. for pictures in YUV format, comprising a luminance component (sometimes also indicated with L) indicated by Y and two chrominance components indicated by U and V. The luminance (luma) component Y represents luminance or gray level intensity (e.g., both are the same in a gray scale picture), while the two chrominance (chroma) components U and V represent chrominance or color information components. Accordingly, a picture in YUV format includes a luma sample array of luma sample values (Y) and two chroma sample arrays of chroma values (U and V). Pictures in RGB format can be converted or transformed into YUV format and vice versa, a process also known as color transformation or conversion. If the picture is black and white, the picture may include only an array of luma samples. In the embodiment of the present application, the pictures transmitted from the picture source 16 to the picture processor may also be referred to as raw picture data 17.
Picture pre-processor 18 is configured to receive original picture data 17 and perform pre-processing on original picture data 17 to obtain pre-processed picture 19 or pre-processed picture data 19. For example, the pre-processing performed by picture pre-processor 18 may include trimming, color format conversion (e.g., from RGB format to YUV format), toning, or de-noising.
An encoder 20 (or video encoder 20) for receiving the pre-processed picture data 19, processing the pre-processed picture data 19 with a relevant prediction mode (such as the prediction mode in various embodiments herein), thereby providing encoded picture data 21 (structural details of the encoder 20 will be described further below based on fig. 2 or fig. 4 or fig. 5). In some embodiments, the encoder 20 may be configured to perform various embodiments described hereinafter to implement the application of the inter prediction method described in the present application on the encoding side.
A communication interface 22, which may be used to receive encoded picture data 21 and may transmit encoded picture data 21 over link 13 to destination device 14 or any other device (e.g., memory) for storage or direct reconstruction, which may be any device for decoding or storage. Communication interface 22 may, for example, be used to encapsulate encoded picture data 21 into a suitable format, such as a data packet, for transmission over link 13.
Destination device 14 includes a decoder 30, and optionally destination device 14 may also include a communication interface 28, a picture post-processor 32, and a display device 34. Described below, respectively:
communication interface 28 may be used to receive encoded picture data 21 from source device 12 or any other source, such as a storage device, such as an encoded picture data storage device. The communication interface 28 may be used to transmit or receive the encoded picture data 21 by way of a link 13 between the source device 12 and the destination device 14, or by way of any type of network, such as a direct wired or wireless connection, any type of network, such as a wired or wireless network or any combination thereof, or any type of private and public networks, or any combination thereof. Communication interface 28 may, for example, be used to decapsulate data packets transmitted by communication interface 22 to obtain encoded picture data 21.
Both communication interface 28 and communication interface 22 may be configured as a one-way communication interface or a two-way communication interface, and may be used, for example, to send and receive messages to establish a connection, acknowledge and exchange any other information related to a communication link and/or data transfer, such as an encoded picture data transfer.
A decoder 30 (otherwise referred to as decoder 30) for receiving the encoded picture data 21 and providing decoded picture data 31 or decoded pictures 31 (structural details of the decoder 30 will be described further below based on fig. 3 or fig. 4 or fig. 5). In some embodiments, the decoder 30 may be configured to perform various embodiments described hereinafter to implement the application of the inter prediction method described in the present application on the decoding side.
A picture post-processor 32 for performing post-processing on the decoded picture data 31 (also referred to as reconstructed picture data) to obtain post-processed picture data 33. Post-processing performed by picture post-processor 32 may include: color format conversion (e.g., from YUV format to RGB format), toning, trimming or resampling, or any other process may also be used to transmit post-processed picture data 33 to display device 34.
A display device 34 for receiving the post-processed picture data 33 for displaying pictures to, for example, a user or viewer. The display device 34 may be or may include any kind of display for presenting the reconstructed picture, e.g. an integrated or external display or monitor. For example, the display may include a Liquid Crystal Display (LCD), an Organic Light Emitting Diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS), a Digital Light Processor (DLP), or any other display of any kind.
Although fig. 1A depicts source device 12 and destination device 14 as separate devices, device embodiments may also include the functionality of both source device 12 and destination device 14 or both, i.e., source device 12 or corresponding functionality and destination device 14 or corresponding functionality. In such embodiments, source device 12 or corresponding functionality and destination device 14 or corresponding functionality may be implemented using the same hardware and/or software, or using separate hardware and/or software, or any combination thereof.
It will be apparent to those skilled in the art from this description that the existence and (exact) division of the functionality of the different elements, or source device 12 and/or destination device 14 as shown in fig. 1A, may vary depending on the actual device and application. Source device 12 and destination device 14 may comprise any of a variety of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, a mobile phone, a smartphone, a tablet or tablet computer, a camcorder, a desktop computer, a set-top box, a television, a camera, an in-vehicle device, a display device, a digital media player, a video game console, a video streaming device (e.g., a content service server or a content distribution server), a broadcast receiver device, a broadcast transmitter device, etc., and may not use or use any type of operating system.
Both encoder 20 and decoder 30 may be implemented as any of a variety of suitable circuits, such as one or more microprocessors, Digital Signal Processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combinations thereof. If the techniques are implemented in part in software, an apparatus may store instructions of the software in a suitable non-transitory computer-readable storage medium and may execute the instructions in hardware using one or more processors to perform the techniques of this disclosure. Any of the foregoing, including hardware, software, a combination of hardware and software, etc., may be considered one or more processors.
In some cases, the video encoding and decoding system 10 shown in fig. 1A is merely an example, and the techniques of this application may be applicable to video encoding settings (e.g., video encoding or video decoding) that do not necessarily involve any data communication between the encoding and decoding devices. In other examples, the data may be retrieved from local storage, streamed over a network, and so on. A video encoding device may encode and store data to a memory, and/or a video decoding device may retrieve and decode data from a memory. In some examples, the encoding and decoding are performed by devices that do not communicate with each other, but merely encode data to and/or retrieve data from memory and decode data.
Referring to fig. 1B, fig. 1B is an illustrative diagram of an example of a video coding system 40 including the encoder 20 of fig. 2 and/or the decoder 30 of fig. 3, according to an example embodiment. Video coding system 40 may implement a combination of the various techniques of the embodiments of the present application. In the illustrated embodiment, video coding system 40 may include an imaging device 41, an encoder 20, a decoder 30 (and/or a video codec implemented by logic circuitry 47), an antenna 42, one or more processors 43, one or more memories 44, and/or a display device 45.
As shown in fig. 1B, the imaging device 41, the antenna 42, the logic 47, the encoder 20, the decoder 30, the processor 43, the memory 44, and/or the display device 45 can communicate with each other. As discussed, although video coding system 40 is depicted with encoder 20 and decoder 30, in different examples video coding system 40 may include only encoder 20 or only decoder 30.
In some instances, antenna 42 may be used to transmit or receive an encoded bitstream of video data. Additionally, in some instances, display device 45 may be used to present video data. In some examples, the logic 47 may include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, or the like. Video decoding system 40 may also include an optional processor 43, which optional processor 43 similarly may include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, or the like. In some examples, the logic 47 may be implemented in hardware, such as video encoding specific hardware, and the processor 43 may be implemented in general purpose software, an operating system, and so on. In addition, the Memory 44 may be any type of Memory, such as a volatile Memory (e.g., Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), etc.) or a nonvolatile Memory (e.g., flash Memory, etc.), and the like. In a non-limiting example, storage 44 may be implemented by a speed cache memory. In some instances, logic circuitry 47 may access memory 44 (e.g., to implement an image buffer). In other examples, logic 47 may include memory (e.g., cache, etc.) for implementing an image buffer, etc.
In some examples, encoder 20, implemented by logic circuitry, may include an image buffer (e.g., implemented by memory 44) and a graphics processing unit. The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include an encoder 20 implemented by logic circuitry 47 to implement the various modules discussed with reference to fig. 2 and/or any other encoder system or subsystem described herein. Logic circuitry may be used to perform various operations discussed herein.
In some examples, decoder 30 may be implemented by logic circuitry 47 in a similar manner to implement the various modules discussed with reference to decoder 30 of fig. 3 and/or any other decoder system or subsystem described herein. In some examples, logic circuit implemented decoder 30 may include an image buffer (implemented by processing unit 2820 or memory 44) and a graphics processing unit. The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include a decoder 30 implemented by logic circuitry 47 to implement the various modules discussed with reference to fig. 3 and/or any other decoder system or subsystem described herein.
In some instances, antenna 42 may be used to receive an encoded bitstream of video data. As discussed, the encoded bitstream may include data related to the encoded video frame, indicators, index values, mode selection data, etc., discussed herein, such as data related to the encoding partition (e.g., transform coefficients or quantized transform coefficients, (as discussed) optional indicators, and/or data defining the encoding partition). Video coding system 40 may also include a decoder 30 coupled to antenna 42 and used to decode the encoded bitstream. The display device 45 is used to present video frames.
It should be understood that for the example described with reference to encoder 20 in the embodiments of the present application, decoder 30 may be used to perform the reverse process. With respect to signaling syntax elements, decoder 30 may be configured to receive and parse such syntax elements and decode the associated video data accordingly. In some examples, encoder 20 may entropy encode the syntax elements into an encoded video bitstream. In such instances, decoder 30 may parse such syntax elements and decode the relevant video data accordingly.
It should be noted that the method described in the embodiment of the present application is mainly used for the inter-frame prediction process, which exists in both the encoder 20 and the decoder 30, and the encoder 20 and the decoder 30 in the embodiment of the present application may be a video standard protocol such as h.263, h.264, HEVV, MPEG-2, MPEG-4, VP8, VP9, or a codec corresponding to a next-generation video standard protocol (e.g., h.266).
Referring to fig. 2, fig. 2 shows a schematic/conceptual block diagram of an example of an encoder 20 for implementing embodiments of the present application. In the example of fig. 2, encoder 20 includes a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a buffer 216, a loop filter unit 220, a Decoded Picture Buffer (DPB) 230, a prediction processing unit 260, and an entropy encoding unit 270. Prediction processing unit 260 may include inter prediction unit 244, intra prediction unit 254, and mode selection unit 262. Inter prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). The encoder 20 shown in fig. 2 may also be referred to as a hybrid video encoder or a video encoder according to a hybrid video codec.
For example, the residual calculation unit 204, the transform processing unit 206, the quantization unit 208, the prediction processing unit 260, and the entropy encoding unit 270 form a forward signal path of the encoder 20, and, for example, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the buffer 216, the loop filter 220, the Decoded Picture Buffer (DPB) 230, the prediction processing unit 260 form a backward signal path of the encoder, wherein the backward signal path of the encoder corresponds to a signal path of a decoder (see the decoder 30 in fig. 3).
The encoder 20 receives, e.g., via an input 202, a picture 201 or an image block 203 of a picture 201, e.g., a picture in a sequence of pictures forming a video or a video sequence. Image block 203 may also be referred to as a current picture block or a picture block to be encoded, and picture 201 may be referred to as a current picture or a picture to be encoded (especially when the current picture is distinguished from other pictures in video encoding, such as previously encoded and/or decoded pictures in the same video sequence, i.e., a video sequence that also includes the current picture).
An embodiment of the encoder 20 may comprise a partitioning unit (not shown in fig. 2) for partitioning the picture 201 into a plurality of blocks, e.g. image blocks 203, typically into a plurality of non-overlapping blocks. The partitioning unit may be used to use the same block size for all pictures in a video sequence and a corresponding grid defining the block size, or to alter the block size between pictures or subsets or groups of pictures and partition each picture into corresponding blocks.
In one example, prediction processing unit 260 of encoder 20 may be used to perform any combination of the above-described segmentation techniques.
Like picture 201, image block 203 is also or can be considered as a two-dimensional array or matrix of sample points having sample values, although its size is smaller than picture 201. In other words, the image block 203 may comprise, for example, one sample array (e.g., a luma array in the case of a black and white picture 201) or three sample arrays (e.g., a luma array and two chroma arrays in the case of a color picture) or any other number and/or class of arrays depending on the color format applied. The number of sampling points in the horizontal and vertical directions (or axes) of the image block 203 defines the size of the image block 203.
The encoder 20 as shown in fig. 2 is used to encode a picture 201 block by block, e.g. performing encoding and prediction for each image block 203.
The residual calculation unit 204 is configured to calculate a residual block 205 based on the picture image block 203 and the prediction block 265 (further details of the prediction block 265 are provided below), e.g. by subtracting sample values of the prediction block 265 from sample values of the picture image block 203 sample by sample (pixel by pixel) to obtain the residual block 205 in the sample domain.
The transform processing unit 206 is configured to apply a transform, such as a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST), on the sample values of the residual block 205 to obtain transform coefficients 207 in a transform domain. The transform coefficients 207 may also be referred to as transform residual coefficients and represent the residual block 205 in the transform domain.
The transform processing unit 206 may be used to apply integer approximations of DCT/DST, such as the transform specified for HEVC/h.265. Such integer approximations are typically scaled by some factor compared to the orthogonal DCT transform. To maintain the norm of the residual block processed by the forward transform and the inverse transform, an additional scaling factor is applied as part of the transform process. The scaling factor is typically selected based on certain constraints, e.g., the scaling factor is a power of 2 for a shift operation, a trade-off between bit depth of transform coefficients, accuracy and implementation cost, etc. For example, a specific scaling factor may be specified on the decoder 30 side for the inverse transform by, for example, inverse transform processing unit 212 (and on the encoder 20 side for the corresponding inverse transform by, for example, inverse transform processing unit 212), and correspondingly, a corresponding scaling factor may be specified on the encoder 20 side for the forward transform by transform processing unit 206.
Quantization unit 208 is used to quantize transform coefficients 207, e.g., by applying scalar quantization or vector quantization, to obtain quantized transform coefficients 209. Quantized transform coefficients 209 may also be referred to as quantized residual coefficients 209. The quantization process may reduce the bit depth associated with some or all of transform coefficients 207. For example, an n-bit transform coefficient may be rounded down to an m-bit transform coefficient during quantization, where n is greater than m. The quantization level may be modified by adjusting a Quantization Parameter (QP). For example, for scalar quantization, different scales may be applied to achieve finer or coarser quantization. Smaller quantization steps correspond to finer quantization and larger quantization steps correspond to coarser quantization. An appropriate quantization step size may be indicated by a Quantization Parameter (QP). For example, the quantization parameter may be an index of a predefined set of suitable quantization step sizes. For example, a smaller quantization parameter may correspond to a fine quantization (smaller quantization step size) and a larger quantization parameter may correspond to a coarse quantization (larger quantization step size), or vice versa. The quantization may comprise a division by a quantization step size and a corresponding quantization or inverse quantization, e.g. performed by inverse quantization 210, or may comprise a multiplication by a quantization step size. Embodiments according to some standards, such as HEVC, may use a quantization parameter to determine the quantization step size. In general, the quantization step size may be calculated based on the quantization parameter using a fixed point approximation of an equation that includes division. Additional scaling factors may be introduced for quantization and dequantization to recover the norm of the residual block that may be modified due to the scale used in the fixed point approximation of the equation for the quantization step size and quantization parameter. In one example implementation, the inverse transform and inverse quantization scales may be combined. Alternatively, a custom quantization table may be used and signaled from the encoder to the decoder, e.g., in a bitstream. Quantization is a lossy operation, where the larger the quantization step size, the greater the loss.
The inverse quantization unit 210 is configured to apply inverse quantization of the quantization unit 208 on the quantized coefficients to obtain inverse quantized coefficients 211, e.g., to apply an inverse quantization scheme of the quantization scheme applied by the quantization unit 208 based on or using the same quantization step as the quantization unit 208. The dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211, corresponding to transform coefficients 207, although the loss due to quantization is typically not the same as the transform coefficients.
The inverse transform processing unit 212 is configured to apply an inverse transform of the transform applied by the transform processing unit 206, for example, an inverse Discrete Cosine Transform (DCT) or an inverse Discrete Sine Transform (DST), to obtain an inverse transform block 213 in the sample domain. The inverse transform block 213 may also be referred to as an inverse transform dequantized block 213 or an inverse transform residual block 213.
The reconstruction unit 214 (e.g., summer 214) is used to add the inverse transform block 213 (i.e., the reconstructed residual block 213) to the prediction block 265 to obtain the reconstructed block 215 in the sample domain, e.g., to add sample values of the reconstructed residual block 213 to sample values of the prediction block 265.
Optionally, a buffer unit 216 (or simply "buffer" 216), such as a line buffer 216, is used to buffer or store the reconstructed block 215 and corresponding sample values, for example, for intra prediction. In other embodiments, the encoder may be used to use the unfiltered reconstructed block and/or corresponding sample values stored in buffer unit 216 for any class of estimation and/or prediction, such as intra prediction.
For example, an embodiment of encoder 20 may be configured such that buffer unit 216 is used not only to store reconstructed blocks 215 for intra prediction 254, but also for loop filter unit 220 (not shown in fig. 2), and/or such that buffer unit 216 and decoded picture buffer unit 230 form one buffer, for example. Other embodiments may be used to use filtered block 221 and/or blocks or samples from decoded picture buffer 230 (neither shown in fig. 2) as input or basis for intra prediction 254.
The loop filter unit 220 (or simply "loop filter" 220) is used to filter the reconstructed block 215 to obtain a filtered block 221, so as to facilitate pixel transition or improve video quality. Loop filter unit 220 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters, such as a bilateral filter, an Adaptive Loop Filter (ALF), or a sharpening or smoothing filter, or a collaborative filter. Although loop filter unit 220 is shown in fig. 2 as an in-loop filter, in other configurations, loop filter unit 220 may be implemented as a post-loop filter. The filtered block 221 may also be referred to as a filtered reconstructed block 221. The decoded picture buffer 230 may store the reconstructed encoded block after the loop filter unit 220 performs a filtering operation on the reconstructed encoded block.
Embodiments of encoder 20 (correspondingly, loop filter unit 220) may be configured to output loop filter parameters (e.g., sample adaptive offset information), e.g., directly or after entropy encoding by entropy encoding unit 270 or any other entropy encoding unit, e.g., such that decoder 30 may receive and apply the same loop filter parameters for decoding.
Decoded Picture Buffer (DPB) 230 may be a reference picture memory that stores reference picture data for use by encoder 20 in encoding video data. DPB 230 may be formed from any of a variety of memory devices, such as Dynamic Random Access Memory (DRAM) including Synchronous DRAM (SDRAM), Magnetoresistive RAM (MRAM), Resistive RAM (RRAM), or other types of memory devices. The DPB 230 and the buffer 216 may be provided by the same memory device or separate memory devices. In a certain example, a Decoded Picture Buffer (DPB) 230 is used to store filtered blocks 221. Decoded picture buffer 230 may further be used to store other previous filtered blocks, such as previous reconstructed and filtered blocks 221, of the same current picture or of a different picture, such as a previous reconstructed picture, and may provide the complete previous reconstructed, i.e., decoded picture (and corresponding reference blocks and samples) and/or the partially reconstructed current picture (and corresponding reference blocks and samples), e.g., for inter prediction. In a certain example, if reconstructed block 215 is reconstructed without in-loop filtering, Decoded Picture Buffer (DPB) 230 is used to store reconstructed block 215.
Prediction processing unit 260, also referred to as block prediction processing unit 260, is used to receive or obtain image block 203 (current image block 203 of current picture 201) and reconstructed picture data, e.g., reference samples of the same (current) picture from buffer 216 and/or reference picture data 231 of one or more previously decoded pictures from decoded picture buffer 230, and to process such data for prediction, i.e., to provide prediction block 265, which may be inter-predicted block 245 or intra-predicted block 255.
The mode selection unit 262 may be used to select a prediction mode (e.g., intra or inter prediction mode) and/or a corresponding prediction block 245 or 255 used as the prediction block 265 to calculate the residual block 205 and reconstruct the reconstructed block 215.
Embodiments of mode selection unit 262 may be used to select prediction modes (e.g., from those supported by prediction processing unit 260) that provide the best match or the smallest residual (smallest residual means better compression in transmission or storage), or that provide the smallest signaling overhead (smallest signaling overhead means better compression in transmission or storage), or both. The mode selection unit 262 may be configured to determine a prediction mode based on Rate Distortion Optimization (RDO), i.e., select a prediction mode that provides the minimum rate distortion optimization, or select a prediction mode in which the associated rate distortion at least meets the prediction mode selection criteria.
The prediction processing performed by the example of the encoder 20 (e.g., by the prediction processing unit 260) and the mode selection performed (e.g., by the mode selection unit 262) will be explained in detail below.
As described above, the encoder 20 is configured to determine or select the best or optimal prediction mode from a set of (predetermined) prediction modes. The prediction mode set may include, for example, intra prediction modes and/or inter prediction modes.
The intra prediction mode set may include 35 different intra prediction modes, for example, non-directional modes such as DC (or mean) mode and planar mode, or directional modes as defined in h.265, or may include 67 different intra prediction modes, for example, non-directional modes such as DC (or mean) mode and planar mode, or directional modes as defined in h.266 under development.
In possible implementations, the set of inter Prediction modes may include, for example, an Advanced Motion Vector (AMVP) mode and a merge (merge) mode depending on available reference pictures (i.e., at least some of the decoded pictures stored in the DBP230, for example, as described above) and other inter Prediction parameters, e.g., depending on whether the entire reference picture or only a portion of the reference picture, such as a search window region of a region surrounding the current block, is used to search for a best matching reference block, and/or depending on whether pixel interpolation, such as half-pixel and/or quarter-pixel interpolation, is applied, for example. In a specific implementation, the inter prediction mode set may include an improved control point-based AMVP mode and an improved control point-based merge mode according to an embodiment of the present application. In one example, intra-prediction unit 254 may be used to perform any combination of the inter-prediction techniques described below.
In addition to the above prediction mode, embodiments of the present application may also apply a skip mode and/or a direct mode.
The prediction processing unit 260 may further be configured to partition the image block 203 into smaller block partitions or sub-blocks, for example, by iteratively using quad-tree (QT) partitions, binary-tree (BT) partitions, or triple-tree (TT) partitions, or any combination thereof, and to perform prediction, for example, for each of the block partitions or sub-blocks, wherein mode selection includes selecting a tree structure of the partitioned image block 203 and selecting a prediction mode to apply to each of the block partitions or sub-blocks.
The inter prediction unit 244 may include a Motion Estimation (ME) unit (not shown in fig. 2) and a Motion Compensation (MC) unit (not shown in fig. 2). The motion estimation unit is used to receive or obtain a picture image block 203 (current picture image block 203 of current picture 201) and a decoded picture 231, or at least one or more previously reconstructed blocks, e.g., reconstructed blocks of one or more other/different previously decoded pictures 231, for motion estimation. For example, the video sequence may comprise a current picture and a previously decoded picture 31, or in other words, the current picture and the previously decoded picture 31 may be part of, or form, a sequence of pictures forming the video sequence.
For example, the encoder 20 may be configured to select a reference block from a plurality of reference blocks of the same or different one of a plurality of other pictures and provide the reference picture and/or an offset (spatial offset) between a position (X, Y coordinates) of the reference block and a position of the current block to a motion estimation unit (not shown in fig. 2) as an inter prediction parameter. This offset is also called Motion Vector (MV).
The motion compensation unit is configured to obtain inter-prediction parameters and perform inter-prediction based on or using the inter-prediction parameters to obtain an inter-prediction block 245. The motion compensation performed by the motion compensation unit (not shown in fig. 2) may involve taking or generating a prediction block based on a motion/block vector determined by motion estimation (possibly performing interpolation to sub-pixel precision). Interpolation filtering may generate additional pixel samples from known pixel samples, potentially increasing the number of candidate prediction blocks that may be used to encode a picture block. Upon receiving the motion vector for the PU of the current picture block, motion compensation unit 246 may locate the prediction block in one reference picture list to which the motion vector points. Motion compensation unit 246 may also generate syntax elements associated with the blocks and video slices for use by decoder 30 in decoding picture blocks of the video slices.
In particular, the inter prediction unit 244 may transmit a syntax element including inter prediction parameters (e.g., indication information for selecting an inter prediction mode for current block prediction after traversing a plurality of inter prediction modes) to the entropy encoding unit 270. In a possible application scenario, if there is only one inter prediction mode, the inter prediction parameters may not be carried in the syntax element, and the decoding end 30 can directly use the default prediction mode for decoding. It will be appreciated that the inter prediction unit 244 may be used to perform any combination of inter prediction techniques.
The intra prediction unit 254 is used to obtain, for example, a picture block 203 (current picture block) of the same picture and one or more previously reconstructed blocks, e.g., reconstructed neighboring blocks, to be received for intra estimation. For example, the encoder 20 may be configured to select an intra-prediction mode from a plurality of (predetermined) intra-prediction modes.
Embodiments of encoder 20 may be used to select an intra prediction mode based on optimization criteria, such as based on a minimum residual (e.g., an intra prediction mode that provides a prediction block 255 that is most similar to current picture block 203) or a minimum code rate distortion.
The intra-prediction unit 254 is further configured to determine the intra-prediction block 255 based on the intra-prediction parameters as the selected intra-prediction mode. In any case, after selecting the intra-prediction mode for the block, intra-prediction unit 254 is also used to provide intra-prediction parameters, i.e., information indicating the selected intra-prediction mode for the block, to entropy encoding unit 270. In one example, intra-prediction unit 254 may be used to perform any combination of intra-prediction techniques.
Specifically, the above-described intra prediction unit 254 may transmit a syntax element including an intra prediction parameter (such as indication information of selecting an intra prediction mode for current block prediction after traversing a plurality of intra prediction modes) to the entropy encoding unit 270. In a possible application scenario, if there is only one intra-prediction mode, the intra-prediction parameters may not be carried in the syntax element, and the decoding end 30 may directly use the default prediction mode for decoding.
Entropy encoding unit 270 is configured to apply an entropy encoding algorithm or scheme (e.g., a Variable Length Coding (VLC) scheme, a Context Adaptive VLC (CAVLC) scheme, an arithmetic coding scheme, a Context Adaptive Binary Arithmetic Coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), Probability Interval Partition Entropy (PIPE) coding, or other entropy encoding methods or techniques) to individual or all of quantized residual coefficients 209, inter-prediction parameters, intra-prediction parameters, and/or loop filter parameters (or not) to obtain encoded picture data 21 that may be output by output 272 in the form of, for example, encoded bitstream 21. The encoded bitstream may be transmitted to video decoder 30 or archived for later transmission or retrieval by video decoder 30. Entropy encoding unit 270 may also be used to entropy encode other syntax elements of the current video slice being encoded.
Other structural variations of video encoder 20 may be used to encode the video stream. For example, the non-transform based encoder 20 may quantize the residual signal directly without the transform processing unit 206 for certain blocks or frames. In another embodiment, encoder 20 may have quantization unit 208 and inverse quantization unit 210 combined into a single unit.
Specifically, in the embodiment of the present application, the encoder 20 may be used to implement the inter prediction method described in the following embodiments.
It should be understood that other structural variations of the video encoder 20 may be used to encode the video stream. For example, for some image blocks or image frames, video encoder 20 may quantize the residual signal directly without processing by transform processing unit 206 and, correspondingly, without processing by inverse transform processing unit 212; alternatively, for some image blocks or image frames, the video encoder 20 does not generate residual data and accordingly does not need to be processed by the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210, and the inverse transform processing unit 212; alternatively, video encoder 20 may store the reconstructed image block directly as a reference block without processing by filter 220; alternatively, the quantization unit 208 and the inverse quantization unit 210 in the video encoder 20 may be merged together. The loop filter 220 is optional, and in the case of lossless compression coding, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210, and the inverse transform processing unit 212 are optional. It should be appreciated that the inter prediction unit 244 and the intra prediction unit 254 may be selectively enabled according to different application scenarios.
Referring to fig. 3, fig. 3 shows a schematic/conceptual block diagram of an example of a decoder 30 for implementing embodiments of the present application. Video decoder 30 is operative to receive encoded picture data (e.g., an encoded bitstream) 21, e.g., encoded by encoder 20, to obtain a decoded picture 231. During the decoding process, video decoder 30 receives video data, such as an encoded video bitstream representing picture blocks of an encoded video slice and associated syntax elements, from video encoder 20.
In the example of fig. 3, decoder 30 includes entropy decoding unit 304, inverse quantization unit 310, inverse transform processing unit 312, reconstruction unit 314 (e.g., summer 314), buffer 316, loop filter 320, decoded picture buffer 330, and prediction processing unit 360. The prediction processing unit 360 may include an inter prediction unit 344, an intra prediction unit 354, and a mode selection unit 362. In some examples, video decoder 30 may perform a decoding pass that is substantially reciprocal to the encoding pass described with reference to video encoder 20 of fig. 2.
Entropy decoding unit 304 is to perform entropy decoding on encoded picture data 21 to obtain, for example, quantized coefficients 309 and/or decoded encoding parameters (not shown in fig. 3), such as any or all of inter-prediction, intra-prediction parameters, loop filter parameters, and/or other syntax elements (decoded). The entropy decoding unit 304 is further for forwarding the inter-prediction parameters, the intra-prediction parameters, and/or other syntax elements to the prediction processing unit 360. Video decoder 30 may receive syntax elements at the video slice level and/or the video block level.
Inverse quantization unit 310 may be functionally identical to inverse quantization unit 110, inverse transform processing unit 312 may be functionally identical to inverse transform processing unit 212, reconstruction unit 314 may be functionally identical to reconstruction unit 214, buffer 316 may be functionally identical to buffer 216, loop filter 320 may be functionally identical to loop filter 220, and decoded picture buffer 330 may be functionally identical to decoded picture buffer 230.
Prediction processing unit 360 may include inter prediction unit 344 and intra prediction unit 354, where inter prediction unit 344 may be functionally similar to inter prediction unit 244 and intra prediction unit 354 may be functionally similar to intra prediction unit 254. The prediction processing unit 360 is typically used to perform block prediction and/or to obtain a prediction block 365 from the encoded data 21, as well as to receive or obtain (explicitly or implicitly) prediction related parameters and/or information about the selected prediction mode from, for example, the entropy decoding unit 304.
When the video slice is encoded as an intra-coded (I) slice, intra-prediction unit 354 of prediction processing unit 360 is used to generate a prediction block 365 for the picture block of the current video slice based on the signaled intra-prediction mode and data from previously decoded blocks of the current frame or picture. When a video frame is encoded as an inter-coded (i.e., B or P) slice, inter prediction unit 344 (e.g., a motion compensation unit) of prediction processing unit 360 is used to generate a prediction block 365 for the video block of the current video slice based on the motion vectors and other syntax elements received from entropy decoding unit 304. For inter prediction, a prediction block may be generated from one reference picture within one reference picture list. Video decoder 30 may construct the reference frame list using default construction techniques based on the reference pictures stored in DPB 330: list 0 and list 1.
Prediction processing unit 360 is used to determine prediction information for the video blocks of the current video slice by parsing the motion vectors and other syntax elements, and to generate a prediction block for the current video block being decoded using the prediction information. In an example of the present application, prediction processing unit 360 uses some of the syntax elements received to determine a prediction mode (e.g., intra or inter prediction) for encoding video blocks of a video slice, an inter prediction slice type (e.g., B-slice, P-slice, or GPB-slice), construction information for one or more of a reference picture list of the slice, a motion vector for each inter-coded video block of the slice, an inter prediction state for each inter-coded video block of the slice, and other information to decode video blocks of a current video slice. In another example of the present disclosure, the syntax elements received by video decoder 30 from the bitstream include syntax elements received in one or more of an Adaptive Parameter Set (APS), a Sequence Parameter Set (SPS), a Picture Parameter Set (PPS), or a slice header.
Inverse quantization unit 310 may be used to inverse quantize (i.e., inverse quantize) the quantized transform coefficients provided in the bitstream and decoded by entropy decoding unit 304. The inverse quantization process may include using quantization parameters calculated by video encoder 20 for each video block in the video slice to determine the degree of quantization that should be applied and likewise the degree of inverse quantization that should be applied.
Inverse transform processing unit 312 is used to apply an inverse transform (e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients in order to produce a residual block in the pixel domain.
The reconstruction unit 314 (e.g., summer 314) is used to add the inverse transform block 313 (i.e., reconstructed residual block 313) to the prediction block 365 to obtain the reconstructed block 315 in the sample domain, e.g., by adding sample values of the reconstructed residual block 313 to sample values of the prediction block 365.
Loop filter unit 320 (either during or after the encoding cycle) is used to filter reconstructed block 315 to obtain filtered block 321 to facilitate pixel transitions or improve video quality. In one example, loop filter unit 320 may be used to perform any combination of the filtering techniques described below. Loop filter unit 320 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters, such as a bilateral filter, an Adaptive Loop Filter (ALF), or a sharpening or smoothing filter, or a collaborative filter. Although loop filter unit 320 is shown in fig. 3 as an in-loop filter, in other configurations, loop filter unit 320 may be implemented as a post-loop filter.
Decoded video block 321 in a given frame or picture is then stored in decoded picture buffer 330, which stores reference pictures for subsequent motion compensation.
Decoder 30 is used to output decoded picture 31, e.g., via output 332, for presentation to or viewing by a user.
Other variations of video decoder 30 may be used to decode the compressed bitstream. For example, decoder 30 may generate an output video stream without loop filter unit 320. For example, the non-transform based decoder 30 may directly inverse quantize the residual signal without the inverse transform processing unit 312 for certain blocks or frames. In another embodiment, video decoder 30 may have inverse quantization unit 310 and inverse transform processing unit 312 combined into a single unit.
Specifically, in the embodiment of the present application, the decoder 30 is configured to implement the inter prediction method described in the following embodiments.
It should be understood that other structural variations of the video decoder 30 may be used to decode the encoded video bitstream. For example, video decoder 30 may generate an output video stream without processing by filter 320; alternatively, for some image blocks or image frames, the quantized coefficients are not decoded by entropy decoding unit 304 of video decoder 30 and, accordingly, do not need to be processed by inverse quantization unit 310 and inverse transform processing unit 312. Loop filter 320 is optional; and the inverse quantization unit 310 and the inverse transform processing unit 312 are optional for the case of lossless compression. It should be understood that the inter prediction unit and the intra prediction unit may be selectively enabled according to different application scenarios.
It should be understood that, in the encoder 20 and the decoder 30 of the present application, the processing result of a certain link may be further processed and then output to the next link, for example, after the links such as interpolation filtering, motion vector derivation, or loop filtering, the processing result of the corresponding link is further subjected to operations such as Clip or shift.
For example, the motion vector of the control point of the current image block derived according to the motion vector of the adjacent affine coding block, or the derived motion vector of the sub-block of the current image block may be further processed, which is not limited in the present application. For example, the value range of the motion vector is constrained to be within a certain bit width. Assuming that the allowable bit width of the motion vector is bitDepth, the range of the motion vector is-2 bitDepth-1 ~2 bitDepth-1 -1. If bitDepth is 16And the value range is-32768-32767. And if the bitDepth is 18, the value range is-131072-131071. As another example, the value of the motion vector (e.g., the motion vector MV of four 4 × 4 sub-blocks within an 8 × 8 image block) is constrained such that the maximum difference between the integer parts of the four 4 × 4 sub-blocks MV does not exceed N pixels, e.g., does not exceed one pixel.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a video coding apparatus 400 (e.g., a video encoding apparatus 400 or a video decoding apparatus 400) provided by an embodiment of the present application. Video coding apparatus 400 is suitable for implementing the embodiments described herein. In one embodiment, video coding device 400 may be a video decoder (e.g., decoder 30 of fig. 1A) or a video encoder (e.g., encoder 20 of fig. 1A). In another embodiment, the video coding device 400 may be one or more components of the decoder 30 of fig. 1A or the encoder 20 of fig. 1A described above.
Video coding apparatus 400 includes: an ingress port 410 and a reception unit (Rx)420 for receiving data, a processor, logic unit or Central Processing Unit (CPU)430 for processing data, a transmitter unit (Tx)440 and an egress port 450 for transmitting data, and a memory 460 for storing data. Video coding device 400 may also include optical-to-Electrical (EO) components and optical-to-electrical (opto) components coupled with ingress port 410, receiver unit 420, transmitter unit 440, and egress port 450 for egress or ingress of optical or electrical signals.
The processor 430 is implemented by hardware and software. Processor 430 may be implemented as one or more CPU chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs. Processor 430 is in communication with inlet port 410, receiver unit 420, transmitter unit 440, outlet port 450, and memory 460. Processor 430 includes a coding module 470 (e.g., encoding module 470 or decoding module 470). The encoding/decoding module 470 implements embodiments disclosed herein to implement the inter prediction methods provided by embodiments of the present application. For example, the encoding/decoding module 470 implements, processes, or provides various encoding operations. Accordingly, substantial improvements are provided to the functionality of the video coding apparatus 400 by the encoding/decoding module 470 and affect the transition of the video coding apparatus 400 to different states. Alternatively, the encode/decode module 470 is implemented as instructions stored in the memory 460 and executed by the processor 430.
The memory 460, which may include one or more disks, tape drives, and solid state drives, may be used as an over-flow data storage device for storing programs when such programs are selectively executed, and for storing instructions and data that are read during program execution. The memory 460 may be volatile and/or nonvolatile, and may be Read Only Memory (ROM), Random Access Memory (RAM), random access memory (TCAM), and/or Static Random Access Memory (SRAM).
Referring to fig. 5, fig. 5 is a simplified block diagram of an apparatus 500 that may be used as either or both of source device 12 and destination device 14 in fig. 1A according to an example embodiment. Apparatus 500 may implement the techniques of this application. In other words, fig. 5 is a schematic block diagram of an implementation manner of an encoding apparatus or a decoding apparatus (simply referred to as a decoding apparatus 500) of the embodiment of the present application. Among other things, the decoding device 500 may include a processor 510, a memory 530, and a bus system 550. Wherein the processor is connected with the memory through the bus system, the memory is used for storing instructions, and the processor is used for executing the instructions stored by the memory. The memory of the coding device stores program code, and the processor may invoke the program code stored in the memory to perform the various video encoding or decoding methods described herein. To avoid repetition, it is not described in detail here.
In the embodiment of the present application, the processor 510 may be a Central Processing Unit (CPU), and the processor 510 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 530 may include a Read Only Memory (ROM) device or a Random Access Memory (RAM) device. Any other suitable type of memory device may also be used for memory 530. Memory 530 may include code and data 531 to be accessed by processor 510 using bus 550. Memory 530 may further include operating system 533 and application programs 535, the application programs 535 including at least one program that allows processor 510 to perform the video encoding or decoding methods described herein, and in particular the inter-prediction methods described herein. For example, the application programs 535 may include applications 1 through N, which further include a video encoding or decoding application (simply a video coding application) that performs the video encoding or decoding methods described herein.
The bus system 550 may include a power bus, a control bus, a status signal bus, and the like, in addition to a data bus. For clarity of illustration, however, the various buses are designated in the figure as bus system 550.
Optionally, the translator device 500 may also include one or more output devices, such as a display 570. In one example, the display 570 may be a touch-sensitive display that incorporates a display with a touch-sensing unit operable to sense touch input. A display 570 may be connected to the processor 510 via the bus 550.
The scheme of the embodiment of the application is explained in detail as follows:
video coding mainly includes links such as Intra Prediction (Intra Prediction), Inter Prediction (Inter Prediction), Transform (Transform), Quantization (Quantization), Entropy coding (Entropy coding), and in-loop filtering (in-loop filtering) (mainly, de-blocking filtering). And dividing the image into coding blocks, then carrying out intra-frame prediction or inter-frame prediction, carrying out transform quantization after obtaining a residual error, finally carrying out entropy coding and outputting a code stream. Here, the coding block is an array of M × N size (M may be equal to N or not equal to N) composed of pixels, and the pixel value of each pixel position is known.
The intra-frame prediction refers to the prediction of the pixel value of the pixel point in the current coding block by using the pixel value of the pixel point in the reconstructed area in the current image.
Inter-frame prediction is to find a matched reference block for a current coding block in a current image in a reconstructed image so as to obtain motion information of the current coding block, and then calculate prediction information or a prediction value of a pixel point in the current coding block according to the motion information (information and values are not distinguished below). The process of calculating Motion information is called Motion Estimation (ME), and the process of calculating a prediction value of a pixel in a current coding block is called Motion Compensation (MC).
It should be noted that the Motion information of the current coding block includes indication information of a prediction direction (usually forward prediction, backward prediction, or bi-prediction), one or two Motion Vectors (MVs) pointing to the Reference block, and indication information of a picture (usually referred to as a Reference frame index) where the Reference block is located.
Forward prediction refers to the current coding block selecting a reference picture from a forward reference picture set to obtain a reference block. Backward prediction refers to that a current coding block selects a reference image from a backward reference image set to obtain a reference block. Bi-directional prediction refers to selecting a reference picture from each of a set of forward and backward reference pictures to obtain a reference block. When a bidirectional prediction method is used, two reference blocks exist in a current coding block, each reference block needs to indicate a motion vector and a reference frame index, and then a predicted value of a pixel point in the current block is determined according to pixel values of pixel points in the two reference blocks.
The motion estimation process requires trying multiple reference blocks in the reference picture for the current coding block, and ultimately which reference block or blocks to use for prediction is determined using Rate-distortion optimization (RDO) or other methods.
After prediction information is obtained by utilizing intra-frame prediction or inter-frame prediction, residual information is obtained by subtracting the corresponding prediction information from the pixel value of a pixel point in a current coding block, then the residual information is transformed by utilizing methods such as Discrete Cosine Transform (DCT) and the like, and then a code stream is obtained by utilizing quantization entropy coding. After the prediction signal is added with the reconstructed residual signal, further filtering operation is required to obtain a reconstructed signal, and the reconstructed signal is used as a reference signal of subsequent coding.
Decoding corresponds to the inverse of encoding. For example, first, residual information is obtained by entropy decoding and inverse quantizing, and the code stream is decoded to determine whether the current coding block uses intra prediction or inter prediction. And if the prediction is intra-frame prediction, constructing prediction information according to the used intra-frame prediction method by using the pixel values of the pixel points in the peripheral reconstructed region. If the inter-frame prediction is performed, it is necessary to analyze Motion information, determine a reference block in the reconstructed image using the analyzed Motion information, and use a pixel value of a pixel point in the block as prediction information, which is called Motion Compensation (MC). The reconstruction information can be obtained by filtering operation by using the prediction information and the residual error information.
In HEVC, two inter Prediction modes are used, an Advanced Motion Vector Prediction (AMVP) mode and a Merge (Merge) mode, respectively.
For the AMVP mode, a candidate Motion vector list is first constructed according to Motion information of a coded block that is adjacent in a spatial domain or a temporal domain of a current coded block, and then an optimal Motion vector is determined from the candidate Motion vector list to be used as a Motion Vector Predictor (MVP) of the current coded block. The rate distortion Cost is calculated by a formula J-SAD + λ, where J is a rate distortion Cost RD Cost, SAD is the Sum of Absolute errors (SAD) between a predicted pixel value obtained by performing motion estimation using a candidate motion vector predictor and an original pixel value, R is a code rate, λ is a lagrange multiplier, and an encoding end transmits an index value of the selected motion vector predictor in a candidate motion vector list and a reference frame index value to a decoding end. Further, Motion search is performed in a neighborhood with the MVP as a center to obtain an actual Motion vector of the current coding block, and the coding end transmits a difference (Motion vector difference) between the MVP and the actual Motion vector to the decoding end.
For the Merge mode, a candidate motion information list is constructed according to motion information of coded blocks adjacent to a current coded block in a space domain or a time domain, then, the optimal motion information is determined from the candidate motion information list through rate distortion cost and is used as the motion information of the current coded block, and then, an index value (marked as Merge index, the same below) of the position of the optimal motion information in the candidate motion information list is transmitted to a decoding end. Spatial and temporal candidate motion information for a current coding block as shown in fig. 6, the spatial candidate motion information is from spatially neighboring 5 blocks (a0, a1, B0, B1, and B2), and if the neighboring blocks are not available or in intra coding mode, no candidate motion information list is added. The time domain candidate motion information of the current coding block is obtained by scaling the MV of the block at the corresponding position in the reference frame according to the Picture Order Count (POC) of the reference frame and the current frame. Firstly, judging whether a block with a position T in a reference frame is available or not, and if not, selecting a block with a position C.
In the inter-frame prediction of HEVC, all pixels in a coding block use the same motion information, and then motion compensation is performed according to the motion information to obtain a prediction value of the pixel of the coding block.
A video sequence contains a certain number of pictures, usually called frames (frames). Neighboring pictures are usually very similar, i.e. contain much redundancy. The purpose of using motion compensation is to increase the compression ratio by eliminating such redundancy between adjacent frames. Motion compensation is a method of describing the difference between adjacent frames (adjacent here means adjacent in coding relation, two frames are not necessarily adjacent in playing order), which belongs to a loop in the inter-frame prediction process. Before motion compensation, the motion information of the coding block is obtained by motion estimation or code stream decoding. These motion information mainly includes: (1) prediction direction of the coding block: the method comprises the steps of forward prediction, backward prediction and bidirectional prediction, wherein the forward prediction indicates that a coding block is obtained by predicting from a previous coded frame, the backward prediction indicates that the coding block is obtained by predicting from a subsequent coded frame, and the bidirectional prediction indicates that the coding block is obtained by combining the prediction of the previous and backward coded frames; (2) the reference frame index of the coding block indicates the frame where the reference block of the current coding block is located; (3) the motion vector MV of a coding block, which represents the motion displacement of the coding block relative to a reference block, includes a horizontal component (denoted MVx) and a vertical component (denoted MVy), which represent the motion displacement of the coding block relative to the reference block in the horizontal direction and the vertical direction, respectively. When the coding block is forward or backward predicted, there is only one MV, and when the coding block is bi-directional predicted, there are two MVs. Fig. 7 gives an explanation of the above motion information. In fig. 7 and the following description about motion information and prediction information, 0 denotes a forward direction and 1 denotes a backward direction. For example, Ref0 denotes a forward reference frame, Ref1 denotes a backward reference frame, MV0 denotes a forward motion vector, and MV1 denotes a backward motion vector. A. B, C denote the forward reference block, the current coding block and the backward reference block, respectively. Cur is the current coding frame, and the dotted line represents the motion track of B. The motion compensation is a process of finding a reference block according to motion information and processing the reference block to obtain a prediction block of a coding block.
The basic process of motion compensation for forward prediction is as follows: in fig. 7, the current coding block is block B in the figure, and the height and width of B are H and W, respectively. At this time, the forward reference frame of the current coding block B is known as the Ref0 frame according to the motion information, and the forward motion vector MV0 of the current coding block B is (MV0x, MV0 y). When coding block B in Cur frame, first find the same coordinate point in Ref0 frame according to coordinate (i, j) of the point at the top left corner of B in Cur frame, obtain block B ' in Ref0 according to length and width of block B, and then move block B ' to block a according to MV0 of block B '. And finally, carrying out interpolation processing on the block A to obtain a prediction block of the current coding block B, wherein the pixel value of each pixel point in the prediction block of the current coding block B is called as the predicted value of the corresponding pixel point in the block B. The motion compensation process for backward prediction is the same as for forward prediction, except that the reference direction is different. It should be noted that the prediction blocks obtained by the backward prediction and the forward prediction motion compensation are referred to as a forward prediction block and a backward prediction block, respectively, and when the coding block is not bi-predicted, the obtained forward prediction block and backward prediction block are prediction blocks of the current coding block.
For bidirectional prediction, a forward prediction block and a backward prediction block are obtained according to motion information respectively according to motion compensation processes of forward prediction and backward prediction, and then a prediction block of a coding block B is obtained only by performing weighted prediction or Bi-directional optical flow (BIO) technology on pixel values with the same positions in the forward prediction block and the backward prediction block.
When the weighted prediction method is used for solving the predicted value of the current coding block, the pixel value of the forward prediction block and the co-located pixel value of the backward prediction block are weighted and summed in sequence, namely
PredB(i,j)=ω 0 PredA(i,j)+ω 1 PredC(i,j) (1)
In equation (1), PredB (i, j), PredA (i, j), and PredC (i, j) are respectively the predicted values of the predicted block, the forward predicted block, and the backward predicted block of the current coding block at coordinates (i, j). Omega 0 、ω 1 (0<=ω 0 <=1,0<=ω 1 <1, and ω 01 1) are weighting coefficients respectively, and different encoders may have different specific values. Usually, ω 0 And ω 1 Both 1/2.
Fig. 8 shows an example of a weighted sum to obtain a prediction block for the current coding block. In fig. 8, PredB, PredA, and PredC are prediction blocks, forward prediction blocks, and backward prediction blocks of the current coding block, respectively, and have a size of 4 × 4, the value of a small block in the prediction block is a prediction value of a certain point, and a coordinate system is established by using the upper left corner of PredB, PredA, and PredC, respectively, as an origin. For example, the predicted value of PredB at coordinate (0,0) is:
PredB(0,0)=ω 0 PredA(0,0)+ω 1 PredC(0,0)=ω 0 a 0,01 c 0,0
the predicted value of PredB at coordinate (0,1) is:
PredB(0,1)=ω 0 PredA(0,1)+ω 1 PredC(0,1)=ω 0 a 0,11 c 0,1
and calculating the rest points in sequence, and no further description is given.
It can be seen that the bidirectional prediction weighted prediction technique is simple in calculation, but the motion compensation method based on the block level is very coarse, and especially for the image with complex texture, the prediction effect is poor, and the compression efficiency is not high.
And the BIO completes motion compensation of bidirectional prediction on the current CU to obtain a forward and backward prediction block, and then derives a corrected motion vector of each 4 multiplied by 4 sub-block in the current CU according to a forward and backward prediction value. And finally, performing primary compensation on each pixel point in the current coding block to finally obtain the prediction block of the current CU.
The modified motion vector (vx, vy) for each 4 × 4 sub-block is obtained by applying the BIO to the 6 × 6 window Ω around the sub-block, thus minimizing the predicted values of L0 and L1. Specifically, (vx, vy) is derived by a formula.
Figure BDA0001939548890000341
Wherein the content of the first and second substances,
Figure BDA0001939548890000342
is floor function (floor (A) represents the largest integer not greater than A); th' BIO =2 13-BD And a threshold value for preventing error transmission due to too large corrected motion vector. S 2,m =S 2 >>12,S 2,s =S 2 &(2 12 -1). BD is the current pixel bit width.
S 1 ,S 2 ,S 3 ,S 5 And S 6 Calculated according to the following formula:
Figure BDA0001939548890000351
wherein the content of the first and second substances,
Figure BDA0001939548890000352
wherein, I (k) (i, j) is the predicted value of the (i, j) pixel position in the current CU (k is equal to 0 or 1, 0 represents forward, 1 represents backward, the same applies below);
Figure BDA00019395488900003511
and
Figure BDA00019395488900003512
the horizontal gradient value and the numerical gradient value of the (i, j) pixel position, respectively, are obtained by the following formulas:
Figure BDA0001939548890000355
after the corrected motion vector is obtained according to the formula (2), the final predicted value of each pixel point in the current block is determined according to the following formula:
Figure BDA0001939548890000356
wherein shift and O offset 15-BD and 1 < (14-BD) +2 (1 < 13). rnd (. eta.) is a rounding function (rounded).
Since the correction motion vector of a 4 × 4 sub-block is calculated, the forward and backward predicted value I of the 6 × 6 area in which the sub-block is located needs to be adopted (k) (i, j), forward and backward horizontal and vertical gradient values
Figure BDA0001939548890000359
And
Figure BDA00019395488900003510
and the gradient value of 6 × 6 area is calculated, and the predicted value of 8 × 8 area is needed. Therefore, when the forward and backward predicted values are obtained through the interpolation filter, 2 rows and 2 columns need to be expanded to the four sides to obtain a predicted pixel block with the size of (W +4) × (H +4), and the gradient value of (W +2) × (H +2) can be calculated, wherein W is the width of the current CU and H is the height of the current CU.
To reduce the complexity of BIO, the following method performs special processing on the boundary of CU.
First, the predicted value of the W × H region is obtained by an 8-tap filter, and the predicted value of the extended region is obtained by extending only 1 row and 1 column around the extended region by a bilinear filter, thereby obtaining the predicted pixel value of the (W +2) × (H +2) region.
Next, from the predicted pixel value of the (W +2) × (H +2) region, the gradient value of the W × H region can be calculated according to equation (5).
Finally, according to the Padding method, expanding the gradient value of the W multiplied by H area to the periphery to obtain the gradient value of the (W +2) multiplied by (H +2) area; the predicted value of the W × H area is expanded to four sides to obtain the predicted value of the (W +2) × (H +2) area. Padding as shown in fig. 9, the arrow indicates the source of Padding data, i.e. the pixel value of the edge is assigned to the extended area.
The specific implementation flow of BIO is as follows:
step 1: motion information of the current CU is determined.
The motion information of the current CU may be determined in the Merge mode, the AMVP mode, or other modes, which is not limited herein.
It should be noted that other determination methods of motion information may also be applied to the present application, and are not described herein again.
Step 2: and judging whether the current CU meets the use condition of the BIO.
If the current CU adopts bi-prediction and the relationship between the forward reference frame number POC _ L0, the backward reference frame number POC _ L1 and the current frame number POC _ Cur satisfies the following formula, the current CU satisfies the usage condition of BIO:
(POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0
it should be noted that whether the BIO is adopted may also be determined by determining whether the size of the current CU is larger than a preset threshold. If only the height W of the current CU is larger than or equal to 8 and the width H is larger than or equal to 8, the BIO can be adopted.
It should be noted that other usage conditions of BIO may also be applied to the present application, and are not described herein again.
If the current CU meets the use condition of the BIO, executing the step 3; otherwise, motion compensation is performed in other manners.
And step 3: and calculating the forward and backward predicted value of the current CU.
Using the motion information to carry out motion compensation to obtain a forward and backward predicted value I (k) (i, j) wherein i [ -1, cuW],j=[-1,cuH](then get the prediction matrix of (cuW +2) × (cuH + 2)).
Wherein the content of the first and second substances,I (k) (i, j) wherein i is [0, cuW-1 ]],j=[0,cuH-1]The prediction value of other positions (the position of 1 line and 1 column is expanded) is obtained by interpolation through a bilinear interpolation filter.
It should be noted that the prediction value of the extended region may also be obtained by other methods, such as using an 8-tap interpolation filter, or directly using a reference pixel at an integer pixel position, which is not limited herein.
It should be noted that the forward/backward prediction value matrix I of the current CU may be calculated (k) And (i, j) determining whether the SAD is larger than a threshold TH _ CU, and if so, executing BIO processing on the current CU. Otherwise, the BIO processing is not performed on the current CU. Other determination methods may also be applied to the present application, and are not described herein again.
The SAD calculation formula is as follows:
Figure BDA0001939548890000361
the threshold TH _ CU may be set to (1< (BD-8 + shift)) × cuW × cuH, shift ═ Max (2, 4-BD).
And 4, step 4: calculating horizontal and vertical gradient values of the forward and backward predicted value of the current CU
Calculating according to the formula (5) according to the forward and backward predicted values to obtain horizontal and vertical gradient values
Figure BDA0001939548890000364
And
Figure BDA0001939548890000365
wherein i ═ 0, cuW-1],j=[0,cuH-1](a prediction matrix of cuW × cuH is obtained).
And 5: and carrying out Padding on the forward and backward predicted value of the current CU and the gradient values in the horizontal direction and the vertical direction.
Padding was performed using the method shown in FIG. 9 to give I (k) (i,j)、
Figure BDA0001939548890000373
And
Figure BDA0001939548890000374
wherein i [ -1, cuW],j=[-1,cuH](then get the prediction matrix of (cuW +2) × (cuH +2), horizontal gradient matrix and vertical gradient matrix).
Step 6: deriving modified motion vectors for each 4 x 4 sub-block, and weighting
And (3) obtaining vx and vy according to a formula (2) for each 4 x 4 sub-block, and finally weighting according to a formula (6) to obtain the predicted value of each 4 x 4 sub-block.
It should be noted that, the SAD between the forward and backward predicted values of each 4 × 4 sub-block in the current CU may be calculated, whether the SAD of each 4 × 4 sub-block is greater than the threshold TH _ SCU is determined, and for the 4 × 4 sub-block satisfying the condition, the modified motion vectors vx and vy are calculated according to the formula (2), and then weighted according to the formula (6). For 4 x 4 sub-blocks that do not satisfy more than this condition, the weighted average is directly performed according to equation (1). Other determination methods may also be applied to the present application, and are not described herein again. TU _ SCU may be set to 1< < (BD-3 + shift).
A Virtual Pipeline Data Unit (VPDU) is a non-overlapping processing unit of M × M luminance or N × N chrominance. In a hardware decoder, successive VPDUs are processed simultaneously in different pipeline stages. Different pipeline stages process different VPDUs at the same time.
The VPDU partition criteria are:
1) if the VPDU includes one or more CUs, the CUs are fully contained in the VPDU.
2) If a CU includes one or more VPDUs, the VPDUs are fully contained in the CU.
When the CU comprises a plurality of VPDUs, the hardware decoder is divided into continuous VPDUs for processing during processing. For example, if the CU size is 128 × 128 and the VPDU size is 64 × 64, 4 VPDUs are processed in succession.
The technical problem to be solved by the present application is that when a CU includes a plurality of VPDUs, all pixels of the VPDUs need to be processed in a manner of pixels inside the CU on the premise of ensuring that VPDU processing and CU processing results are consistent, which increases implementation complexity.
The following embodiments describe the BIO process for a current image block when the current image block is known to employ BIO and the width (cuW) of the current image block is greater than or equal to the width (VPDU _ X) of the VPDU or the height (cuH) of the current image block is greater than or equal to the height (VPDU _ Y) of the VPDU. For convenience of description, a definition of one coordinate is set, and for each VPDU in the current image block, a vertex at the upper left corner of the VPDU is taken as an origin of coordinates for example, the horizontal axis is positive to the right, and the vertical axis is positive to the bottom.
Technical scheme of first embodiment of the application
The embodiment of the present application is applicable to the schematic diagrams of the current image blocks shown in fig. 11-13, as shown in fig. 11, the current image block includes four VPDUs, the size of the current image block is 128 × 128, the size of the VPDU is 64 × 64, a black area is an area to be subjected to BIO processing (i.e., a first area), and a white area is an area not subjected to BIO processing (i.e., a second area). As shown in fig. 12, the current image block includes two VPDUs, the size of the current image block is 128 × 64, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., the first area), and the white area is an area not subjected to BIO processing (i.e., the second area). As shown in fig. 13, the current image block includes two VPDUs, the size of the current image block is 64 × 128, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., the first area), and the white area is an area not subjected to BIO processing (i.e., the second area).
Step 1: and acquiring a prediction value matrix corresponding to the VPDU to be processed in the current image block.
Performing motion compensation by using motion information of the current image block to obtain a forward and backward predicted value matrix I corresponding to the VPDU to be processed (k) (i, j), wherein the value range of i is [ W1, W2 ] ]J has a value in the range of [ H1, H2 ]]Wherein W1 is determined by leftW, W2 is determined by the width W and rightW of VPDU, H1 is determined by AboveH, and H2 is determined by the height H and Bottomh of VPDU. Based on the BIO principle, to obtain the predicted value in the first area, the predicted value needs to be expanded outwards based on the size of the first area to obtain a larger predicted valueIn this embodiment, based on various situations of the current image block shown in fig. 11 to 12, when the prediction value matrix corresponding to the VPDU to be processed is obtained, it is determined at which boundary or boundaries (not all boundaries of the VPDU to be processed) of the VPDU to be processed needs to be expanded outward according to the position of the first area, and therefore the size of the prediction value matrix is larger than that of the VPDU to be processed.
LeftW denotes a positional relationship between a basic prediction unit adjacent to a left boundary and one or more of the first boundary and the third boundary in the VPDU, RightW denotes a positional relationship between a basic prediction unit adjacent to a right boundary and one or more of the first boundary and the third boundary in the VPDU, above denotes a positional relationship between a basic prediction unit adjacent to an upper boundary and one or more of the first boundary and the third boundary in the VPDU, and bottom denotes a positional relationship between a basic prediction unit adjacent to a lower boundary and one or more of the first boundary and the third boundary in the VPDU. For example, LeftW, RightW, above h, and BottomH respectively indicate whether the 4 × 4 small blocks adjacent to the left boundary, the right boundary, the upper boundary, and the lower boundary in the VPDU to be processed are subjected to BIO processing. For another example, values of LeftW, RightW, above h, and BottomH are determined according to whether the left boundary, the right boundary, the upper boundary, and the lower boundary coincide with the boundary of the current image block, and are 1 if the left boundary, the right boundary, the upper boundary, and the lower boundary coincide with the boundary of the current image block, or are 0 if the left boundary, the right boundary, the upper boundary, and the lower boundary coincide with the boundary of the current image block.
In this embodiment of the application, when the second region is a pixel region adjacent to two mutually perpendicular first boundaries in a VPDU, if a left boundary of the VPDU is the second boundary, LeftW is 1; otherwise LeftW is 0. If the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0. If the upper boundary of the VPDU is the second boundary, the above is 1; otherwise, AboveH is 0. If the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
For example, i has a value range of [ -leftW, W-1+ rightW]J has the value range of [ -AboveH, H-1+ BottonH]W denotes the width of the VPDU, H denotes the length of the VPDU, I (k) The size of (i, j) is (W + leftW + rightW) × (H + AboveH + BottomH).
The following description takes the VPDU in the upper left corner of the current image block shown in fig. 11 as the VPDU to be processed as an example, and the VPDU to be processedThe coordinates of the pixel points in the VPDU are (i, j), i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in fig. 14, based on the above value-taking principle, the values of LeftW, RightW, above, and bottom corresponding to the VPDU to be processed are 1,0,1, and 0, respectively, and the prediction value matrix I corresponding to the VPDU to be processed can be obtained (k) The size of (i, j) is 65 × 65, i [ -1,63 [ ]],j=[-1,63]. It can be seen that in the present embodiment, the size of the predictor matrix is larger than that of the VPDU to be processed, the predictor matrix is expanded outward by one row at the upper boundary of the VPDU to be processed, and is expanded outward by one column at the left boundary of the VPDU to be processed, where i ═ 0,63 ]And j ═ 0,63]The predicted values of the pixels in the range (white part in fig. 14) can be obtained by interpolation through an 8-tap interpolation filter, and the predicted values of the pixels in the i-1 and j-1 expansion regions (a row expanded outside the upper boundary of the VPDU to be processed and a column expanded outside the left boundary of the VPDU to be processed, and a black part in fig. 14) can be obtained by interpolation through a bilinear interpolation filter. It should be noted that the predicted value of the pixel point of the extended region may also be obtained by using other methods, such as using an 8-tap interpolation filter, or directly using a reference pixel at the integer pixel position, which is not limited herein. In an example manner, the predicted value of the pixel point in the extended area may be obtained by interpolation according to the predicted value of the pixel point in the VPDU to be processed, and does not need to depend on the predicted values of the pixel points in other VPDUs.
Step 2: a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the first region are calculated.
The first region is a pixel region which needs to be subjected to BIO processing in a VPDU to be processed, and based on the principle of BIO, a predicted value in the first region needs to be obtained, and when a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the region are calculated, the predicted value needs to be expanded outwards on the basis of the size of the first region, and a horizontal prediction gradient matrix and a vertical prediction gradient matrix corresponding to a larger region are obtained.
Predictor matrix I obtained based on step 1 (k) (i, j), calculating according to the formula (5) to obtain a horizontal prediction gradient matrix of the first region
Figure BDA0001939548890000391
Wherein the value range of i is [ W3, W4 ]]J has a value in the range of [ H3, H4 ]]Wherein W3 is determined by leftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh. Calculating to obtain a vertical prediction gradient matrix of the first region according to the formula (5)
Figure BDA0001939548890000392
Wherein the value range of i is [ W5, W6 ]]J has a value in the range of [ H5, H6 ]]Wherein W5 is determined by leftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh. W1 to W6, H1 to H6, are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)。
Figure BDA0001939548890000393
and
Figure BDA0001939548890000394
has a size of (W-3((1-leftW) + (1-rightW))) × (H-3((1-above H) + (1-BottomH))).
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 11 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in the schematic view of figure 15,
Figure BDA0001939548890000395
and
Figure BDA0001939548890000396
has a size of 61 × 61 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are white portions indicated by a dotted line in fig. 15), i ═ 0,60],j=[0,60]. It can be seen that in the present embodiment, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively added by one row outwards at the lower boundary of the first region and by one column outwards at the right boundary of the first region. But based on the principle of BIO, it is also necessary to expand one row outward at the upper boundary of the first region and one column outward at the left boundary of the first region, respectively. The corresponding operation is performed by step 3 described below.
And step 3: padding is performed on the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
The method shown in FIG. 9 is used for Padding the horizontal prediction gradient matrix obtained in step 2 to obtain the extended horizontal prediction gradient matrix
Figure BDA0001939548890000397
Wherein the value range of i is [ W3-leftW, W4+ rightW]J has the value range of [ H3-AboveH, H4+ BottonH]Applying Padding to the vertical prediction gradient matrix obtained in step 2 by the method shown in FIG. 9 to obtain an expanded vertical prediction gradient matrix
Figure BDA0001939548890000398
Wherein the value range of i is [ W5-leftW, W6+ rightW]J has the value range of [ H5-AboveH, H6+ BottonH]After Padding
Figure BDA0001939548890000399
And
Figure BDA00019395488900003910
has a size of (W-6+4 × (leftW + rightW)) × (H-6+4 × (above H + BottomH)). In this embodiment, the method of filling the upper boundary and the left boundary in the horizontal prediction gradient matrix and the vertical prediction gradient matrix with their own pixel values respectively can enable the first pixel value in the VPDU to be processed in the current image block to be filled outwardsThe BIO processing of one area does not depend on the pixel values of adjacent VPDUs, and the parallel independent processing of each VPDU in the current image block is realized.
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 11 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63 ],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in fig. 16, after Padding
Figure BDA0001939548890000401
And
Figure BDA0001939548890000402
is 62 × 62 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix after Padding are as the white part and the black part indicated by the dotted line in fig. 16), i [ -1,60 ═ b [ - ]],j=[-1,60]. It can be seen that, in this embodiment, on the basis of step 2, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively expanded outward by one row at the upper boundary of the first region and by one column at the left boundary of the first region, and the finally obtained horizontal prediction gradient matrix and the vertical prediction gradient matrix are compared with the first region, and are respectively expanded outward by one row at the upper boundary and the lower boundary of the first region and by one column at the left boundary and the right boundary of the first region.
And 4, step 4: a modified motion vector for each basic prediction unit in the first region is calculated, and then a prediction value for each basic prediction unit is calculated.
The size of the basic prediction unit of the first region is 4 × 4. Obtaining a prediction value matrix I according to the step 1 and the step 3 (k) (i, j), horizontal prediction gradient matrix
Figure BDA0001939548890000403
And a vertical prediction gradient matrix
Figure BDA0001939548890000404
Calculating the modified motion vectors vx and vy of each basic prediction unit in the first region according to equation (2), and finally calculating the modified motion vectors vx and vy of each basic prediction unit in the first region according to equation (2) Equation (6) obtains the prediction value of each basic prediction unit in the first region.
Taking the VPDU at the upper left corner in the current image block shown in fig. 11 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the first region are (i, j), [0,59], j ═ 0,59, and a size of the first region is a white portion indicated by a dotted line in fig. 17.
And 5: a prediction value of each basic prediction unit in the second region is calculated.
The size of the basic prediction unit of the second region is 4 × 4. Obtaining a predicted value matrix I according to the step 1 (k) (i, j), a prediction value of each basic prediction unit in the second region is calculated according to formula (1).
Taking the VPDU at the top left corner in the current image block shown in fig. 11 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the second region are (i, j), ([ 60,63], and j ═ 60, 63).
When the image block is coded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the current image block, BIO processing is only performed on a first region in the VPDU, but not on all regions in the VPDU in the prior art, so that the number of basic prediction units for performing BIO processing in the VPDU is reduced, and in the process of BIO processing, pixel value sampling and filling are only performed on an expansion region adjacent to two VPDU boundaries (not all VPDU boundaries) of the current VPDU, so that not only is the BIO processing mode compatible, but also the operation amount of pixel value sampling and filling in the BIO processing process is reduced, and the implementation complexity is further reduced on the premise of not influencing the coding and decoding performance.
It should be noted that, in the first embodiment of the present application, the VPDU in the upper left corner of the current image block shown in fig. 11 is taken as an example of the VPDU to be processed, but the first embodiment of the present application is not limited to the VPDU in the upper left corner, and the method in the first embodiment of the present application is applicable to any VPDU in the current image block shown in any one of fig. 11 to 13.
Technical solution of the second embodiment of the present application (the same portions as those of the first embodiment of the present application, which are not described herein again)
The embodiment of the present application is applicable to the schematic diagrams of the current image blocks shown in fig. 11-13, as shown in fig. 11, the current image block includes four VPDUs, the size of the current image block is 128 × 128, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., the first area), and the white area is an area not subjected to BIO processing (i.e., the second area). As shown in fig. 12, the current image block includes two VPDUs, the size of the current image block is 128 × 64, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., the first area), and the white area is an area not subjected to BIO processing (i.e., the second area). As shown in fig. 13, the current image block includes two VPDUs, the size of the current image block is 64 × 128, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., the first area), and the white area is an area not subjected to BIO processing (i.e., the second area).
Step 1: and acquiring a prediction value matrix corresponding to the VPDU to be processed in the current image block.
Performing motion compensation by using motion information of the current image block to obtain a forward and backward predicted value matrix I corresponding to the VPDU to be processed (k) (i, j), wherein the value range of i is [ W1, W2 ]]J has a value in the range of [ H1, H2 ]]Wherein W1 is determined by leftW, W2 is determined by the width W and rightW of VPDU, H1 is determined by AboveH, and H2 is determined by the height H and Bottomh of VPDU. Based on the principle of BIO, to obtain the predicted value in the first area, it needs to expand outward based on the size of the first area to obtain the predicted value matrix corresponding to a larger area, and this embodiment is based on various situations of the current image block shown in fig. 11-12, and when obtaining the predicted value matrix corresponding to the VPDU to be processed, it is determined at which boundary or boundaries (all boundaries of non-VPDU to be processed) of the VPDU to be processed need to expand outward according to the position of the first area, so the size of the predicted value matrix is larger than the size of the VPDU to be processed.
LeftW denotes a positional relationship between a basic prediction unit adjacent to a left boundary and one or more of the first boundary and the third boundary in the VPDU, RightW denotes a positional relationship between a basic prediction unit adjacent to a right boundary and one or more of the first boundary and the third boundary in the VPDU, above denotes a positional relationship between a basic prediction unit adjacent to an upper boundary and one or more of the first boundary and the third boundary in the VPDU, and bottom denotes a positional relationship between a basic prediction unit adjacent to a lower boundary and one or more of the first boundary and the third boundary in the VPDU. For example, LeftW, RightW, above h, and BottomH respectively indicate whether the 4 × 4 small blocks adjacent to the left boundary, the right boundary, the upper boundary, and the lower boundary in the VPDU to be processed are subjected to BIO processing. For another example, values of LeftW, RightW, above h, and BottomH are determined according to whether the left boundary, the right boundary, the upper boundary, and the lower boundary coincide with the boundary of the current image block, and are 1 if the left boundary, the right boundary, the upper boundary, and the lower boundary coincide with the boundary of the current image block, or are 0 if the left boundary, the right boundary, the upper boundary, and the lower boundary coincide with the boundary of the current image block.
In this embodiment of the application, when the second region is a pixel region adjacent to two mutually perpendicular first boundaries in a VPDU, if a left boundary of the VPDU is the second boundary, LeftW is 1; otherwise LeftW is 0. If the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0. If the upper boundary of the VPDU is the second boundary, the above is 1; otherwise, AboveH is 0. If the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
For example, i has a value range of [ -leftW, W-1+ rightW]J has the value range of [ -AboveH, H-1+ BottonH]W denotes the width of the VPDU, H denotes the length of the VPDU, I (k) The size of (i, j) is (W + leftW + rightW) × (H + AboveH + BottomH).
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 11 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in fig. 14, based on the above value-taking principle, the values of LeftW, RightW, above, and bottom corresponding to the VPDU to be processed are 1,0,1, and 0, respectively, and the prediction value matrix I corresponding to the VPDU to be processed can be obtained (k) The size of (i, j) is 65 × 65, i [ -1,63 [ ]],j=[-1,63]. It can be seen that the size of the predictor matrix in this embodiment is larger than the size of the VPDU to be processed, and the predictor matrix is at the point to be processed The upper boundary of the VPDU is expanded outwards by one row, and the left boundary of the VPDU to be processed is expanded outwards by one column, wherein i is [0,63 ]]And j ═ 0,63]The predicted values of the pixels in the range (white part in fig. 14) can be obtained by interpolation through an 8-tap interpolation filter, and the predicted values of the pixels in the i-1 and j-1 expansion regions (a row expanded outside the upper boundary of the VPDU to be processed and a column expanded outside the left boundary of the VPDU to be processed, and a black part in fig. 14) can be obtained by interpolation through a bilinear interpolation filter. It should be noted that the predicted value of the pixel point of the extended region may also be obtained by using other methods, such as using an 8-tap interpolation filter, or directly using a reference pixel at the integer pixel position, which is not limited herein. In a word, the predicted value of the pixel point in the expansion area is obtained by interpolation according to the predicted value of the pixel point in the VPDU to be processed, and the predicted value of the pixel point in other VPDUs is not required to be relied on.
The difference from the first embodiment of the present application is that the present embodiment can calculate the forward and backward prediction value matrix I corresponding to the VPDU to be processed (k) And (i) judging whether the SAD between the (i, j) is larger than a first preset threshold value, if so, executing BIO processing on the VPDU to be processed, otherwise, executing no BIO processing on the VPDU to be processed, and processing by a non-BIO method. The SAD calculation formula is as follows:
Figure BDA0001939548890000421
The first preset threshold may be set to (1< (BD-8 + shift)) × W × H, BD being the pixel bit width of the VPDU to be processed, shift being MAX (2, 4-BD). It should be noted that other determination methods may be adopted in the above determination process of the SAD, and this is not limited.
According to the embodiment of the application, whether the difference between the corresponding first predicted value matrix and the corresponding second predicted value matrix of the VPDU to be processed is larger than a first preset threshold value or not is judged, and BIO processing is only performed on the VPDU which meets the condition that the difference is larger than the first preset threshold value, so that the number of basic prediction units for BIO processing in the current image block is reduced, and the implementation complexity is reduced.
Step 2: a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the first region are calculated.
The first region is a pixel region which needs to be subjected to BIO processing in a VPDU to be processed, and based on the principle of BIO, a predicted value in the first region needs to be obtained, and when a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the region are calculated, the predicted value needs to be expanded outwards on the basis of the size of the first region, and a horizontal prediction gradient matrix and a vertical prediction gradient matrix corresponding to a larger region are obtained.
When the SAD in the step 1 is larger than a first preset threshold value, a prediction value matrix I obtained in the step 1 is used as a basis (k) (i, j), calculating according to the formula (5) to obtain a horizontal prediction gradient matrix of the first region
Figure BDA0001939548890000422
Wherein the value range of i is [ W3, W4 ]]J has a value in the range of [ H3, H4 ]]Wherein W3 is determined by leftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh. Calculating to obtain a vertical prediction gradient matrix of the first region according to the formula (5)
Figure BDA0001939548890000423
Wherein the value range of i is [ W5, W6 ]]J has a value in the range of [ H5, H6 ]]Wherein W5 is determined by leftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and BottomH. W1 to W6, H1 to H6, are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)。
Figure BDA0001939548890000424
and
Figure BDA0001939548890000425
has a size of (W-3((1-leftW) + (1-rightW))) × (H-3((1-above H) + (1-BottomH))).
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 11 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in figure 15 of the drawings,
Figure BDA0001939548890000431
and
Figure BDA0001939548890000432
has a size of 61 × 61 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are white portions indicated by a dotted line in fig. 15), i ═ 0,60 ],j=[0,60]. It can be seen that in the present embodiment, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively added by one row outwards at the lower boundary of the first region and by one column outwards at the right boundary of the first region. But based on the principle of BIO, it is also necessary to expand one row outward at the upper boundary of the first region and one column outward at the left boundary of the first region, respectively. The corresponding operation is performed by step 3 described below.
And step 3: padding is performed on the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
The method shown in FIG. 9 is used for Padding the horizontal prediction gradient matrix obtained in step 2 to obtain the extended horizontal prediction gradient matrix
Figure BDA0001939548890000433
Wherein the value range of i is [ W3-leftW, W4+ rightW]J has the value range of [ H3-AboveH, H4+ BottonH]Applying Padding to the vertical prediction gradient matrix obtained in step 2 by the method shown in FIG. 9 to obtain an expanded vertical prediction gradient matrix
Figure BDA0001939548890000434
Wherein the value range of i is [ W5-leftW, W6+ rightW]J has the value range of [ H5-AboveH, H6+ BottonH]After Padding
Figure BDA0001939548890000435
And
Figure BDA0001939548890000436
has a size of (W-6+4 (leftW + rightW)) × (H-6+4 (above H + BottomH)). In this embodiment, the method of filling the upper boundary and the left boundary in the horizontal prediction gradient matrix and the vertical prediction gradient matrix with their own pixel values is used to fill the upper boundary and the left boundary, so that the BIO processing of the first region in the VPDU to be processed in the current image block does not depend on the pixel values of the adjacent VPDUs, thereby implementing parallel independent processing of each VPDU in the current image block.
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 11 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in fig. 16, after Padding
Figure BDA0001939548890000437
And
Figure BDA0001939548890000438
is 62 × 62 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix after Padding are as the white part and the black part indicated by the dotted line in fig. 16), i [ -1,60 ═ b [ - ]],j=[-1,60]. It can be seen that, in this embodiment, on the basis of step 2, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively expanded outward by one row at the upper boundary of the first region and by one column at the left boundary of the first region, and the finally obtained horizontal prediction gradient matrix and the vertical prediction gradient matrix are compared with the first region, and are respectively expanded outward by one row at the upper boundary and the lower boundary of the first region and by one column at the left boundary and the right boundary of the first region.
And 4, step 4: a modified motion vector for each basic prediction unit in the first region is calculated, and then a prediction value for each basic prediction unit is calculated.
The size of the basic prediction unit of the first region is 4 × 4. The difference from the first embodiment of the present application is that the present embodiment may calculate a difference between forward and backward predicted values of each basic prediction unit (4 × 4 sub-block) in the first region, and then determine whether the difference of each basic prediction unit is greater than a second preset threshold. For the basic prediction units meeting the condition of being more than the condition, the prediction value matrix I obtained according to the step 1 and the step 3 (k) (i, j), horizontal prediction gradient matrix
Figure BDA0001939548890000439
And a vertical prediction gradient matrix
Figure BDA00019395488900004310
And (3) calculating the corrected motion vectors vx and vy of the basic prediction unit according to the formula (2), and finally calculating the predicted value of the basic prediction unit according to the formula (6). For the basic prediction units which do not meet the condition of being more than the condition, the prediction value matrix I obtained according to the step 1 (k) (i, j), the prediction value of the basic prediction unit is calculated according to formula (1). The second preset threshold may be set to 1<<(BD-3 + shift). It should be noted that, other determination methods may be adopted in the determination process of the difference, which is not limited to this.
Taking the VPDU at the upper left corner in the current image block shown in fig. 11 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the first region are (i, j), [0,59], j ═ 0,59, and a size of the first region is a white portion indicated by a dotted line in fig. 17.
In this embodiment, for the VPDU to be processed, on the basis of reducing the number of basic prediction units for performing BIO processing in the VPDU to be processed, the modified motion vector is calculated only for the basic prediction unit in the first region where the difference between the first prediction value and the second prediction value is greater than the second preset threshold, so that the computation amount of the modified motion vector in the first region is reduced, and the complexity of implementation is reduced.
And 5: a prediction value of each basic prediction unit in the second region is calculated.
The size of the basic prediction unit of the second region is 4 × 4. Obtaining a prediction value matrix I according to the step 1 (k) (i, j), a prediction value of each basic prediction unit in the second region is calculated according to formula (1).
Taking the VPDU at the top left corner in the current image block shown in fig. 11 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the second region are (i, j), ([ 60,63], and j ═ 60, 63).
When the image block is coded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, BIO processing is only performed on a first area in the VPDU, but not on all areas in the VPDU in the prior art, so that the number of basic prediction units for performing BIO processing in the VPDU is reduced, and in the process of BIO processing, pixel value sampling and filling are performed only on an expansion area adjacent to two VPDU boundaries (not all the boundaries of the current VPDU), so that a BIO processing mode is compatible, the operation amount of pixel value sampling and filling in the process of BIO processing is reduced, and the complexity of implementation is further reduced on the premise of not influencing the coding and decoding performance.
It should be noted that, in the second embodiment of the present application, the VPDU in the upper left corner of the current image block shown in fig. 11 is taken as an example of the VPDU to be processed, but the second embodiment of the present application is not limited to the VPDU in the upper left corner, and the method in the second embodiment of the present application is applicable to any VPDU in the current image block shown in any one of fig. 11 to fig. 13.
Technical scheme of third embodiment of the application
The embodiment of the present application is applicable to the schematic diagram of the current image block shown in fig. 18, and as shown in fig. 18, the size of the current image block is 128 × 128, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., a first area), and the white area is an area not subjected to BIO processing (i.e., a second area). It should be noted that, similar to the above embodiments, the embodiments of the present application are also applicable to the case where the sizes of the current image blocks are 128 × 64 and 64 × 128.
Step 1: and acquiring a prediction value matrix corresponding to the VPDU to be processed in the current image block.
Performing motion compensation by using motion information of the current image block to obtain a forward and backward predicted value matrix I corresponding to the VPDU to be processed (k) (i, j), wherein the value range of i is [0, W-1 ]]J has a value in the range of [0, H-1 ]]W denotes the width of the VPDU, H denotes the length of the VPDU, I (k) The size of (i, j) is W × H. Based on the principle of BIO, to obtain the predicted value in the first area, it needs to expand outward based on the size of the first area to obtain the predicted value matrix corresponding to the larger area, and this embodiment is based on the current image block shown in fig. 18, and when obtaining the predicted value matrix corresponding to the VPDU to be processed, it is determined that the predicted value matrix does not need to expand outward at any boundary of the VPDU to be processed according to the position of the first area, so the size of the predicted value matrix is equal to the size of the VPDU to be processed.
In the following description, the VPDU at the top left corner in the current image block shown in fig. 18 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 4,59],j=[4,59]. As shown in FIG. 19, the predictor matrix I corresponding to the VPDU to be processed (k) The size of (i, j) is 64 × 64 (the prediction value matrix is shown as a white portion in fig. 19), and i ═ 0,63],j=[0,63]It can be seen that the size of the prediction value matrix in this embodiment is equal to the size of the VPDU to be processed, and the prediction value of the pixel point in the VPDU to be processed can be obtained by performing interpolation through an 8-tap interpolation filter. In short, the predicted value of the pixel point is obtained by interpolation according to the predicted value of the pixel point in the VPDU to be processed, and the predicted value of the pixel point in other VPDUs is not required to be relied on.
Step 2: a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the first region are calculated.
The first region is a pixel region which needs to be subjected to BIO processing in a VPDU to be processed, and based on the BIO principle, a predicted value in the first region needs to be obtained, and when a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the region are calculated, the predicted value needs to be expanded outwards on the basis of the size of the first region, and a horizontal prediction gradient matrix and a vertical prediction gradient matrix corresponding to a larger region are obtained.
Predictor matrix I obtained based on step 1 (k) (i, j), calculating according to the formula (5) to obtain a horizontal prediction gradient matrix of the first region
Figure BDA0001939548890000451
Wherein the value range of i is [3, W-4 ]]J has a value in the range of [3, H-4 ]]Calculating to obtain a vertical prediction gradient matrix of the first region according to the formula (5)
Figure BDA0001939548890000452
Wherein the value range of i is [3, W-4 ]]J has a value in the range of [3, H-4 ] ],
Figure BDA0001939548890000453
And
Figure BDA0001939548890000454
has a size of (W-6) × (H-6).
In the following description, the VPDU at the top left corner in the current image block shown in fig. 18 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 4,59],j=[4,59]. As shown in figure 20 of the drawings,
Figure BDA0001939548890000455
and
Figure BDA0001939548890000456
has a size of 58 × 58 (horizontal prediction gradient matrix and vertical prediction ladder)The size of the degree matrix is shown as a white portion indicated by a dotted line in fig. 20), i ═ 3,60],j=[3,60]. It can be seen that, in the embodiment, compared with the first region, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively added by one row outwards at the upper and lower boundaries of the first region, and are respectively added by one column outwards at the left and right boundaries of the first region.
And step 3: a modified motion vector for each basic prediction unit in the first region is calculated, and then a prediction value for each basic prediction unit is calculated.
The size of the basic prediction unit of the first region is 4 × 4. Obtaining a prediction value matrix I according to the step 1 and the step 2 (k) (i, j), horizontal prediction gradient matrix
Figure BDA0001939548890000457
And a vertical prediction gradient matrix
Figure BDA0001939548890000458
And (3) calculating the modified motion vectors vx and vy of each basic prediction unit in the first area according to the formula (2), and finally obtaining the predicted value of each basic prediction unit in the first area according to the formula (6).
Taking the VPDU at the top left corner in the current image block shown in fig. 18 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the first region are (i, j), [4,59], j ═ 4,59, and the size of the first region is a white portion indicated by a dotted line in fig. 21.
And 5: a prediction value of each basic prediction unit in the second region is calculated.
The size of the basic prediction unit of the second region is 4 × 4. Obtaining a prediction value matrix I according to the step 1 (k) (i, j), a prediction value of each basic prediction unit in the second region is calculated according to formula (1).
Taking the VPDU at the top left corner in the current image block shown in fig. 18 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the second region are (i, j), [0,3] and [60,63], and j ═ 0,3] and [60,63 ].
When the image block is encoded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the current image block, BIO processing is only performed on a first region in the VPDU, but not on all regions in the VPDU in the prior art, so that the number of basic prediction units for performing the BIO processing in the VPDU is reduced, and in the process of the BIO processing, pixel value sampling and filling are not required to be performed on an expansion region adjacent to the VPDU boundary of the current VPDU (namely, the prediction value matrix is directly determined by the whole VPDU), so that not only is the BIO processing mode compatible, but also the operation amount of the pixel value sampling and filling is greatly reduced, and the implementation complexity is further reduced on the premise of not influencing the encoding and decoding performance.
It should be noted that, in the third embodiment of the present application, a VPDU in the upper left corner of the current image block shown in fig. 18 is taken as an example of a VPDU to be processed, but the method in the third embodiment of the present application is not limited to only the VPDU in the upper left corner, and the method in the third embodiment of the present application is applicable to any VPDU in the current image block shown in fig. 18.
Technical solution of the fourth embodiment of the present application (the same portions as those of the third embodiment of the present application, which are not described herein again)
The embodiment of the present application is applicable to the schematic diagram of the current image block shown in fig. 18, and as shown in fig. 18, the size of the current image block is 128 × 128, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., a first area), and the white area is an area not subjected to BIO processing (i.e., a second area). It should be noted that, similar to the above embodiments, the embodiments of the present application are also applicable to the case where the sizes of the current image blocks are 128 × 64 and 64 × 128.
Step 1: and acquiring a prediction value matrix corresponding to the VPDU to be processed in the current image block.
Performing motion compensation by using motion information of the current image block to obtain a forward and backward predicted value matrix I corresponding to the VPDU to be processed (k) (i, j), wherein the value range of i is [0, W-1 ]]J has a value in the range of [0, H-1 ] ]W denotes the width of the VPDU, H denotes the VPDULength, I (k) The size of (i, j) is W × H. Based on the principle of BIO, to obtain the predicted value in the first area, it needs to expand outward based on the size of the first area to obtain the predicted value matrix corresponding to the larger area, and this embodiment is based on the current image block shown in fig. 18, and when obtaining the predicted value matrix corresponding to the VPDU to be processed, it is determined that the predicted value matrix does not need to expand outward at any boundary of the VPDU to be processed according to the position of the first area, so the size of the predicted value matrix is equal to the size of the VPDU to be processed.
In the following description, the VPDU at the top left corner in the current image block shown in fig. 18 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 4,59],j=[4,59]. As shown in FIG. 19, the predictor matrix I corresponding to the VPDU to be processed (k) The size of (i, j) is 64 × 64 (the prediction value matrix is shown as a white portion in fig. 19), and i ═ 0,63],j=[0,63]It can be seen that the size of the prediction value matrix in this embodiment is equal to the size of the VPDU to be processed, and the prediction value of the pixel point in the VPDU to be processed can be obtained by performing interpolation through an 8-tap interpolation filter. In short, the predicted value of the pixel point is obtained by interpolation according to the predicted value of the pixel point in the VPDU to be processed, and the predicted value of the pixel point in other VPDUs is not required to be relied on.
The difference from the third embodiment of the present application is that the present embodiment can calculate the forward and backward prediction value matrix I corresponding to the VPDU to be processed (k) And (i) judging whether the SAD between the (i, j) is larger than a first preset threshold value, if so, executing BIO processing on the VPDU to be processed, otherwise, executing no BIO processing on the VPDU to be processed, and processing by a non-BIO method. The SAD calculation formula is as follows:
Figure BDA0001939548890000461
the first preset threshold may be set to (1< (BD-8 + shift)) × W × H, BD being the pixel bit width of the VPDU to be processed, shift being MAX (2, 4-BD). It should be noted that other determination methods may be adopted in the above determination process of the SAD, and this is not limited.
According to the embodiment of the application, whether the difference between the corresponding first predicted value matrix and the corresponding second predicted value matrix of the VPDU to be processed is larger than a first preset threshold value or not is judged, and BIO processing is only performed on the VPDU which meets the condition that the difference is larger than the first preset threshold value, so that the number of basic prediction units for BIO processing in the current image block is reduced, and the implementation complexity is reduced.
Step 2: the horizontal and vertical prediction gradient matrices for the first region in the VPDU in the upper left corner are calculated.
The first region is a pixel region which needs to be subjected to BIO processing in a VPDU to be processed, and based on the BIO principle, a predicted value in the first region needs to be obtained, and when a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the region are calculated, the predicted value needs to be expanded outwards on the basis of the size of the first region, and a horizontal prediction gradient matrix and a vertical prediction gradient matrix corresponding to a larger region are obtained.
Predictor matrix I obtained based on step 1 (k) (i, j), calculating according to the formula (5) to obtain a horizontal prediction gradient matrix of the first region
Figure BDA0001939548890000471
Wherein the value range of i is [3, W-4 ]]J has a value in the range of [3, H-4 ]]Calculating to obtain a vertical prediction gradient matrix of the first region according to the formula (5)
Figure BDA0001939548890000472
Wherein the value range of i is [3, W-4 ]]J has a value in the range of [3, H-4 ]],
Figure BDA0001939548890000473
And
Figure BDA0001939548890000474
has a size of (W-6) × (H-6).
In the following description, the VPDU at the top left corner in the current image block shown in fig. 18 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 4,59],j=[4,59]. As shown in figure 20 of the drawings,
Figure BDA0001939548890000475
and
Figure BDA0001939548890000476
is 58 × 58 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are white portions indicated by a dotted line in fig. 20), i ═ 3,60],j=[3,60]. It can be seen that, compared to the first region, the horizontal prediction gradient matrix and the vertical prediction gradient matrix in this embodiment are respectively added by one row at the upper and lower boundaries of the first region, and are respectively added by one column at the left and right boundaries of the first region.
And 3, step 3: a modified motion vector for each basic prediction unit in the first region is calculated, and then a prediction value for each basic prediction unit is calculated.
The size of the basic prediction unit of the first region is 4 × 4. The difference from the fifth embodiment of the present application is that the present embodiment may calculate a difference between forward and backward predicted values of each basic prediction unit (4 × 4 sub-block) in the first region, and then determine whether the difference of each basic prediction unit is greater than a second preset threshold. For the basic prediction units meeting the condition of being more than the condition, the prediction value matrix I obtained according to the step 1 and the step 2 (k) (i, j), horizontal prediction gradient matrix
Figure BDA0001939548890000477
And a vertical prediction gradient matrix
Figure BDA0001939548890000478
And (3) calculating the corrected motion vectors vx and vy of the basic prediction unit according to the formula (2), and finally calculating the predicted value of the basic prediction unit according to the formula (6).For the basic prediction units which do not meet the condition of being more than the condition, the prediction value matrix I obtained according to the step 1 (k) (i, j) calculating a prediction value of the basic prediction unit according to formula (1). The second preset threshold may be set to 1<<(BD-3 + shift). It should be noted that, other determination methods may be adopted in the determination process of the difference, which is not limited to this.
Taking the VPDU at the top left corner in the current image block shown in fig. 18 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the first region are (i, j), [4,59], j ═ 4,59, and the size of the first region is a white portion indicated by a dotted line in fig. 21.
In this embodiment, for the VPDU to be processed, on the basis of reducing the number of basic prediction units for performing BIO processing in the VPDU to be processed, the modified motion vector is calculated only for the basic prediction unit in the first region where the difference between the first prediction value and the second prediction value is greater than the second preset threshold, so that the computation amount of the modified motion vector in the first region is reduced, and the complexity of implementation is reduced.
And 5: a prediction value of each basic prediction unit in the second region is calculated.
The size of the basic prediction unit of the second region is 4 × 4. Obtaining a prediction value matrix I according to the step 1 (k) (i, j), a prediction value of each basic prediction unit in the second region is calculated according to formula (1).
Taking the VPDU at the top left corner in the current image block shown in fig. 18 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the second region are (i, j), [0,3] and [60,63], and j ═ 0,3] and [60,63 ].
When the image block is encoded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the current image block, BIO processing is only performed on a first region in the VPDU, but not on all regions in the VPDU in the prior art, so that the number of basic prediction units for performing the BIO processing in the VPDU is reduced, and in the process of the BIO processing, pixel value sampling and filling are not required to be performed on an expansion region adjacent to the VPDU boundary of the current VPDU (namely, the prediction value matrix is directly determined by the whole VPDU), so that not only is the BIO processing mode compatible, but also the operation amount of the pixel value sampling and filling is greatly reduced, and the implementation complexity is further reduced on the premise of not influencing the encoding and decoding performance.
It should be noted that, in the fourth embodiment of the present application, the VPDU in the upper left corner of the current image block shown in fig. 18 is taken as an example of the VPDU to be processed, but the method in the fourth embodiment of the present application is not limited to only the VPDU in the upper left corner, and the method in the fourth embodiment of the present application is applicable to any VPDU in the current image block shown in fig. 18.
Technical scheme of fifth embodiment of the application
The embodiment of the present application is applicable to the schematic diagram of the current image block shown in fig. 22, and as shown in fig. 22, the size of the current image block is 128 × 128, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., a first area), and the white area is an area not subjected to BIO processing (i.e., a second area). It should be noted that, similar to the above embodiments, the embodiments of the present application are also applicable to the case where the sizes of the current image blocks are 128 × 64 and 64 × 128.
Step 1: and acquiring a prediction value matrix corresponding to the VPDU to be processed in the current image block.
Performing motion compensation by using motion information of the current image block to obtain a forward and backward predicted value matrix I corresponding to the VPDU to be processed (k) (i, j), wherein the value range of i is [ W1, W2 ]]J has a value in the range of [ H1, H2 ]]Wherein W1 is determined by leftW, W2 is determined by the width W and rightW of VPDU, H1 is determined by AboveH, and H2 is determined by the height H and Bottomh of VPDU. Based on the principle of BIO, to obtain the predicted value in the first region, it needs to expand outward based on the size of the first region to obtain the predicted value matrix corresponding to the larger region, and this embodiment is based on various situations of the current image block shown in fig. 11-12, and when obtaining the predicted value matrix corresponding to the VPDU to be processed, it will determine at which boundary or boundaries of the VPDU to be processed the predicted value matrix needs to expand outward according to the position of the first region And therefore the size of the predictor matrix is larger than the size of the VPDU to be processed.
LeftW denotes a positional relationship between a basic prediction unit adjacent to a left boundary and one or more of the first boundary and the third boundary in the VPDU, RightW denotes a positional relationship between a basic prediction unit adjacent to a right boundary and one or more of the first boundary and the third boundary in the VPDU, above denotes a positional relationship between a basic prediction unit adjacent to an upper boundary and one or more of the first boundary and the third boundary in the VPDU, and bottom denotes a positional relationship between a basic prediction unit adjacent to a lower boundary and one or more of the first boundary and the third boundary in the VPDU. For example, LeftW, RightW, above h, and bottom respectively indicate whether the adjacent 4 × 4 small blocks of the left boundary, the right boundary, the upper boundary, and the lower boundary in the VPDU to be processed are subjected to BIO processing, and when the value of LeftW, RightW, above h, and bottom is 1, the adjacent 4 × 4 small blocks of the left boundary, the right boundary, the upper boundary, and the lower boundary in the VPDU to be processed are subjected to BIO processing; otherwise, the BIO treatment is not performed.
The values of LeftW, RightW, above h and BottomH are determined according to whether the left boundary, the right boundary, the upper boundary and the lower boundary meet any one of the following two conditions:
Condition 1, the boundary of the VPDU to be processed coincides with the boundary of the current image block (i.e., the third boundary), in other words, the basic prediction unit adjacent to the VPDU's own boundary (e.g., the left, right, upper, and lower boundaries of the VPDU) in the VPDU is adjacent to the current image block boundary).
Condition 2, the basic prediction unit within the VPDU to be processed that is adjacent to its own boundary (e.g., left, right, upper, lower boundary of the VPDU) is located to the right or below the VPDU boundary line (i.e., the first boundary).
If any one of the conditions is met, the values of LeftW, RightW, above h and BottomH are 1, otherwise the values of LeftW, RightW, above h and BottomH are 0.
In this embodiment of the application, when the second region is a pixel region adjacent to two or less first boundaries in a VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise LeftW is 0. If the right boundary of the VPDU is the second boundary, or if the basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0. If the upper boundary of the VPDU is the second boundary, or if the basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above is 1; otherwise, AboveH is 0. If the lower boundary of the VPDU is the second boundary, or if the basic prediction unit adjacent to the lower boundary in the VPDU is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
For example, i has a value range of [ -leftW, W-1+ rightW]J has the value range of [ -AboveH, H-1+ BottonH]W denotes the width of the VPDU, H denotes the length of the VPDU, I (k) The size of (i, j) is (W + leftW + rightW) × (H + AboveH + BottomH).
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 22 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in fig. 14, based on the above value-taking principle, the values of LeftW, RightW, above, and bottom corresponding to the VPDU to be processed are 1,0,1, and 0, respectively, and the prediction value matrix I corresponding to the VPDU to be processed can be obtained (k) The size of (i, j) is 65 × 65, i [ -1,63 [ ]],j=[-1,63]. It can be seen that in the present embodiment, the size of the predictor matrix is larger than that of the VPDU to be processed, the predictor matrix is expanded outward by one row at the upper boundary of the VPDU to be processed, and is expanded outward by one column at the left boundary of the VPDU to be processed, where i ═ 0,63]And j ═ 0,63]The predicted values of the pixels in the range (white part in fig. 14) can be obtained by interpolation through an 8-tap interpolation filter, and the predicted values of the pixels in the i-1 and j-1 expansion regions (a row expanded outside the upper boundary of the VPDU to be processed and a column expanded outside the left boundary of the VPDU to be processed, and a black part in fig. 14) can be obtained by interpolation through a bilinear interpolation filter. It should be noted that the predicted value of the pixel point of the extended region may also be obtained by other methods, such as using an 8-tap interpolation filter, or directly using a reference pixel at the integer pixel position, which is not done here And (4) limiting. In a word, the predicted value of the pixel point in the expansion area is obtained by interpolation according to the predicted value of the pixel point in the VPDU to be processed, and the predicted value of the pixel point in other VPDUs is not required to be relied on.
Step 2: a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the first region are calculated.
The first region is a pixel region which needs to be subjected to BIO processing in a VPDU to be processed, and based on the principle of BIO, a predicted value in the first region needs to be obtained, and when a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the region are calculated, the predicted value needs to be expanded outwards on the basis of the size of the first region, and a horizontal prediction gradient matrix and a vertical prediction gradient matrix corresponding to a larger region are obtained.
Predictor matrix I obtained based on step 1 (k) (i, j), calculating according to the formula (5) to obtain a horizontal prediction gradient matrix of the first region
Figure BDA0001939548890000501
Wherein the value range of i is [ W3, W4 ]]J has a value in the range of [ H3, H4 ]]Wherein W3 is determined by leftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh. Calculating to obtain a vertical prediction gradient matrix of the first region according to the formula (5)
Figure BDA0001939548890000502
Wherein the value range of i is [ W5, W6 ]]And j has a value range of [ H5, H6 ]]Wherein W5 is determined by leftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh. W1 to W6, H1 to H6, are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)。
Figure BDA0001939548890000503
and
Figure BDA00019395488900005010
has a size of (W-3((1-leftW) + (1-rightW))) × (H-3((1-above H) + (1-BottomH))).
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 22 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in figure 15 of the drawings,
Figure BDA0001939548890000504
and
Figure BDA0001939548890000505
has a size of 61 × 61 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are white portions indicated by a dotted line in fig. 15), i ═ 0,60],j=[0,60]. It can be seen that in the present embodiment, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively added by one row outwards at the lower boundary of the first region and by one column outwards at the right boundary of the first region. But based on the principle of BIO, it is also necessary to expand one row outward at the upper boundary of the first region and one column outward at the left boundary of the first region, respectively. The corresponding operation is performed by step 3 described below.
And step 3: padding is performed on the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
The method shown in FIG. 9 is used for Padding the horizontal prediction gradient matrix obtained in step 2 to obtain the extended horizontal prediction gradient matrix
Figure BDA0001939548890000506
Wherein the value range of i is [ W3-leftW, W4+ rightW]J has the value range of [ H3-AboveH, H4+ BottonH]Applying the method shown in FIG. 9 to the vertical column obtained in step 2Extended by Padding the directly predicted gradient matrix
Figure BDA0001939548890000507
Wherein the value range of i is [ W5-leftW, W6+ rightW]J has the value range of [ H5-AboveH, H6+ BottonH]After Padding
Figure BDA0001939548890000508
And
Figure BDA0001939548890000509
has a size of (W-6+4 × (leftW + rightW)) × (H-6+4 × (above H + BottomH)). In this embodiment, the method of filling the upper boundary and the left boundary in the horizontal prediction gradient matrix and the vertical prediction gradient matrix with their own pixel values is used to fill the upper boundary and the left boundary, so that the BIO processing of the first region in the VPDU to be processed in the current image block does not depend on the pixel values of the adjacent VPDUs, thereby implementing parallel independent processing of each VPDU in the current image block.
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 22 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63 ],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in fig. 16, after Padding
Figure BDA0001939548890000511
And
Figure BDA0001939548890000512
is 62 × 62 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix after Padding are as the white part and the black part indicated by the dotted line in fig. 16), i [ -1,60 ═ b [ - ]],j=[-1,60]. It can be seen that, in this embodiment, on the basis of step 2, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively expanded by one row at the upper boundary of the first region and one column at the left boundary of the first region, and the finally obtained horizontal prediction gradient matrix and the vertical prediction gradient matrix are compared with the first region and are respectively expanded by the upper boundary and the lower boundary of the first regionOne row extending outward and one column extending outward at the left and right borders of the first region, respectively.
And 4, step 4: a modified motion vector for each basic prediction unit in the first region is calculated, and then a prediction value for each basic prediction unit is calculated.
The size of the basic prediction unit of the first region is 4 × 4. Obtaining a prediction value matrix I according to the step 1 and the step 3 (k) (i, j), horizontal prediction gradient matrix
Figure BDA0001939548890000513
And a vertical prediction gradient matrix
Figure BDA0001939548890000514
And (3) calculating the modified motion vectors vx and vy of each basic prediction unit in the first area according to the formula (2), and finally obtaining the predicted value of each basic prediction unit in the first area according to the formula (6).
Taking the VPDU at the top left corner in the current image block shown in fig. 22 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the first region are (i, j), [0,59], j ═ 0,59, and the size of the first region is a white portion indicated by a dotted line in fig. 17.
And 5: a prediction value of each basic prediction unit in the second region is calculated.
The size of the basic prediction unit of the second region is 4 × 4. Obtaining a prediction value matrix I according to the step 1 (k) (i, j), a prediction value of each basic prediction unit in the second region is calculated according to formula (1).
Taking the VPDU at the top left corner in the current image block shown in fig. 22 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the second region are (i, j), ([ 60,63], j ═ 60, 63).
When the image block is coded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the current image block, BIO processing is only performed on a first region in the VPDU, but not on all regions in the VPDU in the prior art, so that the number of basic prediction units for performing the BIO processing in the VPDU is reduced, and in the process of the BIO processing, pixel value sampling and filling are performed only on extension regions adjacent to three, two or one VPDU boundary (not on all VPDU boundaries) of the current VPDU, so that not only is the BIO processing mode compatible, but also the operation quantity of pixel value sampling and filling in the BIO processing process is reduced, and the complexity of implementation is further reduced on the premise of not influencing the coding and decoding performance.
It should be noted that, in the fifth embodiment of the present application, a VPDU in the upper left corner of the current image block shown in fig. 22 is taken as an example of a VPDU to be processed, but the fifth embodiment of the present application is not limited to only the VPDU in the upper left corner, and the method in the fifth embodiment of the present application is applicable to any VPDU in the current image block shown in fig. 22.
Technical solution of the sixth embodiment of the present application (the same portions as those of the fifth embodiment of the present application, which are not described herein again)
The embodiment of the present application is applicable to the schematic diagram of the current image block shown in fig. 22, and as shown in fig. 22, the size of the current image block is 128 × 128, the size of the VPDU is 64 × 64, the black area is an area to be subjected to BIO processing (i.e., a first area), and the white area is an area not subjected to BIO processing (i.e., a second area). It should be noted that, similar to the above embodiments, the embodiments of the present application are also applicable to the case where the sizes of the current image blocks are 128 × 64 and 64 × 128.
Step 1: and acquiring a prediction value matrix corresponding to the VPDU to be processed in the current image block.
Performing motion compensation by using motion information of the current image block to obtain a forward and backward predicted value matrix I corresponding to the VPDU to be processed (k) (i, j), wherein the value range of i is [ W1, W2 ]]J has a value in the range of [ H1, H2 ] ]Wherein W1 is determined by leftW, W2 is determined by the width W and rightW of VPDU, H1 is determined by AboveH, and H2 is determined by the height H and Bottomh of VPDU. Based on the principle of BIO, to obtain the predicted value in the first area, it needs to expand outward based on the size of the first area to obtain the corresponding predicted value of the larger areaThe predictor matrix, which is based on the multiple situations of the current image block shown in fig. 11-12, determines at which boundary or boundaries of the VPDU to be processed the outward expansion is needed according to the position of the first area when the predictor matrix corresponding to the VPDU to be processed is obtained, so that the size of the predictor matrix is larger than that of the VPDU to be processed.
LeftW denotes a positional relationship between a basic prediction unit adjacent to a left boundary and one or more of the first boundary and the third boundary in the VPDU, RightW denotes a positional relationship between a basic prediction unit adjacent to a right boundary and one or more of the first boundary and the third boundary in the VPDU, above denotes a positional relationship between a basic prediction unit adjacent to an upper boundary and one or more of the first boundary and the third boundary in the VPDU, and bottom denotes a positional relationship between a basic prediction unit adjacent to a lower boundary and one or more of the first boundary and the third boundary in the VPDU. For example, LeftW, RightW, above h, and bottom respectively indicate whether the adjacent 4 × 4 small blocks of the left boundary, the right boundary, the upper boundary, and the lower boundary in the VPDU to be processed are subjected to BIO processing, and when the value of LeftW, RightW, above h, and bottom is 1, the adjacent 4 × 4 small blocks of the left boundary, the right boundary, the upper boundary, and the lower boundary in the VPDU to be processed are subjected to BIO processing; otherwise, the BIO treatment is not performed.
The values of LeftW, RightW, above h and BottomH are determined according to whether the left boundary, the right boundary, the upper boundary and the lower boundary meet any one of the following two conditions:
condition 1, the boundary of the VPDU to be processed coincides with the boundary of the current image block (i.e., the third boundary), in other words, the basic prediction unit adjacent to the VPDU's own boundary (e.g., the left, right, upper, and lower boundaries of the VPDU) in the VPDU is adjacent to the current image block boundary).
Condition 2, the basic prediction unit within the VPDU to be processed that is adjacent to its own boundary (e.g., left, right, upper, lower boundary of the VPDU) is located to the right or below the VPDU boundary line (i.e., the first boundary).
If any one of the conditions is met, the values of LeftW, RightW, above h and BottomH are 1, otherwise the values of LeftW, RightW, above h and BottomH are 0.
In this embodiment of the application, when the second region is a pixel region adjacent to two or less first boundaries in a VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise LeftW is 0. If the right boundary of the VPDU is the second boundary, or if the basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0. If the upper boundary of the VPDU is the second boundary, or if the basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above is 1; otherwise, AboveH is 0. If the lower boundary of the VPDU is the second boundary, or if the basic prediction unit adjacent to the lower boundary in the VPDU is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
For example, i has a value range of [ -leftW, W-1+ rightW]J has the value range of [ -AboveH, H-1+ BottonH]W denotes the width of the VPDU, H denotes the length of the VPDU, I (k) The size of (i, j) is (W + leftW + rightW) × (H + AboveH + BottomH).
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 22 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in fig. 14, based on the above value-taking principle, the values of LeftW, RightW, above, and bottom corresponding to the VPDU to be processed are 1,0,1, and 0, respectively, and the prediction value matrix I corresponding to the VPDU to be processed can be obtained (k) The size of (i, j) is 65 × 65, i [ -1,63 [ ]],j=[-1,63]. It can be seen that in the present embodiment, the size of the predictor matrix is larger than that of the VPDU to be processed, the predictor matrix is expanded outward by one row at the upper boundary of the VPDU to be processed, and is expanded outward by one column at the left boundary of the VPDU to be processed, where i ═ 0,63]And j ═ 0,63]The predicted values of the pixels in the range (white part in fig. 14) can be obtained by interpolation through an 8-tap interpolation filter, and the predicted values of the pixels in the i-1 and j-1 expansion regions (a row expanded outside the upper boundary of the VPDU to be processed and a column expanded outside the left boundary of the VPDU, and a black part in fig. 14) can be obtained by interpolation through the 8-tap interpolation filter And interpolating by using a bilinear interpolation filter. It should be noted that the predicted value of the pixel point of the extended region may also be obtained by using other methods, such as using an 8-tap interpolation filter, or directly using a reference pixel at the integer pixel position, which is not limited herein. In a word, the predicted value of the pixel point in the expansion area is obtained by interpolation according to the predicted value of the pixel point in the VPDU to be processed, and the predicted value of the pixel point in other VPDUs is not required to be relied on.
The difference from the fifth embodiment of the present application is that the present embodiment can calculate the forward and backward prediction value matrix I corresponding to the VPDU to be processed (k) And (i) judging whether the SAD between the (i, j) is larger than a first preset threshold value, if so, executing BIO processing on the VPDU to be processed, otherwise, executing no BIO processing on the VPDU to be processed, and processing by a non-BIO method. The SAD calculation formula is as follows:
Figure BDA0001939548890000531
the first preset threshold may be set to (1< (BD-8 + shift)) × W × H, BD being the pixel bit width of the VPDU to be processed, shift being MAX (2, 4-BD). It should be noted that other determination methods may be adopted in the above determination process of the SAD, and this is not limited.
According to the embodiment of the application, whether the difference between the corresponding first predicted value matrix and the corresponding second predicted value matrix of the VPDU to be processed is larger than a first preset threshold value or not is judged, and BIO processing is only performed on the VPDU which meets the condition that the difference is larger than the first preset threshold value, so that the number of basic prediction units for BIO processing in the current image block is reduced, and the implementation complexity is reduced.
Step 2: a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the first region are calculated.
The first region is a pixel region which needs to be subjected to BIO processing in a VPDU to be processed, similarly, based on the principle of BIO, a predicted value in the first region needs to be obtained, and when a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the region are calculated, the prediction value needs to be expanded outwards on the basis of the size of the first region, and a horizontal prediction gradient matrix and a vertical prediction gradient matrix corresponding to a larger region are obtained.
When the SAD in the step 1 is larger than a first preset threshold value, a prediction value matrix I obtained in the step 1 is used as a basis (k) (i, j), calculating according to the formula (5) to obtain a horizontal prediction gradient matrix of the first region
Figure BDA0001939548890000532
Wherein the value range of i is [ W3, W4 ]]J has a value in the range of [ H3, H4 ]]Wherein W3 is determined by leftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh. Calculating to obtain a vertical prediction gradient matrix of the first region according to the formula (5)
Figure BDA0001939548890000533
Wherein the value range of i is [ W5, W6 ]]J has a value in the range of [ H5, H6 ]]Wherein W5 is determined by leftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh. W1 to W6, H1 to H6, are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)。
Figure BDA0001939548890000541
and
Figure BDA0001939548890000542
has a size of (W-3((1-leftW) + (1-rightW))) × (H-3((1-above H) + (1-BottomH))).
The following description takes the VPDU in the upper left corner of the current image block shown in fig. 22 as the VPDU to be processed as an example, where the VPDU is to be processedThe coordinates of the pixel points in the VPDU are (i, j), i ═ 0,63],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in figure 15 of the drawings,
Figure BDA0001939548890000543
and
Figure BDA0001939548890000544
is 61 × 61 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are white portions indicated by a dotted line in fig. 15), i ═ 0,60],j=[0,60]. It can be seen that in the present embodiment, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively added by one row outwards at the lower boundary of the first region and by one column outwards at the right boundary of the first region. But based on the principle of BIO, it is also necessary to expand one row outward at the upper boundary of the first region and one column outward at the left boundary of the first region, respectively. The corresponding operation is performed by step 3 described below.
And step 3: padding is performed on the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
The method shown in FIG. 9 is used to fill (i.e. Padding) the horizontal prediction gradient matrix obtained in step 2 to obtain an expanded horizontal prediction gradient matrix
Figure BDA0001939548890000545
Wherein the value range of i is [ W3-leftW, W4+ rightW]J has the value range of [ H3-AboveH, H4+ BottonH]Applying Padding to the vertical prediction gradient matrix obtained in step 2 by the method shown in FIG. 9 to obtain an expanded vertical prediction gradient matrix
Figure BDA0001939548890000546
Wherein the value range of i is [ W5-leftW, W6+ rightW]J has the value range of [ H5-AboveH, H6+ BottonH]After Padding
Figure BDA0001939548890000547
And
Figure BDA0001939548890000548
has a size of(W-6+4 × (leftW + rightW)) × (H-6+4 × (above H + Bottomh)). In this embodiment, the method of filling the upper boundary and the left boundary in the horizontal prediction gradient matrix and the vertical prediction gradient matrix with their own pixel values is used to fill the upper boundary and the left boundary, so that the BIO processing of the first region in the VPDU to be processed in the current image block does not depend on the pixel values of the adjacent VPDUs, thereby implementing parallel independent processing of each VPDU in the current image block.
In the following description, the VPDU at the upper left corner in the current image block shown in fig. 22 is taken as an example of the VPDU to be processed, where coordinates of pixel points in the VPDU to be processed are (i, j), and i ═ 0,63 ],j=[0,63]The coordinates of the pixel points in the first region are (i, j), i ═ 0,59],j=[0,59]. As shown in fig. 16, after Padding
Figure BDA0001939548890000549
And
Figure BDA00019395488900005410
is 62 × 62 (the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix after Padding are as the white part and the black part indicated by the dotted line in fig. 16), i [ -1,60 ═ b [ - ]],j=[-1,60]. It can be seen that, in this embodiment, on the basis of step 2, the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively expanded outward by one row at the upper boundary of the first region and by one column at the left boundary of the first region, and the finally obtained horizontal prediction gradient matrix and the vertical prediction gradient matrix are compared with the first region, and are respectively expanded outward by one row at the upper boundary and the lower boundary of the first region and by one column at the left boundary and the right boundary of the first region.
And 4, step 4: a modified motion vector for each basic prediction unit in the first region is calculated, and then a prediction value for each basic prediction unit is calculated.
The size of the basic prediction unit of the first region is 4 × 4. The difference from the fifth embodiment of the present application is that the present embodiment may calculate a difference between forward and backward predicted values of each basic prediction unit (4 × 4 sub-block) in the first region, and then determine whether the difference of each basic prediction unit is greater than a second preset value And (4) a threshold value. For the basic prediction units meeting the condition of being more than the condition, the prediction value matrix I obtained according to the step 1 and the step 3 (k) (i, j), horizontal prediction gradient matrix
Figure BDA0001939548890000551
And a vertical prediction gradient matrix
Figure BDA0001939548890000552
And (3) calculating the corrected motion vectors vx and vy of the basic prediction unit according to the formula (2), and finally calculating the predicted value of the basic prediction unit according to the formula (6). For the basic prediction units which do not meet the condition of being more than the condition, the prediction value matrix I obtained according to the step 1 (k) (i, j), the prediction value of the basic prediction unit is calculated according to formula (1). The second preset threshold may be set to 1<<(BD-3 + shift). It should be noted that, other determination methods may be adopted in the determination process of the difference, which is not limited to this.
Taking the VPDU at the top left corner in the current image block shown in fig. 22 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the first region are (i, j), [0,59], j ═ 0,59, and the size of the first region is a white portion indicated by a dotted line in fig. 17.
In this embodiment, for the VPDU to be processed, on the basis of reducing the number of basic prediction units for performing BIO processing in the VPDU to be processed, the modified motion vector is calculated only for the basic prediction unit in the first region where the difference between the first prediction value and the second prediction value is greater than the second preset threshold, so that the computation amount of the modified motion vector in the first region is reduced, and the complexity of implementation is reduced.
And 5: a prediction value of each basic prediction unit in the second region is calculated.
The size of the basic prediction unit of the second region is 4 × 4. Obtaining a prediction value matrix I according to the step 1 (k) (i, j), a prediction value of each basic prediction unit in the second region is calculated according to formula (1).
Taking the VPDU at the top left corner in the current image block shown in fig. 22 as an example of the VPDU to be processed, coordinates of pixel points in the VPDU to be processed are (i, j), i ═ 0,63, j ═ 0,63, coordinates of pixel points in the second region are (i, j), ([ 60,63], j ═ 60, 63).
When the image block is coded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, BIO processing is only carried out on a first area in the VPDU, but BIO processing is not carried out on all areas in the VPDU in the prior art, the number of basic prediction units for carrying out BIO processing in the VPDU is reduced, and pixel value sampling and filling are only carried out on three, two or one expansion areas adjacent to the current VPDU boundary (not all the current VPDU boundaries) in the BIO processing process.
It should be noted that, in the sixth embodiment of the present application, a VPDU in the upper left corner of the current image block shown in fig. 22 is taken as an example of a VPDU to be processed, but the method in the sixth embodiment of the present application is not limited to only the VPDU in the upper left corner, and the method in the sixth embodiment of the present application is applicable to any VPDU in the current image block shown in fig. 22.
Fig. 23 is a flowchart illustrating an inter prediction method according to an embodiment of the present application. This process 2300 may be performed by video encoder 20 or video decoder 30, and in particular, may be performed by inter-prediction units 244, 344 of video encoder 20 or video decoder 30. The process 2300 is depicted as a series of steps or operations, and it is to be understood that the process 2300 may be performed in various orders and/or concurrently and is not limited to the order of execution depicted in fig. 23. Assuming that a video data stream having a plurality of video frames is using a video encoder or video decoder, a process 2300 is performed that includes the steps of predicting a modified motion vector for one or more base prediction units or sub-blocks (e.g., 4 x 4 blocks) in a first region in a current VPDU in a current image block of a current video frame; as shown, the method includes:
step 2301, obtaining a current image block, where the current image block includes at least one virtual pipeline data unit VPDU, and the VPDU includes a first area and a second area;
Step 2302, performing bi-directional prediction-based optical flow technology (BIO) processing on a first area of the VPDU (the VPDU is any one of one or more VPDUs included in the current image block) to obtain modified motion vectors of one or more basic prediction units in the first area, and obtaining a prediction value of the corresponding basic prediction unit according to the modified motion vectors;
step 2303, performing non-BIO processing on the second region of the VPDU to obtain a predicted value of one or more basic prediction units in the second region.
When the image block is coded or decoded by adopting the fusion scheme of the bidirectional prediction-based optical flow technology (BIO) and the Virtual Pipeline Data Unit (VPDU), the embodiment of the application only carries out BIO processing on the first area in the VPDU aiming at each VPDU in the image block, but not carries out BIO processing on all areas in the VPDU in the prior art, thereby reducing the number of basic prediction units for carrying out BIO processing in the VPDU, and reducing the complexity of realization on the premise of not influencing the coding and decoding performance.
In a possible embodiment, the second region is a pixel region where basic prediction units adjacent to a boundary in the VPDU are located, where the boundary includes one or more of a first boundary and a second boundary, where the first boundary is a VPDU boundary that is not overlapped with a third boundary; the second boundary is a VPDU boundary coincident with a third boundary; the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs; the third boundary is a boundary between the current image block and an adjacent image block; the first region is a region in the VPDU to be processed except the second region.
In a possible implementation manner, the performing BIO processing on the first region of the VPDU to obtain modified motion vectors of one or more basic prediction units in the first region includes: obtaining a prediction value matrix according to the motion information of the current image block, wherein the size of the prediction value matrix is larger than or equal to that of the VPDU; calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than that of the first area; and calculating the modified motion vector of one or more basic prediction units in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
When the image block is encoded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), aiming at each VPDU in the image block, on the basis of reducing the number of basic prediction units for BIO processing in the VPDU, pixel value sampling and filling are only carried out on extension areas of less than three VPDU boundaries (not all boundaries of the current VPDU, such as zero or one or two or three VPDU boundaries) adjacent to the current VPDU in the BIO processing process, so that the BIO processing method is compatible, and the operand for pixel value sampling and filling in the BIO processing process is reduced, thereby further reducing the complexity of implementation on the premise of not influencing the encoding and decoding performance.
In one possible embodiment, the calculating the modified motion vector of the one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix includes: and calculating a modified motion vector of each basic prediction unit in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a possible implementation manner, when the second region is a pixel region where a basic prediction unit adjacent to the first boundary and the second boundary in the VPDU is located, the prediction value matrix is represented by I (I, j), where I has a value range of [0, W-1], and j has a value range of [0, H-1 ]; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
When the method and the device adopt a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU) to encode or decode an image block, aiming at each VPDU in the image block, on the basis of reducing the number of basic prediction units for BIO processing in the VPDU, pixel value sampling and filling are not required to be carried out on an expansion area adjacent to the VPDU boundary of the current VPDU in the BIO processing process (namely, the prediction value matrix is directly determined by the whole current VPDU), so that the method and the device are compatible with the BIO processing mode, the operation amount of pixel value sampling and filling is greatly reduced, and the complexity of implementation is further reduced on the premise of not influencing the coding and decoding performance.
In a possible embodiment, when the second region is a pixel region adjacent to the first boundary in the VPDU, the predictor matrix is represented by I (I, j), where I is defined by a range of [ W1, W2], and j is defined by a range of [ H1, H2], where W1 is defined by LeftW, W2 is defined by the width W and RightW of the VPDU, H1 is defined by above H, and H2 is defined by the height H and bottom H of the VPDU; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh; the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh; LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary in the VPDU and one or more of the first boundary and the third boundary, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary in the VPDU and one or more of the first boundary and the third boundary, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary in the VPDU and one or more of the first boundary and the third boundary, and bottom represents a positional relationship between a basic prediction unit adjacent to a lower boundary in the VPDU and one or more of the first boundary and the third boundary.
When the method and the device adopt a fusion scheme of bidirectional prediction-based optical flow technology (BIO) and Virtual Pipeline Data Unit (VPDU) to encode or decode an image block, aiming at each VPDU in the image block, on the basis of reducing the number of basic prediction units for BIO processing in the VPDU, pixel value sampling and filling are only carried out on extension areas adjacent to three, two or one VPDU boundary (not all the boundary of the current VPDU) of the current VPDU in the BIO processing process, so that the method and the device are compatible with the BIO processing mode, and the operation amount of pixel value sampling and filling in the BIO processing process is reduced, thereby further reducing the complexity of implementation on the premise of not influencing the encoding and decoding performance.
In one possible embodiment, the W1 to W6 and H1 to H6 are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)。
in a possible embodiment, when the second region is a pixel region adjacent to two mutually perpendicular first boundaries in the VPDU, or the second region is a pixel region adjacent to one first boundary in the VPDU, if a left boundary of the VPDU is the second boundary, the LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
In a possible embodiment, when the second region is a pixel region adjacent to two or less first boundaries in the VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, then LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
In a possible embodiment, the method is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information; the horizontal prediction gradient matrix comprises a first horizontal prediction gradient matrix and a second horizontal prediction gradient matrix, the first horizontal prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second horizontal prediction gradient matrix is obtained through calculation according to the second prediction value matrix; the vertical prediction gradient matrix comprises a first vertical prediction gradient matrix and a second vertical prediction gradient matrix, the first vertical prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second vertical prediction gradient matrix is obtained through calculation according to the second prediction value matrix; the motion information correction amount includes a first motion information correction amount corresponding to the first reference frame list and a second motion information correction amount corresponding to the second reference frame list, the first motion information correction amount is calculated according to the first predictor matrix, the first horizontal prediction gradient matrix and the first vertical prediction gradient matrix, and the second motion information correction amount is calculated according to the second predictor matrix, the second horizontal prediction gradient matrix and the second vertical prediction gradient matrix.
In a possible implementation, before the calculating the modified motion vector of the one or more basic prediction units in the first region according to the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix, the method further includes: judging whether the difference between a first predicted value and a second predicted value of each basic prediction unit in the first area is larger than a second preset threshold value, wherein the first predicted value is a pixel value corresponding to the basic prediction unit in the first predicted value matrix, and the second predicted value is a pixel value corresponding to the basic prediction unit in the second predicted value matrix; the calculating modified motion vectors of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix comprises: and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
When the image block is encoded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), aiming at each VPDU in the image block, on the basis of reducing the number of basic prediction units for BIO processing in the VPDU, only the basic prediction unit with the difference between a first prediction value and a second prediction value being larger than a second preset threshold value in a first area calculates a correction motion vector, so that the operation amount of the correction motion vector in the first area is reduced, and the implementation complexity is reduced.
In a possible implementation manner, the performing non-BIO processing on the second area of the VPDU to obtain a prediction value of one or more basic prediction units in the second area includes: acquiring a predicted value matrix according to the motion information of the current image block; and calculating the predicted values of one or more basic prediction units in the second area according to the predicted value matrix.
In one possible embodiment, the method is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information; the calculating the prediction values of one or more basic prediction units in the second area according to the prediction value matrix comprises: and weighting and summing pixel values corresponding to the same position of the second area in the first prediction value matrix and the second prediction value matrix to obtain the prediction values of one or more basic prediction units in the second area.
When the image block is encoded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, BIO processing is performed on a first region in the VPDU, non-BIO processing (including weighted summation processing) is performed on a second region in the VPDU to obtain a pixel value of a basic prediction unit of the second region, the number of the basic prediction units for BIO processing in the VPDU is reduced, and therefore implementation complexity is reduced on the premise that encoding and decoding performance is not influenced.
Fig. 24 is a flowchart of an exemplary method according to an embodiment of the present application, and as shown in the drawing, a method of inter prediction is provided, where the process 2400 may be performed by the video encoder 20 or the video decoder 30 (specifically, the inter predictor 244, 344), and includes:
step 2401, judging whether the current image block comprises at least two VPDUs;
step 2402, when the current image block includes a VPDU (that is, the current image block is a VPDU), performing BIO processing on the VPDU to obtain a modified motion vector of one or more basic prediction units in the VPDU, and obtaining a prediction value corresponding to the basic prediction unit according to the modified motion vector;
Step 2403, when the current image block includes at least two VPDUs, inter-frame prediction is performed on the current image block in a non-BIO manner, so as to obtain a prediction value of one or more basic prediction units in the current image block.
For details on obtaining the modified motion vector of one or more basic prediction units in the VPDU by performing BIO processing on the VPDU, refer to the foregoing method embodiments, and are not described herein again.
As can be seen from the above, in the embodiment of the present application, a fusion scheme of a bidirectional prediction based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU) is adopted to encode or decode an image block, which can reduce the number of basic prediction units for performing BIO processing in the VPDU, and also reduce the computation amount of pixel value sampling and filling, thereby reducing the implementation complexity.
Fig. 25 is a flowchart illustrating an inter prediction method according to another embodiment of the present application. This process 2500 may be performed by video encoder 20 or video decoder 30, and in particular, may be performed by inter-prediction units 244, 344 of video encoder 20 or video decoder 30. Process 2500 is described as a series of steps or operations, it being understood that process 2500 may be performed in various orders and/or concurrently, and is not limited to the order of execution shown in FIG. 25. Assuming that a video data stream having a plurality of video frames is using a video encoder or video decoder, a process 2500 is performed that includes the steps of predicting a modified motion vector of one or more base prediction units or sub-blocks (e.g., 4 x 4 blocks) in a first region in a current VPDU in a current image block of a current video frame; as shown, the method includes:
Step 2501, obtaining motion information of a current image block, where the current image block includes at least one VPDU, and the VPDU includes a first area and a second area;
step 2502, obtaining a prediction value matrix according to the motion information, wherein the size of the prediction value matrix is larger than or equal to that of the VPDU;
step 2503, calculating a horizontal prediction gradient matrix of the first region and a vertical prediction gradient matrix of the first region according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first region;
step 2504, calculating a modified motion vector of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix, and obtaining a prediction value of a corresponding basic prediction unit according to the modified motion vector.
When the image block is encoded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), for each VPDU in the image block, BIO processing is only performed on a first region in the VPDU, but not on all regions in the VPDU in the prior art, so that the number of basic prediction units for performing the BIO processing in the VPDU is reduced, and in the process of the BIO processing, pixel value sampling and filling are performed only on extension regions adjacent to three or less VPDU boundaries (not all VPDU boundaries, such as zero or one or two or three VPDU boundaries) of the current VPDU, so that not only is the BIO processing mode compatible, but also the operation amount of the pixel value sampling and filling is reduced, and the implementation complexity is further reduced on the premise of not affecting the encoding and decoding performance.
In one possible embodiment, the calculating the modified motion vector of the one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix includes: and calculating a modified motion vector of each basic prediction unit in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a possible embodiment, the method is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix includes a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information.
In a possible implementation, before the calculating the horizontal prediction gradient matrix of the first region and the vertical prediction gradient matrix of the first region according to the prediction value matrix, the method further includes: judging whether the difference between the first predicted value matrix and the second predicted value matrix is larger than a first preset threshold value or not; the calculating a horizontal prediction gradient matrix of the first region and a vertical prediction gradient matrix of the first region according to the prediction value matrix comprises: and under the condition that the difference is larger than the first preset threshold value, calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix.
When the method and the device adopt a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU) to encode or decode an image block, whether the difference between a corresponding first predicted value matrix and a corresponding second predicted value matrix of each VPDU in the image block is greater than a first preset threshold value or not is judged, and BIO processing is only performed on the VPDUs meeting the condition, so that the number of basic prediction units for performing BIO processing in the image block is further reduced, and the implementation complexity is further reduced.
In a possible implementation, before the calculating the modified motion vector of the one or more basic prediction units in the first region according to the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix, the method further includes: judging whether the difference between a first predicted value and a second predicted value of each basic prediction unit in the first area is larger than a second preset threshold value, wherein the first predicted value is a pixel value corresponding to the basic prediction unit in the first predicted value matrix, and the second predicted value is a pixel value corresponding to the basic prediction unit in the second predicted value matrix; the calculating modified motion vectors of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix comprises: and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
When the image block is encoded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), aiming at each VPDU in the image block, on the basis of reducing the number of basic prediction units for BIO processing in the VPDU, only the basic prediction unit with the difference between a first prediction value and a second prediction value being greater than a second preset threshold value in a first area calculates a correction motion vector, so that the operation amount of the correction motion vector in the first area is further reduced, and the implementation complexity is further reduced.
In a possible embodiment, the second region is a pixel region where basic prediction units adjacent to a boundary in the VPDU are located, where the boundary includes one or more of a first boundary and a second boundary, where the first boundary is a VPDU boundary that is not overlapped with a third boundary; the second boundary is a VPDU boundary coincident with a third boundary; the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs; the third boundary is a boundary between the current image block and an adjacent image block; the first region is a region in the VPDU to be processed except the second region.
In a possible implementation manner, when the second region is a pixel region where a basic prediction unit adjacent to the first boundary and the second boundary in the VPDU is located, the prediction value matrix is represented by I (I, j), where I has a value range of [0, W-1], and j has a value range of [0, H-1 ]; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
When the image block is encoded or decoded by adopting a fusion scheme of a bidirectional prediction-based optical flow technology (BIO) and a Virtual Pipeline Data Unit (VPDU), aiming at each VPDU in the image block, on the basis of reducing the number of basic prediction units for BIO processing in the VPDU, pixel value sampling and filling are not required to be carried out on an expansion area adjacent to the VPDU boundary of the current VPDU in the BIO processing process (namely, the prediction value matrix is directly determined by the whole current VPDU), so that the BIO processing mode is compatible, the operation amount of pixel value sampling and filling is greatly reduced, and the implementation complexity is further reduced on the premise of not influencing the coding and decoding performance.
In a possible embodiment, when the second region is a pixel region adjacent to the first boundary in the VPDU, the predictor matrix is represented by I (I, j), where I is defined by a range of [ W1, W2], and j is defined by a range of [ H1, H2], where W1 is defined by LeftW, W2 is defined by the width W and RightW of the VPDU, H1 is defined by above H, and H2 is defined by the height H and bottom H of the VPDU; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh; the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh; LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary in the VPDU and one or more of the first boundary and the third boundary, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary in the VPDU and one or more of the first boundary and the third boundary, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary in the VPDU and one or more of the first boundary and the third boundary, and bottom represents a positional relationship between a basic prediction unit adjacent to a lower boundary in the VPDU and one or more of the first boundary and the third boundary.
When the method and the device adopt a fusion scheme of bidirectional prediction-based optical flow technology (BIO) and Virtual Pipeline Data Unit (VPDU) to encode or decode an image block, aiming at each VPDU in the image block, on the basis of reducing the number of basic prediction units for BIO processing in the VPDU, pixel value sampling and filling are only carried out on extension areas adjacent to three, two or one VPDU boundary (not all the boundary of the current VPDU) of the current VPDU in the BIO processing process, so that the method and the device are compatible with the BIO processing mode, and the operation amount of pixel value sampling and filling in the BIO processing process is reduced, thereby further reducing the complexity of implementation on the premise of not influencing the encoding and decoding performance.
In a possible embodiment, when the second region is a pixel region adjacent to two mutually perpendicular first boundaries in the VPDU, or the second region is a pixel region adjacent to one first boundary in the VPDU, if a left boundary of the VPDU is the second boundary, the LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
In a possible embodiment, when the second region is a pixel region adjacent to two or less first boundaries in the VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, then LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
Fig. 26 is a schematic block diagram of an inter-prediction device 2600 in an embodiment of the present application. It should be noted that the inter prediction apparatus 2600 is applicable to both inter prediction for decoding a video image and inter prediction for encoding a video image, and it should be understood that the inter prediction apparatus 2600 herein may correspond to the inter prediction unit 244 in fig. 2 or may correspond to the inter prediction unit 344 in fig. 3, and the inter prediction apparatus 2600 may include:
An obtaining module 2601, configured to obtain a current image block, where the current image block includes at least one virtual pipeline data unit VPDU, and the VPDU includes a first area and a second area; a first processing module 2602, configured to perform optical flow technology BIO processing based on bidirectional prediction on a first region of the VPDU to obtain modified motion vectors of one or more basic prediction units in the first region, and obtain prediction values of corresponding basic prediction units according to the modified motion vectors; a second processing module 2603, configured to perform non-BIO processing on the second region of the VPDU to obtain a prediction value of one or more basic prediction units in the second region.
In a possible embodiment, the second region is a pixel region where basic prediction units adjacent to a boundary in the VPDU are located, where the boundary includes one or more of a first boundary and a second boundary, where the first boundary is a VPDU boundary that is not overlapped with a third boundary; the second boundary is a VPDU boundary coincident with a third boundary; the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs; the third boundary is a boundary between the current image block and an adjacent image block; the first region is a region in the VPDU to be processed except the second region.
In a possible implementation, the first processing module 2602 is specifically configured to obtain a predictor matrix according to the motion information of the current image block, where a size of the predictor matrix is greater than or equal to a size of the VPDU; calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first area; calculating modified motion vectors of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix; and obtaining a predicted value of the corresponding basic prediction unit according to the corrected motion vector.
In a possible implementation, the first processing module 2602 is specifically configured to calculate a modified motion vector for each basic prediction unit in the first region according to the predictor matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a possible implementation manner, when the second region is a pixel region where a basic prediction unit adjacent to the first boundary and the second boundary in the VPDU is located, the prediction value matrix is represented by I (I, j), where I has a value range of [0, W-1], and j has a value range of [0, H-1 ]; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
In a possible embodiment, when the second region is a pixel region adjacent to the first boundary in the VPDU, the predictor matrix is represented by I (I, j), where I is defined by a range of [ W1, W2], and j is defined by a range of [ H1, H2], where W1 is defined by LeftW, W2 is defined by the width W and RightW of the VPDU, H1 is defined by above H, and H2 is defined by the height H and bottom H of the VPDU; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh; the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh; LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary in the VPDU and one or more of the first boundary and the third boundary, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary in the VPDU and one or more of the first boundary and the third boundary, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary in the VPDU and one or more of the first boundary and the third boundary, and bottom represents a positional relationship between a basic prediction unit adjacent to a lower boundary in the VPDU and one or more of the first boundary and the third boundary.
In one possible embodiment, the W1 to W6 and H1 to H6 are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH)。
in a possible embodiment, when the second region is a pixel region adjacent to two mutually perpendicular first boundaries in the VPDU, or the second region is a pixel region adjacent to one first boundary in the VPDU, if a left boundary of the VPDU is the second boundary, the LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
In a possible embodiment, when the second region is a pixel region adjacent to two or less first boundaries in the VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, then LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, or a basic prediction unit in the VPDU adjacent to the right boundary is located on the right of the first boundary, RightW is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
In a possible embodiment, the method is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information; the horizontal prediction gradient matrix comprises a first horizontal prediction gradient matrix and a second horizontal prediction gradient matrix, the first horizontal prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second horizontal prediction gradient matrix is obtained through calculation according to the second prediction value matrix; the vertical prediction gradient matrix comprises a first vertical prediction gradient matrix and a second vertical prediction gradient matrix, the first vertical prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second vertical prediction gradient matrix is obtained through calculation according to the second prediction value matrix; the motion information correction amount includes a first motion information correction amount corresponding to the first reference frame list and a second motion information correction amount corresponding to the second reference frame list, the first motion information correction amount is calculated according to the first predictor matrix, the first horizontal prediction gradient matrix and the first vertical prediction gradient matrix, and the second motion information correction amount is calculated according to the second predictor matrix, the second horizontal prediction gradient matrix and the second vertical prediction gradient matrix.
In a possible implementation, the first processing module 2602 is further configured to determine whether a difference between a first prediction value and a second prediction value of each basic prediction unit in the first region is greater than a second preset threshold, where the first prediction value is a pixel value corresponding to the basic prediction unit in the first prediction value matrix, and the second prediction value is a pixel value corresponding to the basic prediction unit in the second prediction value matrix; and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
In a possible implementation, the second processing module 2603 is specifically configured to obtain a predictor matrix according to the motion information of the current image block; and calculating the predicted values of one or more basic prediction units in the second area according to the predicted value matrix.
In a possible embodiment, the apparatus is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information; the calculating the prediction values of one or more basic prediction units in the second area according to the prediction value matrix comprises: and weighting and summing pixel values corresponding to the same position of the second area in the first prediction value matrix and the second prediction value matrix to obtain the prediction values of one or more basic prediction units in the second area.
It should be noted that each module in the inter-frame prediction apparatus in the embodiment of the present application is a functional entity that implements various execution steps included in the inter-frame prediction method of the present application, that is, a functional entity that implements the complete implementation of each step in the inter-frame prediction method of the present application and the extension and deformation of these steps is provided.
Fig. 27 is a schematic block diagram of an inter prediction apparatus 2700 in an embodiment of the present application. It should be noted that the inter prediction apparatus 2700 is applicable to both inter prediction for decoding video images and inter prediction for encoding video images, and it should be understood that the inter prediction apparatus 2700 herein may correspond to the inter prediction unit 244 in fig. 2 or may correspond to the inter prediction unit 344 in fig. 3, and the inter prediction apparatus 2700 may include: a determining module 2701, configured to determine whether a current image block includes at least two VPDUs; a fourth processing module 2703, configured to, when the current image block includes a VPDU, perform bi-directional prediction based optical flow technique BIO processing on the VPDU to obtain a modified motion vector of one or more basic prediction units in the VPDU, and obtain a prediction value corresponding to the basic prediction unit according to the modified motion vector; the third processing module 2702 is configured to, when the current image block includes at least two VPDUs, perform inter prediction on the current image block in a non-BIO manner to obtain prediction values of one or more basic prediction units in the current image block.
It should be noted that each module in the inter-frame prediction apparatus in the embodiment of the present application is a functional entity that implements various execution steps included in the inter-frame prediction method of the present application, that is, a functional entity that implements the complete implementation of each step in the inter-frame prediction method of the present application and the extension and deformation of these steps is provided.
Fig. 28 is a schematic block diagram of an inter prediction apparatus 2800 according to an embodiment of the present application. It should be noted that the inter prediction apparatus 2800 is suitable for both inter prediction of decoded video images and inter prediction of encoded video images, and it should be understood that the inter prediction apparatus 2800 herein may correspond to the inter prediction unit 244 in fig. 2 or may correspond to the inter prediction unit 344 in fig. 3, and the inter prediction apparatus 2800 may include:
an obtaining module 2801, configured to obtain motion information of a current image block, where the current image block includes at least one VPDU, and the VPDU includes a first area and a second area; a predictor matrix module 2802 configured to obtain a predictor matrix according to the motion information, where a size of the predictor matrix is greater than or equal to a size of the VPDU; a gradient matrix module 2803 configured to calculate, according to the predictor matrix, a horizontal prediction gradient matrix of the first region and a vertical prediction gradient matrix of the first region, where sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than a size of the first region; a calculating module 2804, configured to calculate, according to the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix, a modified motion vector of one or more basic prediction units in the first area, where the modified motion vector is used to obtain a predictor of a corresponding basic prediction unit.
In a possible implementation, the calculating module 2804 is specifically configured to calculate, according to the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix, a modified motion vector of each basic prediction unit in the first area, where the modified motion vector is used to obtain a predictor of a corresponding basic prediction unit.
In a possible embodiment, the apparatus is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; the predictor matrix includes a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information.
In a possible implementation, the gradient matrix module 2803 is further configured to determine whether a difference between the first predictor matrix and the second predictor matrix is greater than a preset threshold; and under the condition that the difference is larger than the preset threshold value, calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix.
In a possible implementation manner, the calculating module 2804 is further configured to determine whether a difference between a first prediction value and a second prediction value of each basic prediction unit in the first area is greater than a second preset threshold, where the first prediction value is a pixel value corresponding to the basic prediction unit in the first prediction value matrix, and the second prediction value is a pixel value corresponding to the basic prediction unit in the second prediction value matrix; and for the basic prediction unit with the difference larger than the second preset threshold, calculating a corrected motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix, wherein the corrected motion vector is used for obtaining a prediction value of the corresponding basic prediction unit.
In a possible embodiment, the second region is a pixel region where basic prediction units adjacent to a boundary in the VPDU are located, where the boundary includes one or more of a first boundary and a second boundary, where the first boundary is a VPDU boundary that is not overlapped with a third boundary; the second boundary is a VPDU boundary coincident with a third boundary; the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs; the third boundary is a boundary between the current image block and an adjacent image block; the first region is a region in the VPDU to be processed except the second region.
In a possible implementation manner, when the second region is a pixel region where a basic prediction unit adjacent to the first boundary and the second boundary in the VPDU is located, the prediction value matrix is represented by I (I, j), where I has a value range of [0, W-1], and j has a value range of [0, H-1 ]; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ]; wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
In a possible embodiment, when the second region is a pixel region adjacent to the first boundary in the VPDU, the predictor matrix is represented by I (I, j), where I is defined by a range of [ W1, W2], and j is defined by a range of [ H1, H2], where W1 is defined by LeftW, W2 is defined by the width W and RightW of the VPDU, H1 is defined by above H, and H2 is defined by the height H and bottom H of the VPDU; the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh; the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh; LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary in the VPDU and one or more of the first boundary and the third boundary, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary in the VPDU and one or more of the first boundary and the third boundary, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary in the VPDU and one or more of the first boundary and the third boundary, and bottom represents a positional relationship between a basic prediction unit adjacent to a lower boundary in the VPDU and one or more of the first boundary and the third boundary.
In a possible embodiment, when the second region is a pixel region adjacent to two mutually perpendicular first boundaries in the VPDU, or the second region is a pixel region adjacent to one first boundary in the VPDU, if a left boundary of the VPDU is the second boundary, the LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
In a possible embodiment, when the second region is a pixel region adjacent to two or less first boundaries in the VPDU, if a left boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, then LeftW is 1; otherwise, leftW is 0; if the right boundary of the VPDU is the second boundary, or a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, right w is 1; otherwise Right W is 0; if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0; if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
It should be noted that each module in the inter-frame prediction apparatus in the embodiment of the present application is a functional entity that implements various execution steps included in the inter-frame prediction method of the present application, that is, a functional entity that implements the complete implementation of each step in the inter-frame prediction method of the present application and the extension and deformation of these steps is provided.
Those of skill in the art will appreciate that the functions described in connection with the various illustrative logical blocks, modules, and algorithm steps described in the disclosure herein may be implemented as hardware, software, firmware, or any combination thereof. If implemented in software, the functions described in the various illustrative logical blocks, modules, and steps may be stored on or transmitted over as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. The computer-readable medium may include a computer-readable storage medium, which corresponds to a tangible medium, such as a data storage medium, or any communication medium including a medium that facilitates transfer of a computer program from one place to another (e.g., according to a communication protocol). In this manner, a computer-readable medium may generally correspond to (1) a non-transitory tangible computer-readable storage medium, or (2) a communication medium, such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementing the techniques described herein. The computer program product may include a computer-readable medium.
By way of example, and not limitation, such computer-readable storage media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that the computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but are instead directed to non-transitory tangible storage media. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The instructions may be executed by one or more processors, such as one or more Digital Signal Processors (DSPs), general purpose microprocessors, Application Specific Integrated Circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Thus, the term "processor," as used herein may refer to any of the foregoing structure or any other structure suitable for implementation of the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logical blocks, modules, and steps described herein may be provided within dedicated hardware and/or software modules configured for encoding and decoding, or incorporated in a combined codec. Also, the techniques may be fully implemented in one or more circuits or logic elements.
The techniques of this application may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an Integrated Circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this application to emphasize functional aspects of means for performing the disclosed techniques, but do not necessarily require realization by different hardware units. Indeed, as described above, the various units may be combined in a codec hardware unit, in conjunction with suitable software and/or firmware, or provided by an interoperating hardware unit (including one or more processors as described above).
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The above description is only an exemplary embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (48)

1. An inter-frame prediction method, comprising:
acquiring a current image block, wherein the current image block comprises at least one Virtual Pipeline Data Unit (VPDU), and the VPDU comprises a first area and a second area;
carrying out optical flow technology BIO processing based on bidirectional prediction on a first area of the VPDU to obtain modified motion vectors of one or more basic prediction units in the first area, and obtaining a prediction value of a corresponding basic prediction unit according to the modified motion vectors;
and carrying out non-BIO processing on a second area of the VPDU to obtain a predicted value of one or more basic prediction units in the second area.
2. The method of claim 1, wherein the second region is a pixel region in which basic prediction units (PPUs) adjacent to a boundary in the VPDU are located, wherein the boundary comprises one or more of a first boundary and a second boundary,
wherein the first boundary is a VPDU boundary that is not coincident with a third boundary;
the second boundary is a VPDU boundary coincident with a third boundary;
the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs;
the third boundary is a boundary between the current image block and an adjacent image block;
the first region is a region in the VPDU to be processed except the second region.
3. The method of claim 2, wherein the BIO processing the first region of the VPDU to obtain modified motion vectors for one or more basic prediction units in the first region comprises:
obtaining a prediction value matrix according to the motion information of the current image block, wherein the size of the prediction value matrix is larger than or equal to that of the VPDU;
calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first area;
And calculating the modified motion vector of one or more basic prediction units in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
4. The method of claim 3, wherein when the second region is a pixel region of the VPDU where basic prediction units adjacent to the first boundary and the second boundary are located,
the prediction value matrix is represented by I (I, j), wherein the value range of I is [0, W-1], and the value range of j is [0, H-1 ];
the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ];
the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ];
wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
5. The method of claim 3, wherein when the second region is a pixel region adjacent to the first boundary in the VPDU,
the prediction value matrix is represented by I (I, j), wherein the value range of I is [ W1, W2], the value range of j is [ H1, H2], wherein W1 is determined by LeftW, W2 is determined by the width W and rightW of the VPDU, H1 is determined by AboveH, and H2 is determined by the height H and Bottomh of the VPDU;
The horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh;
the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh;
LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary and one or more of the first and third boundaries in the VPDU, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary and one or more of the first and third boundaries in the VPDU, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary and one or more of the first and third boundaries in the VPDU, and botton represents a positional relationship between a basic prediction unit adjacent to a lower boundary and one or more of the first and third boundaries in the VPDU.
6. The method of claim 5, wherein W1-W6, H1-H6 are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH);
Wherein, the values of leftW, rightW, AboveH and BottonH are 1 or 0.
7. The method of claim 5 or 6, wherein when the second region is a pixel region in the VPDU adjacent to two mutually perpendicular first boundaries or the second region is a pixel region in the VPDU adjacent to one first boundary,
if the left boundary of the VPDU is the second boundary, the leftW is 1; otherwise, leftW is 0;
if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0;
if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0;
if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
8. The method of claim 5 or 6, wherein when the second region is a pixel region of the VPDU which is adjacent to two or less of the first boundary,
if the left boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise, leftW is 0;
if the right boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, RightW is 1; otherwise Right W is 0;
If the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0;
if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the lower boundary in the VPDU is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
9. The method according to any of claims 3-6, wherein the method is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list;
the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information;
the horizontal prediction gradient matrix comprises a first horizontal prediction gradient matrix and a second horizontal prediction gradient matrix, the first horizontal prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second horizontal prediction gradient matrix is obtained through calculation according to the second prediction value matrix;
The vertical prediction gradient matrix comprises a first vertical prediction gradient matrix and a second vertical prediction gradient matrix, the first vertical prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second vertical prediction gradient matrix is obtained through calculation according to the second prediction value matrix;
the motion information correction amount includes a first motion information correction amount corresponding to the first reference frame list and a second motion information correction amount corresponding to the second reference frame list, the first motion information correction amount is calculated according to the first predictor matrix, the first horizontal prediction gradient matrix and the first vertical prediction gradient matrix, and the second motion information correction amount is calculated according to the second predictor matrix, the second horizontal prediction gradient matrix and the second vertical prediction gradient matrix.
10. The method of claim 9, wherein before calculating the modified motion vector for the one or more base prediction units in the first region based on the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix, further comprising:
judging whether the difference between a first predicted value and a second predicted value of each basic prediction unit in the first area is larger than a second preset threshold value, wherein the first predicted value is a pixel value corresponding to the basic prediction unit in the first predicted value matrix, and the second predicted value is a pixel value corresponding to the basic prediction unit in the second predicted value matrix;
The calculating modified motion vectors of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix comprises:
and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
11. The method according to any of claims 3-6, wherein said calculating modified motion vectors for one or more basic prediction units in the first region based on the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix comprises:
and calculating a modified motion vector of each basic prediction unit in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
12. The method according to any of claims 1-6 and 10, wherein the performing non-BIO processing on the second region of the VPDU to obtain predicted values of one or more basic prediction units in the second region comprises:
Acquiring a predicted value matrix according to the motion information of the current image block;
and calculating the predicted values of one or more basic prediction units in the second area according to the predicted value matrix.
13. The method of claim 12, wherein the method is used for bi-directional prediction;
the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list;
the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information;
the calculating the prediction values of one or more basic prediction units in the second area according to the prediction value matrix comprises:
and weighting and summing pixel values corresponding to the same position of the second area in the first prediction value matrix and the second prediction value matrix to obtain the prediction values of one or more basic prediction units in the second area.
14. An inter-frame prediction method, comprising:
acquiring motion information of a current image block, wherein the current image block comprises at least one Virtual Pipeline Data Unit (VPDU), and the VPDU comprises a first area and a second area;
Obtaining a predictor matrix according to the motion information, wherein the size of the predictor matrix is larger than or equal to that of the VPDU;
calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first area;
and calculating a modified motion vector of one or more basic prediction units in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix, wherein the modified motion vector is used for obtaining a prediction value of a corresponding basic prediction unit.
15. The method of claim 14, wherein the method is used for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list;
the predictor matrix includes a first predictor matrix and a second predictor matrix, the first predictor matrix being obtained according to the first motion information, the second predictor matrix being obtained according to the second motion information.
16. The method of claim 15, wherein prior to calculating the horizontal prediction gradient matrix for the first region and the vertical prediction gradient matrix for the first region from the predictor matrix, further comprising:
judging whether the difference between the first predicted value matrix and the second predicted value matrix is larger than a first preset threshold value or not;
the calculating a horizontal prediction gradient matrix of the first region and a vertical prediction gradient matrix of the first region according to the prediction value matrix comprises:
and under the condition that the difference is larger than the first preset threshold value, calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix.
17. The method according to claim 15 or 16, wherein before calculating the modified motion vector for one or more basic prediction units in the first region according to the predictor matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix, further comprising:
judging whether the difference between a first predicted value and a second predicted value of each basic prediction unit in the first area is larger than a second preset threshold value, wherein the first predicted value is a pixel value corresponding to the basic prediction unit in the first predicted value matrix, and the second predicted value is a pixel value corresponding to the basic prediction unit in the second predicted value matrix;
The calculating modified motion vectors of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix comprises:
and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
18. The method according to any of claims 14-16, wherein said calculating modified motion vectors for one or more basic prediction units in the first region based on the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix comprises:
and calculating a modified motion vector of each basic prediction unit in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
19. The method of any of claims 14-16, wherein the second region is a pixel region in which basic prediction units (PPUs) adjacent to a boundary are located in the VPDU, wherein the boundary comprises one or more of a first boundary and a second boundary,
Wherein the first boundary is a VPDU boundary that is not coincident with a third boundary;
the second boundary is a VPDU boundary coincident with a third boundary;
the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs;
the third boundary is a boundary between the current image block and an adjacent image block;
the first region is a region in the VPDU to be processed except the second region.
20. The method of claim 19, wherein when the second region is a pixel region of the VPDU where basic prediction units adjacent to the first boundary and the second boundary are located,
the prediction value matrix is represented by I (I, j), wherein the value range of I is [0, W-1], and the value range of j is [0, H-1 ];
the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ];
the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ];
wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
21. The method of claim 19, wherein when the second region is a pixel region adjacent to the first boundary in the VPDU,
the prediction value matrix is represented by I (I, j), wherein the value range of I is [ W1, W2], the value range of j is [ H1, H2], wherein W1 is determined by LeftW, W2 is determined by the width W and rightW of the VPDU, H1 is determined by AboveH, and H2 is determined by the height H and Bottomh of the VPDU;
the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh;
the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh;
LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary and one or more of the first and third boundaries in the VPDU, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary and one or more of the first and third boundaries in the VPDU, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary and one or more of the first and third boundaries in the VPDU, and botton represents a positional relationship between a basic prediction unit adjacent to a lower boundary and one or more of the first and third boundaries in the VPDU.
22. The method of claim 21 wherein when the second region is a pixel region in the VPDU adjacent to two mutually perpendicular first boundaries or the second region is a pixel region in the VPDU adjacent to one of the first boundaries,
if the left boundary of the VPDU is the second boundary, the leftW is 1; otherwise, leftW is 0;
if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0;
if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0;
if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
23. The method of claim 21, wherein when the second region is a pixel region of the VPDU which is adjacent to two or less of the first boundary,
if the left boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise, leftW is 0;
if the right boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, RightW is 1; otherwise Right W is 0;
If the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0;
if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the lower boundary in the VPDU is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
24. An inter-frame prediction apparatus, comprising:
the image processing device comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a current image block, the current image block comprises at least one Virtual Pipeline Data Unit (VPDU), and the VPDU comprises a first area and a second area;
the first processing module is used for carrying out optical flow technology BIO processing based on bidirectional prediction on a first area of the VPDU to obtain corrected motion vectors of one or more basic prediction units in the first area, and obtaining a prediction value corresponding to the basic prediction unit according to the corrected motion vectors;
and the second processing module is used for carrying out non-BIO processing on the second area of the VPDU to obtain the predicted value of one or more basic prediction units in the second area.
25. The apparatus of claim 24, wherein the second region is a pixel region in which basic prediction units (PPUs) adjacent to a boundary in the VPDU are located, wherein the boundary comprises one or more of a first boundary and a second boundary,
Wherein the first boundary is a VPDU boundary that is not coincident with a third boundary;
the second boundary is a VPDU boundary coincident with a third boundary;
the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs;
the third boundary is a boundary between the current image block and an adjacent image block;
the first region is a region in the VPDU to be processed except the second region.
26. The apparatus according to claim 25, wherein the first processing module is specifically configured to obtain a predictor matrix according to the motion information of the current image block, and a size of the predictor matrix is greater than or equal to a size of the VPDU; calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix, wherein the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than the size of the first area; calculating modified motion vectors of one or more basic prediction units in the first region according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix; and obtaining a predicted value of the corresponding basic prediction unit according to the corrected motion vector.
27. The apparatus of claim 26, wherein when the second region is a pixel region of the VPDU where basic prediction units adjacent to the first boundary and the second boundary are located,
the prediction value matrix is represented by I (I, j), wherein the value range of I is [0, W-1], and the value range of j is [0, H-1 ];
the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ];
the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ];
wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
28. The apparatus of claim 26, wherein when the second region is a pixel region adjacent to the first boundary in the VPDU,
the prediction value matrix is represented by I (I, j), wherein the value range of I is [ W1, W2], the value range of j is [ H1, H2], wherein W1 is determined by LeftW, W2 is determined by the width W and rightW of the VPDU, H1 is determined by AboveH, and H2 is determined by the height H and Bottomh of the VPDU;
The horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh;
the vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh;
LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary and one or more of the first and third boundaries in the VPDU, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary and one or more of the first and third boundaries in the VPDU, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary and one or more of the first and third boundaries in the VPDU, and botton represents a positional relationship between a basic prediction unit adjacent to a lower boundary and one or more of the first and third boundaries in the VPDU.
29. The apparatus of claim 28, wherein the W1-W6, H1-H6 are calculated by the following formula:
W1=-LeftW,W2=W-1+RightW,H1=-AboveH,H2=H-1+BottonH
W3=3×(1-LeftW),W4=W-1-3×(1-RightW),H3=3×(1-AboveH),H4=H-1-3×(1-BottonH)
W5=3×(1-LeftW),W6=W-1-3×(1-RightW),H5=3×(1-AboveH),H6=H-1-3×(1-BottonH);
Wherein, the values of leftW, rightW, AboveH and BottonH are 1 or 0.
30. The apparatus of claim 28 or 29, wherein when the second region is a pixel region in the VPDU adjacent to two mutually perpendicular first boundaries or the second region is a pixel region in the VPDU adjacent to one of the first boundaries,
if the left boundary of the VPDU is the second boundary, the leftW is 1; otherwise, leftW is 0;
if the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0;
if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0;
if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
31. The apparatus of claim 28 or 29, wherein when the second region is a pixel region of the VPDU which is adjacent to two or less of the first boundary,
if the left boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise, leftW is 0;
if the right boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, RightW is 1; otherwise Right W is 0;
If the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0;
if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit in the VPDU adjacent to the lower boundary is located below the first boundary, BottonH is 1; otherwise, BottonH is 0.
32. The apparatus according to any of claims 26-29, wherein the apparatus is configured for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list;
the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information;
the horizontal prediction gradient matrix comprises a first horizontal prediction gradient matrix and a second horizontal prediction gradient matrix, the first horizontal prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second horizontal prediction gradient matrix is obtained through calculation according to the second prediction value matrix;
The vertical prediction gradient matrix comprises a first vertical prediction gradient matrix and a second vertical prediction gradient matrix, the first vertical prediction gradient matrix is obtained through calculation according to the first prediction value matrix, and the second vertical prediction gradient matrix is obtained through calculation according to the second prediction value matrix;
the motion information correction amount includes a first motion information correction amount corresponding to the first reference frame list and a second motion information correction amount corresponding to the second reference frame list, the first motion information correction amount is calculated according to the first predictor matrix, the first horizontal prediction gradient matrix and the first vertical prediction gradient matrix, and the second motion information correction amount is calculated according to the second predictor matrix, the second horizontal prediction gradient matrix and the second vertical prediction gradient matrix.
33. The apparatus of claim 32, wherein the first processing module is further configured to determine whether a difference between a first prediction value and a second prediction value of each basic prediction unit in the first region is greater than a second preset threshold, the first prediction value being a pixel value corresponding to the basic prediction unit in the first prediction value matrix, and the second prediction value being a pixel value corresponding to the basic prediction unit in the second prediction value matrix; and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
34. The apparatus according to any of claims 26-29, wherein the first processing module is specifically configured to calculate the modified motion vector for each basic prediction unit in the first region based on the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix, in terms of calculating the modified motion vector for one or more basic prediction units in the first region based on the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix.
35. The apparatus according to any of claims 24-29 and 33, wherein the second processing module is specifically configured to obtain a predictor matrix according to the motion information of the current image block; and calculating the predicted values of one or more basic prediction units in the second area according to the predicted value matrix.
36. The apparatus of claim 35, wherein the apparatus is configured for bi-directional prediction;
the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list;
the predictor matrix comprises a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information;
The calculating the prediction values of one or more basic prediction units in the second area according to the prediction value matrix comprises:
and weighting and summing pixel values corresponding to the same position of the second area in the first prediction value matrix and the second prediction value matrix to obtain the prediction values of one or more basic prediction units in the second area.
37. An inter-frame prediction apparatus, comprising:
the device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring motion information of a current image block, the current image block comprises at least one Virtual Pipeline Data Unit (VPDU), and the VPDU comprises a first area and a second area;
a predictor matrix module, configured to obtain a predictor matrix according to the motion information, where a size of the predictor matrix is greater than or equal to a size of the VPDU;
a gradient matrix module, configured to calculate, according to the prediction value matrix, a horizontal prediction gradient matrix of the first region and a vertical prediction gradient matrix of the first region, where sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix are respectively larger than a size of the first region;
and the calculation module is used for calculating the corrected motion vectors of one or more basic prediction units in the first area according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix, wherein the corrected motion vectors are used for obtaining the prediction values of the corresponding basic prediction units.
38. The apparatus of claim 37, wherein the apparatus is configured for bi-directional prediction; the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list;
the predictor matrix includes a first predictor matrix and a second predictor matrix, the first predictor matrix is obtained according to the first motion information, and the second predictor matrix is obtained according to the second motion information.
39. The apparatus of claim 38, wherein the gradient matrix module is further configured to determine whether a difference between the first predictor matrix and the second predictor matrix is greater than a preset threshold; and under the condition that the difference is larger than the preset threshold value, calculating a horizontal prediction gradient matrix of the first area and a vertical prediction gradient matrix of the first area according to the prediction value matrix.
40. The apparatus according to claim 38 or 39, wherein the calculating module is further configured to determine whether a difference between a first prediction value and a second prediction value of each basic prediction unit in the first area is greater than a second preset threshold, the first prediction value is a pixel value corresponding to the basic prediction unit in the first prediction value matrix, and the second prediction value is a pixel value corresponding to the basic prediction unit in the second prediction value matrix; and for the basic prediction unit with the difference larger than the second preset threshold, calculating a correction motion vector of the basic prediction unit according to the prediction value matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix.
41. The apparatus according to any of claims 37-39, wherein the computing module is specifically configured to compute the modified motion vector for each basic prediction unit in the first region according to the predictor matrix, the horizontal prediction gradient matrix, and the vertical prediction gradient matrix.
42. The apparatus of any of claims 37-39, wherein the second region is a pixel region in which basic prediction units (PPUs) adjacent to a boundary in the VPDU are located, wherein the boundary comprises one or more of a first boundary and a second boundary,
wherein the first boundary is a VPDU boundary that is not coincident with a third boundary;
the second boundary is a VPDU boundary coincident with a third boundary;
the VPDU boundaries comprise horizontal boundaries between the VPDU to be processed and adjacent VPDUs and/or vertical boundaries between the VPDU to be processed and adjacent VPDUs;
the third boundary is a boundary between the current image block and an adjacent image block;
the first region is a region in the VPDU to be processed except the second region.
43. The apparatus of claim 42, wherein when the second region is a pixel region of the VPDU where basic prediction units adjacent to the first boundary and the second boundary are located,
The prediction value matrix is represented by I (I, j), wherein the value range of I is [0, W-1], and the value range of j is [0, H-1 ];
the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ];
the vertical prediction gradient matrix is represented by Y (i, j), wherein the value range of i is [3, W-4], and the value range of j is [3, H-4 ];
wherein, W represents the width of the VPDU, H represents the height of the VPDU, and (i, j) represents the position coordinates of each pixel sampling point in the VPDU.
44. The apparatus of claim 42, wherein when the second region is a pixel region adjacent to the first boundary in the VPDU,
the prediction value matrix is represented by I (I, j), wherein the value range of I is [ W1, W2], the value range of j is [ H1, H2], wherein W1 is determined by LeftW, W2 is determined by the width W and rightW of the VPDU, H1 is determined by AboveH, and H2 is determined by the height H and Bottomh of the VPDU;
the horizontal prediction gradient matrix is represented by X (i, j), wherein the value range of i is [ W3, W4], the value range of j is [ H3, H4], wherein W3 is determined by LeftW, W4 is determined by W and rightW, H3 is determined by AboveH, and H4 is determined by H and Bottomh;
The vertical prediction gradient matrix is Y (i, j), wherein the value range of i is [ W5, W6], the value range of j is [ H5, H6], wherein W5 is determined by LeftW, W6 is determined by W and rightW, H5 is determined by AboveH, and H6 is determined by H and Bottomh;
LeftW represents a positional relationship between a basic prediction unit adjacent to a left boundary and one or more of the first and third boundaries in the VPDU, RightW represents a positional relationship between a basic prediction unit adjacent to a right boundary and one or more of the first and third boundaries in the VPDU, above represents a positional relationship between a basic prediction unit adjacent to an upper boundary and one or more of the first and third boundaries in the VPDU, and botton represents a positional relationship between a basic prediction unit adjacent to a lower boundary and one or more of the first and third boundaries in the VPDU.
45. The apparatus of claim 44, wherein when the second region is a pixel region in the VPDU adjacent to two mutually perpendicular first boundaries or the second region is a pixel region in the VPDU adjacent to one first boundary,
if the left boundary of the VPDU is the second boundary, the leftW is 1; otherwise, leftW is 0;
If the right boundary of the VPDU is the second boundary, then Right W is 1; otherwise Right W is 0;
if the upper boundary of the VPDU is the second boundary, the AboveH is 1; otherwise, AboveH is 0;
if the lower boundary of the VPDU is the second boundary, BottonH is 1; otherwise, BottonH is 0.
46. The apparatus of claim 44, wherein when the second region is a pixel region of the VPDU which is adjacent to two or less of the first boundary,
if the left boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the left boundary in the VPDU is located to the right of the first boundary, the LeftW is 1; otherwise, leftW is 0;
if the right boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the right boundary in the VPDU is located to the right of the first boundary, RightW is 1; otherwise Right W is 0;
if the upper boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the upper boundary in the VPDU is located below the first boundary, the above-mentioned above is 1; otherwise, AboveH is 0;
if the lower boundary of the VPDU is the second boundary, or if a basic prediction unit adjacent to the lower boundary in the VPDU is located below the first boundary, then BottonH is 1; otherwise, BottonH is 0.
47. A video decoding device, comprising:
a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to perform the method as described in any one of claims 1-23.
48. A video encoding device, comprising:
a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to perform the method as described in any one of claims 1-23.
CN201910017363.9A 2019-01-02 2019-01-08 Inter-frame prediction method and device and corresponding encoder and decoder Active CN111405277B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2019100026682 2019-01-02
CN201910002668 2019-01-02

Publications (2)

Publication Number Publication Date
CN111405277A CN111405277A (en) 2020-07-10
CN111405277B true CN111405277B (en) 2022-08-09

Family

ID=71428352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910017363.9A Active CN111405277B (en) 2019-01-02 2019-01-08 Inter-frame prediction method and device and corresponding encoder and decoder

Country Status (1)

Country Link
CN (1) CN111405277B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114079784A (en) * 2020-08-20 2022-02-22 Oppo广东移动通信有限公司 Inter-frame prediction method, encoder, decoder, and computer storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483948A (en) * 2017-09-18 2017-12-15 郑州云海信息技术有限公司 Pixel macroblock processing method in a kind of webp compressions processing
JP2018093374A (en) * 2016-12-02 2018-06-14 日本電信電話株式会社 Prediction image formation method, prediction image formation device, and computer program
CN108781294A (en) * 2016-02-05 2018-11-09 联发科技股份有限公司 The motion compensation process and device based on bi-directional predicted optic flow technique for coding and decoding video

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180249172A1 (en) * 2015-09-02 2018-08-30 Mediatek Inc. Method and apparatus of motion compensation for video coding based on bi prediction optical flow techniques

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108781294A (en) * 2016-02-05 2018-11-09 联发科技股份有限公司 The motion compensation process and device based on bi-directional predicted optic flow technique for coding and decoding video
JP2018093374A (en) * 2016-12-02 2018-06-14 日本電信電話株式会社 Prediction image formation method, prediction image formation device, and computer program
CN107483948A (en) * 2017-09-18 2017-12-15 郑州云海信息技术有限公司 Pixel macroblock processing method in a kind of webp compressions processing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CE9-related: Complexity reduction and bit-width control for bi-directional optical flow (BIO);Xiaoyu Xiu 等;《Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11》;20180925;全文 *

Also Published As

Publication number Publication date
CN111405277A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
KR102621958B1 (en) Candidate motion vector list acquisition method, device, encoder and decoder
WO2020232845A1 (en) Inter-frame prediction method and device
CN112204962B (en) Image prediction method, apparatus and computer-readable storage medium
CN115243048A (en) Video image decoding and encoding method and device
CN112055200A (en) MPM list construction method, and chroma block intra-frame prediction mode acquisition method and device
CN111526362A (en) Inter-frame prediction method and device
CN113709478B (en) Inter-frame prediction method, device and corresponding encoder and decoder
CN112153389B (en) Method and device for inter-frame prediction
US20220046234A1 (en) Picture prediction method and apparatus, and computer-readable storage medium
CN112088534B (en) Method, device and equipment for inter-frame prediction and storage medium
CN112135137B (en) Video encoder, video decoder and corresponding methods
CN111263166B (en) Video image prediction method and device
CN114270847A (en) Construction method and device of fusion candidate motion information list and coder/decoder
CN111405277B (en) Inter-frame prediction method and device and corresponding encoder and decoder
CN113170176B (en) Video encoder, video decoder and corresponding methods
CN111435993B (en) Video encoder, video decoder and corresponding methods
CN111372086B (en) Video image decoding method and device
CN111726617A (en) Optimization method and device for fusion motion vector difference technology and coder-decoder
CN113557738A (en) Video image prediction method and device
WO2020119525A1 (en) Inter-frame prediction method and device
CN112135129A (en) Inter-frame prediction method and device
CN111726630A (en) Processing method and device based on triangular prediction unit mode
CN111355961A (en) Method and device for inter-frame prediction

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
GR01 Patent grant
GR01 Patent grant