CN113709462B - Encoding and decoding method, device and equipment - Google Patents

Encoding and decoding method, device and equipment Download PDF

Info

Publication number
CN113709462B
CN113709462B CN202111152790.1A CN202111152790A CN113709462B CN 113709462 B CN113709462 B CN 113709462B CN 202111152790 A CN202111152790 A CN 202111152790A CN 113709462 B CN113709462 B CN 113709462B
Authority
CN
China
Prior art keywords
motion information
current block
weight
frame
reference frame
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
CN202111152790.1A
Other languages
Chinese (zh)
Other versions
CN113709462A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202111152790.1A priority Critical patent/CN113709462B/en
Publication of CN113709462A publication Critical patent/CN113709462A/en
Application granted granted Critical
Publication of CN113709462B publication Critical patent/CN113709462B/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/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

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

Abstract

The application provides a coding and decoding method, a device and equipment thereof, comprising: acquiring a weight prediction angle and a weight configuration parameter of a current block; configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter; determining a peripheral matching position from the outer peripheral positions based on the weighted prediction angle; determining a target weight value of the pixel position according to a reference weight value associated with the peripheral matching position, and determining an associated weight value according to the target weight value; acquiring a mode information candidate list, and acquiring first target mode information and second target mode information based on the mode information candidate list; determining a first predicted value according to the first target mode information, and determining a second predicted value according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value; and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block. The prediction accuracy is improved through the application.

Description

Encoding and decoding method, device and equipment
Technical Field
The present application relates to the field of encoding and decoding technologies, and in particular, to an encoding and decoding method, apparatus, and device.
Background
In order to achieve the purpose of saving space, video images are transmitted after being encoded, and the complete video encoding can include the processes of prediction, transformation, quantization, entropy encoding, filtering and the like. For the prediction process, the prediction process may include intra-frame prediction and inter-frame prediction, where inter-frame prediction refers to using the correlation of the video time domain to predict the current pixel using the pixels adjacent to the encoded image, so as to achieve the purpose of effectively removing the video time domain redundancy. The intra-frame prediction means that the correlation of a video spatial domain is utilized, and the pixels of the coded blocks of the current frame image are used for predicting the current pixels so as to achieve the purpose of removing the video spatial domain redundancy.
In the related art, the current block is rectangular, and the edge of the real object is often not rectangular, so that two different objects (such as an object having foreground and a background) are often present for the object edge. Therefore, when the motion of the two objects is inconsistent, the rectangular partition cannot well partition the two objects, and even if the current block is divided into two non-rectangular sub-blocks and the current block is predicted through the two non-rectangular sub-blocks, the problems of poor prediction effect, poor coding performance and the like exist at present.
Disclosure of Invention
In view of this, the present application provides a coding and decoding method, apparatus and device, which improve the accuracy of prediction.
The application provides a coding and decoding method, which comprises the following steps:
when the weighted prediction of a current block is determined, acquiring a weighted prediction angle and a weighted configuration parameter of the current block; wherein the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the method for determining the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining that the weight conversion rate is a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate;
configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
for each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
Obtaining a mode information candidate list created for a current block, the mode information candidate list including at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
determining a first predicted value of the pixel position according to the first target mode information, and determining a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value;
and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
The present application provides a coding and decoding device, the device includes: the device comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring a weight prediction angle and a weight configuration parameter of a current block when determining that the weighted prediction is started on the current block; the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the determination method of the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B-frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining that the weight conversion rate is a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate; the configuration module is used for configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter; a determining module, configured to determine, for each pixel position of the current block, a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weighted prediction angle; determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position; the obtaining module is further configured to obtain a mode information candidate list created for the current block, where the mode information candidate list includes at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list; the determining module is further configured to determine a first predicted value of the pixel position according to the first target mode information, and determine a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value; and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
The application provides a decoding side device, including: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor;
the processor is configured to execute machine executable instructions to perform the steps of:
when determining to start weighted prediction on a current block, acquiring a weighted prediction angle and a weighted configuration parameter of the current block; wherein the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the method for determining the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B-frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining the weight conversion rate as a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate;
configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
For each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
obtaining a mode information candidate list created for a current block, the mode information candidate list including at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
determining a first predicted value of the pixel position according to the first target mode information, and determining a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value;
and determining the weighted prediction value of the current block according to the weighted prediction values of all the pixel positions of the current block.
The application provides a coding end device, comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor;
The processor is configured to execute machine executable instructions to perform the steps of:
when the weighted prediction of a current block is determined, acquiring a weighted prediction angle and a weighted configuration parameter of the current block; wherein the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the method for determining the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining the weight conversion rate as a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate;
configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
for each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; determining a target weight value of the pixel position according to a reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
Obtaining a mode information candidate list created for a current block, the mode information candidate list including at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
determining a first predicted value of the pixel position according to the first target mode information, and determining a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value;
and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
According to the technical scheme, an effective mode for configuring the weight value is provided in the embodiment of the application, and a reasonable target weight value can be configured for each pixel position of the current block, so that the accuracy of prediction is improved, the prediction performance is improved, the coding performance is improved, the predicted value of the current block can be closer to the original pixel, and the coding performance is improved.
Drawings
FIG. 1 is a schematic diagram of a video coding framework;
FIGS. 2A-2E are schematic diagrams of weighted prediction;
FIG. 3 is a flow chart of a method of encoding and decoding in one embodiment of the present application;
FIGS. 4A-4D are schematic diagrams of peripheral locations outside of a current block;
FIG. 5 is a schematic representation of weight prediction angles in one embodiment of the present application;
FIG. 6 is a diagram illustrating reference weight values for four weight transform rates in one embodiment of the present application;
FIGS. 7A-7C are schematic diagrams of weighted prediction angle and angle partitioning in one embodiment of the present application;
FIG. 8 is a diagram of neighboring blocks of a current block in one embodiment of the present application;
fig. 9A and 9B are schematic diagrams illustrating a segmentation effect of a current block in an embodiment of the present application.
Detailed Description
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples and claims of this application, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items. It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, depending on the context, without departing from the scope of embodiments of the present application. Further, the word "if" as used may be interpreted as "at \8230; \8230when", or "when 8230; \8230, when", or "in response to a determination".
The embodiment of the application provides a coding and decoding method, a coding and decoding device and equipment thereof, which can relate to the following concepts:
intra prediction (intra prediction) and inter prediction (inter prediction):
the intra-frame prediction is that based on the correlation of a video spatial domain, a coded block is used for prediction so as to achieve the purpose of removing the video spatial domain redundancy. Intra prediction specifies a plurality of prediction modes, each corresponding to a texture direction (except for the DC mode), for example, if the image texture is horizontally arranged, the horizontal prediction mode can better predict image information.
Inter-frame prediction refers to that based on the correlation of a video time domain, because a video sequence contains stronger time domain correlation, pixels of a current image are predicted by using pixels of adjacent coded images, and the aim of effectively removing video time domain redundancy can be achieved. The inter-frame prediction part of the video coding standard adopts a block-based Motion compensation technique, and the main principle is to find a best matching block in a previously coded image for each pixel block of a current image, and the process is called Motion Estimation (ME).
Prediction pixel (Prediction Signal): the prediction pixel is a pixel value derived from a pixel that has been coded and decoded, and a residual is obtained from a difference between an original pixel and the prediction pixel, and then residual transform quantization and coefficient coding are performed. The inter-frame prediction pixel refers to a pixel value derived from a reference frame by a current block, and a final prediction pixel needs to be obtained through interpolation operation due to pixel position dispersion. The closer the predicted pixel is to the original pixel, the smaller the residual energy obtained by subtracting the predicted pixel from the original pixel is, and the higher the coding compression performance is.
Motion Vector (MV): in inter prediction, a relative displacement between a current block of a current frame and a reference block of a reference frame may be represented using a motion vector. Each divided block has a corresponding motion vector transmitted to a decoding end, and if the motion vector of each block is independently encoded and transmitted, especially a large number of blocks of small size, a lot of bits are consumed. In order to reduce the number of bits used to encode a motion vector, the spatial correlation between adjacent blocks can be used to predict the motion vector of a current block from the motion vector of an adjacent encoded block and then encode the prediction difference, which can effectively reduce the number of bits representing the motion vector. When encoding a Motion Vector of a current block, the Motion Vector of the current block may be predicted using Motion vectors of adjacent encoded blocks, and then a Difference value (MVD) between a predicted value (MVP) of the Motion Vector and a true estimate value of the Motion Vector may be encoded.
Motion Information (Motion Information): since the motion vector indicates a position offset between the current block and a certain reference block, in order to accurately acquire information pointing to the block, index information of the reference frame image is required in addition to the motion vector to indicate which reference frame image the current block uses. In video coding techniques, a reference frame picture list may be generally established for a current frame, and the reference frame picture index information indicates that the current block uses the next reference frame picture in the reference frame picture list.
In addition, many coding techniques also support multiple reference picture lists, and therefore, an index value, which may be referred to as a reference direction, may also be used to indicate which reference picture list is used. As described above, in the video encoding technology, motion-related information such as a motion vector, a reference frame index, and a reference direction may be collectively referred to as motion information.
Intra prediction mode: in intra-frame coding, an intra-frame prediction mode is used for motion compensation, namely, the intra-frame prediction mode is adopted to obtain a prediction value of a current block. For example, the intra prediction mode may include, but is not limited to, a Planar mode, a DC mode, and 33 angular modes. Referring to table 1, as an example of the intra prediction mode, the Planar mode corresponds to mode 0, the dc mode corresponds to mode 1, and the remaining 33 angular modes correspond to modes 1 to 34. The Planar mode is applied to an area where the pixel value changes slowly, and uses two linear filters in the horizontal direction and the vertical direction, and the average value of the two linear filters is used as the predicted value of the current block pixel. The DC mode is suitable for a large-area flat area, and the average value of the surrounding pixels of the current block is used as the predicted value of the current block. There are 33 angle modes, and more subdivided angle modes, such as 67 angle modes, are adopted in the new generation codec standard VVC.
TABLE 1
Figure GDA0003895886610000041
Figure GDA0003895886610000051
Knowledge base frame (lib picture): the knowledge base frame may also be referred to as a knowledge base image, similar to the concept of a long term reference frame (long term reference picture), which may be a relatively distant frame, and may exist in a reference frame list (also referred to as a reference frame queue) of the current frame for efficient inter-frame prediction. Illustratively, the POC (Picture Order Count, i.e. Picture Order number) of the knowledge base frame may be set to be POC of the current frame minus 1.
Rate-Distortion principle (Rate-Distortion Optimized): there are two major indicators for evaluating coding efficiency: code rate and Peak Signal to Noise Ratio (PSNR), the smaller the bit stream, the larger the compression rate, and the larger the PSNR, the better the reconstructed image quality, and in the case of mode selection, the discrimination formula is essentially the comprehensive evaluation of the two. For example, the cost for a mode: j (mode) = D + λ R, where D represents Distortion, which can be generally measured using SSE metric, where SSE refers to the sum of the mean square of the difference between the reconstructed image block and the source image; and λ is a lagrange multiplier, and R is the actual number of bits required for encoding the image block in the mode, including the sum of bits required for encoding mode information, motion information, residual errors and the like. When selecting the mode, if the RDO principle is used to make a comparison decision on the coding mode, the best coding performance can be ensured.
The video coding framework comprises the following steps: referring to fig. 1, a video encoding frame may be used to implement the processing flow of the encoding end in the embodiment of the present application, a schematic diagram of a video decoding frame is similar to that in fig. 1, and details are not repeated here, and a video decoding frame may be used to implement the processing flow of the decoding end in the embodiment of the present application. Illustratively, in the video encoding framework and the video decoding framework, modules such as intra prediction/inter prediction, motion estimation/motion compensation, reference image buffer, in-loop filtering, reconstruction, transformation, quantization, inverse transformation, inverse quantization, entropy encoder, and the like can be included, but are not limited thereto. At the encoding end, the processing flow at the encoding end can be realized through the matching among the modules, and at the decoding end, the processing flow at the decoding end can be realized through the matching among the modules.
In the related art, the current block may be rectangular, and the edge of the actual object is often not rectangular, so that two different objects (such as an object with foreground and a background) are often present for the edge of the object. When the motion of two objects is inconsistent, the rectangular partition cannot divide the two objects well, and for this reason, the current block may be divided into two non-rectangular sub-blocks, and the two non-rectangular sub-blocks may be subjected to weighted prediction. For example, the weighted prediction is a weighting operation performed by using a plurality of predicted values, so as to obtain a final predicted value, and the weighted prediction may include: inter-frame and intra-frame joint weighted prediction, inter-frame and inter-frame joint weighted prediction, intra-frame and intra-frame joint weighted prediction, and the like. For the weighted predicted weight values, the same weight values may be configured for different pixel positions of the current block, and different weight values may also be configured for different pixel positions of the current block.
Fig. 2A is a schematic diagram of inter-frame and intra-frame joint weighted prediction.
A CIIP (Combined inter/intra prediction, inter-frame intra joint prediction) prediction block is obtained by weighting an intra prediction block (that is, an intra prediction value of a pixel position is obtained by using an intra prediction mode) and an inter prediction block (that is, an inter prediction value of a pixel position is obtained by using an inter prediction mode), and a weight ratio of the intra prediction value and the inter prediction value adopted by each pixel position is 1. For example, for each pixel position, the intra-frame prediction value of the pixel position and the inter-frame prediction value of the pixel position are weighted to obtain a joint prediction value of the pixel position, and finally the joint prediction value of each pixel position is formed into a CIIP prediction block.
Referring to fig. 2B, a diagram of inter-frame triangulation weighted prediction (TPM) is shown.
The TPM prediction block is obtained by combining an inter prediction block 1 (i.e., an inter prediction value of a pixel position obtained by using the inter prediction mode 1) and an inter prediction block 2 (i.e., an inter prediction value of a pixel position obtained by using the inter prediction mode 2). The TPM prediction block can be divided into two regions, one region can be an inter region 1, the other region can be an inter region 2, the two inter regions of the TPM prediction block can be in a non-rectangular distribution, and the angle of the dashed boundary can be a main diagonal or a secondary diagonal.
For each pixel position of the inter-frame region 1, the inter-frame prediction value of the inter-frame prediction block 1 is mainly determined based on the inter-frame prediction value of the inter-frame prediction block 1, for example, when the inter-frame prediction value of the inter-frame prediction block 1 at the pixel position is weighted with the inter-frame prediction value of the inter-frame prediction block 2 at the pixel position, the weight value of the inter-frame prediction block 1 is larger, the weight value of the inter-frame prediction block 2 is smaller (even 0), and the joint prediction value of the pixel position is obtained. For each pixel position of the inter-frame region 2, the inter-frame prediction value of the inter-frame prediction block 2 is mainly determined based on the inter-frame prediction value of the inter-frame prediction block 2, for example, when the inter-frame prediction value of the inter-frame prediction block 1 at the pixel position is weighted with the inter-frame prediction value of the inter-frame prediction block 2 at the pixel position, the weight value of the inter-frame prediction block 2 is larger, the weight value of the inter-frame prediction block 1 is smaller (even 0), and the joint prediction value of the pixel position is obtained.
Fig. 2C is a schematic diagram of inter-frame and intra-frame joint triangle weighted prediction. And modifying the inter-frame and intra-frame combined weighted prediction to enable the inter-frame area and the intra-frame area of the CIIP prediction block to present the weight distribution of the triangular weighted partition prediction.
The CIIP prediction block is obtained by combining an intra-frame prediction block (namely, an intra-frame prediction value of a pixel position is obtained by adopting an intra-frame prediction mode) and an inter-frame prediction block (namely, an inter-frame prediction value of the pixel position is obtained by adopting an inter-frame prediction mode). The CIIP prediction block can be divided into two regions, one region can be an intra-frame region, the other region can be an inter-frame region, the inter-frame of the CIIP prediction block can be in non-rectangular distribution, the dashed boundary region can be divided in a mixed weighting mode or directly, the angle of the dashed boundary can be a main diagonal or a secondary diagonal, and the positions of the intra-frame region and the inter-frame region can be changed.
For each pixel position of the intra-frame area, the intra-frame prediction value is determined mainly based on the intra-frame prediction value, for example, when the intra-frame prediction value of the pixel position is weighted with the inter-frame prediction value of the pixel position, the weight value of the intra-frame prediction value is larger, the weight value of the inter-frame prediction value is smaller, and the joint prediction value of the pixel position is obtained. For each pixel position of the inter-frame region, the inter-frame prediction value is determined mainly based on the inter-frame prediction value, for example, when the intra-frame prediction value of the pixel position is weighted with the inter-frame prediction value of the pixel position, the weight value of the inter-frame prediction value is larger, the weight value of the intra-frame prediction value is smaller, and the joint prediction value of the pixel position is obtained.
Referring to fig. 2D, a schematic diagram of inter block geometric partitioning (GEO) mode is shown, where the GEO mode is used to divide an inter prediction block into two sub blocks by using a partition line, and different from the TPM mode, the GEO mode may use more division directions, and a weighted prediction process of the GEO mode is similar to that of the TPM mode.
The GEO prediction block is obtained by combining an inter prediction block 1 (i.e., an inter prediction value of a pixel position obtained by using the inter prediction mode 1) and an inter prediction block 2 (i.e., an inter prediction value of a pixel position obtained by using the inter prediction mode 2). The GEO prediction block may be divided into two regions, one region may be an inter region 1, and the other region may be an inter region 2.
For each pixel position of the inter region 1, the determination is mainly based on the inter prediction value of the inter prediction block 1, for example, when the inter prediction value of the inter prediction block 1 at the pixel position is weighted with the inter prediction value of the inter prediction block 2 at the pixel position, the weight value of the inter prediction block 1 is large, and the weight value of the inter prediction block 2 is small. For each pixel position of the inter region 2, the determination is mainly based on the inter prediction value of the inter prediction block 2, for example, when the inter prediction value of the inter prediction block 1 at the pixel position is weighted with the inter prediction value of the inter prediction block 2 at the pixel position, the weight value of the inter prediction block 2 is large, and the weight value of the inter prediction block 1 is small.
Illustratively, the weight value configuration of the GEO prediction block is related to the distance of the pixel position from the dividing line, and as shown in fig. 2E, pixel position a, pixel position B and pixel position C are located at the lower right side of the dividing line, and pixel position D, pixel position E and pixel position F are located at the upper left side of the dividing line. For pixel position A, pixel position B and pixel position C, the weight value sequence of the inter-frame area 2 is B ≧ A ≧ C, and the weight value sequence of the inter-frame area 1 is C ≧ A ≧ B. For pixel position D, pixel position E and pixel position F, the weight value sequence of inter-frame area 1 is D ≧ F ≧ E, and the weight value sequence of inter-frame area 2 is E ≧ F ≧ D. The above method needs to calculate the distance between the pixel position and the dividing line, and then determine the weight value of the pixel position.
For each of the above cases, in order to implement weighted prediction, it is necessary to determine a weight value of each pixel position of the current block, and perform weighted prediction on the pixel position based on the weight value of the pixel position. However, in the related art, there is no effective way to configure a weight value, and a reasonable weight value cannot be configured, which results in problems of poor prediction effect, poor coding performance, and the like.
In view of the above findings, the weight value derivation method provided in this embodiment of the present application may determine a target weight value of each pixel position of the current block according to a reference weight value of a peripheral position outside the current block, and may configure a reasonable target weight value for each pixel position, so as to improve prediction accuracy, improve prediction performance, improve coding performance, and make a predicted value closer to an original pixel.
The following describes the encoding and decoding method in the embodiments of the present application in detail with reference to several specific embodiments.
Example 1: referring to fig. 3, a flowchart of a coding/decoding method, which may be applied to a decoding side (also referred to as a video decoder) or an encoding side (also referred to as a video encoder), is shown, and the method may include:
step 301, when determining to start weighted prediction on a current block, obtaining a weighted prediction angle and a weighted configuration parameter of the current block, where the weighted configuration parameter includes a weighted transformation rate and an initial position of weighted transformation, and the initial position of weighted transformation may be determined by at least one of the following parameters: the weight prediction angle of the current block, the weight prediction position of the current block and the size of the current block.
For example, when the current block needs to be predicted, the decoding side or the encoding side may first determine whether to start weighted prediction on the current block. If the weighted prediction is started for the current block, the encoding and decoding method of the embodiment of the present application is adopted, that is, step 301 and the subsequent steps are executed. If the weighted prediction is not started for the current block, the implementation manner is not limited in the embodiment of the present application.
For example, when it is determined that weighted prediction is to be initiated on a current block, a weighted prediction angle of the current block, a weighted prediction position of the current block, and a weighted transformation ratio of the current block may be obtained. Then, the start position of the weight transform of the current block may be determined based on at least one of the weight prediction angle of the current block, the weight prediction position of the current block, and the size of the current block. So far, the weighted prediction angle of the current block, the weighted transformation rate of the current block and the initial position of the weighted transformation of the current block can be obtained.
For example, the determination method of the weighted transformation ratio of the current block may include, but is not limited to: and determining the weight transformation ratio of the current block based on the frame type of the current frame where the current block is located. For example, if the frame type is a P frame, the weight transformation ratio of the current block is the maximum value of the reference weight values. If the frame type is a B frame and the current block supports weighted slew rate switching mode, then: acquiring weight transformation rate indication information of a current block; if the weight transformation ratio indication information is first indication information, determining the weight transformation ratio of the current block as a first weight transformation ratio; if the weight transformation rate indication information is the second indication information, the weight transformation rate of the current block may be determined to be the second weight transformation rate. In one possible embodiment, the weight transformation rate indication information of the current block may be a weight transformation rate index corresponding to the current block, the first indication information is used for indicating that the current block does not need to be subjected to weight transformation rate switching, and the second indication information is used for indicating that the current block needs to be subjected to weight transformation rate switching.
Illustratively, the weighted prediction angle of the current block is a horizontal angle; or the weight prediction angle of the current block is a vertical angle; or the absolute value of the slope of the weighted prediction angle of the current block is the nth power of 2, and n is an integer.
For example, obtaining the weighted prediction angle of the current block may include, but is not limited to: if the frame type of the current frame where the current block is located is a B frame, acquiring a weight prediction angle of the current block from a first angle list; and if the frame type of the current frame where the current block is located is a P frame, acquiring the weight prediction angle of the current block from the second angle list. For example, the second angle list may include a plurality of weighted prediction angles, and the first angle list may include a plurality of weighted prediction angles, and the weighted prediction angles included in the second angle list may be a subset of the weighted prediction angles included in the first angle list.
For example, obtaining the weighted prediction position of the current block may include, but is not limited to: if the frame type of the current frame where the current block is located is a B frame, acquiring a weight prediction position of the current block from a first position list; and if the frame type of the current frame where the current block is located is a P frame, acquiring the weight prediction position of the current block from the second position list. For example, the second location list may include a plurality of weighted predicted locations, and the first location list may include a plurality of weighted predicted locations, and the weighted predicted locations included in the second location list may be a subset of the weighted predicted locations included in the first location list.
In one possible embodiment, a partial weight prediction angle may be selected from the first angle list based on the size of the current block, and a second angle list may be constructed based on the selected partial weight prediction angle, i.e., the second angle list includes the selected partial weight prediction angle. And selecting a partial weight prediction position from the first position list based on the size of the current block, and constructing a second position list based on the selected partial weight prediction position, wherein the second position list comprises the selected partial weight prediction position. For example, the size of the current block may include a width value of the current block and a height value of the current block.
Step 302, configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter of the current block.
Illustratively, the number of peripheral locations outside the current block is determined by at least one of the following parameters: the size of the current block and the weight prediction angle of the current block. For example, the number M of peripheral positions outside the current block is determined based on the size of the current block and/or the weighted prediction angle of the current block, and reference weight values are configured for the M peripheral positions according to the weight configuration parameters of the current block.
For example, for a peripheral location outside the current block, the reference weight value of the peripheral location may be configured according to the coordinate value of the peripheral location, the coordinate value of the start location of the weight transformation, and the weight transformation ratio. The coordinate value of the peripheral position and the coordinate value of the initial position of the weight transformation may not be in the same coordinate system as the pixel coordinate value, that is, the reference weight value of the peripheral position is configured as an independent operation, and when the reference weight corresponding to the pixel position is determined, the coordinate values are in the same coordinate system.
For example, the reference weight value of the peripheral position outside the current block may be monotonically increased; or, the reference weight values of the peripheral locations outside the current block may monotonically decrease. For example, the arrangement of the reference weight values of the peripheral positions outside the current block may be 00 \823030970024688 \823088, or the arrangement of the reference weight values of the peripheral positions outside the current block may be 88 \82308864200 \823000.
For example, the peripheral locations outside the current block may include, but are not limited to: the peripheral position of the upper line outside the current block, or the peripheral position of the left column outside the current block. Of course, the above is only an example of the peripheral position, and the present invention is not limited thereto.
If the peripheral position outside the current block includes the peripheral position of the upper line outside the current block, the reference weight values in the left-to-right order may be monotonically increasing or monotonically decreasing. Alternatively, if the peripheral position outside the current block includes a peripheral position in a left column outside the current block, the reference weight values in the order from top to bottom may be monotonically increasing or monotonically decreasing.
For example, the peripheral location outside the current block may include a target region, a first neighboring region of the target region, and a second neighboring region of the target region. For example, the reference weight values of the first neighboring region are all first reference weight values, the reference weight values of the second neighboring region are all second reference weight values, and the first reference weight values are different from the second reference weight values. For example, the target area may include one reference weight value or at least two reference weight values; if the target region includes at least two reference weight values, the at least two reference weight values of the target region may be monotonically increasing or monotonically decreasing.
Step 303, for each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; and determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position.
For example, for each pixel position of the current block, if the frame type of the current frame where the current block is located is a B frame, the peripheral matching position pointed to by the pixel position may be determined from peripheral positions outside the current block based on the weighted prediction angle of the current block.
For example, the weighted prediction angle indicates an angular direction pointed to by a pixel position inside the current block, for example, based on a weighted prediction angle, the angular direction corresponding to the weighted prediction angle points to an outer peripheral position of the current block. Based on the above, for each pixel position of the current block, the angle direction pointed by the pixel position is determined based on the weight prediction angle, and then the peripheral matching position pointed by the pixel position is determined from the peripheral positions outside the current block according to the angle direction.
For each pixel position of the current block, if the frame type of the current frame where the current block is located is a P frame, determining a sub-block where the pixel position is located from all sub-blocks included in the current block; then, the peripheral position pointed to by the preset position in the sub-block is determined from the peripheral positions outside the current block based on the weighted prediction angle of the current block, and the peripheral position pointed to by the preset position in the sub-block is determined as the peripheral matching position corresponding to the pixel position, that is, the peripheral position pointed to by the preset position in the sub-block can be used as the peripheral matching position corresponding to each pixel position in the sub-block.
For example, the current block may be divided into at least one sub-block, and for each sub-block of the current block, the sub-block may be a rectangular sub-block (i.e., a quadrilateral sub-block), or may not be a rectangular sub-block, such as a triangular sub-block, a pentagonal sub-block, a hexagonal sub-block, and the like. The shape of different sub-blocks may be the same, or the shape of different sub-blocks may be different. The different sub-blocks may be the same size, or the different sub-blocks may be different sizes.
If the sub-block is a rectangular sub-block, the size of the sub-block may be M × N, where M is the width of the sub-block, M is greater than or equal to 1, N is the height of the sub-block, and N is greater than or equal to 1. In summary, the sub-block may comprise at least one pixel location. If the sub-block is not a rectangular sub-block, the sub-block may also include at least one pixel location.
For this reason, if a sub-block has a pixel position 1 × 1 (i.e. includes only one pixel position), the predetermined position of the sub-block may be the pixel position itself. If the sub-block is not a 1 × 1 pixel location (i.e. includes at least two pixel locations), the predetermined locations of the sub-block may include, but are not limited to: the pixel position of the left upper corner, or the pixel position of the right upper corner, or the pixel position of the left lower corner, or the pixel position of the right lower corner, or the pixel position of the center, which is not limited to this, may be any pixel position inside the sub-block.
For example, for each pixel position of the current block, after determining the peripheral matching position pointed by the pixel position, the target weight value of the pixel position is determined based on the reference weight value associated with the peripheral matching position, for example, the reference weight value associated with the peripheral matching position is determined as the target weight value of the pixel position, and the associated weight value of the pixel position is determined according to the target weight value of the pixel position, for example, the sum of the target weight value and the associated weight value of each pixel position may be a fixed preset value, and therefore, the associated weight value may be a difference between the preset value and the target weight value. Assuming that the preset value is 8 and the target weight value of the pixel position is 0, the associated weight value of the pixel position is 8; if the target weight value of a pixel position is 1, the associated weight value of the pixel position is 7, and so on, as long as the sum of the target weight value and the associated weight value is 8.
For example, the peripheral position outside the current block may include an integer pixel position, or a sub-pixel position, or an integer pixel position and a sub-pixel position, and for the integer pixel position, it may be a 1 pixel position, or a 2 pixel position, or a 4 pixel position, etc., without limitation. Determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position may include: if the peripheral matching position is a sub-pixel position and the sub-pixel position is set with a reference weight value, determining a target weight value of the pixel position according to the reference weight value of the sub-pixel position. And if the peripheral matching position is the integer pixel position and the integer pixel position is provided with the reference weight value, determining the target weight value of the pixel position according to the reference weight value of the integer pixel position.
In a possible implementation, the current block may be a luminance component and/or a chrominance component, if the current block is a luminance component, for each pixel position of the luminance component, if the frame type of the current frame is a B frame, a peripheral matching position pointed by the pixel position is determined from peripheral positions outside the current block based on a weight prediction angle, and a reference weight value associated with the peripheral matching position is determined as a target weight value of the pixel position. For each pixel position of the brightness component, if the frame type of the current frame is a P frame, determining a peripheral position pointed by a preset position in a sub-block where the pixel position is located from peripheral positions outside the current block based on a weight prediction angle, determining the peripheral position pointed by the preset position in the sub-block as a peripheral matching position corresponding to the pixel position, and determining a reference weight value associated with the peripheral matching position as a target weight value of the pixel position.
If the current block is a chrominance component, for each pixel position of the chrominance component, if the frame type of the current block is a B frame, determining a peripheral matching position pointed by the pixel position from peripheral positions outside the current block based on a weight prediction angle, and determining a reference weight value associated with the peripheral matching position as a target weight value of the pixel position. Or, finding a luminance position matching the pixel position from the luminance component of the current block, and determining the target weight value of the luminance position as the target weight value of the pixel position, that is, the peripheral matching position corresponding to the luminance position is also the peripheral matching position corresponding to the pixel position.
For each pixel position of the chrominance components, if the frame type of the current frame is a P frame, determining a peripheral position pointed by a preset position in a sub-block where the pixel position is located from peripheral positions outside the current block based on a weight prediction angle, determining the peripheral position pointed by the preset position in the sub-block as a peripheral matching position corresponding to the pixel position, and determining a reference weight value associated with the peripheral matching position as a target weight value of the pixel position. Or, a luminance sub-block matching the pixel position (i.e., a sub-block where the luminance position matching the pixel position in the luminance component is located) is found from the luminance component of the current block, and the target weight value of the preset position in the luminance sub-block is determined as the target weight value of the pixel position, that is, the peripheral matching position corresponding to the preset position in the luminance sub-block is also the peripheral matching position corresponding to the pixel position. Or, a preset position within the chroma sub-block where the pixel position is located (i.e., a preset position within the sub-block of the chroma component) is determined, a luminance position matching the preset position within the chroma sub-block is found from the luminance component of the current block, and the target weight value of the luminance position is determined as the target weight value of the pixel position, that is, the peripheral matching position corresponding to the luminance position is also the peripheral matching position corresponding to the pixel position.
Obviously, a plurality of pixel positions of the chrominance component may correspond to the same chrominance sub-block, the preset position in the chrominance sub-block is the same, and the luminance position matching the preset position is the same, that is, the plurality of pixel positions correspond to the same target weight value.
Step 304, obtaining a mode information candidate list created for the current block, wherein the mode information candidate list comprises at least one candidate mode information; first target mode information and second target mode information of the current block are acquired based on the mode information candidate list.
For example, if an inter Weighted Prediction (Angular Weighted Prediction) mode is initiated for the current block, the mode information candidate list may be a motion information candidate list, the motion information candidate list may include at least one candidate motion information, and the candidate motion information in the motion information candidate list may be uni-directional motion information. Based on this, the first object mode information may be first object motion information, and the second object mode information may be second object motion information.
For example, at least one available motion information to be added to the motion information candidate list of the current block may be first acquired, and then, the motion information candidate list created for the current block may be acquired based on the at least one available motion information.
Illustratively, the at least one available motion information may include, but is not limited to, at least one of the following motion information: temporal motion information; spatial domain motion information; and presetting motion information. Of course, the above are just a few examples of the types of motion information.
Illustratively, if the frame type of the current frame where the current block is located is a B frame, the candidate motion information is selected from the motion information candidate list as the first original motion information of the current block, and the candidate motion information is selected from the motion information candidate list as the second original motion information of the current block. And determining first target motion information of the current block according to the first original motion information, and determining second target motion information of the current block according to the second original motion information. For example, the first original motion information includes a first original motion vector, the first target motion information includes a first target motion vector, a first motion vector difference corresponding to the first original motion vector is obtained, the first target motion vector is determined based on the first motion vector difference and the first original motion vector, or the first original motion vector is determined as the first target motion vector. The second original motion information includes a second original motion vector, the second target motion information includes a second target motion vector, a second motion vector difference corresponding to the second original motion vector is obtained, and the second target motion vector is determined according to the second motion vector difference and the second original motion vector, or the second original motion vector is determined as the second target motion vector. Wherein obtaining a first motion vector difference corresponding to a first original motion vector comprises: and acquiring direction information and amplitude information of the first motion vector difference, and determining the first motion vector difference according to the direction information and the amplitude information of the first motion vector difference. Obtaining a second motion vector difference corresponding to a second original motion vector, comprising: and acquiring direction information and amplitude information of the second motion vector difference, and determining the second motion vector difference according to the direction information and the amplitude information of the second motion vector difference.
For example, in another possible implementation, if the frame type of the current frame where the current block is located is a P frame, one candidate motion information may be selected from the motion information candidate list as the first target motion information of the current block, and another candidate motion information may be selected from the motion information candidate list as the second target motion information of the current block.
Step 305, aiming at each pixel position of the current block, determining a first predicted value of the pixel position according to the first target mode information of the current block, and determining a second predicted value of the pixel position according to the second target mode information of the current block; and determining the weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value.
For example, assuming that the target weight value is a weight value corresponding to the first target mode information, and the associated weight value is a weight value corresponding to the second target mode information, the weighted prediction value of the pixel position may be: (the first predicted value of the pixel position + the target weight value of the pixel position + the second predicted value of the pixel position + the associated weight value of the pixel position)/a fixed preset value. Or, assuming that the target weight value is a weight value corresponding to the second target mode information, and the associated weight value is a weight value corresponding to the first target mode information, the weighted prediction value of the pixel position may be: (the second predicted value of the pixel position + the target weight value of the pixel position + the first predicted value of the pixel position + the associated weight value of the pixel position)/a fixed preset value.
And step 306, determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
For example, the weighted prediction values of all pixel positions of the current block are composed into the weighted prediction value of the current block.
For example, after determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block, for each mode information storage unit (i.e., motion information storage unit) of the current block, the storage mode of the mode information storage unit is determined according to the coordinates of the mode information storage unit, the weighted prediction angle of the current block, and the reference weight value of the peripheral position outside the current block; based on the storage manner of the mode information storage unit, first target mode information is stored as target mode information of the mode information storage unit, or second target mode information is stored as target mode information of the mode information storage unit. Or, aiming at each mode information storage unit of the current block, determining the storage mode of the mode information storage unit according to the coordinates of the mode information storage unit, the weight prediction angle of the current block and the weight prediction position of the current block; based on the storage manner of the mode information storage unit, first target mode information is stored as target mode information of the mode information storage unit, or second target mode information is stored as target mode information of the mode information storage unit.
For example, the execution sequence is only an example given for convenience of description, and in practical applications, the execution sequence between the steps may also be changed, and the execution sequence is not limited. Moreover, in other embodiments, the steps of the respective methods do not have to be performed in the order shown and described herein, and the methods may include more or less steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
According to the technical scheme, an effective mode for configuring the weight value is provided in the embodiment of the application, and a reasonable target weight value can be configured for each pixel position of the current block, so that the accuracy of prediction is improved, the prediction performance is improved, the coding performance is improved, the predicted value of the current block can be closer to the original pixel, and the coding performance is improved.
Example 2: the embodiment of the present application provides another encoding and decoding method, which can be applied to an encoding end, and the method includes:
Step a1, when determining to start weighted prediction on a current block, a coding end acquires a weighted prediction angle of the current block, a weighted prediction position of the current block and a weighted transformation ratio of the current block. Illustratively, the encoding end determines whether to start weighted prediction on the current block, if so, the step a1 and the subsequent steps are executed, and if not, the processing mode is not limited in the application.
In a possible embodiment, it is determined to start weighted prediction for the current block if the current block satisfies a condition for starting weighted prediction. And if the current block does not meet the condition of starting weighted prediction, determining not to start weighted prediction on the current block. For example, it is determined whether the feature information of the current block satisfies a certain condition. If yes, determining to start weighted prediction on the current block; if not, it is determined that weighted prediction is not to be initiated for the current block. The characteristic information includes but is not limited to one or any combination of the following: the frame type of the current frame where the current block is located, the size information of the current block, and the switch control information. The switch control information may include, but is not limited to: sequence level (SPS, SH) switch control information, or picture level (PPS, PH) switch control information, or Slice level (Slice, tile, patch), or maximum coding unit level (LCU, CTU), or block level (CU, PU, TU) switch control information.
For example, if the feature information is the frame type of the current frame where the current block is located, the frame type of the current frame where the current block is located meets a specific condition, which may include but is not limited to: if the frame type of the current frame where the current block is located is a B frame, it can be determined that the frame type satisfies a specific condition. Or, if the frame type of the current frame where the current block is located is an I frame, it may be determined that the frame type satisfies a specific condition. Or, if the frame type of the current frame where the current block is located is a P frame, it may be determined that the frame type satisfies a specific condition.
For example, if the feature information is size information of the current block, such as width and height, the size information satisfies specific conditions including, but not limited to: and if the width is greater than or equal to the first numerical value and the height is greater than or equal to the second numerical value, determining that the size information of the current block meets a specific condition. Or, if the width is greater than or equal to the third value, the height is greater than or equal to the fourth value, the width is less than or equal to the fifth value, and the height is less than or equal to the sixth value, it is determined that the size information of the current block satisfies the specific condition. Or, if the product of the width and the height is greater than or equal to the seventh value, determining that the size information of the current block satisfies the specific condition. The above values may be empirically configured, such as 8, 16, 32, 64, 128, etc. For example, the first value is 8, the second value is 8, the third value is 8, the fourth value is 8, the fifth value is 64, the sixth value is 64, and the seventh value is 64. In summary, if the width is greater than or equal to 8 and the height is greater than or equal to 8, it is determined that the size information of the current block satisfies the specific condition. Or, if the width is greater than or equal to 8, the height is greater than or equal to 8, the width is less than or equal to 64, and the height is less than or equal to 64, determining that the size information of the current block satisfies the specific condition. Or, if the product of the width and the height is greater than or equal to 64, it is determined that the size information of the current block satisfies the specific condition.
For example, if the feature information is size information of the current block, such as a width and a height of the current block, the size information of the current block satisfies a specific condition, which may include but is not limited to: the width is not less than a and not more than b, and the height is not less than a and not more than b. a may be less than or equal to 16 and b may be greater than or equal to 16. For example, a equals 8, b equals 64, or b equals 32.
For example, if the characteristic information is the switch control information, the switch control information satisfies a specific condition, which may include but is not limited to: and if the switch control information allows the current block to start the weighted prediction, determining that the switch control information meets a specific condition.
For example, if the feature information is the frame type of the current frame where the current block is located and the size information of the current block, the frame type meets the specific condition, and when the size information meets the specific condition, it may be determined that the feature information of the current block meets the specific condition. Or, if the feature information is the frame type of the current frame where the current block is located and the switch control information, the frame type meets the specific condition, and when the switch control information meets the specific condition, it may be determined that the feature information of the current block meets the specific condition. Or, if the feature information is size information and switch control information of the current block, the size information satisfies a specific condition, and when the switch control information satisfies the specific condition, it may be determined that the feature information of the current block satisfies the specific condition. Or, if the feature information is the frame type of the current frame where the current block is located, the size information of the current block, and the switch control information, the frame type satisfies the specific condition, the size information satisfies the specific condition, and when the switch control information satisfies the specific condition, it may be determined that the feature information of the current block satisfies the specific condition.
In a possible implementation manner, when determining to start weighted prediction on the current block, the encoding side may obtain a weighted prediction angle of the current block, a weighted prediction position of the current block, and a weighted transformation ratio of the current block.
Illustratively, the weighted prediction angle represents an angular direction pointed to by a pixel position inside the current block, and as shown in fig. 4A, based on a certain weighted prediction angle, an angular direction pointed to by a pixel position inside the current block (e.g., pixel position 1, pixel position 2, and pixel position 3) is shown, and the angular direction points to a certain peripheral position outside the current block. Referring to FIG. 4B, based on another weighted prediction angle, an angular direction to which pixel positions inside the current block (e.g., pixel position 2, pixel position 3, and pixel position 4) point is shown, which points to some peripheral position outside the current block.
Illustratively, the weight prediction position (which may also be referred to as a distance parameter) is used to configure a reference weight value for a peripheral position outside the current block. For example, the range of the peripheral positions outside the current block (i.e., the number of peripheral positions outside the current block) is determined according to the weighted prediction angle of the current block, the size of the current block, and other parameters, as shown in fig. 4A or 4B.
Then, the range of the peripheral positions is divided into N equal parts, the value of N can be arbitrarily configured, such as 4, 6, 8, etc., and taking 8 as an example for explanation, the weight prediction position is used to indicate which peripheral position outside the current block is used as the initial position of the weight transformation of the current block, so that the reference weight value of the peripheral position outside the current block is configured according to the initial position of the weight transformation.
Referring to fig. 4C, after equally dividing all peripheral positions 8, 7 weighted predicted positions can be obtained. On this basis, when the weight prediction position is 0, it can indicate the peripheral position a0 (i.e. the peripheral position pointed by the dashed line 0, in practical applications, the dashed line 0 does not exist, the dashed line 0 is only an example given for ease of understanding, and the dashed line 0-dashed line 6 are used to equally divide all peripheral positions 8) as the starting position of the weight transformation of the peripheral position outside the current block. By analogy, when the weight prediction position is 6, the peripheral position a6 is indicated as the start position of the weight transform of the peripheral position outside the current block.
For example, the value of N may be different for different weight prediction angles, where N is 6 for the weight prediction angle a, indicating that the range of the peripheral position determined based on the weight prediction angle a is divided by 6, and N is 8 for the weight prediction angle B, indicating that the range of the peripheral position determined based on the weight prediction angle B is divided by 8.
The values of N may be the same for different weight prediction angles, and when the values of N are the same, the number of weight prediction positions may be different, for example, when the value of N is 8 for the weight prediction angle a, the range of the peripheral position specified by the weight prediction angle a is divided into 8, and when the value of N is 8 for the weight prediction angle B, the range of the peripheral position specified by the weight prediction angle B is divided into 8, however, 5 positions in total are selected as the weight prediction positions corresponding to the weight prediction angle a, and 7 positions in total are selected as the weight prediction positions corresponding to the weight prediction angle B, from a0 to a 6.
In the above, the range of the peripheral position is divided into N equal parts, and in practical application, a non-uniform dividing manner may also be adopted, for example, the range of the peripheral position is divided into N parts instead of N equal parts, which is not limited.
After dividing all the peripheral positions 8 equally, 7 weighted prediction positions can be obtained, and in step a1, the encoding side may obtain one weighted prediction position from the 7 weighted prediction positions, or may select some weighted prediction positions (for example, 5 weighted prediction positions) from the 7 weighted prediction positions and obtain one weighted prediction position from the 5 weighted prediction positions.
Illustratively, the weight transformation rate indicates a transformation rate of the reference weight value of the peripheral position outside the current block for indicating a variation speed of the reference weight value, and the weight transformation rate may be any number other than 0, e.g., the weight transformation rate may be-4, -2, -1, 2,4, 0.5, 0.75, 1.5, etc. When the absolute value of the weight conversion ratio is 1, that is, the weight conversion ratio is-1 or 1, it is indicated that the change speed of the reference weight value is 1, the reference weight value needs to pass through values of 0,1,2,3,4,5,6,7,8, etc. from 0 to 8, and the reference weight value needs to pass through values of 8,7,6,5,4,3,2,1,0, etc. from 8 to 0. When the absolute value of the weight conversion ratio is 2, that is, the weight conversion ratio is-2 or 2, it indicates that the change speed of the reference weight value is 2, the reference weight value needs to pass through values of 0,2,4,6,8, etc. from 0 to 8, and the reference weight value needs to pass through values of 8,6,4,2,0, etc. from 8 to 0. When the absolute value of the weight conversion ratio is 4, that is, the weight conversion ratio is-4 or 4, it indicates that the change speed of the reference weight value is 4, the reference weight value needs to pass through 0,4,8, etc. from 0 to 8, and the reference weight value needs to pass through 8,4,0, etc. from 8 to 0. <xnotran> 0.5 , -0.5 0.5, 0.5, 0 8 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8 , 8 0 8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0 . </xnotran> Of course, the above is exemplified by 0 to 8, and 0 and 8 may be replaced by any number.
Step a2, the encoding end configures a reference weight value for the peripheral position outside the current block according to the weight transformation rate of the current block and the initial position of the weight transformation (the initial position of the weight transformation rate and the initial position of the weight transformation can be called as a weight configuration parameter).
Illustratively, the starting position of the weight transformation may be determined by at least one of the following parameters: the weighted prediction angle of the current block, the weighted prediction position of the current block, and the size of the current block, and thus, the start position of the weighted transform of the current block can be determined based on at least one of the weighted prediction angle of the current block, the weighted prediction position of the current block, and the size of the current block. Then, a reference weight value is configured for the peripheral position outside the current block according to the weight transformation rate of the current block and the initial position of the weight transformation.
Step a3, aiming at each pixel position of the current block, the coding end determines a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle of the current block.
For example, if the frame type of the current frame where the current block is located is a B frame, the encoding end determines the peripheral matching position pointed by the pixel position from the peripheral positions outside the current block based on the weight prediction angle of the current block. If the frame type of the current frame where the current block is located is a P frame, the encoding end determines the sub-block where the pixel position is located from all sub-blocks included in the current block, determines the peripheral position pointed by the preset position in the sub-block from the peripheral positions outside the current block based on the weight prediction angle of the current block, and determines the peripheral position pointed by the preset position in the sub-block as the peripheral matching position corresponding to the pixel position, that is, the peripheral position pointed by the preset position in the sub-block can be used as the peripheral matching position corresponding to each pixel position in the sub-block.
For example, the peripheral location outside the current block may include: the peripheral position (i.e. pixel position) of the upper line outside the current block, for example, the peripheral position of the nth 1 th line outside the current block, n1 may be 1, or may also be 2, 3, etc., which is not limited herein. Alternatively, the peripheral position (i.e. pixel position) of the left column outside the current block, for example, the peripheral position of the n2 th column outside the current block, n2 may be 1, or 2, 3, etc., which is not limited herein. Of course, the above are just a few examples of the peripheral locations, and are not limiting. The current block outer peripheral position may be located between pixel positions, i.e., sub-pixel positions, in which case the position of the current block cannot be simply described as the x-th line, but is located between the x-th and y-th lines.
For example, for a range of peripheral positions outside the current block, a range of peripheral positions outside the current block may be specified in advance; alternatively, the range of the peripheral position outside the current block may be determined according to the weighted prediction angle, for example, the peripheral position pointed to by each pixel position inside the current block is determined according to the weighted prediction angle, and the boundary of the peripheral positions pointed to by all the pixel positions may be the range of the peripheral position outside the current block, and the range of the peripheral position is not limited.
The current block outer perimeter location may comprise a integer pixel location; alternatively, the peripheral position outside the current block may include a non-integer pixel position, and the non-integer pixel position may be a sub-pixel position, such as a 1/2 sub-pixel position, a 1/4 sub-pixel position, a 3/4 sub-pixel position, etc., which is not limited herein; alternatively, the current block outer perimeter locations may include integer pixel locations and sub-pixel locations.
Illustratively, two peripheral positions outside the current block may correspond to one integer-pixel position; or, four peripheral positions outside the current block may correspond to one integer pixel position; or, a peripheral position outside the current block may correspond to an integer pixel position; alternatively, a peripheral location outside the current block may correspond to two integer-pixel locations. Of course, the above are only examples, and the relationship between the peripheral position and the whole pixel position may be arbitrarily configured without limitation.
As shown in fig. 4A and fig. 4B, one peripheral position corresponds to one integer pixel position, and as shown in fig. 4D, two peripheral positions correspond to one integer pixel position, which is not described again in this embodiment for other cases.
For example, if the frame type of the current frame where the current block is located is a P frame, the current block may be divided into at least one sub-block, and for each sub-block of the current block, the sub-block may be a rectangular sub-block or may not be a rectangular sub-block. The shape of the different sub-blocks may be the same or different. The different sub-blocks may be the same size or different sizes. The preset positions of each sub-block may be the same or different, and only the preset positions of the sub-blocks are required to be agreed by the encoding terminal and the decoding terminal, for example, the preset positions of the sub-blocks may be determined according to the size, area, shape, and the like of the current block. For example, if the sub-block has a pixel position of 1 × 1, the predetermined position of the sub-block may be the pixel position itself. If the sub-block is not a 1 × 1 pixel location, the predetermined locations of the sub-block may include, but are not limited to: the pixel position of the left upper corner, or the pixel position of the right upper corner, or the pixel position of the left lower corner, or the pixel position of the right lower corner, or the pixel position of the center, which is not limited to this, may be any pixel position inside the sub-block.
For example, the current block may be divided into rectangular sub-blocks of 4 × 4 size, and the preset position of each sub-block is the central pixel position of the sub-block. Or, dividing the current block into at least two non-rectangular sub-blocks, wherein the preset position of each sub-block is the central pixel position of the sub-block. Alternatively, the current block may be divided into a rectangular sub-block of 4 × 4 size, a rectangular sub-block of 8 × 8 size, a rectangular sub-block of 4 × 8 size, and a rectangular sub-block of 8 × 4 size, and the predetermined position of each sub-block may be a center pixel position of the sub-block.
And a4, the encoding end determines a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position.
For each pixel position of the current block, after determining the peripheral matching position to which the pixel position points, the encoding end determines a reference weight value associated with the peripheral matching position, and determines a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, for example, the reference weight value associated with the peripheral matching position is determined as the target weight value of the pixel position.
The encoding end determines the target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and may include: if the peripheral matching position is a sub-pixel position and the sub-pixel position is set with a reference weight value, determining a target weight value of the pixel position according to the reference weight value of the sub-pixel position. And if the peripheral matching position is the integer pixel position and the integer pixel position is provided with the reference weight value, determining the target weight value of the pixel position according to the reference weight value of the integer pixel position.
And a5, the encoding end determines the associated weight value of the pixel position according to the target weight value of the pixel position.
For example, for each pixel position, the sum of the target weight value of the pixel position and the associated weight value of the pixel position may be a fixed preset value, that is, the associated weight value may be a difference between the preset value and the target weight value. Based on this, assuming that the preset value is 8, and the target weight value of the pixel position is 2, the associated weight value of the pixel position is 6.
Step a6, the encoding end obtains a motion information candidate list created for the current block, where the motion information candidate list may include at least one candidate motion information (for convenience of distinguishing, the motion information in the motion information candidate list is marked as candidate motion information); first target motion information and second target motion information of the current block are acquired based on the motion information candidate list.
Step a7, aiming at each pixel position of the current block, the encoding end determines a first predicted value of the pixel position according to the first target motion information of the current block, and determines a second predicted value of the pixel position according to the second target motion information of the current block.
Step a8, the encoding end determines the weighted predicted value of the pixel position according to the first predicted value of the pixel position, the target weight value of the pixel position, the second predicted value of the pixel position and the associated weight value of the pixel position.
For example, the weighted prediction value for the pixel position may be: (the first predicted value of the pixel position + the target weight value of the pixel position + the second predicted value of the pixel position + the associated weight value of the pixel position)/a fixed preset value.
And a9, the coding end determines the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
Example 3: the embodiment of the present application provides another encoding and decoding method, which can be applied to a decoding end, and the method includes:
step b1, when determining to start the weighted prediction on the current block, the decoding end obtains the weighted prediction angle of the current block, the weighted prediction position of the current block and the weighted transformation rate of the current block. Illustratively, the decoding end determines whether to start weighted prediction on the current block, if so, the step b1 and the subsequent steps are executed, and if not, the processing mode is not limited in the application.
In a possible implementation manner, the encoding end judges whether the characteristic information of the current block meets a specific condition, and if so, determines to start weighted prediction on the current block. The decoding end also judges whether the characteristic information of the current block meets a specific condition, and if so, the weighted prediction of the current block is determined to be started; if not, it is determined not to initiate weighted prediction for the current block. How the decoding end determines whether the current block starts weighted prediction based on the characteristic information is similar to the determination method of the encoding end, and is not repeated here.
In another possible implementation, the encoding end determines whether the current block supports weighted prediction according to the feature information of the current block, and when the current block supports weighted prediction, it may also determine whether to start weighted prediction on the current block by using other strategies, for example, it may determine whether to start weighted prediction on the current block by using a rate distortion principle. When the encoding side transmits the encoded bitstream of the current block after determining whether to initiate weighted prediction on the current block, the encoded bitstream may include syntax indicating whether to initiate weighted prediction on the current block. The decoding end determines whether the current block supports weighted prediction according to the characteristic information of the current block, and the specific mode is similar to the determination mode of the encoding end, and is not described herein again. When the current block supports weighted prediction, the decoding end can analyze syntax whether to start weighted prediction from the coded bit stream, and determine whether to start weighted prediction on the current block according to the syntax.
For example, when determining to start weighted prediction on the current block, the decoding end may further obtain a weighted prediction angle of the current block, a weighted prediction position of the current block, and a weighted transformation rate of the current block, and for a description about the weighted prediction angle, the weighted prediction position, and the weighted transformation rate, reference may be made to step a1 in embodiment 2, and details are not repeated here.
And b2, the decoding end configures a reference weight value for the peripheral position outside the current block according to the weight transformation rate of the current block and the initial position of the weight transformation (the initial positions of the weight transformation rate and the weight transformation can be called as weight configuration parameters).
For example, the decoding side may determine the starting position of the weight transform of the current block based on at least one of the weight prediction angle of the current block, the weight prediction position of the current block, and the size of the current block. Then, the decoding end configures a reference weight value for the peripheral position outside the current block according to the weight transformation rate of the current block and the initial position of the weight transformation.
Step b3, aiming at each pixel position of the current block, the decoding end can determine a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle of the current block.
And b4, the decoding end determines the target weight value of the pixel position according to the reference weight value associated with the peripheral matching position.
And b5, the decoding end determines the associated weight value of the pixel position according to the target weight value of the pixel position.
Step b6, the decoding end creates a motion information candidate list for the current block, and the motion information candidate list comprises at least one candidate motion information; first target motion information and second target motion information of the current block are acquired based on the motion information candidate list.
And b7, aiming at each pixel position of the current block, the decoding end determines a first predicted value of the pixel position according to the first target motion information of the current block and determines a second predicted value of the pixel position according to the second target motion information of the current block.
And b8, the decoding end determines the weighted predicted value of the pixel position according to the first predicted value of the pixel position, the target weight value of the pixel position, the second predicted value of the pixel position and the associated weight value of the pixel position.
And b9, the decoding end determines the weighted prediction value of the current block according to the weighted prediction values of all the pixel positions of the current block.
For example, for step b2 to step b9, the implementation process thereof may refer to step a2 to step a9, except that step b2 to step b9 are processing flows of a decoding end, but not processing flows of an encoding end, and are not described herein again.
Example 4: in embodiments 1 to 3, weighting processing needs to be performed based on the Weighted Prediction angle, and weighting processing is performed by using the motion information of the inter frame, and this weighting processing manner may be denoted as an inter-frame Angle Weighted Prediction (AWP) mode, that is, when the current block supports the AWP mode, the current block is predicted by using embodiments 1 to 3, so as to obtain the Prediction value of the current block. Examples 1-3 relate to weighted prediction angles that may be any angle, such as any angle within 180 degrees, or any angle within 360 degrees, such as 10 degrees, 20 degrees, etc.
In one possible embodiment, the weight prediction angle may be a horizontal angle; alternatively, the weighted prediction angle may be a vertical angle; alternatively, the absolute value of the slope of the weight prediction angle (i.e., the absolute value of the slope of the weight prediction angle, i.e., the tan value of the weight prediction angle) may be an nth power of 2, where n is an integer, such as a positive integer, 0, a negative integer, etc.
For example, the absolute value of the slope of the weighted prediction angle may be 1 (i.e., the 0 power of 2), or 2 (i.e., the 1 power of 2), or 1/2 (i.e., the-1 power of 2), or 4 (i.e., the 2 power of 2), or 1/4 (i.e., the-2 power of 2), or 8 (i.e., the 3 power of 2), or 1/8 (i.e., the-3 power of 2), etc. Illustratively, referring to fig. 5, 8 weighted prediction angles are shown, the absolute value of the slope of which is 2 to the power of n.
In the embodiment of the application, the shift operation can be performed on the weight prediction angle, and the following embodiments refer to examples of the shift operation on the weight prediction angle, so that when the absolute value of the slope of the weight prediction angle is n-th power of 2, division operation can be avoided when the shift operation is performed on the weight prediction angle, and thus the shift implementation is convenient.
For example, the number of weighted prediction angles supported by different block sizes (i.e., the size of the current block) may be the same or different. For example, block size a supports 8 weight prediction angles, block size B and block size C support 6 weight prediction angles, and so on.
Example 5: in the above-described embodiments 1 to 3, the encoding side/decoding side may configure the reference weight value for the peripheral position outside the current block according to the weight transformation rate of the current block and the initial position of the weight transformation of the current block. In one possible embodiment, the following may be used: and configuring a reference weight value of each peripheral position outside the current block according to the coordinate value of the peripheral position, the coordinate value of the initial position of the weight transformation and the weight transformation rate. For each peripheral position, if the peripheral position is a peripheral position of an upper row outside the current block, the coordinate value of the peripheral position is an abscissa value, and the coordinate value of the initial position of the weight transformation is an abscissa value. If the peripheral position is a peripheral position in a row on the left side outside the current block, the coordinate value of the peripheral position is a vertical coordinate value, and the coordinate value of the initial position of the weight transformation is a vertical coordinate value.
For example, the pixel position of the upper left corner of the current block (e.g., the first pixel position of the upper left corner) may be used as a coordinate origin, and the coordinate values of the peripheral position of the current block (e.g., an abscissa value or an ordinate value) and the coordinate value of the start position of the weight transformation (e.g., an abscissa value or an ordinate value) are coordinate values relative to the coordinate origin. Of course, other pixel positions of the current block can also be used as the origin of coordinates, and the implementation is similar to the implementation in which the pixel position at the upper left corner is used as the origin of coordinates.
In one possible embodiment, a difference value between the coordinate values of the peripheral position and the coordinate values of the start position of the weight transformation is determined, and a product value of the difference value and the weight transformation rate of the current block is determined. If the product value is smaller than a first value (the minimum value of the reference weight value, such as 0), determining that the reference weight value associated with the peripheral position is the first value; if the product value is greater than a second value (the maximum value of the reference weight value, such as 8), determining that the reference weight value associated with the peripheral position is the second value; if the product value is not less than the first value and the product value is not greater than the second value, determining the reference weight value associated with the peripheral position as the product value.
In another possible implementation manner, the reference weight value associated with the peripheral position may also be determined according to a magnitude relationship between the coordinate value of the peripheral position and the coordinate value of the start position of the weight transformation. For example, if the coordinate value of the peripheral position is smaller than the coordinate value of the initial position of the weight transformation, it may be determined that the reference weight value associated with the peripheral position is the first numerical value; if the coordinate value of the peripheral position is not less than the coordinate value of the initial position of the weight transformation, it can be determined that the reference weight value associated with the peripheral position is the second numerical value. For another example, if the coordinate value of the peripheral position is smaller than the coordinate value of the initial position of the weight transformation, it may be determined that the reference weight value associated with the peripheral position is the second numerical value; if the coordinate value of the peripheral position is not less than the coordinate value of the initial position of the weight transformation, it may be determined that the reference weight value associated with the peripheral position is the first value.
In the above embodiment, both the first value and the second value may be configured empirically, and the first value is smaller than the second value, which is not limited to either the first value or the second value. For example, the first value is a minimum value of the pre-agreed reference weight value, such as 0, and the second value is a maximum value of the pre-agreed reference weight value, such as 8, although 0 and 8 are also merely exemplary.
For example, referring to fig. 4C, after all the peripheral positions 8 are equally divided, 7 weighted predicted positions can be obtained, and when the weighted predicted position is 0, the peripheral position a0 is represented, and the coordinate value of the initial position of the weight conversion is the coordinate value of the peripheral position a 0. When the weight prediction position is 1, the peripheral position a1 is represented, and the coordinate value of the initial position of the weight transformation is the coordinate value of the peripheral position a1, and so on, and the determination manner of the coordinate value of the initial position of the weight transformation is not described herein again.
Example 6: in embodiments 1 to 3, the encoding side/decoding side configures a reference weight value for a peripheral position outside the current block according to the weight transformation rate of the current block and the start position of the weight transformation of the current block. In one possible embodiment, the following may be used: the method comprises the steps of obtaining a weight prediction angle of a current block, a weight transformation rate of the current block and a weight prediction position of the current block, determining an initial position of the weight transformation of the current block based on the weight prediction position of the current block, and determining weight configuration parameters based on the initial position of the weight transformation and the weight transformation rate, wherein the weight configuration parameters comprise the initial position of the weight transformation and the weight transformation rate. And determining a reference weight value of the peripheral position outside the current block according to the weight configuration parameter. For example, the reference weight value is determined as follows: y = Clip3 (minimum value, maximum value, a × (x-s)), x denotes an index of a peripheral position, a denotes a weight conversion rate, and s denotes a start position of weight conversion. In summary, for each peripheral location outside the current block, the reference weight value of the peripheral location is configured according to the index of the peripheral location, the start location of the weight transformation, and the weight transformation ratio.
The following describes a process of configuring a reference weight value for a peripheral position outside a current block, with reference to specific steps.
And step c1, obtaining an effective number of reference weight values.
Illustratively, the number of peripheral locations outside the current block is an effective number, and in step c1, an effective number of reference weight values needs to be obtained, where the effective number may be determined based on the size of the current block and/or the weight prediction angle of the current block. For example, the effective amount is determined as follows: VL = (N + (M > > X)) < <1, N and M are height and width of the current block, respectively, and X is log2 log value of absolute value of slope of weight prediction angle of the current block, such as 0 or 1.
In one possible implementation, the reference weight values may be monotonically increasing or monotonically decreasing for a significant number. Or, for the effective number of reference weight values, a plurality of first values may be included first and then a plurality of second values may be included, or, for the effective number of reference weight values, a plurality of second values may be included first and then a plurality of first values may be included. If the peripheral position outside the current block includes the pixel position of the upper line outside the current block, the reference weight values in the left-to-right sequence are monotonically increased or monotonically decreased. If the peripheral position outside the current block includes a row of pixel positions on the left side outside the current block, the reference weight values in the order from top to bottom are monotonically increased or monotonically decreased. This is explained below with reference to several specific cases.
Case 1: the reference weight values may be monotonically increasing, or monotonically decreasing, for a significant number of reference weight values. For example, an effective number of reference weight values may be [88.. 88765432100.. 00], i.e., monotonically decreasing. As another example, the effective number of reference weight values may be [00.. 00123456788.. 88], i.e., monotonically increasing. Of course, the above is merely an example, and no limitation is made thereto.
For example, the reference weight value may be configured according to a weight configuration parameter, the weight configuration parameter may include a weight transformation ratio and a start position of the weight transformation, and the obtaining manner of the weight transformation ratio may be as described in the following embodiments, the start position of the weight transformation may be a value configured according to experience, the start position of the weight transformation may be determined by the weight prediction position, or the start position of the weight transformation may be determined by the weight prediction angle and the weight prediction position, which is not limited to this.
The reference weight values may be monotonically increasing or monotonically decreasing for an effective number, in order from first to last. For example, the maximum value of the reference weight values is M1, the minimum value of the reference weight values is M2, and for a significant number of reference weight values, the maximum value M1 monotonically decreases to the minimum value M2; or monotonically increases from the minimum value M2 to the maximum value M1. Assuming that M1 is 8 and M2 is 0, the reference weight values may monotonically decrease from 8 to 0; or monotonically increasing from 0 to 8.
For example, the weight transformation rate and the start position of the weight transformation may be obtained first, and then, a plurality of reference weight values may be determined according to the weight transformation rate and the start position of the weight transformation. For example, the reference weight value is determined as follows: y = Clip3 (minimum value, maximum value, a × (x-s)), x represents the index of the peripheral position, that is, the range of x is 1-significant number value, for example, x is 1, which represents the 1 st peripheral position, y represents the reference weight value of the 1 st peripheral position, x is 2, which represents the 2 nd peripheral position, and y represents the reference weight value of the 2 nd peripheral position. a represents a weight conversion rate, and s represents a start position of weight conversion.
Clip3 is used to limit the reference weight value between a minimum value and a maximum value, both of which may be configured empirically, and for convenience of description, in the following process, the minimum value is 0, and the maximum value is 8 for example.
a represents the weight transformation rate, a can be an integer different from 0, for example, a can be-4, -2, -1, 2, 4, etc., and the value of a is not limited. If the absolute value of a is 1, the reference weight value needs to go through 0,1,2,3,4,5,6,7,8 from 0 to 8, or the reference weight value needs to go through 8,7,6,5,4,3,2,1,0 from 8 to 0.
s denotes the starting position of the weight transformation, and s can be determined from the weight prediction position, e.g. s = f (weight prediction position), i.e. s is a function related to the weight prediction position. For example, after the range of the peripheral positions outside the current block is determined, the effective number of the peripheral positions may be determined, and all the peripheral positions are divided into N equal parts, where the value of N may be arbitrarily configured, such as 4, 6, 8, etc., and the weighted prediction position is used to indicate which peripheral position outside the current block is used as the target peripheral region of the current block, and the peripheral position corresponding to the weighted prediction position is the starting position of the weighted transformation. Alternatively, s may be determined by a weight prediction angle and a weight prediction position, for example, s = f (weight prediction angle, weight prediction position), i.e., s is a function related to the weight prediction angle and the weight prediction position. For example, the range of the peripheral position outside the current block may be determined according to the weighted prediction angle, after the range of the peripheral position outside the current block is determined, the effective number of the peripheral positions may be determined, and all the peripheral positions may be divided by N, the weighted prediction position is used to indicate which peripheral position outside the current block is used as the target peripheral region of the current block, and the peripheral position corresponding to the weighted prediction position is the start position of the weighted transform.
In summary, in y = Clip3 (minimum value, maximum value, a × x-s), the weight transformation ratio a and the start position s of the weight transformation are both known values, and for each peripheral position outside the current block, the reference weight value of the peripheral position can be determined through the functional relationship. For example, assuming that the weight transformation ratio a is 2 and the start position s of the weight transformation is 2, the functional relationship may be y =2 (x-2), and the reference weight value y may be obtained for each peripheral position x outside the current block.
In summary, an effective number of reference weight values for the current block may be obtained, which are monotonically increasing or monotonically decreasing. In a possible implementation, the peripheral location outside the current block may comprise a target region, a first neighborhood of the target region, a second neighborhood of the target region. The target area may comprise one reference weight value or at least two reference weight values; if the target area comprises at least two reference weight values, the at least two reference weight values of the target area are monotonically increased or monotonically decreased. The monotonic increase may be a strictly monotonic increase (i.e., at least two reference weight values of the target region are strictly monotonic increases); the monotonic decrease may be a strictly monotonic decrease (i.e. the at least two reference weight values of the target region are strictly monotonic decreases). For example, the reference weight value of the target region monotonically increases from 1-7, or the reference weight value of the target region monotonically decreases from 7-1.
For example, the reference weight values of the first neighboring region are all first reference weight values, the reference weight values of the second neighboring region are all second reference weight values, and the first reference weight values are different from the second reference weight values. For example, the reference weight values of the first neighboring region are all 0, the target region includes at least two reference weight values, the reference weight values are monotonically increased from 1 to 7, and the reference weight values of the second neighboring region are all 8, obviously, the reference weight values of the first neighboring region are different from the reference weight values of the second neighboring region. For another example, the reference weight values of the first neighboring region are all 8, the target region includes at least two reference weight values, the reference weight values monotonically decrease from 7-1, and the reference weight values of the second neighboring region are all 0.
Case 2: for the effective number of reference weight values, a plurality of first values may be included first, and then a plurality of second values may be included, or a plurality of second values may be included first, and then a plurality of first values may be included. For example, an effective number of reference weight values may be [88.. 8800.. 00] or [00.. 0088.. 88]. For example, a plurality of reference weight values may be determined according to the start position of the weight transform. For example, the start position of the weight transform indicates the s-th reference weight value, and thus, all reference weight values before (excluding) the s-th reference weight value are a first value (e.g., 8), and all reference weight values after (including) the s-th reference weight value are a second value (e.g., 0). Or, all reference weight values before the s-th reference weight value are the second numerical value, and all reference weight values after the s-th reference weight value are the first numerical value.
And c2, configuring the reference weight values of the peripheral positions outside the current block according to the effective number of the reference weight values.
For example, the number of peripheral locations outside the current block is an effective number, and the number of reference weight values is an effective number, and thus, the effective number of reference weight values may be configured as reference weight values of peripheral locations outside the current block.
For example, the 1 st reference weight value may be configured as a reference weight value of the 1 st peripheral position outside the current block, the 2 nd reference weight value may be configured as a reference weight value of the 2 nd peripheral position outside the current block, and so on.
In summary, since the reference weight value is already configured for the peripheral positions outside the current block, that is, each peripheral position has the reference weight value, after the peripheral matching position pointed by the pixel position is determined from the peripheral positions outside the current block, the reference weight value associated with the peripheral matching position, that is, the target weight value of the pixel position, may be determined.
Embodiments of the above process are described below with reference to several specific application scenarios. In the following several application scenarios, it is assumed that the size of the current block is M × N, M being the width of the current block and N being the height of the current block. X is the log2 logarithm of the tan value of the weighted prediction angle, such as 0 or 1.Y is an index value of the weight prediction position, and a, b, c and d are preset constant values. ValidLenth (hereinafter abbreviated as VL) represents the effective number, firstPos (hereinafter abbreviated as FP) represents the start position of weight transformation, referenceWeights [ i ] represents the reference weight value of the ith peripheral position, clip3 is used to limit the reference weight value to be between 0 and 8, i represents the index of the peripheral position outside the current block, and a represents the absolute value of the weight transformation rate.
Application scenario 1: the significance quantity (which may also be referred to as a reference weight significance length, or VL) is determined based on the size of the current block and the weight prediction angle of the current block, and the start position (i.e., FP) of the weight transform is acquired. For example, VL is determined by the following equation: VL = (N + (M > > X)) < <1; FP is determined by the following formula: FP = (VL > > 1) -a + Y ((VL-1) > > 3). Based on this, a reference weight value for each peripheral position is derived by the following formula: referenceWeights [ i ] = Clip3 (0,8,a (i-FP)). The value range of i can be 0-VL-1, or 1-VL. After obtaining the reference weight value ReferenceWeights [ i ] of the peripheral position of the current block, deriving a target weight value of the pixel position (x, y) of the current block by the following formula: sampleWeight [ X ] [ y ] = ReferenceWeights [ (y < < 1) + ((X < < 1) > > X) ], < < represents a left shift, and > > represents a right shift.
Application scenario 2: VL is determined by the following equation: VL = (N + (M > > X)) < <1; FP is determined by the following formula: FP = (VL > > 1) -b + Y ((VL-1) > > 3) - ((M < < 1) > > X). A reference weight value for each peripheral location is derived by the following formula: referenceWeights [ i ] = Clip3 (0,8,a (i-FP)). Deriving a target weight value for a pixel position (x, y) of the current block by: sampleWeight [ X ] [ y ] = ReferenceWeights [ (y < < 1) - ((X < < 1) > > X) ].
Application scenario 3: VL is determined by the following equation: VL = (M + (N > > X)) < <1; FP is determined by the following formula: FP = (VL > > 1) -c + Y ((VL-1) > > 3) - ((N < < 1) > > X). The reference weight value for each peripheral location is derived by the following equation: referenceWeights [ i ] = Clip3 (0,8,a (i-FP)). The target weight value for each pixel position (x, y) may be derived by the following equation: sampleWeight [ X ] [ y ] = ReferenceWeights [ (X < < 1) - ((y < < 1) > > X) ].
Application scenario 4: VL is determined by the following equation: VL = (M + (N > > X)) < <1; FP is determined by the following formula: FP = (VL > > 1) -d + Y ((VL-1) > > 3); deriving a reference weight value for each peripheral position of the current block by: referenceWeights [ i ] = Clip3 (0,8,a (i-FP)). Deriving a target weight value for each pixel position (x, y) of the current block by: sampleWeight [ X ] [ y ] = referenceWeighths [ (X < < 1) + ((y < < 1) > > X) ].
Application scenario 5: referring to fig. 6, a diagram of reference weight values for four weight transform rates is shown.
When the absolute value of the weight transformation ratio is 1, that is, the weight transformation ratio is 1 or the weight transformation ratio is-1, the reference weight value of each peripheral position of the current block can be derived by the following formula: referenceWeights [ i ] = Clip3 (0, 8,1 = (i-FP)), and the above formula may be equivalent to ReferenceWeights [ i ] = Clip3 (0, 8, i-FP). In this case, referring to the first case shown in fig. 6, FP may be 4, i.e., the reference weight value for the 1 st to 4 th peripheral positions is 0, the reference weight value for the 5 th peripheral position is 1, the reference weight value for the 6 th peripheral position is 2, and so on.
When the absolute value of the weight transformation ratio is 2, that is, the weight transformation ratio is 2 or the weight transformation ratio is-2, the reference weight value of each peripheral position of the current block is derived by the following formula: referenceWeights [ i ] = Clip3 (0, 8,2 (i-FP)), and the above formula may be equivalent to ReferenceWeights [ i ] = Clip3 (0, 8, (i-FP) < < 1). In this case, referring to the second case shown in fig. 6, FP may be 6, i.e., the reference weight values of 1 st to 6 th peripheral positions are 0, the reference weight value of 7 th peripheral position is 2, the reference weight value of 8 th peripheral position is 4, and so on.
When the absolute value of the weight transformation ratio is 4, that is, the weight transformation ratio is 4 or the weight transformation ratio is-4, the reference weight value of each peripheral position of the current block may be derived by the following formula: referenceWeights [ i ] = Clip3 (0, 8,4 (i-FP)), and the above formula may be equivalent to ReferenceWeights [ i ] = Clip3 (0, 8, (i-FP) < < 2). In this case, referring to the third case shown in fig. 6, FP may be 7, the reference weight value for the 1 st to 7 th peripheral positions is 0, the reference weight value for the 8 th peripheral position is 4, the reference weight value for the 9 th to 17 th peripheral positions is 8, and so on.
When the absolute value of the weight transformation ratio is 8, that is, the weight transformation ratio is 8 or the weight transformation ratio is-8, the reference weight value of each peripheral position of the current block is derived by the following formula: referenceWeights [ i ] = Clip3 (0, 8 x (i-FP)), and the above formula may be equivalent to ReferenceWeights [ i ] = Clip3 (0, 8, (i-FP) < < 3). In this case, referring to the fourth case shown in fig. 6, FP may be 8, i.e., the reference weight values of 1 st to 8 th peripheral positions are 0, the reference weight value of 9 th peripheral position is 9, the reference weight values of 10 th to 17 th peripheral positions are 8, and so on.
As described above, based on the fact that FP is 4 when the absolute value of the weight conversion ratio is 1, FP is 6 (that is, FP +2 at the time of weight conversion ratio 1) when the absolute value of the weight conversion ratio is 2, and FP is 7 (that is, FP +3 at the time of weight conversion ratio 1) when the absolute value of the weight conversion ratio is 4, the positions of the reference weight values of 4 can be aligned.
For example, for the current block, when the weight transformation ratio switching is supported and initiated, one of the reference weight value distribution examples of the 4 types of weight transformation ratios shown in fig. 6 may be selected for switching, so as to reduce the jump prominence of the image display in some image display scenes by switching the weight transformation ratio of the image or the local area of the image. For example, there are some image display scenarios in which the problem of the prominent jump needs to be solved, and the weight change rate switching of the AWP mode can solve the problem. For example, the mixed image content includes partial screen content, animation, images including animation, and the like, and the weight conversion rate switching can be performed on a certain area including the screen content, so that the problem of prominent jump can be solved.
In the above process, VL is related to the weighted prediction angle of the current block and the size of the current block, and for simplification of the scheme, some parameters may be fixed for optimization, for example, the weighted prediction angle of the current block may be configured as a fixed parameter value, and VL is only related to the size of the current block. In the above process, FP is related to the weight prediction angle of the current block, the size of the current block, and the weight prediction position of the current block, and for simplification of the scheme, some parameters may be fixed to achieve optimization, for example, the weight prediction angle of the current block may be configured as a fixed parameter value, and FP is related to only the size of the current block and the weight prediction position of the current block. Or, the weight prediction position of the current block is configured as a fixed parameter value, and FP is only related to the size of the current block and the weight prediction angle of the current block. Or, both the weighted prediction angle of the current block and the weighted prediction position of the current block are configured as fixed parameter values, the two fixed parameter values may be the same or different, and the FP is only related to the size of the current block, which is not limited to this.
Example 7: in embodiments 1 to 3, the encoding side/decoding side may configure a reference weight value for a peripheral position outside the current block according to the weight transformation rate of the current block and the start position of the weight transformation of the current block. In one possible embodiment, the derivation of the weighting array of the inter AWP mode, where M and N are the width and height of the current block, may include:
And step d1, acquiring parameters such as stepIndex, angleIndex and angleAreaIndex according to the awp _ index.
Illustratively, the value of the aw _ index represents the index values of the weight prediction position and the weight prediction angle, and the value of the aw _ index ranges from 0 to 55 assuming that there are 7 weight prediction positions and 8 weight prediction angles. If the weighted prediction positions are-3 to 3 (indicating that the 4 th weighted prediction position is the center and the 4 th weighted prediction position is 0) and the weighted prediction angles have indexes of 0 to 7, the arrangement of the weighted prediction positions and the weighted prediction angles corresponding to the 56 index values of the awp _ index may include:
arrangement mode 1:
{ angle 0, span-3 }, { angle 1, span-3 }, { angle 6, span-3 }, { angle 7, span-3 };
{ angle 0, span-2 }, { angle 1, span-2 }, { angle 6, span-2 }, { angle 7, span-2 };
{ angle 0, span-1 }, { angle 1, span-1 }, { angle 6, span-1 }, { angle 7, span-1 };
{ angle 0, span 0}, { angle 1, span 0}, { angle 6, span 0}, { angle 7, span 0};
{ angle 0, span 1}, { angle 1, span 1}, { angle 6, span 1}, { angle 7, span 1};
{ angle 0, span 2}, { angle 1, span 2}, { angle 6, span 2}, { angle 7, span 2};
{ angle 0, span 3}, { angle 1, span 3}, { angle 6, span 3}, { angle 7, span 3}.
Arrangement mode 2:
{ angle 0, span 0}, { angle 1, span 0}, { angle 6, span 0}, { angle 7, span 0};
{ angle 0, span-1 }, { angle 1, span-1 }, { angle 6, span-1 }, { angle 7, span-1 };
{ angle 0, span 1}, { angle 1, span 1}, { angle 6, span 1}, { angle 7, span 1};
{ angle 0, span-2 }, { angle 1, span-2 }, { angle 6, span-2 }, { angle 7, span-2 };
{ angle 0, span 2}, { angle 1, span 2}, { angle 6, span 2}, { angle 7, span 2};
{ angle 0, span-3 }, { angle 1, span-3 }, { angle 6, span-3 }, { angle 7, span-3 };
{ angle 0, span 3}, { angle 1, span 3}, { angle 6, span 3}, { angle 7, span 3}.
In the above arrangement 1 and arrangement 2, the angle 0 represents the first weighted prediction angle of the 8 weighted prediction angles, the angle 1 represents the second weighted prediction angle of the 8 weighted prediction angles, and so on.
The span 0 represents the 4 th weighted prediction position (i.e., the weighted prediction position at the center) among the 7 weighted prediction positions, the span-1 represents the first weighted prediction position to the left of the 4 th weighted prediction position (i.e., represents the 3 rd weighted prediction position among the 7 weighted prediction positions), the span 1 represents the first weighted prediction position to the right of the 4 th weighted prediction position (i.e., represents the 5 th weighted prediction position among the 7 weighted prediction positions), the span-2 represents the second weighted prediction position to the left of the 4 th weighted prediction position (i.e., represents the 2 nd weighted prediction position among the 7 weighted prediction positions), and so on.
In the arrangement 1, the value of the aw _ index corresponding to { angle 0, span-3 } is 0, the aw _ index corresponding to { angle 1, span-3 } is 1, the aw _ index corresponding to { angle 2, span-3 } is 2, and so on, and the value of the aw _ index corresponding to { angle 7, span 3} is 55, obviously, the values of the aw _ index may increase in sequence according to the sequence of the arrangement 1.
In the arrangement 2, the value of the aw _ index corresponding to { angle 0, span 0} is 0, the value of the aw _ index corresponding to { angle 1, span 0} is 2, the value of the aw _ index corresponding to { angle 2, span 0} is 3, and so on, and the value of the aw _ index corresponding to { angle 7, span 3} is 55, it is obvious that the values of the aw _ index may increase in sequence in the order of the arrangement 2.
In summary, when the value of the aw _ index is smaller, the code rate cost is smaller, and when the value of the aw _ index is larger, the code rate cost is larger, so that the code rate cost of the front value of the aw _ index is lower than the code rate cost of the rear value. For the above reasons, in the arrangement 2, the weight prediction position of "span 0" is placed at the top, that is, the combination of the weight prediction position of "span 0" and 8 weight prediction angles is considered, and the value of awp _ index is the first 8 values, and the code rate cost is the minimum. Since the probability that the weighted prediction position of "span 0" is selected is high, the permutation mode 2 can reduce the code rate cost of encoding. For convenience of description, in the following embodiments, the arrangement 2 is described as an example.
Illustratively, stepIndex represents a weight prediction position (i.e., an index value of the weight prediction position), and the weight prediction position may range from-3 to 3. For example, the weight prediction position is-3 for the 1 st weight prediction position, the weight prediction position is-2 for the 2 nd weight prediction position, and so on, and the weight prediction position is 3 for the 7 th weight prediction position.
The angleIndex represents the log2 logarithm (e.g., 0 or 1 or a larger constant) of the absolute value of the slope of the weighted prediction angle, and the angleAreaIndex represents the angular partition in which the weighted prediction angle is located. Referring to fig. 7A, 8 weight prediction angles are shown, the angleIndex for weight prediction angle 0 being the log2 log of the absolute value of the slope of weight prediction angle 0, the angleIndex for weight prediction angle 1 being the log2 log of the absolute value of the slope of weight prediction angle 1, and so on, the angleIndex for weight prediction angle 7 being the log2 log of the absolute value of the slope of weight prediction angle 7. The weight prediction angle 0 and the weight prediction angle 1 are located in the angle partition 0, the weight prediction angle 2 and the weight prediction angle 3 are located in the angle partition 1, the weight prediction angle 4 and the weight prediction angle 5 are located in the angle partition 2, and the weight prediction angle 6 and the weight prediction angle 7 are located in the angle partition 3.
In summary, obtaining stepIndex, angleIndex and angleAreaIndex according to the awp _ index can include:
stepIndex can be determined using the following formula:
stepIndex=(awp_index>>3+1)>>1
if((awp_index>>3)%2==1)
{
stepIndex=-stepIndex
}
modAngNum (angle number) can be determined according to the following formula: modAngNum = awp _ index%8; based on modAngNum, angleIndex can be determined as follows: if modAngNum equals 2, angleIndex =7; if modAngNum equals 6, angleIndex =8; otherwise, angleIndex = modAngNum%2.
The angleAreaIndex can be determined using the following formula: angleAreaIndex = modAngNum > >1.
To sum up, after determining the weight prediction angle of the current block and the weight prediction position of the current block, the encoding end may determine the value of the awp _ index based on the weight prediction angle and the weight prediction position, see arrangement 2. When the encoding end sends the encoding bit stream to the decoding end, the encoding bit stream can carry the value of the aw _ index, based on the value of the aw _ index, the decoding end obtains the value of the aw _ index, and obtains stepIndex, angleIndex and angleAreaIndex according to the aw _ index. stepIndex can uniquely determine a weighted prediction position, angleIndex and angleAreaIndex can uniquely determine a weighted prediction angle, see Table 2, but of course, other ways of determining weighted prediction angles, such as changing partition numbers, etc., can be used.
TABLE 2
Figure GDA0003895886610000221
Step d2, configuring reference weight values for the peripheral positions outside the current block according to stepIndex, angleIndex and angleAreaIndex, and explaining the configuration process of the reference weight values by combining several specific situations.
In case one, if the anglerareaindex is 0, that is, the weighted prediction angle is located in the angular partition 0, for example, the weighted prediction angle is the weighted prediction angle 0 or the weighted prediction angle 1, the starting position FP of the weighted transform is determined by using the following formula: FP = (VL _ H > > 1) -6+ DeltaPos _H. Then, a reference weight value of a peripheral position outside the current block is determined using the following formula: in this formula, the minimum value of the reference weight value is 0, the maximum value of the reference weight value is 8, and the weight conversion rate is 1, which is described as an example, that is, the formula may be equivalent to ReferenceWeights [ x ] = Clip3 (minimum value, maximum value, a (x-FP)). x may be an index of a peripheral position outside the current block, and the value of x ranges from 0 to VL _ H-1, a represents a weight transformation rate.
In the above formula, VL _ H may represent the number of peripheral positions outside the current block (i.e., an effective number, which may also be referred to as an effective length), and when the angleaareindex is 0, the peripheral position outside the current block to which the weighted prediction angle points may be the peripheral position in the left column, and therefore, the effective number may be denoted as VL _ H.
For example, the effective amount VL _ H may be determined using the following equation: VL _ H = (N + (M > > angleendex)) < <1. The reason for shifting one bit to the left is that the formula adopts 1/2-pel precision, and if the precision is 1-pel precision, VL _ H = (N + (M > > angleIndex)); if the precision is 1/4-pel, then VL _ H = (N + (M > > angleIndex)) < <2; if the precision is 2-pel precision, VL _ H = (N + (M > > angleIndex)) > >1, and other pixel precisions can be analogized, which are not described herein again. In the following formula, the involved part > >1 operation may be changed due to the difference of pixel precision.
DeltaPos _ H represents a position variation parameter (i.e., a middle parameter), and when the anglerareaindex is 0, the peripheral position outside the current block to which the weighted prediction angle points is the peripheral position of the left column outside the current block, and the position variation parameter is denoted as DeltaPos _ H. DeltaPos _ H is determined using the following equation: deltaPos _ H = stepIndex ((VL _ H > > 3) -1).
In case two, if the anglerareaindex is 1, that is, the weighted prediction angle is located in the angular partition 1, for example, the weighted prediction angle is the weighted prediction angle 2 or the weighted prediction angle 3, the starting position FP of the weighted transform can be determined by using the following formula: FP = (VL _ H > > 1) -4+ DeltaPos _H- ((M < < 1) > > angleIndex). Then, a reference weight value of a peripheral position outside the current block is determined by using the following formula: referenceWeights [ x ] = Clip3 (0, 8, a (x-FP)), and in this equation, the minimum value of the reference weight value is 0, the maximum value of the reference weight value is 8, and the weight conversion rate is a. x may be an index of a peripheral position outside the current block, and a value of x ranges from 0 to VL _ H-1.
In the above formula, VL _ H and DeltaPos _ H can be referred to as case one, and are not described herein again.
In case three, if the anglerareaindex is 2, that is, the weighted prediction angle is located in the angular partition 2, for example, the weighted prediction angle is the weighted prediction angle 4 or the weighted prediction angle 5, the starting position FP of the weighted transform can be determined by using the following formula: FP = (VL _ W > > 1) -4+ DeltaPos _W- ((N < < 1) > > angleIndex). Then, a reference weight value of a peripheral position outside the current block is determined by using the following formula: referenceWeights [ x ] = Clip3 (0, 8, a (x-FP)), and in this formula, the minimum value of the reference weight value is 0, the maximum value of the reference weight value is 8, and the weight conversion rate is a, for example, the description will be given. x can be the index of the peripheral position outside the current block, and the value range of x is 0 to VL _ W-1.
In the above formula, VL _ W represents the number of peripheral positions outside the current block (i.e., the effective number, which may also be referred to as the effective length), and when the anglerareaindex is 2, the peripheral position outside the current block to which the weighted prediction angle points may be the peripheral position of the upper row, and therefore, the effective number is denoted as VL _ W. Illustratively, the effective number VL _ W may be determined using the following equation: VL _ W = (M + (N > > angleIndex)) < <1.
DeltaPos _ W represents a position variation parameter (i.e., an intermediate parameter), and when the anglerareaindex is 2, the peripheral position outside the current block to which the weighted prediction angle points is the peripheral position of the upper line outside the current block, and the position variation parameter is denoted as DeltaPos _ W. DeltaPos _ W is determined using the following equation: deltaPos _ W = stepIndex ((VL _ W > > 3) -1).
In case four, if the anglerareaindex is 3, that is, the weighted prediction angle is located in the angle partition 3, for example, the weighted prediction angle is the weighted prediction angle 6 or the weighted prediction angle 7, the starting position FP of the weighted transform may be determined by using the following formula: FP = (VL _ W > > 1) -6+ DeltaPos _W. Then, the reference weight value of the peripheral position outside the current block may be determined using the following formula: referenceWeights [ x ] = Clip3 (0, 8, a (x-FP)), and in this formula, the minimum value of the reference weight value is 0, the maximum value of the reference weight value is 8, and the weight conversion rate is a, for example, the description will be given. x may be an index of a peripheral position outside the current block, and a value of x ranges from 0 to VL _ W-1.
In the above formula, VL _ W and DeltaPos _ W can be referred to as case three, and are not described herein again.
In summary, it can be determined which case should be used for processing according to the angleAreaIndex, for example, in case one and case two, VL _ H and DeltaPos _ H are determined according to angleIndex and stepIndex, FP is determined according to VL _ H and DeltaPos _ H, and then a reference weight value is configured according to FP. In case three and case four, VL _ W and DeltaPos _ W are determined according to anglelndex and steplndex, FP is determined according to VL _ W and DeltaPos _ W, and then a reference weight value is configured according to FP.
The difference between the formulas in the above cases is that the starting position of the reference weight value ReferenceWeights [ x ] is changed when the upper left corner of the current block is taken as the origin of coordinates. For example, referring to fig. 7B, which shows an example of the angle partition 2 and the angle partition 3, at 1/2-pel precision, the starting position of the reference weight value ReferenceWeights [ x ] is (high < < 1) > > anglelndex, i.e., offset "- ((N < < 1) > > anglelndex)" in the formula. The implementation of angular partition 0 and angular partition 1 is similar, except that the offset in the formula is "- ((M < < 1) > > angleIndex)", i.e., the height is changed to the width.
And d3, acquiring the brightness weight value of the pixel position according to the angleIndex and the reference weight value ReferenceWeights [ x ].
In case one, if the angleaareindex is 0, the following formula is adopted to determine the luminance weight value of the pixel position (x, y): the pixel position (x, y) points to the peripheral position, and the ReferenceWeights [ (y < < 1) + ((x < < 1) > > angle index) ], (y < < 1) + ((x < < 1) > > angle index) ] indicates the reference weight value of the peripheral position. The value range of x is 0-M-1, and the value range of y is 0-N-1.
In case two, if the angleaareindex is 1, the following formula is adopted to determine the brightness weight value of the pixel position (x, y): the pixel position (x, y) points to the peripheral position, and the ReferenceWeights [ (y < < 1) - ((x < < 1) > > angle index) ], wherein (y < < 1) - ((x < < 1) > > angle index) represents the peripheral position pointed by the pixel position (x, y), and the ReferenceWeights [ (y < < 1) - ((x < < 1) > > angle index) ] represent the reference weight value of the peripheral position. The value range of x is 0-M-1; the value range of y is 0 to N-1.
In case three, if the anglerareaindex is 2, the following formula is adopted to determine the luminance weight value of the pixel position (x, y): the pixel position (x, y) points to the peripheral position, and the ReferenceWeights [ (x < < 1) - ((y < < 1) > > angleIndex) ] represents the reference weight value of the peripheral position. The value range of x is 0-M-1; the value range of y is 0 to N-1.
In case four, if the anglerareaindex is 3, the following formula is adopted to determine the luminance weight value of the pixel position (x, y): the pixel position (x, y) points to the peripheral position, and the ReferenceWeights [ (x < < 1) + ((y < < 1) > > angleIndex) ] represents the reference weighted value of the peripheral position. The value range of x is 0-M-1; the value range of y is 0 to N-1.
And d4, acquiring the chromaticity weight value of the pixel position according to the brightness weight value of the pixel position, wherein the target weight value of the pixel position can be formed by the brightness weight value of the pixel position and the chromaticity weight value of the pixel position.
For example, if the format of the chroma resolution is 4, then the chroma weight value for pixel location (x, y) is determined using the following equation: awpWeightArrayUV [ x ] [ y ] = AwpWeightArrayY [ x < <1] [ y < <1]. For another example, if the format of the chroma resolution is 4, the chroma weight value of the pixel position (x, y) is determined using the following formula: awpWeightArrayUV [ x ] [ y ] = AwpWeightArrayY [ x ] [ y ]. Wherein, the value range of x is 0-M/2-1; the value range of y is 0-N/2-1.
Another implementation manner of step d4 is: and acquiring the chroma weight value of the pixel position according to the angleIndex and the reference weight value ReferenceWeight [ x ], without acquiring the chroma weight value according to the brightness weight value. For example, if the format of the chroma resolution is 4.
For example, if angleaareindex is 0, the chroma weight value of the pixel location (x, y) can be determined using the following formula: awpWeightArrayUV [ x ] [ y ] = ReferenceWeights [ (y < < 2) + ((x < < 2) > > angleIndex) ].
For example, if angleaareindex is 1, the chroma weight value of the pixel location (x, y) can be determined using the following formula: awpWeightArrayUV [ x ] [ y ] = ReferenceWeights [ (y < < 2) - ((x < < 2) > > angleIndex) ].
For example, if angleaareindex is 2, the chroma weight value of the pixel location (x, y) can be determined using the following formula: awpWeightArrayUV [ x ] [ y ] = ReferenceWeights [ (x < < 2) - ((y < < 2) > > angleIndex) ].
For example, if anglerareaindex is 3, the chroma weight value for pixel location (x, y) can be determined using the following formula: awpWeightArrayUV [ x ] [ y ] = ReferenceWeights [ (x < < 2) + ((y < < 2) > > angleIndex) ].
In each formula, x ranges from 0 to M-1, and y ranges from 0 to N-1.
In step d3 and step d4, the formulas in the respective cases are different in that, as shown in fig. 7C, examples of the angle section 2 and the angle section 3 are shown. When the upper left corner of the current block is taken as the origin of coordinates, the calculation formula of the matching position of (x, y) in the angle partition 2 may be: the formula for calculating the matching position of (x, y) > angleIndex (x, y) in the angular partition 3 can be: x + y > > angleIndex. At 1/2-pel accuracy, the formula for the calculation of the matching position of (x, y) in angular partition 2 may be: the calculation formula of the matching position of (x < < 1) - (y < < 1) > > angle index (x, y) in the angle partition 3 can be as follows: (x < < 1) + (y < < 1) > > angleIndex. The implementation of angular sector 0 and angular sector 1 is similar, except that the position of (x, y) is swapped.
Example 8: in embodiments 1 to 3, the encoding end/decoding end needs to obtain the weight transformation rate of the current block, in order to obtain the weight transformation rate of the current block, in this embodiment, the frame type of the current frame where the current block is located needs to be distinguished, that is, the weight transformation rate of the current block is determined based on the frame type of the current frame where the current block is located, and a method for obtaining the weight transformation rate is described below.
In a possible implementation manner, if the frame type of the current frame where the current block is located is a P frame, the weight transformation rate of the current block is the maximum value of the reference weight value. For example, if the maximum value of the configured reference weight values is 8 (which indicates that the reference weight values configured for the peripheral positions outside the current block cannot be greater than 8), the weight transformation rate of the current block is 8, i.e., shifted to the left by 3 (< 3); if the maximum value of the configured reference weight value is 16, the weight transformation ratio of the current block is 16, and so on.
In a possible implementation manner, if the frame type of the current frame where the current block is located is a B frame, then: if the current block supports the weight transformation ratio switching mode, the weight transformation ratio of the current block can be obtained by adopting the following method: and acquiring the weight transformation rate indication information of the current block, and determining the weight transformation rate of the current block according to the weight transformation rate indication information. Illustratively, if the weight transformation rate indication information is first indication information, the weight transformation rate of the current block is a first weight transformation rate; and if the weight transformation ratio indication information is the second indication information, the weight transformation ratio of the current block is the second weight transformation ratio. If the current block does not support the weighted transformation ratio switching mode, a preset weighted transformation ratio may be determined as the weighted transformation ratio of the current block.
In summary, if the current block supports the weighted transformation ratio switching mode, the weighted transformation ratio of the current block may be a first weighted transformation ratio or a second weighted transformation ratio, and the first weighted transformation ratio is different from the second weighted transformation ratio, i.e., the weighted transformation ratio of the current block is variable, so that the weighted transformation ratio can be adaptively switched instead of adopting a uniform one weighted transformation ratio.
For example, if the switching control information allows the current block to enable the weighted rate switching mode, the current block supports the weighted rate switching mode, and if the switching control information does not allow the current block to enable the weighted rate switching mode, the current block does not support the weighted rate switching mode. The handover control information may include, but is not limited to: sequence level switching control information, frame level switching control information, slice level switching control information, tile level switching control information, patch level switching control information, CTU (Coding Tee Unit) level switching control information, LCU (Largest Coding Unit) level switching control information, block level switching control information, CU (Coding Unit) level switching control information, PU (Prediction Unit) level switching control information, and the like, without limitation.
For the encoding end, it is able to know the switching control information, and know whether the switching control information allows the current block to enable the weighted transformation rate switching mode, and then determine whether the current block supports the weighted transformation rate switching mode. The coding end can code the switching control information to the code stream, so that the decoding end analyzes the switching control information from the code stream, knows whether the switching control information allows the current block to start a weight conversion rate switching mode, and then determines whether the current block supports the weight conversion rate switching mode. The encoding end may not encode the switching control information to the code stream, but the decoding end implicitly deduces the switching control information to know whether the switching control information allows the current block to enable the weight transformation rate switching mode, and then determines whether the current block supports the weight transformation rate switching mode.
Taking picture-level control information as an example, the picture-level control information is picture _ aw _ refine _ index (angle weighted prediction weight adjustment index value), if picture _ aw _ refine _ index is a first value, it indicates that the picture-level control information specifies that the current picture enables a first weight transformation rate, thereby specifying that the current block enables the first weight transformation rate, and if picture _ aw _ refine _ index is a second value, it indicates that the picture-level control information specifies that the current picture enables a second weight transformation rate, thereby specifying that the current block enables the second weight transformation rate. Illustratively, the first value is 1 and the second value is 0, or the first value is 0 and the second value is 1. Of course, the above is only an example of the first value and the second value, and the present invention is not limited thereto. For other types of control information, the implementation process is similar to the image-level control information, and is not described herein again.
For example, the weight transformation rate indication information of the current block may be a weight transformation rate index corresponding to the current block, the first indication information is used for indicating that the current block does not need to be subjected to weight transformation rate switching, and the second indication information is used for indicating that the current block needs to be subjected to weight transformation rate switching. On the basis, the weight transformation rate index corresponding to the current block can be obtained, and the weight transformation rate of the current block is determined according to the weight transformation rate index. For example, if the weighted transform rate index is used to indicate that the current block does not need to be subjected to weighted transform rate switching, the weighted transform rate of the current block may be a first weighted transform rate; if the weighted transformation rate index is used to indicate that the current block needs to be subjected to weighted transformation rate switching, the weighted transformation rate of the current block may be a second weighted transformation rate. The absolute value of the first weight transformation rate is not equal to the absolute value of the second weight transformation rate.
For example, the absolute value of the first weight transformation ratio may be greater than the absolute value of the second weight transformation ratio, e.g., the absolute value of the first weight transformation ratio may be 4, and the absolute value of the second weight transformation ratio may be 1 or 2. Alternatively, the absolute value of the first weight conversion rate may be 2 and the absolute value of the second weight conversion rate may be 1. Alternatively, the absolute value of the first weight transformation ratio may be 8 and the absolute value of the second weight transformation ratio may be 1, 2 or 4. For another example, the absolute value of the first weight transformation ratio may be smaller than the absolute value of the second weight transformation ratio, e.g., the absolute value of the first weight transformation ratio may be 1, and the absolute value of the second weight transformation ratio may be 2, 4, or 8. Alternatively, the absolute value of the first weight conversion rate may be 2, and the absolute value of the second weight conversion rate may be 4 or 8. Alternatively, the absolute value of the first weight conversion rate may be 4, and the absolute value of the second weight conversion rate may be 8. Of course, the above are just a few examples, and there is no limitation thereto as long as the absolute value of the first weight conversion rate is not equal to the absolute value of the second weight conversion rate.
For example, the weight-transform-rate index may include, but is not limited to: sequence level weight transform rate index, frame level weight transform rate index, slice level weight transform rate index, tile level weight transform rate index, patch level weight transform rate index, CTU level weight transform rate index, LCU level weight transform rate index, block level weight transform rate index, CU level weight transform rate index, PU level weight transform rate index, and the like, without limitation. For example, the sequence-level weighted transformation rate index corresponding to the current block may be determined as the weighted transformation rate index corresponding to the current block, or the frame-level weighted transformation rate index corresponding to the current block may be determined as the weighted transformation rate index corresponding to the current block, and so on, as long as the weighted transformation rate index corresponding to the current block can be obtained.
For example, the first weight transformation rate may be used as a default weight transformation rate, and for the encoding end, it may be known whether the current block needs to be subjected to weight transformation rate switching, and if the current block does not need to be subjected to weight transformation rate switching, the encoding end determines that the weight transformation rate of the current block is the first weight transformation rate. And if the current block needs to be subjected to weight transformation rate switching, the encoding end determines the weight transformation rate of the current block as a second weight transformation rate. Or, for the encoding end, the weight transformation rate index corresponding to the current block may be obtained, and if the weight transformation rate index is used to indicate that the current block does not need to be subjected to weight transformation rate switching, the encoding end may determine that the weight transformation rate of the current block is the first weight transformation rate. If the weight transformation rate index is used for indicating that the current block needs to be subjected to weight transformation rate switching, the encoding end determines the weight transformation rate of the current block as a second weight transformation rate.
For example, the encoding side determines a rate distortion cost value 1 corresponding to the first weight conversion rate and a rate distortion cost value 2 corresponding to the second weight conversion rate. And if the rate distortion cost value 1 is less than the rate distortion cost value 2, determining that the current block does not need to be subjected to weight transformation rate switching, and if the rate distortion cost value 2 is less than the rate distortion cost value 1, determining that the current block needs to be subjected to weight transformation rate switching.
The encoding end may encode the weight transformation rate index into the code stream, so that the decoding end parses the weight transformation rate index from the code stream, and determines the weight transformation rate index as the weight transformation rate index corresponding to the current block.
To sum up, the decoding end may obtain the weight transformation rate index corresponding to the current block, and if the weight transformation rate index is used to indicate that the current block does not need to perform weight transformation rate switching, the decoding end determines that the weight transformation rate of the current block is the first weight transformation rate. If the weighted transformation ratio index is used for indicating that the current block needs to be subjected to weighted transformation ratio switching, the decoding end determines that the weighted transformation ratio of the current block is a second weighted transformation ratio. For example, if the weight transformation rate index is a first value, it indicates that the current block does not need to be subjected to weight transformation rate switching, and if the weight transformation rate index is a second value, it indicates that the current block needs to be subjected to weight transformation rate switching. Illustratively, the first value is 1 and the second value is 0, or the first value is 0 and the second value is 1. Of course, the above is only an example of the first value and the second value, and the present invention is not limited thereto.
The encoding end may not encode the weighted transformation rate index into the code stream, but the decoding end implicitly derives the weighted transformation rate index, and determines the weighted transformation rate index as the weighted transformation rate index corresponding to the current block. For example, if the consecutive blocks all need to be weight-changed, the current block also needs to be weight-changed, the decoding end implicitly derives a weight-changed index, the weight-changed index is determined as the weight-changed index corresponding to the current block, and the weight-changed index indicates that the current block needs to be weight-changed. If the weight transformation rate switching is not needed in a plurality of continuous blocks, the weight transformation rate switching is not needed in the current block, the decoding end implicitly deduces a weight transformation rate index, and the weight transformation rate index indicates that the weight transformation rate switching is not needed in the current block. Of course, the above manner is only an example of implicitly deriving the weight transformation rate index, and the derivation manner is not limited. To sum up, the decoding end may obtain the weight transformation rate index corresponding to the current block, and determine that the weight transformation rate of the current block is the first weight transformation rate if the weight transformation rate index indicates that the current block does not need to perform weight transformation rate switching. And if the weight transformation rate index indicates that the current block needs to be subjected to weight transformation rate switching, determining the weight transformation rate of the current block as a second weight transformation rate.
In summary, the weight transformation rate of the current block is the first weight transformation rate or the second weight transformation rate, that is, the weight transformation rate of the current block can be switched, the switching of the weight transformation rate depends on a certain level of weight transformation rate index (awpweinendex), the weight transformation rate index is a display identifier or an implicit identifier, the display identifier refers to encoding the weight transformation rate index into the code stream, so that the decoding end parses the weight transformation rate index from the code stream, and the implicit identifier refers to adaptively deriving the weight transformation rate index according to the available information by the encoding and decoding end. Illustratively, a certain level of weight transform rate index refers to:
the sequence level indicates the weight transform rate index of the current sequence as the weight transform rate index of all blocks belonging to the current sequence; the frame level indicates a weight transformation rate index of the current frame as a weight transformation rate index of all blocks belonging to the current frame; the Slice level indicates the weight transformation rate index of the current Slice as the weight transformation rate index of all blocks belonging to the current Slice; the Tile level indicates a weight transformation rate index of the current Tile as a weight transformation rate index of all blocks belonging to the current Tile; the Patch stage indicates the weight transform rate index of the current Patch as the weight transform rate index of all blocks belonging to the current Patch; the CTU level indicates a weight transformation rate index of the current CTU as a weight transformation rate index of all blocks belonging to the current CTU; the LCU level indicates a weight transform rate index of the current LCU as a weight transform rate index of all blocks belonging to the current LCU; the block level indicates a weight transform rate index of the current block as a weight transform rate index belonging to the current block; the CU level indicates a weight transform rate index of the current CU as a weight transform rate index belonging to the current CU; the PU level indicates a weight transform rate index of the current PU as a weight transform rate index belonging to the current PU. Of course, the above are only a few examples and are not limiting.
For example, the first weighted transformation rate may be used as a default weighted transformation rate, and when the weighted transformation rate index is used to indicate that the current block does not need to be switched, the weighted transformation rate is not switched, that is, the weighted transformation rate of the current block is determined to be the first weighted transformation rate. And when the weight transformation rate index is used for indicating that the current block needs to be subjected to weight transformation rate switching, switching the weight transformation rate, namely determining the weight transformation rate of the current block as a second weight transformation rate.
Example 9: in embodiments 1 to 3, an encoding end/a decoding end needs to obtain a weighted prediction angle and a weighted prediction position of a current block, and in embodiment 8, a weighted transformation ratio of the current block can be obtained, and on this basis, the encoding end/the decoding end can obtain the weighted prediction angle and the weighted prediction position of the current block in the following manner:
the encoding end and the decoding end agree on the same weight prediction angle as the weight prediction angle of the current block, and agree on the same weight prediction position as the weight prediction position of the current block. For example, the encoding side and the decoding side use the weighted prediction angle 0 as the weighted prediction angle of the current block, and the encoding side and the decoding side use the weighted prediction position 4 as the weighted prediction position of the current block.
And the encoding end constructs a weight prediction angle list which comprises at least one weight prediction angle, and constructs a weight prediction position list which comprises at least one weight prediction position. And the encoding end sequentially traverses each weight prediction angle in the weight prediction angle list and each weight prediction position in the weight prediction position list, namely traverses each weight prediction angle and each weight prediction position combination. And (b) taking each combination as the weight prediction angle and the weight prediction position obtained in the step (a 1), and obtaining the weighted prediction value of the current block based on the weight prediction angle, the weight prediction position and the weight transformation ratio.
For example, when the encoding end goes through the weighted prediction angle 0 and the weighted prediction position 0, the weighted prediction value of the current block is obtained based on the weighted prediction angle 0 and the weighted prediction position 0. And when traversing to the weight prediction angle 1 and the weight prediction position 0, obtaining the weighted prediction value of the current block based on the weight prediction angle 1 and the weight prediction position 0, and so on. And obtaining the weighted prediction value of the current block based on each combination of the weighted prediction angle and the weighted prediction position. After the weighted prediction value of the current block is obtained based on the combination of the weighted prediction angle and the weighted prediction position, the rate distortion cost value is determined according to the weighted prediction value of the current block, the determination mode of the rate distortion cost value is not limited, and the minimum rate distortion cost value is selected based on the rate distortion cost value of each combination.
Then, the coding end uses the combination of the weight prediction angle and the weight prediction position corresponding to the minimum rate distortion cost value as the target weight prediction angle and the target weight prediction position respectively, and finally, the index value of the target weight prediction angle in the weight prediction angle list and the index value of the target weight prediction position in the weight prediction position list can be coded into a code stream.
For a decoding end, the decoding end constructs a weight prediction angle list, the weight prediction angle list is the same as the weight prediction angle list of the encoding end, and the weight prediction angle list comprises at least one weight prediction angle. And constructing a weight prediction position list, wherein the weight prediction position list is the same as the weight prediction position list of the encoding end, and the weight prediction position list comprises at least one weight prediction position. After receiving the coded bit stream of the current block, the decoding end analyzes the indication information from the coded bit stream, selects a weight prediction angle from the weight prediction angle list as the weight prediction angle of the current block according to the indication information, and selects a weight prediction position from the weight prediction position list as the weight prediction position of the current block according to the indication information.
For example, when the encoding end sends the encoded bitstream to the decoding end, the encoded bitstream may include indication information, where the indication information is used to indicate the weighted prediction angle of the current block and the weighted prediction position of the current block, see awp _ index in embodiment 7, taking the arrangement 2 as an example, based on the weighted prediction angle of the current block and the weighted prediction position of the current block, the encoding end may know the value of the awp _ index, and encode the value of the awp _ index (i.e., the indication information) in the encoded bitstream. After receiving the coded bit stream, the decoding end parses the indication information (i.e., the value of the aw _ index) from the coded bit stream, and based on the value of the aw _ index and the arrangement mode 2, can determine the weighted prediction angle of the current block and the weighted prediction position of the current block.
Exemplary embodiments 1-9 are the codec process of the AWP mode, in which the number of modes of the AWP can be at the switch control size at the sequence level, the frame level, the Slice level, the Tile level, the Patch level, the CTU level, the LCU level, the block level, the CU level, and the PU level. The control of the number of modes can be realized by increasing or decreasing the weight prediction angle or/and increasing or decreasing the number of reference weight configuration modes. The syntax flag may be coded separately or derived depending on another flag, for example, the number of AWP modes is controlled by a certain flag, for example, when the flag is 1, the weighted prediction angles are 6, and when the flag is 0, the weighted prediction angles are 8.
In a possible implementation manner, the weighted prediction angle list constructed by the encoding end/the decoding end may further distinguish frame types of a current frame where the current block is located, that is, different weighted prediction angle lists are constructed for a P frame and a B frame, the weighted prediction angle list constructed for the B frame is recorded as a first angle list, the weighted prediction angle list constructed for the P frame is recorded as a second angle list, and the weighted prediction angles included in the second angle list are subsets of the weighted prediction angles included in the first angle list. Based on this, if the frame type of the current frame where the current block is located is a B frame, the weight prediction angle of the current block can be obtained from the first angle list; if the frame type of the current frame where the current block is located is a P frame, the weight prediction angle of the current block can be obtained from the second angle list.
For example, a first angle list may be constructed, which includes a plurality of weighted prediction angles, such as the 8 weighted prediction angles of the above embodiment, where the 8 weighted prediction angles are angle 0, angle 1, \ 8230;, and angle 7, respectively.
Then, a partial weight prediction angle may be selected from the first angle list based on the size of the current block, and a second angle list may be constructed based on the selected partial weight prediction angles, as to which weight prediction angles are selected, as shown in table 3.
In a possible implementation manner, the weighted prediction position list constructed by the encoding end/the decoding end may further distinguish frame types of a current frame where the current block is located, that is, different weighted prediction position lists are constructed for a P frame and a B frame, the weighted prediction position list constructed for the B frame is defined as a first position list, the weighted prediction position list constructed for the P frame is defined as a second position list, and a weighted prediction position included in the second position list is a subset of a weighted prediction position included in the first position list. Based on this, if the frame type of the current frame where the current block is located is a B frame, the weight prediction position of the current block can be obtained from the first position list; if the frame type of the current frame where the current block is located is a P frame, the weight prediction position of the current block can be obtained from the second position list.
For example, a first location list is constructed, and the first location list includes a plurality of weighted prediction locations, such as the 7 weighted prediction locations of the above-mentioned embodiment, where the 7 weighted prediction locations are span-3, span-2, span-1, span 0, span 1, span 2, and span 3, respectively. Then, partial weighted prediction positions may be selected from the first position list based on the size of the current block, and a second position list may be constructed based on the selected partial weighted prediction positions, as to which weighted prediction positions are selected, as shown in table 3.
TABLE 3
Figure GDA0003895886610000291
Taking the above arrangement 2 as an example, the relationship between the aw _ index and the weight prediction angle and the weight prediction position is shown in table 4.
TABLE 4
Figure GDA0003895886610000292
Figure GDA0003895886610000301
Taking the size of the current block as 8x8 as an example, the awp _ index is {16,26,28,30,32,44},16 corresponds to angle 0 and span 1, 26 corresponds to angle 2 and span-2, 28 corresponds to angle 4 and span-2, 30 corresponds to angle 6 and span-2, 32 corresponds to angle 0 and span 2,44 corresponds to angle 4 and span-3, as shown in table 3 and table 4. In summary, when the size of the current block is 8x8, the first angle list may include angles 0 to 7, the first location list may include spans-3 to 3, and the second angle list may include angles 0, 2,4, and 6, and the second location list may include spans 1, 2, and 3, that is, the second angle list and the second location list may be constructed based on the size of the current block.
Similarly, when the size of the current block is 8x16, 8x32, 8x64, 16x8, 16x16, 16x32, 16x64, 32x8, 32x16, 32x32, 32x64, 64x8, 64x16, 64x32, 64x64, the first angle lists each include an angle 0-an angle 7, the first position lists each include a span-3-a span 3, and the second angle list and the second position list may be constructed based on the size of the current block.
Example 10: in embodiments 1 to 3, the encoding end/the decoding end needs to obtain a motion information candidate list created for the current block, where the motion information candidate list includes at least one candidate motion information, and the candidate motion information in the motion information candidate list may be unidirectional motion information. For example, at least one available motion information to be added to the motion information candidate list is acquired, and the motion information candidate list created for the current block is acquired based on the available motion information. The at least one available motion information includes, but is not limited to, at least one of the following motion information: temporal motion information; spatial domain motion information; and presetting motion information.
In one possible implementation, for the temporal motion information, the obtaining process of the available motion information to be added to the motion information candidate list may include: based on the preset position of the current block, a time domain adjacent block corresponding to the preset position is selected from a reference frame of the current block, and the motion information of the time domain adjacent block is determined as available motion information, that is, the available motion information is time domain motion information. For spatial motion information, the process of acquiring available motion information to be added to the motion information candidate list may include: for the spatial neighboring blocks of the current block, if the spatial neighboring blocks exist and the spatial neighboring blocks adopt the inter prediction mode, the motion information of the spatial neighboring blocks may be determined as available motion information, that is, the available motion information is spatial motion information. For the preset motion information, the process of acquiring the available motion information to be added to the motion information candidate list may include: preset motion information may be determined as available motion information, which may include, but is not limited to, default motion information derived based on candidate motion information already existing in the motion information candidate list.
In one possible implementation, for the available motion information to be added to the motion information candidate list, if the available motion information is unidirectional motion information, the unidirectional motion information may be added to the motion information candidate list. Alternatively, if the unidirectional motion information does not overlap with candidate motion information already existing in the motion information candidate list, the unidirectional motion information may be added to the motion information candidate list. Alternatively, if the unidirectional motion information overlaps with candidate motion information already existing in the motion information candidate list, the unidirectional motion information may not be added to the motion information candidate list.
In one possible implementation, for the available motion information to be added to the motion information candidate list, if the available motion information is bidirectional motion information, the available motion information may be clipped into unidirectional motion information (such as unidirectional motion information pointing to a reference frame in the first reference frame list, or unidirectional motion information pointing to a reference frame in the second reference frame list) according to an attribute of the available motion information, and the unidirectional motion information is added to the motion information candidate list. Alternatively, if the unidirectional motion information does not overlap with candidate motion information already existing in the motion information candidate list, the unidirectional motion information may be added to the motion information candidate list. Alternatively, if the unidirectional motion information overlaps with candidate motion information already existing in the motion information candidate list, the unidirectional motion information may not be added to the motion information candidate list.
Illustratively, the available motion information (i.e., bi-directional motion information) may be clipped to uni-directional motion information as follows: available motion information is clipped to one-way motion information according to parity properties of numbers of the available motion information. For example, if the available motion information is motion information of a neighboring block of the current block, the number of the available motion information is determined based on the traversal order of the neighboring blocks, which are spatial neighboring blocks and/or temporal neighboring blocks. If the odd-even attribute of the serial number is an odd number, cutting the available motion information into unidirectional motion information pointing to the reference frame in the first reference frame list; if the numbered parity attribute is an even number, the available motion information is clipped to unidirectional motion information pointing to the reference frames in the second list of reference frames. Or if the odd-even attribute of the number is an even number, cutting the available motion information into unidirectional motion information pointing to the reference frame in the first reference frame list; if the numbered parity attribute is odd, the available motion information is clipped to unidirectional motion information that points to the reference frames in the second reference frame list.
For example, the neighboring blocks of the current block may be spatial neighboring blocks, as shown in fig. 8, which are schematic diagrams of positions of the spatial neighboring blocks, and F, G, C, a, B, and D are spatial neighboring blocks of the current block, and of course, the spatial neighboring blocks may be one or more of F, G, C, a, B, and D. Assuming that the spatial neighboring blocks have a FGCABD traversal order, F corresponds to a number of 0, G corresponds to a number of 1, C corresponds to a number of 2, A corresponds to a number of 3, B corresponds to a number of 4, and D corresponds to a number of 5. Alternatively, F corresponds to number 1, G corresponds to number 2, C corresponds to number 3, A corresponds to number 4, B corresponds to number 5, D corresponds to number 6. Of course, the traversal order of FGCABD described above is only an example, and the traversal order is not limited, and the above numbering is also only an example. Assuming that the numbers corresponding to the FGCABD are 0,1,2,3,4,5, if the available motion information is the motion information of the spatial neighboring block F, the number of the available motion information is determined to be 0 based on the traversal order of the spatial neighboring block F, and 0 represents the first spatial neighboring block that is traversed in the traversal order. If the available motion information is the motion information of the spatial neighboring block G, the number of the available motion information is determined to be 1 based on the traversal order of the spatial neighboring block G, where the number 1 represents a second spatial neighboring block that is traversed according to the traversal order, and so on.
For another example, the neighboring blocks of the current block may be temporal neighboring blocks, and assuming that the traversal order of the temporal neighboring blocks is temporal neighboring blocks at upper-right pixel positions, temporal neighboring blocks at lower-right pixel positions, and temporal neighboring blocks at lower-left pixel positions, the temporal neighboring block at the upper-right pixel position corresponds to a number 0, the temporal neighboring block at the lower-right pixel position corresponds to a number 1, and the temporal neighboring block at the lower-left pixel position corresponds to a number 2. Or, the number corresponding to the temporal neighboring block at the upper-right pixel position is 1, the number corresponding to the temporal neighboring block at the lower-right pixel position is 2, and the number corresponding to the temporal neighboring block at the lower-left pixel position is 3. Of course, the above traversal order is only an example, and the traversal order is not limited thereto, and the numbers corresponding to the time-domain neighboring blocks are also only examples. In summary, if the available motion information is the motion information of the temporal neighboring block at the top-right pixel position, the number of the available motion information is determined to be 0 based on the traversal order of the temporal neighboring block at the top-right pixel position, and so on.
For another example, the neighboring blocks of the current block may be spatial neighboring blocks and temporal neighboring blocks, where the spatial neighboring blocks have a traversal order FGCABD, the temporal neighboring blocks are located behind any spatial neighboring blocks (e.g., located behind D, or behind B, or behind a, or behind C, or behind G, or behind F), or the temporal neighboring blocks are located in front of all spatial neighboring blocks (e.g., located in front of F), and where the temporal neighboring blocks are located in front of F, the traversal order of all neighboring blocks is TFGCABD, T is used to represent temporal neighboring blocks (which may be temporal neighboring blocks at any position). Of course, the traversal order of TFGCABD described above is merely an example, and no limitation is made to this traversal order. Based on this, T corresponds to number 0, F corresponds to number 1, G corresponds to number 2, C corresponds to number 3, A corresponds to number 4, B corresponds to number 5, D corresponds to number 6. Alternatively, T corresponds to number 1, F corresponds to number 2, G corresponds to number 3, C corresponds to number 4, A corresponds to number 5, B corresponds to number 6, D corresponds to number 7.
In summary, for spatial neighboring blocks and temporal neighboring blocks, it is assumed that the numbers corresponding to TFGCABD are sequentially 0,1,2,3,4,5,6, if the available motion information is the motion information of the temporal neighboring block T, the number of the available motion information is determined to be 0 based on the traversal order of the temporal neighboring block T, if the available motion information is the motion information of the spatial neighboring block D, the number of the available motion information is determined to be 6 based on the traversal order of the spatial neighboring block D, and so on. If the numbers corresponding to the TFGCABDs are 0,1,2,3,4,5,6 in sequence, after traversing the motion information of the TFGCABDs in sequence, the motion information of T is available motion information and bidirectional motion information, the motion information of G is available motion information and bidirectional motion information, and the motion information of a is available motion information and bidirectional motion information, the number of the motion information of T is 0, the number of the motion information of G is 2, and the number of the motion information of a is 4. In one case, the parity attribute of the number of motion information of T is an even number, and the motion information of T is clipped to unidirectional motion information pointing to the reference frames in the second reference frame list. The odd-even property of the number of the motion information of G is an even number, and the motion information of G is clipped to unidirectional motion information pointing to the reference frames in the second reference frame list. The odd-even property of the number of the motion information of A is even number, and the motion information of A is cut into unidirectional motion information pointing to the reference frames in the second reference frame list. In another case, the odd-even property of the number of the motion information of T is an even number, and the motion information of T is clipped to unidirectional motion information pointing to the reference frames in the first reference frame list. The odd-even property of the number of the motion information of G is an even number, and the motion information of G is clipped to unidirectional motion information pointing to the reference frames in the first reference frame list. The odd-even property of the number of the motion information of A is even number, and the motion information of A is cut into unidirectional motion information pointing to the reference frames in the first reference frame list.
For example, the available motion information may also be preset motion information, which is clipped into unidirectional motion information according to the number of the preset motion information. Of course, if the preset information is derived from the unidirectional motion information already existing in the list, the preset motion information is also unidirectional motion information, and no clipping operation is required. Assuming that the traversal order of the spatial neighboring blocks is FGCABD, the default motion information is located behind any spatial neighboring block or in front of all spatial neighboring blocks, and assuming that the default motion information is located behind D, the traversal order is FGCABDK, K is used to represent the default motion information (when there is at least one default motion information, and there are multiple default motion information, the multiple default motion information are arranged in sequence). Of course, the traversal order of FGCABDK is only an example and is not limited to this traversal order. Based on this, the corresponding number of FGCABDK is 0123456 or 1234567. Assuming that the traversal order of the neighboring blocks (e.g., spatial neighboring blocks and temporal neighboring blocks) is tfgcabdd, the preset motion information may be located after any neighboring block or before all neighboring blocks, and assuming that the preset motion information is located after D, the traversal order is TFGCABDK. Of course, the traversal order of TFGCABDK is only an example and is not limited thereto. For this reason, the corresponding numbering of TFGCABDK is 01234567 or 12345678.
Illustratively, the available motion information (i.e., bi-directional motion information) may be clipped to uni-directional motion information as follows: the available motion information is clipped to unidirectional motion information according to its nature (which can also be understood as type). For example, if the available motion information is motion information of a temporal neighboring block of the current block, the available motion information may be clipped to unidirectional motion information pointing to a reference frame in the first list of reference frames; that is, as long as the nature of the available motion information is that of temporal neighboring blocks, the available motion information is clipped to unidirectional motion information pointing to the reference frames in the first reference frame list. Alternatively, if the available motion information is motion information of a temporal neighboring block of the current block, the available motion information may be clipped to unidirectional motion information pointing to a reference frame in the second reference frame list, i.e., as long as the nature of the available motion information is motion information of the temporal neighboring block.
For another example, if the available motion information is motion information of a spatial neighboring block of the current block, the available motion information is clipped to unidirectional motion information pointing to a reference frame in the first reference frame list, i.e., as long as the nature of the available motion information is motion information of the spatial neighboring block, the available motion information is clipped to unidirectional motion information pointing to a reference frame in the first reference frame list. Alternatively, if the available motion information is motion information of a spatial neighboring block of the current block, the available motion information is clipped to unidirectional motion information pointing to a reference frame in the second reference frame list, i.e., as long as the nature of the available motion information is motion information of the spatial neighboring block, the available motion information is clipped to unidirectional motion information pointing to a reference frame in the second reference frame list.
For another example, if the available motion information is the preset motion information (i.e., the nature of the available motion information is the preset motion information), the available motion information is clipped to one-way motion information pointing to the reference frames in the first reference frame list. Or, if the available motion information is the preset motion information, the available motion information is clipped to be the one-way motion information pointing to the reference frame in the second reference frame list.
In the above embodiments, the first reference frame List is also referred to as a first reference frame queue, and may also be referred to as a forward reference frame List, such as List0. The second List of reference frames is also referred to as a second reference frame queue, and may also be referred to as a backward reference frame List, such as List1.
For example, whether unidirectional motion information (if the available motion information is unidirectional motion information, the unidirectional motion information to be compared is available motion information, and if the available motion information is bidirectional motion information, the unidirectional motion information to be compared is clipped from the available motion information) is repeated with candidate motion information already existing in the motion information candidate list may be compared. The duplication checking operation for the unidirectional motion information and the candidate motion information comprises the following steps: if the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information, and the motion vector of the unidirectional motion information is the same as the motion vector of the candidate motion information, determining that the unidirectional motion information is repeated with the candidate motion information; otherwise, determining that the unidirectional motion information is not repeated with the candidate motion information. The determination process of whether the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information includes:
Case 1, if the list of reference frames pointed to by the unidirectional motion information is the same as the list of reference frames pointed to by the candidate motion information, and the index of reference frame (refIdx) pointed to by the unidirectional motion information is the same as the index of reference frame (refIdx) pointed to by the candidate motion information, it may be determined that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information; otherwise, it may be determined that the unidirectional motion information points to a different reference frame than the candidate motion information points to.
Case 2, if POC (display order) of the reference frame pointed to by the unidirectional motion information is the same as POC of the reference frame pointed to by the candidate motion information, determining that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information; otherwise, the reference frame pointed to by the unidirectional motion information is determined to be different from the reference frame pointed to by the candidate motion information.
And 3, if the reference frame pointed by the unidirectional motion information is a knowledge base frame and the reference frame pointed by the candidate motion information is a non-knowledge base frame, or the reference frame pointed by the unidirectional motion information is a non-knowledge base frame and the reference frame pointed by the candidate motion information is a knowledge base frame, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information.
If the reference frame pointed to by the unidirectional motion information and the reference frame pointed to by the candidate motion information are both non-knowledge base frames, comparing whether the POC of the reference frame pointed to by the unidirectional motion information is the same as the POC of the reference frame pointed to by the candidate motion information, if so, determining that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information; if not, it may be determined that the reference frame pointed to by the unidirectional motion information is different from the reference frame pointed to by the candidate motion information.
If the reference frame pointed to by the unidirectional motion information and the reference frame pointed to by the candidate motion information are knowledge base frames, it can be determined that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information.
And 4, if the reference frame pointed by the unidirectional motion information is a knowledge base frame and the reference frame pointed by the candidate motion information is a non-knowledge base frame, or the reference frame pointed by the unidirectional motion information is a non-knowledge base frame and the reference frame pointed by the candidate motion information is a knowledge base frame, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information.
If the reference frame pointed by the unidirectional motion information and the reference frame pointed by the candidate motion information are both non-knowledge base frames, comparing whether the POC of the reference frame pointed by the unidirectional motion information is the same as the POC of the reference frame pointed by the candidate motion information, if so, determining that the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information; if not, it may be determined that the reference frame pointed to by the unidirectional motion information is different from the reference frame pointed to by the candidate motion information.
If the reference frame pointed by the unidirectional motion information and the reference frame pointed by the candidate motion information are knowledge base frames, comparing whether the knowledge base frame index of the reference frame pointed by the unidirectional motion information is equal to the knowledge base frame index of the reference frame pointed by the candidate motion information, if so, determining that the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information, and if not, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information.
Example 11: with respect to embodiment 10, the motion information candidate list may be obtained using temporal motion information (motion information of temporal neighboring blocks is referred to as temporal motion information) and/or spatial motion information (motion information of spatial neighboring blocks is referred to as spatial motion information), and available motion information may be selected from the temporal motion information and/or the spatial motion information. For example, the temporal motion information is at least one, and the spatial motion information is the motion information of the spatial neighboring blocks, such as F, G, C, a, B, and D in fig. 8.
For spatial motion information, the available motion information to be added to the motion information candidate list may be obtained as follows:
referring to FIG. 8, F, G, C, A, B, D may be spatial neighboring blocks of the current block E, and the "availability" of F, G, C, A, B, D may be determined. Illustratively, if F exists and the inter prediction mode is adopted, F is available, and the motion information of F is available motion information; otherwise, F is unavailable, and the motion information of F is unavailable motion information. If G exists and the inter-frame prediction mode is adopted, G is available, and the motion information of G is available motion information; otherwise, G is unavailable, and the motion information of G is unavailable motion information. If C exists and the inter-frame prediction mode is adopted, C is available, and the motion information of C is available motion information; otherwise, C is unavailable, and the motion information of C is unavailable motion information. If A exists and the inter-frame prediction mode is adopted, A is available, and the motion information of A is available; otherwise, A is unavailable, and the motion information of A is unavailable motion information. If B exists and the inter-frame prediction mode is adopted, B is available, and the motion information of B is available motion information; otherwise, B is unavailable and the motion information of B is unavailable. If D exists and the inter-frame prediction mode is adopted, D is available, and the motion information of D is available motion information; otherwise, D is unavailable, and the motion information of D is unavailable motion information.
For temporal motion information, the available motion information to be added to the motion information candidate list may be obtained as follows:
based on the preset position of the current block, selecting a time domain adjacent block corresponding to the preset position from a reference frame of the current block, and determining the motion information of the time domain adjacent block as available motion information. For example, if the current frame where the current block is located is a B frame, the unidirectional motion information or the bidirectional motion information may be derived from a co-located block of a co-located reference frame, and the unidirectional motion information or the bidirectional motion information may be used as the available motion information. If the current frame is a P frame, then the uni-directional motion information may be derived from the co-located blocks of the co-located reference frame and used as the available motion information.
For example, the co-located block is a time-domain neighboring block in the co-located reference frame corresponding to a preset position of the current block, and the preset position of the current block may be configured empirically without limitation, such as an upper-left pixel position of the current block, an upper-right pixel position of the current block, a lower-left pixel position of the current block, a lower-right pixel position of the current block, a center pixel position of the current block, and the like. For example, the coordinates of the upper left corner pixel position may be (x 0, y 0), the coordinates of the upper right corner pixel position may be (x 0+ width, y 0) (x 0+ width-1, y 0), the coordinates of the lower right corner pixel position may be (x 0+ width, y0+ height) (x 0+ width-1, y0+ height) (x 0+ width, y0+ height-1) (x 0+ width-1, y0+ height-1), and the coordinates of the lower left corner pixel position may be (x 0, y0+ height) (x 0, y0+ height-1), and the co-located reference frame may be a preset reference frame, for example, the first reference code stream in List0 of the lower left corner may be a co-located reference stream, or a derived reference frame, for example, the co-located reference frame may be determined from the co-located reference stream, and the most recent co-located reference frame may be decoded from the List0, for example, and the co-located reference stream may be a co-located reference frame.
If the current frame where the current block is located is a B frame, unidirectional motion information or bidirectional motion information is derived according to the motion information of the co-located block, and if the current frame where the current block is located is a P frame, unidirectional motion information is derived according to the motion information of the co-located block.
For example, regarding the preset position of the current block, one possible implementation is: if the coordinate position of the outer lower right corner of the current block does not exceed the preset block boundary (the preset block boundary may be a maximum coding unit boundary, such as an LCU boundary or a CTU boundary), the preset position is the coordinate position of the outer lower right corner of the current block. If the coordinate position of the lower right corner point outside the current block exceeds the preset block boundary, the preset position is the coordinate position of the lower right corner point inside the current block (such as the coordinate position of the lower right corner point outside the current block, and exceeds the preset block right boundary and the lower boundary), or the upper position of the coordinate position of the lower right corner point outside the current block (such as the coordinate position of the lower right corner point outside the current block, and exceeds the preset block lower boundary), or the left position of the coordinate position of the lower right corner point outside the current block (such as the coordinate position of the lower right corner point outside the current block, and exceeds the preset block right boundary).
As for the temporal motion information, motion information derived using mode information of temporal neighboring blocks may be used. For example, the motion information to be transformed of the temporal neighboring block may be determined first, for example, when the temporal neighboring block adopts the intra prediction mode, the motion information to be transformed of the temporal neighboring block is derived based on the motion information of other blocks. For example, spatial neighboring blocks are used to derive motion information as band transform motion information of temporal neighboring blocks, or zero motion information pointing to a co-located frame can be directly used as the motion information of the final temporal neighboring blocks; and when the time domain adjacent blocks adopt the inter-frame prediction mode, determining the motion information to be transformed of the time domain adjacent blocks based on the motion information of the time domain adjacent blocks. Then, the motion information to be transformed of the neighboring blocks in the time domain is transformed to obtain the motion information in the time domain (i.e., the motion information that can be used for the current block transformed to the current block), for example, based on the distance between the reference frame of the current block (i.e., the co-located frame, i.e., the frame where the neighboring blocks in the time domain are located) and the reference frame of the neighboring blocks in the time domain, and the distance between the current block and the reference frame of the current block, the motion vectors of the neighboring blocks in the time domain are scaled to obtain the scaled motion vectors, and the scaled motion vectors and the index of the reference frame of the current block are combined to form the motion information, which is the motion information in the time domain. For the case that the time domain neighboring block is an inter-frame prediction block, specifically, for example, if the time domain neighboring block is bidirectional motion information, corresponding stretch operations are performed on the unidirectional motion information pointing to List0 and the unidirectional motion information pointing to List1 at the same time to obtain time domain motion information; if the time domain neighboring block is the unidirectional motion information pointing to List0 or List1, performing two-time expansion on the unidirectional motion information to obtain bidirectional motion information as the time domain motion information. For another example, if the motion information of the time domain neighboring blocks has motion information pointing to List0, the unidirectional motion information pointing to List0 obtained after the stretching is used as the time domain motion information, otherwise, the unidirectional motion information pointing to List0 obtained after the motion information pointing to List1 is stretched is used as the time domain motion information. For another example, if the motion information of the time domain neighboring blocks has motion information pointing to List1, the unidirectional motion information pointing to List1 obtained after the stretching is used as the time domain motion information, otherwise, the unidirectional motion information pointing to List1 obtained after the motion information pointing to List0 is stretched is used as the time domain motion information.
In a possible embodiment, when deriving the temporal motion information, the frame type of the current frame where the current block is located may also be distinguished, that is, the temporal motion information is derived based on the frame type of the current frame, where the derived temporal motion information is unidirectional when the frame type is a P frame, and unidirectional or bidirectional when the frame type is a B frame, which will be described below.
Deriving a condition 1, if the frame type of a current frame where a current block is located is a P frame, determining a co-located frame of the current frame (a reference frame with a reference index value of 0 in a reference image queue 0 (List 0) of the current frame is used as the co-located frame), and determining a co-located block of the current block (namely, a block corresponding to a preset position of the current block) from the co-located frame; if the co-located block is a non-inter-predicted block, deriving unidirectional zero motion information pointing to a reference frame with reference index value 0 in a first reference frame List (e.g., list 0); otherwise, if the motion information of the co-located block pointing to the first reference frame list exists, the unidirectional motion information of the reference frame pointing to the reference index value 0 in the first reference frame list is obtained through the telescopic operation based on the unidirectional motion information pointing to the first reference frame list.
Deriving a situation 2, if the frame type of the current frame where the current block is located is a P frame, determining a co-located frame of the current frame, and determining a co-located block of the current block from the co-located frame; if the co-located block is a non-inter-predicted block, then the spatial neighboring block may be used to derive uni-directional motion information pointing to a reference frame with a reference index value of 0 in the first reference frame list; otherwise, if the motion information of the co-located block pointing to the first reference frame list exists, the unidirectional motion information of the reference frame pointing to the reference index value 0 in the first reference frame list is obtained through the telescopic operation based on the unidirectional motion information pointing to the first reference frame list.
Deriving a condition 3, if the frame type of the current frame where the current block is located is a B frame, determining a co-located frame of the current frame (a reference frame with a reference index value of 0 in a reference image queue 1 (List 1) of the current frame is used as the co-located frame), and determining a co-located block of the current block (i.e., a block corresponding to a preset position of the current block) from the co-located frame; if the co-located block does not exist or the co-located block is a non-inter prediction block, deriving bi-directional motion information pointing to a reference frame with reference index value 0 in the first reference frame List and pointing to a reference frame with reference index value 0 in the second reference frame List (e.g., list 1) using spatial neighboring blocks; otherwise, if the motion information of the co-located block pointing to the first reference frame list exists, based on the unidirectional motion information pointing to the first reference frame list, bidirectional motion information of a reference frame pointing to a reference index value 0 in the first reference frame list and a reference frame pointing to a reference index value 0 in the second reference frame list is obtained through telescopic operation; otherwise, if the motion information of the co-located block pointing to the second reference frame list exists, based on the unidirectional motion information pointing to the second reference frame list, bidirectional motion information pointing to the reference frame with reference index value 0 in the first reference frame list and pointing to the reference frame with reference index value 0 in the second reference frame list is obtained through scaling operation.
Deriving a condition 4, if the frame type of the current frame where the current block is located is a B frame, determining a co-located frame of the current frame, and determining a co-located block of the current block from the co-located frame; if the co-located block does not exist or is a non-inter prediction block, deriving bidirectional zero motion information pointing to a reference frame with a reference index value of 0 in the first reference frame list and pointing to a reference frame with a reference index value of 0 in the second reference frame list; otherwise, if the motion information of the co-located block pointing to the first reference frame list exists, based on the unidirectional motion information pointing to the first reference frame list, obtaining the bidirectional motion information of the reference frame pointing to the reference index value 0 in the first reference frame list and the reference frame pointing to the reference index value 0 in the second reference frame list through telescopic operation; otherwise, if the motion information of the co-located block pointing to the second reference frame list exists, based on the unidirectional motion information pointing to the second reference frame list, the bidirectional motion information of the reference frame pointing to the reference index value 0 in the first reference frame list and the reference frame pointing to the reference index value 0 in the second reference frame list is obtained through the telescopic operation.
Deriving a condition 5, if the frame type of the current frame where the current block is located is a B frame, determining a co-located frame of the current frame, and determining a co-located block of the current block from the co-located frame; if the co-located block does not exist or is a non-inter prediction block, deriving unidirectional zero motion information pointing to a reference frame with a reference index value of 0 in the first reference frame list; if the motion information of the co-located block pointing to the first reference frame list exists, acquiring the unidirectional motion information of the reference frame pointing to the reference index value 0 in the first reference frame list through telescopic operation based on the unidirectional motion information pointing to the first reference frame list; otherwise, if the motion information of the co-located block pointing to the second reference frame list exists, the unidirectional motion information pointing to the reference frame with the reference index value of 0 in the first reference frame list is obtained through the telescopic operation based on the unidirectional motion information pointing to the second reference frame list.
In one possible embodiment, after obtaining the available motion information (which may be unidirectional motion information or bidirectional motion information), for each available motion information (such as spatial motion information, temporal motion information, preset motion information, etc.), the available motion information may be added to the motion information candidate list in one or a combination of the following ways:
and carrying out duplicate checking treatment. For example, if the available motion information is unidirectional motion information, the unidirectional motion information is added to the motion information candidate list. If the available motion information is bidirectional motion information, the available motion information is cut into unidirectional motion information according to the attribute of the available motion information, and the cut unidirectional motion information is added into a motion information candidate list.
And (5) carrying out duplicate checking treatment. For example, if the available motion information is uni-directional motion information and the uni-directional motion information is not overlapped with the candidate motion information already existing in the motion information candidate list, the uni-directional motion information may be added to the motion information candidate list. If the unidirectional motion information is repeated with the candidate motion information, the unidirectional motion information is not added to the motion information candidate list.
If the available motion information is bidirectional motion information, the available motion information may be clipped to unidirectional motion information according to the attribute of the available motion information, and if the clipped unidirectional motion information is not repeated with candidate motion information existing in the motion information candidate list, the unidirectional motion information may be added to the motion information candidate list. If the clipped unidirectional motion information is repeated with the candidate motion information, the unidirectional motion information may not be added to the motion information candidate list.
In the duplication checking process, it is required to determine whether the unidirectional motion information is duplicated with candidate motion information already existing in the motion information candidate list, and for this process, it may be determined whether all candidate motion information already existing in the unidirectional motion information and motion information candidate list (i.e., each candidate motion information already existing) is duplicated, or it may be determined whether part of candidate motion information already existing in the unidirectional motion information and motion information candidate list (e.g., the first candidate motion information, or the last candidate motion information, or the first two candidate motion information, or the last two candidate motion information, without limitation) is duplicated.
For convenience of description, two pieces of motion information subjected to the duplication checking operation are referred to as motion information 1 and motion information 2, and when the motion information 1 is unidirectional motion information to be duplicated, the motion information 2 is candidate motion information existing in a motion information candidate list; for the duplication checking operation between the motion information 1 and the motion information 2, the following method can be adopted:
and (4) carrying out duplicate checking operation based on the List + refIdx + MV _ x + MV _ y in a duplicate checking mode 1. For example, it is checked whether the List pointed to is the same (i.e., pointing to List0, pointing to List1, or pointing to both List0 and List 1), whether refidx is the same, and whether MV is the same (i.e., whether the horizontal component of the motion vector is the same, and whether the vertical component of the motion vector is the same). For example, it is first queried whether the reference frame list pointed by motion information 1 is the same as the reference frame list pointed by motion information 2, and if not, motion information 1 and motion information 2 are not repeated. If the motion information 1 and the motion information 2 are the same, inquiring whether the refIdx of the motion information 1 is the same as the refIdx of the motion information 2, and if the motion information 1 and the motion information 2 are different, not repeating the motion information 1 and the motion information 2. And if the motion vectors are the same, inquiring whether the motion vector of the motion information 1 is the same as the motion vector of the motion information 2, if not, the motion information 1 is not repeated with the motion information 2, and if so, determining that the motion information 1 is repeated with the motion information 2.
If the reference frame List pointed to by the motion information 1 and the reference frame List pointed to by the motion information 2 are both List0, they are the same, or if the reference frame List pointed to by the motion information 1 and the reference frame List pointed to by the motion information 2 are both List1, they are the same, or if the reference frame List pointed to by the motion information 1 is List0 and the reference frame List pointed to by the motion information 2 is List1, they are different, or if the reference frame List pointed to by the motion information 1 is List1 and the reference frame List pointed to by the motion information 2 is List0, they are different, or if the reference frame List pointed to by the motion information 1 is List0 and the reference frame List pointed to by the motion information 2 is List0 and List1, they are different, or if the reference frame List pointed to by the motion information 1 is List1 and the reference frame List pointed to by the motion information 2 is List0 and List1, they are different, or if the reference frame List pointed to by the motion information 1 is List0 and List1, the reference frame List pointed to by the motion information 2 is not equal to List0 and List1, they are different, or if the reference frame index in the reference frame List1 in the reference frame List pointed to List0, the reference frame List 2 is not equal to List0, and the reference frame index of the reference frame pointed to the reference frame List 2 is List 3, and the reference frame pointed to the reference frame index of the reference frame pointed to the reference frame List 1.
Of course, the above is only a few examples of comparing reference frame lists, and is not limited thereto.
For example, if the horizontal component of the motion vector of the motion information 1 is the same as the horizontal component of the motion vector of the motion information 2, and the vertical component of the motion vector of the motion information 1 is the same as the vertical component of the motion vector of the motion information 2, it is explained that the motion vector of the motion information 1 is the same as the motion vector of the motion information 2.
Duplicate checking mode 2, duplicate checking operation is performed based on POC (i.e. frame number) + MV _ x (horizontal component of motion vector) + MV _ y (vertical component of motion vector). For example, check first whether the POC of the pointed reference frames is the same (i.e. if the POC of the reference frame pointing to the reference frame index refIdx0 in List0 is equal to the POC of the reference frame pointing to the reference frame index refIdx1 in List1, it is also determined to be the same, and the check for the unidirectional motion information and the check for the bidirectional motion information and the bidirectional motion information are both applicable); it is checked whether the MVs are the same (i.e., whether the horizontal components are the same and whether the vertical components are the same).
For example, it is first queried whether the POC of the reference frame pointed to by motion information 1 is the same as the POC of the reference frame pointed to by motion information 2, and if not, it is determined that motion information 1 and motion information 2 are not repeated. If the motion vectors are the same, it may be continuously queried whether the motion vector of the motion information 1 is the same as the motion vector of the motion information 2, if the motion vectors are different, it may be determined that the motion information 1 and the motion information 2 are not repeated, and if the motion vectors are the same, it may be determined that the motion information 1 and the motion information 2 are repeated.
POC of the pointed reference frames is the same, including: motion information 1 points to the reference frame in List0 with reference frame index refIdx0, and motion information 2 points to the reference frame in List0 with reference frame index refIdx0, and the POC of the reference frame pointed to by motion information 1 is the same as the POC of the reference frame pointed to by motion information 2. Or, motion information 1 points to the reference frame with reference frame index refIdx1 in List1, and motion information 2 points to the reference frame with reference frame index refIdx1 in List1, and POC of the reference frame pointed to by motion information 1 is the same as POC of the reference frame pointed to by motion information 2. Or, motion information 1 points to the reference frame with reference frame index refIdx0 in List0, and motion information 2 points to the reference frame with reference frame index refIdx1 in List1, and POC of the reference frame pointed to by motion information 1 is the same as POC of the reference frame pointed to by motion information 2. Or, motion information 1 points to the reference frame with reference frame index refIdx1 in List1, and motion information 2 points to the reference frame with reference frame index refIdx0 in List0, and POC of the reference frame pointed to by motion information 1 is the same as POC of the reference frame pointed to by motion information 2. Or, motion information 1 points to the reference frame in List0 with reference to frame index refIdx0, points to the reference frame in List1 with reference to frame index refIdx1, motion information 2 points to the reference frame in List0 with reference to frame index refIdx2, points to the reference frame in List1 with reference to frame index refIdx3, POC of the reference frame in List0 with reference to frame index refIdx0 pointed to by motion information 1 is the same as POC of the reference frame in List1 with reference to frame index refIdx3 pointed to by motion information 2, and POC of the reference frame in List1 with reference to frame index refIdx1 pointed to by motion information 1 is the same as POC of the reference frame in List0 with reference to frame index refIdx2 pointed to by motion information 2. Of course, the above is only an example that the POC of the reference frame is the same, and no limitation is made to this.
The above process is to check the POC of the reference frame, and it should be noted that the POC of the reference frame is only an example of the check operation, and other attributes capable of confirming whether the reference frame is the same, such as DOC (decoding order flag) of the reference frame, may be adopted besides the POC, and the present invention is not limited thereto. In summary, POC may be replaced with DOC.
And (4) carrying out duplicate checking operation for the knowledge base frame based on the pointed reference frame in a duplicate checking mode 3. If the reference frame pointed by the motion information 1 is a knowledge base frame and the reference frame pointed by the motion information 2 is a non-knowledge base frame, determining that the reference frame pointed by the motion information 1 is different from the reference frame pointed by the motion information 2, and determining that the motion information 1 and the motion information 2 are not repeated. Or, if the reference frame pointed by the motion information 1 is a non-knowledge base frame and the reference frame pointed by the motion information 2 is a knowledge base frame, determining that the reference frame pointed by the motion information 1 is different from the reference frame pointed by the motion information 2, and determining that the motion information 1 and the motion information 2 are not repeated.
If the reference frame pointed to by the motion information 1 and the reference frame pointed to by the motion information 2 are both non-knowledgebase frames, comparing whether the POC of the reference frame pointed to by the motion information 1 is the same as the POC of the reference frame pointed to by the motion information 2. If not, determining that the reference frame pointed by the motion information 1 is different from the reference frame pointed by the motion information 2, and determining that the motion information 1 and the motion information 2 are not repeated. If so, determining that the reference frame pointed by the motion information 1 is the same as the reference frame pointed by the motion information 2, continuously inquiring whether the motion vector of the motion information 1 is the same as the motion vector of the motion information 2, if not, determining that the motion information 1 is not repeated with the motion information 2, and if so, determining that the motion information 1 is repeated with the motion information 2.
If the reference frame pointed by the motion information 1 and the reference frame pointed by the motion information 2 are both non-knowledge base frames, the duplicate checking method 1 or the duplicate checking method 2 can be adopted for duplicate checking, and the duplicate checking process is not repeated.
If the reference frame pointed by the motion information 1 and the reference frame pointed by the motion information 2 are both knowledge base frames, comparing whether the knowledge base frame index of the reference frame pointed by the motion information 1 is equal to the knowledge base frame index of the reference frame pointed by the motion information 2, if not, determining that the reference frame pointed by the motion information 1 is different from the reference frame pointed by the motion information 2, and determining that the motion information 1 and the motion information 2 are not repeated. If so, determining that the reference frame pointed by the motion information 1 is the same as the reference frame pointed by the motion information 2, continuously inquiring whether the motion vector of the motion information 1 is the same as the motion vector of the motion information 2, if not, determining that the motion information 1 is not repeated with the motion information 2, and if so, determining that the motion information 1 is repeated with the motion information 2.
The knowledge base frame index refers to: when there are multiple knowledge base frames, each knowledge base frame has a unique index, e.g., the index of the first knowledge base frame is 0, the index of the second knowledge base frame is 1, and so on. Based on this, when the knowledge base frame indexes are equal, it means that the two knowledge base frames are the same frame, and when the knowledge base frame indexes are not equal, it means that the two knowledge base frames are not the same frame.
In one possible implementation, the POC of the knowledge base frame (similar to the long-term reference frame) is set to (POC-1 of the current frame), so when determining whether two reference frames are the same frame, the case of the knowledge base frame can be considered, that is, the duplication formula 3 is adopted to determine whether the reference frame pointed to by the motion information 1 is the same as the reference frame pointed to by the motion information 2.
Illustratively, two motion information (e.g., both are unidirectional motion information, such as motion information 1 and motion information 2) are not repeated if they satisfy one or more of the following conditions; otherwise the two motion information are repeated: a) One reference frame is a knowledge base frame, and the other reference frame is a non-knowledge base frame; b) The two motion information points to List0, the motion vectors are not equal or the reference frames POC are not equal; c) The two pieces of motion information both point to List1, and the motion vectors are not equal or the POCs of the reference frames are not equal; d) One motion information points to List0 and the other motion information points to List1, the motion vectors are not equal or the reference frames POC are not equal.
For example, the following method can be used to determine whether the reference frames are the same: two reference frames are different if they satisfy one or more of the following conditions; otherwise the two reference frames are the same. a) One reference frame is a non-knowledge base frame (also referred to as a non-knowledge base image or a non-knowledge image), and the other reference frame is a knowledge base frame (also referred to as a knowledge base image or a knowledge image); b) The two reference frames are non-knowledge base frames, and the POCs of the reference images corresponding to the two reference frames are not equal; c) Both reference frames are knowledge base frames, and the corresponding knowledge base frame indexes (i.e. knowledge picture indexes) of the two reference frames are not equal.
Illustratively, two motion information are not repeated if they satisfy one or more of the following conditions, otherwise they are repeated: the reference frames of the two motion information are different; the motion vectors corresponding to the two pieces of motion information are not equal.
In one possible implementation, the motion information candidate list may be obtained by using spatial motion information and/or temporal motion information, for example, awwpunarray, and the process of obtaining the motion information candidate list is described below with reference to several specific application scenarios. In a subsequent application scenario, assuming that the length of the motion information candidate list is X, that is, X pieces of available motion information need to be added, after the available motion information is added to the motion information candidate list, the added motion information is referred to as candidate motion information.
Application scenario 1: and adding the time domain motion information into the motion information candidate list, if the length of the list is equal to X, ending the adding process, and if the length of the list is less than X, adding the spatial domain motion information into the motion information candidate list until the length of the list is X. For example, if the list length is X-1 after adding the temporal motion information, one spatial motion information is added, and if the list length is X-2 after adding the temporal motion information, two pieces of motion information are added, and so on.
For each available motion information, when the available motion information is added to the motion information candidate list, a duplicate checking operation may be performed or may not be performed. If the duplication checking operation is performed on the unidirectional motion information and the candidate motion information existing in the motion information candidate list, the duplication checking operation may be performed by adopting the duplication checking method 1, the duplication checking method 2 or the duplication checking method 3.
Application scenario 2: adding the temporal motion information and the spatial motion information into a motion information candidate list (the spatial motion information may be located before the temporal motion information, or the temporal motion information may also be located before the spatial motion information, for convenience of description, the temporal motion information is located before the spatial motion information is taken as an example in the following, sequentially adding each piece of motion information into the motion information candidate list according to the sequence of the temporal motion information and the spatial motion information, if the length of the list is equal to X, ending the adding process, and if the length of the list is less than X, adding preset motion information into the motion information candidate list until the length of the list is X.
Illustratively, the available motion information is added to the motion information candidate list in the order of temporal motion information (i.e., available motion information), available motion information in F, G, C, a, B, D (i.e., spatial motion information). For each available motion information, when the available motion information is added to the motion information candidate list, a duplicate checking operation may be performed or may not be performed. If the duplication checking operation is performed on the unidirectional motion information and the candidate motion information already existing in the motion information candidate list, the duplication checking operation may be performed by adopting the duplication checking method 1, the duplication checking method 2 or the duplication checking method 3.
In summary, based on the order of temporal motion information and spatial motion information, the temporal motion information and the spatial motion information may be added to the motion information candidate list together until the list length is equal to X, or the traversal is finished, the list length is smaller than X, and the preset motion information is added to the motion information candidate list until the list length is X.
Application scenario 3: adding the time domain motion information into a motion information candidate list, and reserving at least Y positions for the spatial domain motion information after adding the time domain motion information into the motion information candidate list, wherein the time domain motion information is bidirectional motion information or unidirectional motion information. Illustratively, adding the temporal motion information into the motion information candidate list, and ending the adding process of the temporal motion information if the length of the list is equal to X-Y, or ending the adding process of the temporal motion information until the traversal of the temporal motion information is ended, wherein the length of the list is smaller than X-Y. And then adding the spatial domain motion information into a motion information candidate list, if the length of the list is equal to X, ending the adding process of the spatial domain motion information, or ending the adding process of the spatial domain motion information until the traversal of the spatial domain motion information is ended, wherein the length of the list is less than X, and adding preset motion information into the motion information candidate list until the length of the list is X.
In each application scenario, X may take any positive integer, for example, X may take a value of 4,5, and the like.
In each application scenario, it is possible to add preset motion information (which may also be referred to as default motion information) to the motion information candidate list, and implementation manners of the preset motion information may include, but are not limited to, the following manners:
preset motion information 1: zero motion information, such as a zero motion vector that points to ListX and refIdx is less than the number of reference frames in ListX. For example, a 0-complement operation may be performed, i.e., the motion information may be (0,0,ref u idx3,listz).
Preset motion information 2: default motion information derived based on candidate motion information already present in the motion information candidate list. For example, let the absolute value of the x-axis direction or the y-axis direction that needs to be enlarged or reduced be temp _ val, and the result is result:
1. if temp _ val <8, result =8, or result = -8.
For example, if temp _ val in the x-axis direction of the candidate motion information is smaller than 8, the motion vector in the x-axis direction of the default motion information is 8, or the motion vector in the x-axis direction of the default motion information is-8.
If temp _ val in the y-axis direction of the candidate motion information is smaller than 8, the motion vector in the y-axis direction of the default motion information is 8, or the motion vector in the y-axis direction of the default motion information is-8.
2. Assuming that 1 is not satisfied, if temp _ val < =64, result = (temp _ val + 5+ 2) > >2, or result = (temp _ val + 3+ 2) > >2, the sign is the same as the sign of the motion vector of the candidate motion information.
Illustratively, if the motion vector in the x-axis direction of the candidate motion information is positive and the absolute value of the motion vector in the x-axis direction (temp _ val) is less than or equal to 64, the motion vector in the x-axis direction of the default motion information is (temp _ val + 5+ 2) > >2, and if the motion vector in the x-axis direction of the candidate motion information is negative and the absolute value of the motion vector in the x-axis direction (temp _ val) is less than or equal to 64, the motion vector in the x-axis direction of the default motion information is result = (temp _ val + 3+ 2) >2.
The y-axis direction motion vector for the default motion information is similar to the x-axis direction motion vector.
3. Assuming that 1 and 2 are not satisfied, if temp _ val < =128, result = (temp _ val + 9+ 4) > >3, or result = (temp _ val + 7+ 4) > >3, the sign is the same as the sign of the motion vector of the candidate motion information.
4. Assuming that 1, 2, and 3 are not satisfied, result = (temp _ val + 33+ 16) > >5, or result = (temp _ val + 31+ 16) > >5, with the same sign as the sign of the motion vector of the candidate motion information.
Preset motion information 3: default motion information derived based on candidate motion information already present in the motion information candidate list. For example, based on any one of the valid candidate motion information (x, y, ref _ idx, listX) in the motion information candidate list, ref _ idx and ListX are respectively the reference frame index and the reference frame list, and both are collectively referred to as reference frame information, at least one of the following motion information may be added: (x + a, y + b, ref _ idx, listX), a and b can be any integer; (k 1 x, k1 y, ref _ idx _ new1, listX), where k1 is any positive integer other than 0, i.e., performing a scaling operation on the motion vector; (k 2 x, k2 y, ref _ idx _ new2, listY), where k2 is any positive integer other than 0, i.e. the motion vector is scaled.
Preset motion information 4: the preset motion information is the candidate motion information already existing in the motion information candidate list, that is, performing an extending (padding) operation, and performing a repeated padding operation by using the candidate motion information already existing in the motion information candidate list. For example, the last uni-directional motion information already present in the motion information candidate list may be used for the re-fill.
In summary, when the list length is smaller than X and the preset motion information needs to be added to the motion information candidate list, the preset motion information 1 may be added to the motion information candidate list until the list length is X or the addition is finished. Alternatively, the preset motion information 2 may be added to the motion information candidate list until the list length is X or the addition is finished. Alternatively, the preset motion information 3 may be added to the motion information candidate list until the list length is X or the addition is finished. Alternatively, the preset motion information 1 and the preset motion information 2 may be added to the motion information candidate list until the list length is X or the addition is finished. Alternatively, the preset motion information 1 and the preset motion information 3 may be added to the motion information candidate list until the list length is X or the addition is finished. Alternatively, the preset motion information 2 and the preset motion information 3 may be added to the motion information candidate list until the list length is X or the addition is finished. Alternatively, the preset motion information 1, the preset motion information 2, and the preset motion information 3 may be added to the motion information candidate list until the list length is X or the addition is finished.
For example, after adding the preset motion information to the motion information candidate list in the above manner, if the list length is still smaller than X, the preset motion information 4 may be added to the motion information candidate list, that is, the filling operation is repeated by using the candidate motion information already existing in the motion information candidate list until the list length is X.
In another possible implementation, when the length of the list is smaller than X and the preset motion information needs to be added to the motion information candidate list, the preset motion information 4 may be directly added to the motion information candidate list, that is, the filling operation is repeated by using the candidate motion information already existing in the motion information candidate list until the length of the list is X.
In the above embodiment, the preset motion information may be unidirectional motion information or bidirectional motion information. If the preset motion information is unidirectional motion information, when the preset motion information is added to the motion information candidate list, a duplicate checking operation may be performed or may not be performed. And if the result of the duplication checking operation is not repeated, adding the preset motion information into the motion information candidate list. And if the result of the duplication checking operation is duplication, not adding the preset motion information to the motion information candidate list.
Application scenario 4: in a first step, F, G, C, A, B and D are neighboring prediction blocks of the current block, and the "availability" of F, G, C, A and D is determined. And secondly, putting the available motion information into a motion information candidate list according to the sequence of the time domain motion information, F, G, C, A, B and D until the length of the motion information candidate list is 5 or the traversal is finished.
And if the available motion information is unidirectional motion information, performing duplicate checking operation on the available motion information and candidate motion information already existing in the motion information candidate list, and if the available motion information is not repeated, putting the available motion information and the candidate motion information into the motion information candidate list. Otherwise, the bidirectional motion information is cut into unidirectional motion information according to the odd-even attribute of the number (namely the traversal sequence number) of the available motion information, then the unidirectional motion information and the candidate motion information which already exists in the motion information candidate list are subjected to duplication checking operation, and if the unidirectional motion information and the candidate motion information are not duplicated, the unidirectional motion information and the candidate motion information are put into the motion information candidate list. For example, if the number is even, the bidirectional motion information is clipped to unidirectional motion information pointing to the reference frame List0, and if the number is odd, the bidirectional motion information is clipped to unidirectional motion information pointing to the reference frame List 1.
And thirdly, if the length of the motion information candidate list is less than 5, sequentially generating four pieces of motion information, wherein the reference frame information of the generated four pieces of motion information is the same as the reference frame information of the first unidirectional motion information in the motion information candidate list. Recording the motion vector of the first unidirectional motion information in the motion information candidate list as (x, y), wherein the motion vectors corresponding to the generated four motion information are (x 0, y 0), (x 1, y 1), (x 2, y 2), (x 3, y 3), and sequentially adding the newly generated motion information into the motion information candidate list until the length of the motion information candidate list is 5, and calculating the four motion information as follows:
x0=abs(x)<88:(abs(x)<=64?((abs(x)*5+2)>>2):(abs(x)<=128?((abs(x)*9+4)>>3):((abs(x)*33+16)>>5)))
x0=(x<0)?-x0:x0
y0=y
x1=x
y1=abs(y)<88:(abs(y)<=64?((abs(y)*5+2)>>2):(abs(y)<=128?((abs(y)*9+4)>>3):((abs(y)*33+16)>>5)))
y1=(y<0)?-y1:y1
x2=abs(x)<88:(abs(x)<=64?((abs(x)*3+2)>>2):(abs(x)<=128?((abs(x)*7+4)>>3):((abs(x)*31+16)>>5)))
x2=(x<0)?-x2:x2
x2=abs(x)<8?-x2:x2
y2=y
x3=x
y3=abs(y)<88:(abs(y)<=64?((abs(y)*3+2)>>2):(abs(y)<=128?((abs(y)*7+4)>>3):((abs(y)*31+16)>>5)))
y3=(y<0)?-y3:y3
y3=abs(y)<8?-y3:y3
Is there a : representing a trinocular operator, also known as a conditional operator, is an operator with 3 operands. For example, AB: c is a three-purpose operator as a whole, a is a condition, B is an operation in which the condition is satisfied, and C is an operation in which the condition is not satisfied.
And fourthly, assigning one single motion information of AwpCandIdx0+1 motion candidates in the motion information candidate list to mvAwp0L0, mvAwp0L1, refIdxAwp0L0 and RefIdxAwp0L1.
And fifthly, assigning one single motion information of the AwpCandIdx1+1 motion candidates in the motion information candidate list to mvAwp1L0, mvAwp1L1, refIdxAwp1L0 and RefIdxAwp1L1.
The fourth step and the fifth step are processes of determining target motion information (mvAwp 0L0, mvAwp0L1, refIdxAwp0L0, refIdxAwp0L1, and mvAwp1L0, mvAwp1L1, refIdxAwp1L0, and RefIdxAwp1L1 are target motion information) based on the motion information candidate list, and the determination processes are referred to subsequent embodiments and will not be described herein again.
In the above-described embodiment, the length of the motion information candidate list may be determined based on a high level syntax indicating the length of the motion information candidate list, the length of the motion information candidate list indicating the maximum number of candidate motion information in the motion information candidate list. The high level syntax may be sequence level control information, frame level control information, slice level control information, tile level control information, patch level control information, CTU level control information, LCU level control information, block level control information, CU level control information, PU level control information, etc., without limitation, for example, the length of the motion information candidate list is controlled by sequence level syntax awp _ cand _ list _ length _ num. See table 5 for an example of the sequence level syntax, awp _ cand _ list _ length _ num. The awp _ enable _ flag represents an angular weighted prediction mode permission flag, is a binary variable, and has a value of 1 to represent that an angular weighted prediction mode is used; a value of 0 indicates that no angular weighted prediction mode is used. The value of AwpEnableFlag is equal to the value of awp _ enable _ flag, which is 0 if not present in the bitstream. The length of the motion information candidate list for the angular weighted prediction mode is denoted by awp _ cand _ list _ length _ minus2, the value of awp candlistlength minus2 is equal to awp _ cand _ list _ length _ minus2, the value of awp _ cand _ list _ length _ minus2 may range from 0 to 3, and the value of awp cand _ list _ length _ minus2 is 0 if it is not present in the bitstream.
TABLE 5
Figure GDA0003895886610000421
Example 12: for embodiments 1 to 3, after obtaining the motion information candidate list, the encoding end/the decoding end may obtain the first target motion information and the second target motion information based on the motion information candidate list. For example, one candidate motion information may be selected as the first target motion information and another candidate motion information may be selected as the second target motion information based on the motion information candidate list. Alternatively, one candidate motion information (i.e. as first original motion information) may be selected on the basis of the motion information candidate list, superimposed on the first motion vector difference, resulting in first target motion information, and one candidate motion information (i.e. as second original motion information) may be selected, superimposed on the second motion vector difference, resulting in second target motion information. Illustratively, regarding the manner of obtaining the first object motion information and the second object motion information, the following manner may be adopted:
the method A includes that if the frame type of a current frame where a current block is located is a P frame, one candidate motion information is selected from a motion information candidate list to serve as first target motion information of the current block, and another candidate motion information is selected from the motion information candidate list to serve as second target motion information of the current block. For example, if the frame type of the current frame where the current block is located is a P frame, the AWP _ MVR mode is not started for the current block (see the following embodiments for the content of the AWP _ MVR mode), and on this basis, one candidate motion information is directly selected from the motion information candidate list as the first target motion information of the current block, and another candidate motion information is selected from the motion information candidate list as the second target motion information of the current block.
For example, for both the encoding end and the decoding end, the motion information candidate list may be obtained, and the motion information candidate list of the encoding end is the same as the motion information candidate list of the decoding end, which is not limited to this.
For the encoding end, based on the rate distortion principle, one candidate motion information may be selected from the motion information candidate list as the first target motion information of the current block, and another candidate motion information may be selected from the motion information candidate list as the second target motion information of the current block, where the first target motion information is different from the second target motion information, and this is not limited.
In a possible implementation manner, when the encoding end sends the encoded bitstream to the decoding end, the encoded bitstream may carry indication information a and indication information b, where the indication information a is used to indicate an index value 1 of the first target motion information of the current block, and the index value 1 indicates that the first target motion information is the several candidate motion information in the motion information candidate list. The indication information b is used to indicate an index value 2 of the second target motion information of the current block, and the index value 2 indicates that the second target motion information is the second candidate motion information in the motion information candidate list. Illustratively, index value 1 and index value 2 may be different.
After receiving the coded bit stream, the decoding end analyzes the indication information a and the indication information b from the coded bit stream. Based on the indication information a, the decoding end selects candidate motion information corresponding to the index value 1 from the motion information candidate list, and the candidate motion information is used as the first target motion information of the current block. Based on the indication information b, the decoding end selects candidate motion information corresponding to the index value 2 from the motion information candidate list, and the candidate motion information is used as second target motion information of the current block.
In another possible implementation, when the encoding end sends the encoded bitstream to the decoding end, the encoded bitstream may carry indication information a and indication information c, where the indication information a may be used to indicate an index value 1 of the first target motion information of the current block, and the index value 1 indicates that the first target motion information is the several candidate motion information in the motion information candidate list. The indication information c may be used to indicate a difference value between an index value 2 and an index value 1, where the index value 2 indicates that the second target motion information is the second candidate motion information in the motion information candidate list. Illustratively, index value 1 and index value 2 may be different.
After receiving the coded bit stream, the decoding end may parse the indication information a and the indication information c from the coded bit stream. Based on the indication information a, the decoding end may select candidate motion information corresponding to the index value 1 from the motion information candidate list, which is the first target motion information of the current block. Based on the indication information c, the decoding end determines an index value 2 according to a difference value between the index value 2 and the index value 1, and then the decoding end may select candidate motion information corresponding to the index value 2 from the motion information candidate list, where the candidate motion information is used as second target motion information of the current block.
For example, the indication information of the first target motion information and the indication information of the second target motion information may be interchanged, and the encoding end and the decoding end may be identical, where the interchange of the indication information does not affect the parsing process, that is, there is no parsing dependency. The indication information of the first target motion information and the indication information of the second target motion information cannot be equal, if two index values are encoded, the value of the index value a is 1, the value of the index value b is 3, when the index value a is encoded first, the index value b can be encoded by 2 (3-1), and when the index value b is encoded first, the index value b needs to be encoded by 3. In summary, the indication information with a small index value is encoded first, so that the encoding cost of a large index value can be reduced. For example, the indication information of the first object motion information, such as the index value a, is encoded first, and then the indication information of the second object motion information, such as the index value b, is encoded. It is also possible to encode the indication information of the second object motion information, such as the index value b, first and then encode the indication information of the first object motion information, such as the index value a. For example, if the index value a is 1 and the index value b is 3, the index value a is encoded first and then the index value b is encoded. For another example, if the index value b is 1 and the index value a is 3, the index value b is encoded first and then the index value a is encoded.
Mode B, if the frame type of the current frame where the current block is located is a B frame, selecting candidate motion information from a motion information candidate list as first original motion information of the current block, and selecting candidate motion information from the motion information candidate list as second original motion information of the current block, wherein the first original motion information and the second original motion information can be different, namely selecting two different candidate motion information from the motion information candidate list as the first original motion information and the second original motion information; alternatively, the first original motion information and the second original motion information may be the same, that is, the same candidate motion information is selected from the motion information candidate list as the first original motion information and the second original motion information. Then, first target motion information of the current block may be determined according to the first original motion information, and second target motion information of the current block may be determined according to the second original motion information, the first target motion information being different from the second target motion information. For example, if the frame type of the current frame where the current block is located is a B frame, an AWP _ MVR mode is started for the current block, and when the AWP _ MVR mode is started for the current block, the first target motion information of the current block and the second target motion information of the current block may be obtained in a mode B.
In one possible implementation, if the high level syntax allows the current block to start the AWP _ MVR mode (i.e. the weighted prediction motion vector modification mode), the method B is adopted to obtain the first target motion information and the second target motion information, i.e. to select the first original motion information and the second original motion information from the motion information candidate list, to determine the first target motion information based on the first original motion information, and to determine the second target motion information based on the second original motion information. If the high-level syntax does not allow the current block to start the AWP _ MVR mode, acquiring first target motion information and second target motion information by adopting a mode A, namely directly selecting the first target motion information and the second target motion information from a motion information candidate list. Illustratively, the high level syntax may be sequence level control information, frame level control information, slice level control information, tile level control information, patch level control information, CTU level control information, LCU level control information, block level control information, CU level control information, PU level control information, etc., without limitation. If the frame type of the current frame where the current block is located is a B frame, an AWP _ MVR mode is allowed to be started for the current block, and if the frame type of the current frame where the current block is located is a P frame, the AWP _ MVR mode is not allowed to be started for the current block.
In the following embodiments, a process flow of starting the AWP _ MVR mode for the current block will be described as an example.
As to how to determine the target motion information according to the original motion information, a scheme of superimposing motion vector differences by using one-way motion information, which may be referred to as an angle weighted prediction motion vector modification mode (AWP _ MVR mode), is provided in this embodiment, for example, the first original motion information includes a first original motion vector, the first target motion information includes a first target motion vector, the second original motion information includes a second original motion vector, and the second target motion information includes a second target motion vector. Acquiring a first motion vector difference (i.e., MVD) corresponding to the first original motion vector; a first target motion vector is determined based on the first motion vector difference and the first original motion vector (the sum of the first motion vector difference and the first original motion vector being the first target motion vector). Acquiring a second motion vector difference corresponding to a second original motion vector; a second target motion vector is determined based on the second motion vector difference and the second original motion vector (the sum of the second motion vector difference and the second original motion vector is the second target motion vector).
For example, when determining the first target motion vector, the first motion vector difference may not be superimposed, that is, the first original motion vector may be determined as the first target motion vector. However, in determining the second target motion vector, the second motion vector difference may be superimposed, i.e. the second target motion vector is determined based on the second motion vector difference and the second original motion vector. Alternatively, the first and second electrodes may be,
when determining the second target motion vector, the second original motion vector may be determined as the second target motion vector without superimposing the second motion vector difference. However, in determining the first target motion vector, the first motion vector difference may be superimposed, i.e. the first target motion vector may be determined on the basis of the first motion vector difference and the first original motion vector. Alternatively, the first and second electrodes may be,
in determining the first target motion vector, the first motion vector difference may be superimposed, i.e. the first target motion vector is determined based on the first motion vector difference and the first original motion vector. In determining the second target motion vector, the second motion vector difference may be superimposed, i.e. the second target motion vector is determined based on the second motion vector difference and the second original motion vector.
Illustratively, direction information and magnitude information of the first motion vector difference may be obtained, and the first motion vector difference may be determined based on the direction information and magnitude information of the first motion vector difference. And may obtain direction information and magnitude information of the second motion vector difference, and determine the second motion vector difference based on the direction information and magnitude information of the second motion vector difference.
Illustratively, for the decoding end, the direction information of the first motion vector difference may be obtained as follows: the decoding end parses the direction information of the first motion vector difference from the encoded bitstream of the current block. The direction information of the second motion vector difference may be obtained as follows: the decoding end parses the direction information of the second motion vector difference from the encoded bitstream of the current block.
Illustratively, for the decoding side, the amplitude information of the first motion vector difference may be obtained as follows: the decoding end analyzes the amplitude information of the first motion vector difference from the coded bit stream of the current block. The amplitude information of the second motion vector difference may be obtained as follows: the decoding end parses the magnitude information of the second motion vector difference from the encoded bitstream of the current block.
In a possible implementation manner, the encoding side and the decoding side may agree on direction information and magnitude information of the motion vector difference, and if the direction information indicates that the direction is to the right and the magnitude information indicates that the magnitude is a, the motion vector difference is (a, 0); if the direction information indicates that the direction is downward and the amplitude information indicates that the amplitude is A, the motion vector difference is (0, -A); if the direction information indicates that the direction is towards the left and the amplitude information indicates that the amplitude is A, the motion vector difference is (-A, 0); if the direction information indicates that the direction is upward and the amplitude information indicates that the amplitude is A, the motion vector difference is (0, A); if the direction information indicates that the direction is upward right and the amplitude information indicates that the amplitude is A, the motion vector difference is (A, A); if the direction information indicates that the direction is upward left and the amplitude information indicates that the amplitude is A, the motion vector difference is (-A, A); if the direction information indicates that the direction is left and down and the amplitude information indicates that the amplitude is A, the motion vector difference is (-A, -A); if the direction information indicates that the direction is downward to the right and the magnitude information indicates that the magnitude is a, the motion vector difference is (a, -a). Of course, the above are only a few examples, and the direction information and the magnitude information are not limited.
Illustratively, the magnitude a represents a set of values from which the magnitude of the actual motion vector difference can be selected, e.g. the magnitude a represents a set of values (1, 2,4,8, 16) from which the magnitude of the motion vector difference can be selected, i.e. the selected magnitude of the motion vector difference can be 1,2,4,8, 16.
For example, the motion vector difference may support part or all of the direction information, and a value range of the amplitude a supported by the motion vector difference may be configured according to experience, and is at least one value, which is not limited herein. If the motion vector difference supports up, down, left, right, etc. directions, the motion vector difference supports the following 5 types of step configuration: 1/4-pel,1/2-pel,1-pel,2-pel,4-pel, i.e. the value of the amplitude A is 1,2,4,8, 16. In summary, when the direction is upward, the motion vector difference may be (0, 1), (0, 2), (0, 4), (0, 8), (0, 16). The motion vector difference may be (0, -1), (0, -2), (0, -4), (0, -8), (0, -16) when the direction is downward. When the direction is to the left, the motion vector difference may be (-1, 0), (-2, 0), (-4, 0), (-8, 0), (-16, 0). When the direction is rightward, the motion vector difference may be (1, 0), (2, 0), (4, 0), (8, 0), (16, 0).
For another example, the motion vector difference supports up, down, left, right, etc. directions, and the motion vector difference supports the following 6 types of step configurations: 1/4-pel,1/2-pel,1-pel,2-pel,3-pel,4-pel, i.e. the amplitude A can take values of 1,2,4,8, 12, 16.
For another example, the motion vector difference supports eight directions, i.e., up, down, left, right, up-left, down-left, up-right, down-right, etc., and the motion vector difference supports the following 3 types of step configurations: 1/4-pel,1/2-pel,1-pel, i.e. the amplitude A can take on a value of 1,2,4.
For another example, the motion vector difference supports four directions, i.e., up, down, left, and right, and the motion vector difference supports the following 4 types of step configurations: the value of 1/4-pel,1/2-pel,1-pel,2-pel, i.e. the amplitude A, can be 1,2,4,8.
Of course, the above description is given only by way of example and not limitation. For example, the direction supported by the motion vector difference may be arbitrarily selected, and six directions, i.e., up, down, left, right, up-left, down-left, etc., may be supported, or two directions, i.e., up, down, etc., may be supported. For another example, the step configuration supported by the motion vector difference is variable, and flexible configuration is possible. For another example, the step size configuration may be adaptively configured according to coding parameters such as quantization parameter QP, for example, 1-pel,2-pel,4-pel,8-pel for larger QP and 1/4-pel,1/2-pel,1-pel,2-pel for smaller QP. For example, the decoding end may perform the decoding operation according to the step configurations analyzed at the sequence level, the picture level, the frame level, the Slice level, the tile level, the patch level, and the CTU level.
For convenience of description, in the subsequent embodiment, assuming that the motion vector difference supports the up and down equal directions, supports the 1-pel,2-pel equal step size configuration, and is described in terms of 1/4-pel precision, the motion vector difference may be (0, 4), (0, 8), (0, -4), (0, -8), i.e., (0, 1< < 2), (0, 1< < 3), (0, -1< < 2), (0, -1< < 3).
For a coding end, after a motion information candidate list is obtained, sequentially traversing each candidate motion information combination in the motion information candidate list, wherein the candidate motion information combination comprises two candidate motion information, one candidate motion information is used as first original motion information, and the other candidate motion information is used as second original motion information. It should be noted that the first original motion information and the second original motion information may be the same (i.e. the two candidate motion information selected from the motion information candidate list are the same) or different. If the first original motion information is the same as the second original motion information, it is possible to ensure that the first target motion information is different from the second target motion information by superimposing different motion vector differences. For each candidate motion information combination, sequentially traversing a motion vector difference combination, the motion vector difference combination comprising a first motion vector difference and a second motion vector difference, the first motion vector difference and the second motion vector difference may be the same or different. For example, there are two motion vector differences, which are motion vector difference 1 and motion vector difference 2, motion vector difference combination 1 is motion vector difference 1 and motion vector difference 1, motion vector difference combination 2 is motion vector difference 1 (i.e., the first motion vector difference) and motion vector difference 2, motion vector difference combination 3 is motion vector difference 2 (i.e., the first motion vector difference) and motion vector difference 1, and motion vector difference combination 4 is motion vector difference 2 and motion vector difference 2.
For example, for the candidate motion information combination and the motion vector difference combination currently traversed, if the first original motion information is different from the second original motion information, the first motion vector difference and the second motion vector difference may be the same or different. The first motion vector difference and the second motion vector difference may be different if the first original motion information is the same as the second original motion information.
And aiming at the candidate motion information combination and the motion vector difference combination which are traversed currently, taking the sum of the motion vector of the first original motion information and the first motion vector difference as a first target motion vector, taking the sum of the motion vector of the second original motion information and the second motion vector difference as a second target motion vector, determining the rate distortion cost value based on the first target motion vector and the second target motion vector, and not limiting the determination mode. And performing the processing on each candidate motion information combination and each motion vector difference combination to obtain the rate distortion cost value. Then, a minimum rate distortion cost value is selected from all the rate distortion cost values, and information of a candidate motion information combination (first original motion information and second original motion information) and information of a motion vector difference combination (first motion vector difference and second motion vector difference) corresponding to the minimum rate distortion cost value are encoded in the encoded bitstream of the current block.
For example, an index value of first original motion information in a motion information candidate list corresponding to a minimum rate distortion cost value, an index value of second original motion information in the motion information candidate list corresponding to the minimum rate distortion cost value, direction information and magnitude information of a first motion vector difference corresponding to the minimum rate distortion cost value, and direction information and magnitude information of a second motion vector difference corresponding to the minimum rate distortion cost value are encoded in an encoded bitstream of the current block. For example, for the direction information of the first motion vector difference or the direction information of the second motion vector difference, the indication information of the direction information may be 0 for indicating the first direction in the direction list. For the magnitude information of the first motion vector difference or the magnitude information of the second motion vector difference, the indication information of the magnitude information may be 0, indicating the first step configuration in the step configuration list.
For example, if the motion vector difference supports four directions, i.e., up, down, left, and right, and the motion vector difference supports 5 types of step configurations, i.e., 1/4-pel,1/2-pel,1-pel,2-pel, and 4-pel, then the direction information of the motion vector difference can be encoded by using 2bin length-fixed codes (4 types of values in total), and 4 values of the 2bin length-fixed codes respectively represent four directions, i.e., up, down, left, and right. The amplitude information of the motion vector difference can be encoded by using a truncated unary code, i.e. 5 types of step size configuration are represented by the truncated unary code.
For example, if the motion vector difference supports four directions of up, down, left, right, and the like, and the motion vector difference supports 6 types of step size arrangement such as 1/4-pel,1/2-pel,1-pel,2-pel,3-pel,4-pel, and the like, the direction information of the motion vector difference can be encoded using 2bin length-fixed codes (4 types of values in total), and the magnitude information of the motion vector difference can be encoded using a truncated unary code.
For example, if the motion vector difference supports eight directions, i.e., up, down, left, right, up-left, down-left, up-right, down-right, etc., and the motion vector difference supports 3 types of step size arrangements, i.e., 1/4-pel,1/2-pel,1-pel, etc., the direction information of the motion vector difference may be encoded using 3bin length-fixed codes (total 8 types of values), and the magnitude information of the motion vector difference may be encoded using truncated unary codes.
For example, if the motion vector difference supports four directions of up, down, left, right, and the like, and the motion vector difference supports 4 types of step size arrangement such as 1/4-pel,1/2-pel,1-pel,2-pel, and the like, based on this, the direction information of the motion vector difference can be encoded using a truncated unary code, and the magnitude information of the motion vector difference can be encoded using a 2bin fixed length code (4 types of values in total).
Of course, the above are only a few examples of the encoding method, and the encoding method is not limited thereto.
To sum up, for the encoding end, the optimal motion vector (i.e., the target motion vector) may be searched in a certain area, and then the difference between the optimal motion vector and the original motion vector is used as the Motion Vector Difference (MVD), and the magnitude information and the direction information of the motion vector difference are encoded into the code stream. When searching for the optimal motion vector in a certain region, the encoding end needs to stipulate the direction and magnitude of the motion vector difference, i.e. search for the optimal motion vector within a limited range of motion vector differences such as (A, 0), (0, -A), (-A, 0), (0, A), (A, A), (-A, A), (-A, -A), (A, -A), etc.
For the decoding end, after receiving the coded bit stream of the current block, the decoding end may parse the index value of the first original motion information in the motion information candidate list from the coded bit stream, select the candidate motion information corresponding to the index value from the motion information candidate list, and use the candidate motion information as the first original motion information of the current block. The decoding end may parse the index value of the second original motion information in the motion information candidate list from the encoded bitstream, select candidate motion information corresponding to the index value from the motion information candidate list, and use the candidate motion information as the second original motion information of the current block.
The decoding end may further parse direction information and magnitude information of the first motion vector difference from the encoded bitstream, and determine the first motion vector difference according to the direction information and the magnitude information. And parsing direction information and magnitude information of the second motion vector difference from the encoded bitstream, and determining the second motion vector difference based on the direction information and the magnitude information.
Then, the decoding end may determine first target motion information of the current block according to the first motion vector difference and the first original motion information, and determine second target motion information of the current block according to the second motion vector difference and the second original motion information.
Illustratively, when determining the first motion vector difference based on the direction information of the first motion vector difference and the magnitude information of the first motion vector difference, if the magnitude information of the first motion vector difference indicates a magnitude of A1: if the direction information of the first motion vector difference indicates that the direction is to the right, the first motion vector difference is (A1, 0); the first motion vector difference is (0, -A1) if the direction information of the first motion vector difference indicates a downward direction; if the direction information of the first motion vector difference indicates that the direction is to the left, the first motion vector difference is (-A1, 0); if the direction information of the first motion vector difference indicates that the direction is upward, the first motion vector difference is (0, A1). If the direction information of the first motion vector difference indicates that the direction is to the upper right, the first motion vector difference is (A1, A1); if the direction information of the first motion vector difference indicates an upward left direction, the first motion vector difference is (-A1, A1); if the direction information of the first motion vector difference indicates a direction to the lower left, the first motion vector difference is (-A1 ); if the direction information of the first motion vector difference indicates a direction to the lower right, the first motion vector difference is (A1, -A1).
When determining the second motion vector difference according to the direction information of the second motion vector difference and the magnitude information of the second motion vector difference, if the magnitude information of the second motion vector difference indicates a magnitude of A2, then: if the direction information of the second motion vector difference indicates that the direction is to the right, the second motion vector difference is (A2, 0); if the direction information of the second motion vector difference indicates that the direction is downward, the second motion vector difference is (0, -A2); if the direction information of the second motion vector difference indicates a direction of left, the second motion vector difference is (-A2, 0); if the direction information of the second motion vector difference indicates that the direction is upward, the second motion vector difference is (0, A2). If the direction information of the second motion vector difference indicates that the direction is to the upper right, the second motion vector difference is (A2, A2); if the direction information of the second motion vector difference indicates that the direction is upward to the left, the second motion vector difference is (-A2, A2); if the direction information of the second motion vector difference indicates a direction to the lower left, the second motion vector difference is (-A2 ); if the direction information of the second motion vector difference indicates a direction to the lower right, the second motion vector difference is (A2, -A2).
Referring to the above embodiments, the encoding end may use fixed length codes, truncated unary codes, etc. when encoding the direction information of the motion vector difference, and therefore, the decoding end may use fixed length codes, truncated unary codes, etc. to decode the direction information of the motion vector difference, so as to obtain the direction information of the motion vector difference, such as up, down, left, right, top left, bottom left, top right, bottom right, etc.
Referring to the above embodiment, when the encoding end encodes the amplitude information of the motion vector difference, the encoding end may use fixed length codes, truncated unary codes, and the like, so that the decoding end may use fixed length codes, truncated unary codes, and the like, to decode the amplitude information of the motion vector difference to obtain the amplitude information of the motion vector difference, such as step size configurations of 1/4-pel,1/2-pel,1-pel,2-pel, and the like, and then determine the value of the amplitude a of the motion vector difference according to the step size configurations of 1/4-pel,1/2-pel,1-pel,2-pel, and the like.
In a possible embodiment, the encoding end may further encode, in the encoded bitstream, a first modification flag for indicating whether to superimpose the motion vector difference on the first original motion vector and a second modification flag for indicating whether to superimpose the motion vector difference on the first original motion vector, the first modification flag indicating whether to superimpose the motion vector difference on the first original motion vector or not, the second modification flag indicating whether to superimpose the motion vector difference on the second original motion vector or not.
After receiving the encoded bit stream of the current block, the decoding end may parse the first modification flag and the second modification flag from the encoded bit stream of the current block. If the first correction flag is used to indicate that the motion vector difference is superimposed on the first original motion vector, analyzing direction information and magnitude information of the first motion vector difference from the encoded bitstream of the current block, and determining the first motion vector difference according to the direction information and the magnitude information of the first motion vector difference, and then determining a first target motion vector of the current block according to the first original motion vector and the first motion vector difference. If the first correction flag is used to indicate that the motion vector difference is not superimposed on the first original motion vector, the direction information and the magnitude information of the first motion vector difference are not resolved, and the first original motion vector may be directly used as the first target motion vector of the current block. If the second correction flag is used to indicate that the motion vector difference is superimposed on the second original motion vector, analyzing direction information and magnitude information of the second motion vector difference from the encoded bitstream of the current block, and determining the second motion vector difference according to the direction information and the magnitude information of the second motion vector difference, and then determining a second target motion vector of the current block according to the second original motion vector and the second motion vector difference. If the second correction flag is used to indicate that the motion vector difference is not superimposed on the second original motion vector, the direction information and the magnitude information of the second motion vector difference are not resolved, and the second original motion vector can be directly used as the second target motion vector of the current block.
Illustratively, when the first correction flag is a first value, it indicates that the motion vector difference is superimposed on the first original motion vector, and when the first correction flag is a second value, it indicates that the motion vector difference is not superimposed on the first original motion vector. And when the second correction mark is a second value, indicating that the motion vector difference is not superposed on the second original motion vector. The first value and the second value may be configured empirically, such as the first value is 1 and the second value is 0, or such as the first value is 0 and the second value is 1.
In another possible embodiment, the encoding end may further encode a modification flag in the encoded bitstream for indicating whether to superimpose the motion vector difference on the original motion vector, the modification flag indicating whether to superimpose the motion vector difference on the original motion vector or not. And after receiving the coded bit stream, the decoding end analyzes the correction mark from the coded bit stream, and if the correction mark is used for indicating the superposition of the motion vector difference on the original motion vector, the decoding end analyzes the direction information and the amplitude information of the first motion vector difference from the coded bit stream and analyzes the direction information and the amplitude information of the second motion vector difference. Then, a first motion vector difference is determined according to direction information and magnitude information of the first motion vector difference, a first target motion vector of the current block is determined according to the first original motion vector and the first motion vector difference, a second motion vector difference is determined according to direction information and magnitude information of the second motion vector difference, and a second target motion vector of the current block is determined according to the second original motion vector and the second motion vector difference. If the correction flag is used to indicate that the motion vector difference is not superimposed on the original motion vector, the direction information and magnitude information of the first motion vector difference are not resolved, and the direction information and magnitude information of the second motion vector difference are not resolved, the first original motion vector is directly used as the first target motion vector of the current block, and the second original motion vector is used as the second target motion vector of the current block.
For example, when the modification flag has a first value, it may indicate that a motion vector difference is superimposed on the original motion vector, and when the modification flag has a second value, it may indicate that a motion vector difference is not superimposed on the original motion vector.
Example 13: in the embodiment of the present application, a coding/decoding method is provided, where the method may be applied to a decoding end (also referred to as a video decoder) or an encoding end (also referred to as a video encoder), and in this embodiment, the method is a weighted prediction for an intra-frame AWP mode, and the intra-frame AWP mode may be denoted as an intra-frame SAWP mode, and the method may include:
step S11, when determining to start weighted prediction on the current block, obtaining a weighted prediction angle and a weighted configuration parameter of the current block, wherein the weighted configuration parameter comprises a weighted transformation rate and an initial position of weighted transformation, and the initial position of the weighted transformation can be determined by at least one of the following parameters: the weight prediction angle of the current block, the weight prediction position of the current block and the size of the current block.
Illustratively, step S11 is similar to step 301, and the same parts are not described again, except that:
in intra-SAWP mode, frame types are not distinguished, i.e. I, P and B frames are realized in the same way, i.e. for I, P and B frames, the weight transformation rate of the current block is obtained in the same way. For example, if the current block supports the weighted transform rate switching mode, then: acquiring weight transformation rate indication information of a current block; if the weight transformation rate indication information is first indication information, determining the weight transformation rate of the current block as a first weight transformation rate; and if the weight transformation rate indication information is second indication information, determining the weight transformation rate of the current block as a second weight transformation rate.
For the I frame, the P frame, and the B frame, the weighted prediction angle of the current block is obtained in the same manner, for example, a weighted prediction angle list of the current block is constructed (i.e., the first angle list for the B frame in step 301, and certainly, the second angle list may also be used), and the weighted prediction angle of the current block may be obtained from the weighted prediction angle list of the current block.
For the I frame, the P frame, and the B frame, the weighted prediction position of the current block is obtained in the same manner, for example, a weighted prediction position list of the current block is constructed (i.e., the first position list for the B frame in step 301, and certainly, the second position list may also be used), and the weighted prediction position of the current block may be obtained from the weighted prediction position list of the current block.
And S12, configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter of the current block.
For example, step S12 is similar to step 302, and will not be repeated here,
step S13, aiming at each pixel position of the current block, determining a peripheral matching position pointed by the pixel position from peripheral positions outside the current block based on the weight prediction angle of the current block. And determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position.
For example, step S13 is similar to step 303, and the same parts are not described again, except that:
in intra-SAWP mode, the frame types are not distinguished, i.e. I, P and B frames are implemented in the same way, i.e. for I, P and B frames, the peripheral matching position pointed to by the pixel position is determined from the peripheral positions outside the current block based on the weighted prediction angle of the current block, regardless of the peripheral positions pointed to by the preset positions in the sub-block.
Step S14, obtaining a mode information candidate list established for the current block, wherein the mode information candidate list comprises at least one candidate mode information; first target mode information and second target mode information of the current block are acquired based on the mode information candidate list.
For example, if intra-SAWP mode is enabled for the current block, the mode information candidate list may be an intra information candidate list, and the intra information candidate list may include at least one intra mode (i.e., candidate intra mode). Based on this, the first target mode information may be a first target intra mode, and the second target mode information may be a second target intra mode.
For example, the encoding end and the decoding end may each construct an intra information candidate list, where the intra information candidate list includes at least two candidate intra modes, and the candidate intra modes in the intra information candidate list may include, but are not limited to: the candidate intra mode is not limited to the Planar mode, the DC mode, the vertical angle mode, the horizontal angle mode, and various angle modes.
In one possible embodiment, after constructing the intra information candidate list, the first target intra mode and the second target intra mode of the current block are obtained based on the intra information candidate list, which may include but is not limited to:
first, if there is one intra information candidate list and the intra information candidate list can include at least two intra modes, one intra mode is selected from the intra information candidate list as a first target intra mode of the current block, and another intra mode is selected from the intra information candidate list as a second target intra mode of the current block.
For example, for the encoding end, the encoding end may select one intra mode from the intra information candidate list as a first target intra mode of the current block and another intra mode from the intra information candidate list as a second target intra mode of the current block based on a rate distortion principle, and encode indication information (for indicating an index value of the first target intra mode in the intra information candidate list and an index value of the second target intra mode in the intra information candidate list) in the encoded bitstream of the current block. For the decoding end, the decoding end may parse the indication information from the encoded bitstream of the current block, and based on the indication information, select one intra mode from the intra information candidate list as a first target intra mode of the current block, and select another intra mode from the intra information candidate list as a second target intra mode of the current block.
Second, if there are two intra information candidate lists (the two intra information candidate lists are respectively referred to as an intra information candidate list 1 and an intra information candidate list 2), and each intra information candidate list can include at least one intra mode, one intra mode is selected from the intra information candidate list 1 as the first target intra mode of the current block, and one intra mode is selected from the intra information candidate list 2 as the second target intra mode of the current block.
For example, for the encoding side, the encoding side may select one intra mode from the intra information candidate list 1 as a first target intra mode of the current block and select one intra mode from the intra information candidate list 2 as a second target intra mode of the current block based on a rate distortion principle, and encode indication information (indicating an index value of the first target intra mode in the intra information candidate list 1 and an index value of the second target intra mode in the intra information candidate list 2) in the encoded bitstream of the current block. For the decoding end, the decoding end may parse the indication information from the encoded bitstream of the current block, and based on the indication information, select one intra mode from the intra information candidate list 1 as the first target intra mode of the current block, and select one intra mode from the intra information candidate list 2 as the second target intra mode of the current block.
And if one intra-frame information candidate list exists and the intra-frame information candidate list comprises at least two intra-frame modes, selecting one intra-frame mode from the intra-frame information candidate list as a first original intra-frame mode of the current block, and selecting another intra-frame mode from the intra-frame information candidate list as a second original intra-frame mode of the current block. Determining a first target intra-frame mode of the current block according to the first original intra-frame mode; determining a second target intra-mode for the current block according to the second original intra-mode.
For example, for the encoding side, a first target intra-mode and a second target intra-mode for the current block may be determined. If the first target intra mode does not exist in the intra information candidate list, selecting an intra mode from the intra information candidate list as a first original prediction mode of the current block, and determining a first offset between the first target intra mode and the first original prediction mode (e.g., a difference between an intra mode number of the first target intra mode and an intra mode number of the first original prediction mode). If the second target intra mode does not exist in the intra information candidate list, selecting an intra mode from the intra information candidate list as the second original prediction mode of the current block, and determining a second offset between the second target intra mode and the second original prediction mode (e.g., a difference between an intra mode number of the second target intra mode and an intra mode number of the second original prediction mode).
And the encoding end encodes indication information in the encoding bit stream, wherein the indication information is used for indicating the index value of the first original prediction mode in the intra-frame information candidate list, the index value of the second original prediction mode in the intra-frame information candidate list, the first offset and the second offset.
For the decoding end, the decoding end may parse the indication information from the encoded bitstream of the current block, and based on the indication information, select one intra mode from the intra information candidate list as the first original prediction mode of the current block, and select one intra mode from the intra information candidate list as the second original prediction mode of the current block. And determining a first offset and a second offset based on the indication information, and then determining a first target intra mode (i.e., the sum of the intra mode number of the first original prediction mode and the first offset) based on the first original prediction mode and the first offset, and determining a second target intra mode (i.e., the sum of the intra mode number of the second original prediction mode and the second offset) based on the second original prediction mode and the second offset.
For another example, for the encoding side, a first target intra-mode and a second target intra-mode of the current block may be determined. If the first target intra-frame mode does not exist in the intra-frame information candidate list, selecting one intra-frame mode from the intra-frame information candidate list as a first original prediction mode of the current block, and determining a first offset between the first target intra-frame mode and the first original prediction mode. If the second target intra mode exists in the intra information candidate list, selecting one intra mode from the intra information candidate list as the second original prediction mode of the current block, namely the second target intra mode of the current block.
The encoding end encodes indication information in the encoding bit stream, wherein the indication information is used for indicating the index value of the first original prediction mode in the intra-frame information candidate list, the index value of the second original prediction mode in the intra-frame information candidate list and the first offset. For the decoding end, the decoding end may parse the indication information from the encoded bitstream of the current block, and based on the indication information, select one intra mode from the intra information candidate list as a first original prediction mode of the current block, select one intra mode from the intra information candidate list as a second original prediction mode of the current block, and determine the first offset. A first target intra mode is determined based on the first original prediction mode and the first offset, and a second original prediction mode is determined as a second target intra mode.
For another example, for the encoding side, a first target intra-mode and a second target intra-mode of the current block may be determined. If the second target intra-frame mode does not exist in the intra-frame information candidate list, selecting one intra-frame mode from the intra-frame information candidate list as a second original prediction mode of the current block, and determining a second offset between the second target intra-frame mode and the second original prediction mode. If the first target intra mode exists in the intra information candidate list, selecting one intra mode from the intra information candidate list as the first original prediction mode of the current block, namely the first target intra mode of the current block.
And the encoding end encodes indication information in the encoding bit stream, wherein the indication information is used for indicating the index value of the first original prediction mode in the intra-frame information candidate list, the index value of the second original prediction mode in the intra-frame information candidate list and the second offset. For the decoding end, the decoding end may parse the indication information from the encoded bitstream of the current block, and based on the indication information, select one intra mode from the intra information candidate list as a first original prediction mode of the current block, select one intra mode from the intra information candidate list as a second original prediction mode of the current block, and determine a second offset. A second target intra mode is determined based on the second original prediction mode and the second offset, and the first original prediction mode is determined as the first target intra mode.
In summary, a first offset corresponding to the first original intra-frame mode may be obtained, and the first target intra-frame mode is determined according to the first original intra-frame mode and the first offset; alternatively, the first original intra mode is determined as the first target intra mode. And a second offset corresponding to the second original intra-frame mode may be obtained, and a second target intra-frame mode may be determined according to the second original intra-frame mode and the second offset; alternatively, the second original intra mode is determined as the second target intra mode.
For example, referring to the above embodiments, the decoding end may parse the first offset from the encoded bitstream of the current block, and/or the decoding end may parse the second offset from the encoded bitstream of the current block.
Fourth, if there are two intra information candidate lists (the two intra information candidate lists are respectively marked as an intra information candidate list 1 and an intra information candidate list 2), and each intra information candidate list can include at least one intra mode, one intra mode is selected from the intra information candidate list 1 as the first original intra mode of the current block, and another intra mode is selected from the intra information candidate list 2 as the second original intra mode of the current block. Determining a first target intra-frame mode of the current block according to the first original intra-frame mode; determining a second target intra-mode for the current block according to the second original intra-mode.
For example, the encoding side determines a first target intra mode and a second target intra mode of the current block. If the intra information candidate list 1 does not have the first target intra mode, selecting one intra mode from the intra information candidate list 1 as the first original prediction mode of the current block, and determining a first offset between the first target intra mode and the first original prediction mode. If the intra information candidate list 2 does not have the second target intra mode, selecting one intra mode from the intra information candidate list 2 as the second original prediction mode of the current block, and determining a second offset between the second target intra mode and the second original prediction mode. The encoding end encodes indication information in the encoded bit stream, which is used for indicating the index value of the first original prediction mode in the intra information candidate list 1, the index value of the second original prediction mode in the intra information candidate list 2, the first offset and the second offset.
The decoding end parses indication information from the coded bit stream of the current block, selects an intra mode from the intra information candidate list 1 as a first original prediction mode of the current block based on the indication information, selects an intra mode from the intra information candidate list 2 as a second original prediction mode of the current block, and determines a first offset and a second offset. A first target intra mode is determined based on the first original prediction mode and the first offset, and a second target intra mode is determined based on the second original prediction mode and the second offset.
For another example, the encoding end determines a first target intra mode and a second target intra mode of the current block, selects the intra mode from the intra information candidate list 1 as a first original prediction mode of the current block if the first target intra mode does not exist in the intra information candidate list 1, and determines a first offset between the first target intra mode and the first original prediction mode. If the second target intra mode exists in the intra information candidate list 2, the intra mode is selected from the intra information candidate list 2 as the second original prediction mode of the current block, that is, the second target intra mode of the current block. The encoding end encodes indication information in the encoded bit stream, which is used for indicating the index value of the first original prediction mode in the intra information candidate list 1, the index value of the second original prediction mode in the intra information candidate list 2 and the first offset. The decoding end parses indication information from an encoded bitstream of the current block, selects an intra mode from the intra information candidate list 1 as a first original prediction mode of the current block based on the indication information, selects an intra mode from the intra information candidate list 2 as a second original prediction mode of the current block, and determines a first offset. A first target intra mode is determined based on the first original prediction mode and the first offset, and a second original prediction mode is determined as a second target intra mode.
For another example, the encoding side determines a first target intra mode and a second target intra mode of the current block. If the second target intra mode does not exist in the intra information candidate list 2, the intra mode is selected from the intra information candidate list 2 as the second original prediction mode of the current block, and a second offset between the second target intra mode and the second original prediction mode is determined. If the first target intra mode exists in the intra information candidate list 1, the intra mode is selected from the intra information candidate list 1 as the first original prediction mode of the current block, that is, the first target intra mode of the current block. The encoding end encodes indication information in the encoding bit stream, which is used for indicating the index value of the first original prediction mode in the intra information candidate list 1, the index value of the second original prediction mode in the intra information candidate list 2 and the second offset. The decoding end analyzes the indication information from the coding bit stream of the current block, selects the intra mode from the intra information candidate list 1 as the first original prediction mode of the current block based on the indication information, selects the intra mode from the intra information candidate list 2 as the second original prediction mode of the current block, and determines the second offset. A second target intra mode is determined based on the second original prediction mode and the second offset, and the first original prediction mode is determined as the first target intra mode.
Step S15, aiming at each pixel position of the current block, determining a first predicted value of the pixel position according to first target mode information of the current block, and determining a second predicted value of the pixel position according to second target mode information of the current block; and determining the weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value.
And S16, determining the weighted prediction value of the current block according to the weighted prediction values of all the pixel positions of the current block.
For example, step S15 and step S16 are similar to step 305 and step 306, and are not repeated here.
Illustratively, the contents of embodiment 2, embodiment 3, embodiment 4, embodiment 5, embodiment 6, embodiment 7, embodiment 8 and embodiment 9 may also be applied to the intra-frame SAWP mode. Different from the content of embodiments 2 to 9, in the intra-frame SAWP mode, the frame types do not need to be distinguished, that is, the implementation manners of the I frame, the P frame, and the B frame are the same, that is, in embodiments 2 to 9, the scheme of distinguishing the P frame from the B frame is used, in the intra-frame SAWP mode, the implementation manners of the I frame, the P frame, and the B frame can refer to the B frame scheme of embodiments 2 to 9 without distinguishing the frame types, and the detailed description is not repeated here.
Example 14: on the basis of the above embodiments, the following descriptions are provided for relevant syntax of inter-frame AWP mode, AWP _ MVR mode (sub-mode of inter-frame AWP mode), and intra-frame SAWP mode, in conjunction with specific application scenarios:
see syntax table 1, which is an example of a syntax table for sequence headers.
Grammar table 1
Figure GDA0003895886610000521
Figure GDA0003895886610000531
In syntax table 1, saw _ enable _ flag is a high level syntax switch for the SAWP mode of I, P, and B frames, and aw _ enable _ flag is a high level syntax switch common to the AWP and AWP _ MVR modes of P, B frames.
The saw _ enable _ flag is called as a spatial angular weighted prediction mode permission flag, a binary variable. A value of '1' indicates that spatial angle weighted prediction mode can be used; a value of '0' indicates that spatial angle weighted prediction mode should not be used. The value of sawpageflag is equal to the value of sawpageenable flag. If the bitstream does not have the sawp _ enable _ flag, the value of sawpassableflag is 0.
The aw _ enable _ flag may be referred to as an angular weighted prediction mode enable flag, a binary variable. A value of '1' indicates that an angle weighted prediction mode can be used; a value of '0' indicates that the angle weighted prediction mode should not be used. The value of AwpEnableFlag is equal to the value of awp _ enable _ flag. The value of awpEnablFlag is 0 if awpJENableFlag is not present in the bitstream.
See syntax table 2 and syntax table 3, which are examples of syntax tables for the picture header.
Grammar table 2
if(SawpEnableFlag){
picture_awp_refine_index u(1)
}
Grammar table 3
if((AwpEnableFlag&&PictureType==2)||SawpEnableFlag){
picture_awp_refine_index u(1)
}
Syntax table 2 is a syntax table of an I-frame picture header, and syntax table 3 is a syntax table of P-frame and B-frame picture headers.
picture _ aw _ refine _ index, called picture-level angular weighted prediction weight index, i.e. picture-level weight transform rate index, is a 1-bit unsigned integer used to determine the weight transform rate of an angular weighted prediction mode, which in turn determines the reference weight of the angular weighted prediction mode. The value of PictureAwpRefineIndex is equal to the value of picture _ aw _ refine _ index. If picture _ aw _ refine _ index is not present in the bitstream, the value of picture awwprefeinendex is 0.
See syntax table 4, which is an example of a syntax table for inter-frame AWP mode.
Grammar table 4
Figure GDA0003895886610000532
The awp _ index is called an angular weighted prediction mode index, and is an angular weighted prediction mode index value. If the current frame is a B frame, the value of the awpIndex is equal to the value of the awpIndex; otherwise, the value of awpIndex can be obtained according to the value of awpIndex and the width W and height H of the current block: awpndex = awwpwxh [ aw _ index ] < <1
Illustratively, for W and H of 8, 16, 32, 64, awpWxH is defined as follows:
awp8x8={8,13,14,15,16,22}
awp8x16={4,5,6,12,13,14,15,18,20,21,22,24}
awp8x32={0,1,2,4,5,6,8,9,10,12,13,14,15,16,17,18,20,21,22,24,25,26}
awp8x64={0,1,2,4,5,6,8,9,10,12,13,14,15,16,17,18,20,21,22,24,25,26}
awp16x8={3,4,6,12,13,14,15,18,20,24,26,27}
awp16x16={2,3,4,5,6,8,12,13,14,15,16,18,20,21,22,24,26,27}
awp16x32={0,1,2,3,4,5,6,8,9,10,12,13,14,15,16,17,18,20,21,22,24,25,26,27}
awp16x64={0,1,2,3,4,5,6,8,9,10,12,13,14,15,16,17,18,20,21,22,24,25,26,27}
awp32x8={0,2,3,4,6,7,8,10,11,12,13,14,15,16,18,19,20,22,24,26,27}
awp32x16={0,1,2,3,4,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27}
awp32x32={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27}
awp32x64={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27}
awp64x8={0,2,3,4,6,7,8,10,11,12,13,14,15,16,18,19,20,22,23,24,26,27}
awp64x16={0,1,2,3,4,6,7,8,10,11,12,13,14,15,16,18,19,20,22,23,24,25,26,27}
awp64x32={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27}
awp64x64={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27}
illustratively, if an awp _ index is not present in the bitstream, the value of awpndex is 0.
The awp _ mvr _ cand _ flag0 is a first motion vector correction flag (i.e., a first correction flag) for angle weighted prediction, and is a binary variable. A value of '1' indicates that the angular weighted prediction first motion vector should be modified (i.e., the MVD is superimposed); a value of '0' indicates that the angular weighted prediction first motion vector should not be modified (i.e., the MVD should not be superimposed). The value of AwpMvrCandFlag0 is equal to the value of awp _ mvr _ cand _ flag 0. If the bitstream does not have awp _ mvr _ cand _ flag0, the value of AwpMvrCandFlag0 is 0.
awp _ mvr _ cand _ step0 indicates the angular weighted prediction first motion vector correction step index value (indicating the magnitude) and the angular weighted prediction first motion vector correction step index value. The value of AwpMvrCandStep0 is equal to the value of awp _ mvr _ cand _ step 0. If aw _ mvr _ cand _ step0 is not present in the bitstream, awpMvrCandStep0 has a value of 0.
The awp _ mvr _ cand _ dir0 is an angular weighted prediction first motion vector correction direction index value (for indicating direction) and is an angular weighted prediction first motion vector correction direction index value. The value of AwpMvrCandDir0 is equal to the value of awp _ mvr _ cand _ dir 0. If there is no awp _ mvr _ cand _ dir0 in the bitstream, the value of AwpMvrCandDir0 is 0.
awp _ mvr _ cand _ flag1 is a second motion vector correction flag (i.e., a second correction flag) for angular weighted prediction, which is a binary variable. A value of '1' indicates that the angular weighted prediction second motion vector should be modified (i.e., the MVD is superimposed); a value of '0' indicates that the angular weighted prediction second motion vector should not be modified (i.e., the MVD should not be superimposed). The value of AwpMvrCandFlag1 is equal to the value of awp _ mvr _ cand _ flag 1. If the bitstream does not have awp _ mvr _ cand _ flag1, the value of AwpMvrCandFlag1 is 0.
aw _ mvr _ cand _ step1 is the angular weighted prediction second motion vector correction step index value (indicating the magnitude), and is the angular weighted prediction second motion vector correction step index value. The value of AwpMvrCandStep1 is equal to the value of awp _ mvr _ cand _ step 1. If aw _ mvr _ cand _ step1 is not present in the bitstream, awpMvrCandStep1 has a value of 0.
aw _ mvr _ cand _ dir1 is an angular weighted prediction second motion vector correction direction index value (for indicating direction), and is an angular weighted prediction second motion vector correction direction index value. The value of AwpMvrCandDir1 is equal to the value of awp _ mvr _ cand _ dir 1. If aw _ mvr _ cand _ dir1 is not present in the bitstream, awpMvrCandDir1 has a value of 0.
The address _ cand _ index0 is an angular weighted prediction mode first motion information index (for indicating motion information) and is an angular weighted prediction mode first motion information index value. The value of AwpCandIndex0 is equal to the value of awp _ cand _ index 0. If the AwpCandIndex0 is not present in the bitstream, the value of awpcandlndex 0 is 0.
The awp _ cand _ index1 is an angular weighted prediction mode second motion information index (for indicating motion information) and is an angular weighted prediction mode second motion information index value. The value of AwpCandIndex1 is equal to the value of awp _ cand _ index 1. If the awp _ cand _ index1 is not present in the bitstream, the value of awpcandlndex 1 is 0.
Exemplarily, referring to syntax table 4, pictureType = =2 denotes a B frame, and thus, the start condition of each element in syntax table 4 is a B frame, that is, the enable condition of the AWP _ MVR mode is a B frame, and the AWP _ MVR mode is not enabled in a P frame.
See syntax table 5, which is an example of a syntax table for intra SAWP mode.
Grammar table 5
Figure GDA0003895886610000552
The sawp _ index is called a spatial angular weighted prediction mode index and is a spatial angular weighted prediction mode index value. The value of sawpIndex is equal to the value of sawpIndex. If an awp _ index does not exist in the bitstream, the value of sawpIndex is 0.
sawp _ pred _ mode0_ index is an index of the spatial angular weighted prediction mode first prediction mode (for indicating an intra mode), and is an index value of the spatial angular weighted prediction mode first prediction mode. The value range of sawp _ pred _ mode0_ index is 0 to 27. The value of sawwpPedMode 0Index is equal to the value of sawp _ pred _ mode0_ Index.
sawp _ pred _ mode1_ index is an index of the spatial angular weighted prediction mode second prediction mode (for indicating an intra mode), and is an index value of the spatial angular weighted prediction mode second prediction mode. The value range of sawp _ pred _ mode1_ index is 0 to 27. The value of sawwpPedMode 1Index is equal to the value of sawp _ pred _ mode1_ Index.
Example 15: for the AWP mode of B frame, AWP _ MVR mode, AWP _ SCC mode, and AWP mode of P frame, in the AWP weight derivation process, the input is the angular weighted prediction mode index value awpndex, and the width W and height H of the current block, and the output is the angular weighted predicted luminance weight matrix awpwweightmatrix y and the chrominance weight matrix awpwweightmatrix xuv. For the SAWP mode of I, P and B frames, the input is the spatial angle weighted prediction mode index value SawpIndex, and the width W and height H of the current block, and the output is the spatial angle weighted predicted luminance weight matrix SawpWeightMatrix and chrominance weight matrix SawpWeightMatrixUV. Illustratively, the AWP weight derivation process may include:
in step 1, the variables stepIndex, angleIndex and angleAreaIndex are calculated as follows.
Figure GDA0003895886610000551
Figure GDA0003895886610000561
The calculation procedures of stepIndex, angleIndex and angleAreaIndex can be found in example 7, and are not described herein.
Step 2, look-up table 6 to obtain VL (i.e. ValidLenth, effective number) according to anglerareeindex and picterawprefeindex (i.e. image-level weight transformation rate index for indicating weight transformation rate), and look-up table 7 to obtain shift (i.e. the number of bits to shift left the weight transformation rate) and FP (i.e. FirstPos, start position of weight transformation), if the current frame is a P frame, shift is modified to be equal to 3 (i.e. the weight transformation rate is shifted left by 3 bits, indicating that the weight transformation rate is shifted left by 8). Finally, the reference weight list ReferenceWeights is obtained as follows.
Figure GDA0003895886610000562
TABLE 6
Figure GDA0003895886610000563
TABLE 7
Figure GDA0003895886610000564
And step 3, looking up a table 8 according to the frame type of the current frame and angleAreaIndex to obtain tP (namely the peripheral position outside the current block), and then obtaining a brightness weight matrix AwpWeightMatrix by adopting the following method.
Figure GDA0003895886610000565
TABLE 8
Figure GDA0003895886610000566
Figure GDA0003895886610000571
And 4, obtaining the chroma weight matrix AwpWeightMatrixUV in the following mode.
If the current frame is a P frame, obtaining a chroma weight matrix AwpWeightMatrixUV by adopting the following method:
Figure GDA0003895886610000572
otherwise: the chroma weight matrix, awwpweightmatrixuv, is obtained as follows:
Figure GDA0003895886610000573
in summary, it can be seen that, for the chroma component, if the frame type of the current frame is B frame, a luminance position matching the pixel position is found from the luminance component of the current block, and the luminance weight value of the luminance position is determined as the chroma weight value of the pixel position, where [ x < <1] [ y < <1] in the luminance component is the luminance position matching the pixel position [ x ] [ y ] in the chroma component.
For the chroma component, if the frame type of the current frame is P frame, finding out a chroma sub-block matching the pixel position from the chroma component of the current block, finding out a luminance position corresponding to a preset position [ (x > > 2) < <2] [ (y > > 2) < <2] of the chroma sub-block from the luminance component of the current block, determining a luminance weight value of the luminance position as the chroma weight value of the pixel position, determining [ (x > > 2) < <3] [ (y > > 2) < <3] of the luminance component as a luminance position corresponding to a preset position (namely, upper left corner position) in the chroma sub-block matching the pixel position [ x ] [ y ] of the chroma component, and determining a luminance weight value of the luminance position as the chroma weight value of the pixel position [ x ] [ y ].
Based on the above AWP weight derivation method, different pixel positions in the current block can be made to correspond to different reference weight values (i.e. luminance weight values or chrominance weight values), so as to achieve the effect of segmenting the current block. Referring to fig. 9A and 9B, schematic diagrams of the effect of segmenting the current block are shown, that is, different pixel positions of the current block correspond to different reference weight values.
The SAWP weight derivation process can include:
at step 1, the variables stepIndex, angleIndex and angleAreaIndex are calculated as follows.
Figure GDA0003895886610000574
Figure GDA0003895886610000581
The calculation procedures of stepIndex, angleIndex and angleAreaIndex can be found in example 7, and are not described herein.
Step 2, look-up table 6 based on the anglerareaindex to obtain VL (i.e. ValidLenth, effective number), and look-up table 7 based on the anglerareaindex and pictureawrefeindendex (i.e. image-level weight transformation rate index for indicating the weight transformation rate) to obtain shift (i.e. the number of bits left-shifted by the weight transformation rate) and FP (i.e. FirstPos, the start position of weight transformation). Finally, a reference weight list ReferenceWeights is obtained in the following manner.
Figure GDA0003895886610000582
TABLE 6
Figure GDA0003895886610000583
TABLE 7
Figure GDA0003895886610000584
And step 3, looking up a table 8 according to the angleAreaIndex to obtain tP (namely the peripheral position outside the current block), and then obtaining a brightness weight matrix SawpWeightMatrixY in the following way.
Figure GDA0003895886610000585
TABLE 8
Figure GDA0003895886610000586
Figure GDA0003895886610000591
In step 4, the chromaticity weight matrix sawpwweightmatrixuv is obtained as follows.
Figure GDA0003895886610000592
In summary, it can be seen that, for the chroma component, a luminance position matching a pixel position is found from the luminance component of the current block, and a luminance weight value of the luminance position is determined as the chroma weight value of the pixel position, where [ x < <1] [ y < <1] in the luminance component is the luminance position matching the pixel position [ x ] [ y ] in the chroma component.
Based on the above-mentioned SAWP weight derivation method, different pixel positions in the current block can be made to correspond to different reference weight values (i.e. luminance weight values or chrominance weight values), so as to achieve the effect of segmenting the current block. Referring to fig. 9A and 9B, schematic diagrams of the effect of segmenting the current block are shown, that is, different pixel positions of the current block correspond to different reference weight values.
Example 16: for the AWP mode, the AWP _ MVR mode, the AWP _ SCC mode, and the P-frame AWP mode of the B frame, the building process of the unidirectional motion information candidate list (i.e. the motion information candidate list) may include:
in step 1, as shown in fig. 8, F, G, C, a, B and D are adjacent prediction blocks of the current block E, and the "availability" of these adjacent prediction blocks (e.g., F, G, C, a, B and D) is determined.
a) F is "available" if F exists and inter prediction mode is employed; otherwise, F is "unavailable".
b) G is "available" if it exists and inter prediction mode is employed; otherwise, G is "unavailable".
c) C is "available" if C exists and inter prediction mode is employed; otherwise, C is "unavailable".
d) A is "available" if A is present and inter prediction mode is employed; otherwise, a is "unavailable".
e) B is "available" if B is present and inter prediction mode is employed; otherwise, B is "unavailable.
f) D is "available" if D is present and inter prediction mode is employed; otherwise, D is "not available".
And step 2, initializing idx to be equal to 0, deriving motion information T (time-domain motion information), and putting T and the motion information of the available blocks (in the sequence of F, G, C, A, B and D) into a motion information candidate list AwpCandArray one by one according to the following steps.
In deriving the motion information T, the motion information T may be derived using the derivation case 1 of embodiment 11, or the motion information T may be derived using the derivation case 2 of embodiment 11, or the motion information T may be derived using the derivation case 3 of embodiment 11, or the motion information T may be derived using the derivation case 4 of embodiment 11, or the motion information T may be derived using the derivation case 5 of embodiment 11.
a) And if the prediction reference mode of the current motion information is 'PRED _ List0' or 'PRED _ List1', performing a duplicate checking operation on the current motion information and the motion information which already exists in the AfpCandArray, and if the current motion information is not repeated, putting the current motion information into the AfpCandArray.
PRED _ List0 is unidirectional motion information pointing to List0, and PRED _ List1 is unidirectional motion information pointing to List 1.
And (4) after the current motion information is put into the AwpCandArray, adding 1 to idx, and if idx is equal to 5, turning to the step 4.
b) Otherwise, if the prediction reference mode of the current motion information is 'PRED _ List01', numbering according to the traversal sequence of the current available motion information, modifying the prediction reference mode of the current motion information according to the following rule, and performing duplication operation on the modified motion information and the motion information existing in the AwpCandArray, and if the motion information is not repeated, putting the AwpCandArray in the motion information.
PRED _ List01 refers to bidirectional motion information pointing to List0 and List 1.
Illustratively, modifying the prediction reference mode of the current motion information according to the following rules may include:
if the traversal sequence number is an even number, modifying the prediction reference mode of the current motion information into 'PRED _ List0';
if the traversal order number is odd, the prediction reference mode of the current motion information is modified to 'PRED _ List1'.
And (4) after the modified motion information is placed into the AwpCandArray, adding 1 to idx, and if idx is equal to 5, turning to the step 4.
Illustratively, for the one-way motion information duplication checking operation, if the motion information a and the motion information B satisfy the following one or more conditions, the motion information a and the motion information B are different; otherwise, motion information a and motion information B are the same:
the reference frame determined by the prediction reference mode and the reference index in the motion information a is different from the reference frame determined by the prediction reference mode and the reference index in the motion information B. The motion vector corresponding to the prediction reference mode in the motion information a is different from the motion vector corresponding to the prediction reference mode in the motion information B.
For example, the motion vector corresponding to the prediction reference mode 'PRED _ List0' is an L0 motion vector, and the motion vector corresponding to the prediction reference mode 'PRED _ List1' is an L1 motion vector.
Illustratively, in determining whether the reference frames are the same, if two reference frames satisfy one or more of the following conditions, then the two reference frames are different, otherwise the two reference frames are the same: one of the reference frames is a non-knowledge frame and the other reference frame is a knowledge frame. Both reference frames are non-knowledge frames and the corresponding reference frames DOI are not equal. Both reference frames are knowledge frames, and the corresponding knowledge frame indices are not equal.
Step 3, if idx is less than 5, motion information motionInfo [ i ] (i =0 to 3) is generated as follows. The prediction reference mode of motionInfo [ i ] is equal to the prediction reference mode of AwpCandArray [0], the motion vector of AwpCandArray [0] corresponding to the prediction reference mode is denoted mv, and the motion vector of motionInfo [ i ] corresponding to the prediction reference mode is denoted mvInfo [ i ].
Figure GDA0003895886610000601
And step 4, assigning the motion information AwpCandArray [ AwpCandIdx0] to motionInfoAwp0.
And 5, assigning the motion information AwpCandArray [ AwpCandIdx1] to motionInfoAwp1.
And 6, setting the values of the BgcFlag and the BgcIndex to be 0. If AwpMvrCandFlag0 or AwpMvrCandFlag1 is equal to 1, correction is performed for mvAwp0L0, mvAwp0L1, and mvAwp1L0, mvAwp1L 1.
a) And respectively obtaining motion vector offsets AwpMvrOffset0 and AwpMvrOffset1 according to a table look-up 9 of the values of the AwpMvrCandStep0 and the AwpMvrCandStep 1.
TABLE 9
Figure GDA0003895886610000602
Figure GDA0003895886610000611
b) If the value of the AwpMvrCandFlagX is equal to 1, the mvAwpXL0 and the mvAwpXL1 are corrected, and the X is 0 or 1.
If the value of RefIdxAwpXL0 is greater than or equal to 0, mvawpxxl 0 (mvawpxxl 0_ x, mvAwpXL0_ y) is corrected to:
Figure GDA0003895886610000612
otherwise (the value of RefIdxWPXL 1 is greater than or equal to 0), mvAwpXL1 (mvAwpXL 1_ x, mvAwpXL1_ y) is corrected as follows:
Figure GDA0003895886610000613
in AwpMvrCandDirX, awpMvrOffset and AwpMvrCanDirX, X has a value of 0 or 1.
Example 17: the construction process of the SAWP mode aiming at the I frame, the SAWP mode of the P frame, the SAWP mode of the B frame and the intra prediction mode list (i.e. the intra information candidate list) comprises the following steps:
if the current block E is a luma block (i.e., a luma component), let modAngNum equal SawpIndex%8.
And step 1, calculating the value of a predicted value predritrappredmode [ i ] of the current block prediction mode, wherein the value range of i is 0-1. The length of the intra information candidate list of the SAWP mode is 26, two of which are MPMs, i.e., i =0,1.
a) The following operations are performed on intraPredModeA: if the left prediction block A is 'present' and is a normal intra prediction block, assigning IntraLumaPredMode of A to IntraPredMode A; otherwise, the value of intraPredModeA equals-1. Mode validation processing is performed on intraPredModeA. If intraPredModais-1, intraPredModaA equals candidate mode 0 for modAngNum in Table 10.
b) The following operations are performed on intraPredModeB: if the upper prediction block B is 'existing' and is a common intra prediction block, assigning IntraLumaPredMode of B to IntraPredMode B; otherwise, the value of intraPredModeB is equal to-1. And carrying out mode validity processing on the intraPredModB. If intraPredModB is-1, intraPredModB equals candidate mode 0 for modAngNum in Table 10.
c) If intraPredModeA equals intraPredModeB, the following operations are performed: if intraPredModeA is equal to candidate mode0 for modAngNum in Table 10, intraPredModeA is equal to candidate mode1 for modAngNum in Table 10. Otherwise, if intraPredModeA is equal to candidate mode1 corresponding to modAngNum in Table 10, intraPredModeA is equal to candidate mode0 corresponding to modAngNum in Table 10.
d) predntrapredmode [0] is equal to Min (intrapredModea, intrapredModB) and predntrapredMode [1] is equal to Max (intrapredModea, intrapredModB).
Table 10 modAngNum corresponds to candidate patterns
modAngNum Candidate pattern 0 Candidate pattern 1
0 30 6
1 27 24
2 24 12
3 21 24
4 18 24
5 15 12
6 12 24
7 9 12
At step 2, the value of SawpPredMode0 (i.e., the first target intra mode) is calculated as follows.
Figure GDA0003895886610000621
At step 3, the value of SawpPredMode1 (i.e., the second target intra mode) is calculated as follows.
Figure GDA0003895886610000622
In the above process, the following method may be adopted to perform mode validity processing on intraPredModeX, where X is a or B:
Figure GDA0003895886610000623
Figure GDA0003895886610000631
example 18: in the above embodiment, regarding the first target mode information and the second target mode information of the current block, as to how to store the target mode information of the current block, the following manner may be adopted:
in one possible implementation, for each mode information storage unit of the current block, the storage mode of the mode information storage unit is determined according to the coordinates of the mode information storage unit, the weight prediction angle of the current block and the reference weight value of the peripheral position outside the current block; based on the storage manner of the mode information storage means, first target mode information is stored as target mode information of the mode information storage means, or second target mode information is stored as target mode information of the mode information storage means. For example, for the pattern information storage unit, a target pixel position may be selected from the pattern information storage unit (e.g., a pixel position may be selected from the pattern information storage unit as the target pixel position based on the coordinates of the pattern information storage unit), such as a pixel position at the upper left corner, a pixel position at the upper right corner, a pixel position at the lower left corner, a pixel position at the lower right corner, a center pixel position, and the like of the pattern information storage unit. And determining a peripheral matching position pointed by the target pixel position from peripheral positions outside the current block according to the weight prediction angle, and determining a storage mode of the mode information storage unit according to a reference weight value associated with the peripheral matching position. For example, if the reference weight value associated with the peripheral matching position is greater than a preset threshold (which may be configured empirically), the storage manner of the mode information storage unit is determined as storing the first target mode information, and if the reference weight value associated with the peripheral matching position is not greater than the preset threshold, the storage manner of the mode information storage unit is determined as storing the second target mode information; or if the reference weight value associated with the peripheral matching position is greater than the preset threshold, determining that the storage mode of the mode information storage unit is to store the second target mode information, and if the reference weight value associated with the peripheral matching position is not greater than the preset threshold, determining that the storage mode of the mode information storage unit is to store the first target mode information. The first object pattern information is stored as object pattern information of the pattern information storage unit if the mode information storage unit stores the first object pattern information, or the second object pattern information is stored as object pattern information of the pattern information storage unit if the mode information storage unit stores the second object pattern information.
In another possible embodiment, for each mode information storage unit of the current block, the storage mode of the mode information storage unit can be determined according to the coordinates of the mode information storage unit, the weighted prediction angle of the current block and the weighted prediction position of the current block; the first target pattern information is stored as target pattern information of the pattern information storage unit or the second target pattern information is stored as target pattern information of the pattern information storage unit based on a storage manner of the pattern information storage unit. For example, if the mode information storage means stores the first object mode information, the first object mode information is stored as the object mode information of the mode information storage means, or if the mode information storage means stores the second object mode information, the second object mode information is stored as the object mode information of the mode information storage means.
For example, the current block may be divided into at least one pattern information storage unit, and the size of each pattern information storage unit may be arbitrarily configured, for example, 1 × 1 pattern information storage unit, 2 × 2 pattern information storage unit, 4 × 4 pattern information storage unit, and the like. For each mode information storage unit of the current block, a storage manner of the mode information storage unit may be determined according to the weight prediction angle and the weight prediction position, and based on the storage manner of the mode information storage unit, the first target mode information may be stored as target mode information of the mode information storage unit, or the second target mode information may be stored as target mode information of the mode information storage unit. In summary, for each mode information storage unit (e.g. 4 × 4 size) of the current block, the first target mode information is determined to be stored as the target mode information of the mode information storage unit according to the weight prediction angle and the weight prediction position, or the second target mode information is determined to be stored as the target mode information of the mode information storage unit according to the relative position relationship between each mode information storage unit and the "division result".
The following describes a storage process of the target mode information in conjunction with several specific application scenarios. Assuming that the size of the current block is M × N, M is the width of the current block, N is the height of the current block, X is the log2 logarithm of the tan value of the weighted prediction angle, such as 0 or 1, y is the index value of the weighted prediction position, such as-3 to 3, etc., and a, b, c, d are preset constant values.
Application scenario 1: the effective amount VL is determined by the following equation: VL = (N + (M > > X)) < <1; the parameter FP is determined by the following formula: FP = (VL > > 1) -a + Y ((VL-1) > > 3). Recording coordinates of a center position or an upper left corner position as (X, y) for each pattern information storage unit, based on which if (y < < 1) + ((X < < 1) > > X) is greater than or equal to FP, the pattern information storage unit is stored in such a manner that first target pattern information is stored; otherwise, the mode information storage unit stores the target mode information.
Application scenario 2: the effective amount VL is determined by the following equation: VL = (N + (M > > X)) < <1; the parameter FP is determined by the following formula: FP = (VL > > 1) -b + Y ((VL-1) > > 3) - ((M < < 1) > > X). Recording coordinates of a center position or an upper left corner position as (X, y) for each pattern information storage unit, based on which if (y < < 1) - ((X < < 1) > > X) is greater than or equal to FP, the pattern information storage unit stores first target pattern information in a manner of storing the first target pattern information; otherwise, the mode information storage unit stores the second target mode information.
Application scenario 3: the effective amount VL is determined by the following equation: VL = (M + (N > > X)) < <1; the parameter FP is determined by the following formula: FP = (VL > > 1) -c + Y ((VL-1) > > 3) - ((N < < 1) > > X). Recording coordinates of the center position or the upper left corner position as (X, y) for each pattern information storage unit, based on which if (X < < 1) - ((y < < 1) > > X) is greater than or equal to FP, the pattern information storage unit is stored in such a manner that first target pattern information is stored; otherwise, the mode information storage unit stores the second target mode information.
Application scenario 4: the effective amount VL is determined by the following equation: VL = (M + (N > > X)) < <1; the parameter FP is determined by the following formula: FP = (VL > > 1) -d + Y ((VL-1) > > 3). Recording coordinates of a center position or a position of an upper left corner as (X, y) for each pattern information storage unit, based on which if (X < < 1) + ((y < < 1) > > X) is greater than or equal to FP, the pattern information storage unit is stored in such a manner that first target pattern information is stored; otherwise, the mode information storage unit may be configured to store the second target mode information.
Illustratively, the storage manner of each mode information storage unit is determined based on the application scenarios 1 to 4, and based on the storage manner of the mode information storage unit, the first target mode information may be stored as the target mode information of the mode information storage unit, or the second target mode information may be stored as the target mode information of the mode information storage unit.
Application scenario 5: when the first target mode information and the second target mode information are from different reference frame lists, the following storage manner may be adopted: the effective amount VL is determined by the following equation: VL = (M + (N > > X)) < <1; the parameter FP is determined by the following formula: FP = (VL > > 1) -d + Y ((VL-1) > > 3). Recording coordinates of a center position or a position of an upper left corner as (X, y) for each pattern information storage means, and based on this, if (X < < 1) + ((y < < 1) > > X) is larger than FP, the pattern information storage means stores first target pattern information in a manner of storing the first target pattern information; if (X < < 1) + ((y < < 1) > > X) is smaller than FP, the mode information storage means stores the second target mode information in a manner of storing it; if (X < < 1) + ((y < < 1) > > X) is equal to FP, the pattern information storage unit may store the new pattern information (i.e., the new pattern information in which the first object pattern information and the second object pattern information are combined).
Application scenario 6: when the first target mode information and the second target mode information come from different reference frame lists, the following storage manner may be adopted: the effective amount VL is determined by the following equation: VL = (M + (N > > X)) < <1; the parameter FP is determined by the following formula: FP = (VL > > 1) -d + Y ((VL-1) > > 3). Recording coordinates of a center position or an upper left corner position as (X, y) for each mode information storage unit, and based on this, (X < < 1) + ((y < < 1) > > X) being greater than f1, the mode information storage unit stores the first target mode information in a storage manner; if (X < < 1) + ((y < < 1) > > X) is less than f2, the mode information storage means is stored in such a manner that the second target mode information is stored; if (X < < 1) + ((y < < 1) > > X) is not greater than f1 and not less than f2, the mode information storage unit may store the new mode information (i.e., the new mode information in which the first target mode information and the second target mode information are combined).
For example, f1 may be larger than FP, and f2 may be smaller than FP, and values of f1 and f2 are not limited. If f1 can be FP +2, f2 can be FP-2, of course, f1 and f2 can be arbitrarily set.
Illustratively, based on the application scenarios 5 and 6, the storage manner of each mode information storage unit is determined, and based on the storage manner of the mode information storage unit, the first target mode information may be stored as the target mode information of the mode information storage unit, or the second target mode information may be stored as the target mode information of the mode information storage unit, or the new mode information may be stored as the target mode information of the mode information storage unit.
Application scenario 7: for the AWP mode of the B frame, the AWP _ MVR mode, the AWP _ SCC mode, the AWP mode of the P frame and the SAWP mode of the I frame, the P frame and the B frame, the storage modes of the target mode information are consistent.
Let W and H be the width and height of the current block, (x, y) be the top left pixel position of each 4 × 4 sub-block in the current block, pos _ x be equal to ((x > > 2) < < 2) +2, pos \\ y be equal to ((y > > 2) < < 2) +2, i.e. the center position, then the target mode information storage mode modeloragetype for each 4 × 4 block can be derived as follows:
a) The values for stepIndex, angleIndex, and angelAreaIndex were calculated as follows.
Figure GDA0003895886610000651
b) tP and FP are obtained according to the angleAreaIndex table look-up table 11, and based on tP and FP, the target mode information storage mode modelStorageType of each 4 x 4 block in the current block can be calculated in the following way.
Figure GDA0003895886610000652
TABLE 11
Figure GDA0003895886610000661
Illustratively, the mode information storage unit stores the first target mode information if ModeStorageType is equal to 0, and stores the second target mode information otherwise (ModeStorageType is equal to 1).
For example, the above embodiments may be implemented separately or in combination, for example, embodiment 1 and embodiment 2 are implemented in combination, embodiment 1 and embodiment 3 are implemented in combination, embodiment 1 and at least one of embodiment 4 to embodiment 12 are implemented in combination, embodiment 1 and at least one of embodiment 14 to embodiment 18 are implemented in combination, embodiment 2 and at least one of embodiment 4 to embodiment 12 are implemented in combination, embodiment 2 and at least one of embodiment 14 to embodiment 18 are implemented in combination, embodiment 3 and at least one of embodiment 4 to embodiment 12 are implemented in combination, and embodiment 3 and at least one of embodiment 14 to embodiment 18 are implemented in combination. For another example, any at least two of embodiments 14 to 18 may be implemented in combination, any at least two of embodiments 4 to 12 may be implemented in combination, and the like. Example 12 and at least one of example 4 to example 12, and example 12 and at least one of example 14 to example 18. Of course, the above are only examples, and the combination manner between the embodiments is not limited.
For example, in the above embodiments, the content of the encoding end may also be applied to the decoding end, that is, the decoding end may perform processing in the same manner, and the content of the decoding end may also be applied to the encoding end, that is, the encoding end may perform processing in the same manner.
Example 19: based on the same application concept as the method, the embodiment of the present application further provides a decoding apparatus, where the decoding apparatus is applied to a decoding end, and the decoding apparatus includes: a memory configured to store video data; a decoder configured to implement the encoding and decoding methods in the above embodiments 1 to 18, i.e., the processing flow of the decoding end.
For example, in one possible implementation, a decoder configured to implement:
when determining to start weighted prediction on a current block, acquiring a weighted prediction angle and a weighted configuration parameter of the current block; wherein the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the method for determining the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B-frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining the weight conversion rate as a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate;
Configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
for each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
obtaining a mode information candidate list created for a current block, the mode information candidate list including at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
determining a first predicted value of the pixel position according to the first target mode information, and determining a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value;
and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
Based on the same application concept as the method, the embodiment of the present application further provides an encoding apparatus, where the encoding apparatus is applied to an encoding end, and the encoding apparatus includes: a memory configured to store video data; an encoder configured to implement the encoding and decoding methods in embodiments 1 to 18, i.e., the processing flow at the encoding end.
For example, in one possible implementation, an encoder configured to implement:
when determining to start weighted prediction on a current block, acquiring a weighted prediction angle and a weighted configuration parameter of the current block; wherein the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the method for determining the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B-frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining the weight conversion rate as a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate;
Configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
for each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
obtaining a mode information candidate list created for a current block, the mode information candidate list including at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
determining a first predicted value of the pixel position according to the first target mode information, and determining a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value;
and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
Based on the same application concept as the method, the embodiment of the present application further provides an encoding and decoding apparatus, where the apparatus includes: the obtaining module is used for obtaining a weight prediction angle and a weight configuration parameter of a current block when the current block is determined to start weight prediction; the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the determination method of the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining the weight conversion rate as a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate; the configuration module is used for configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter; a determining module, configured to determine, for each pixel position of the current block, a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weighted prediction angle; determining a target weight value of the pixel position according to a reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position; the obtaining module is further configured to obtain a mode information candidate list created for the current block, where the mode information candidate list includes at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list; the determining module is further configured to determine a first predicted value of the pixel position according to the first target mode information, and determine a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value; and determining the weighted prediction value of the current block according to the weighted prediction values of all the pixel positions of the current block.
For example, the determining module is specifically configured to, when determining the peripheral matching position corresponding to the pixel position from the peripheral positions outside the current block based on the weighted prediction angle: if the frame type of the current frame where the current block is located is a B frame, determining a peripheral matching position pointed by the pixel position from peripheral positions outside the current block based on the weight prediction angle; or if the frame type of the current frame where the current block is located is a P frame, determining the sub-block where the pixel position is located from all sub-blocks included in the current block; and determining the peripheral position pointed by the preset position in the sub-block from the peripheral positions outside the current block based on the weight prediction angle, and determining the peripheral position as a peripheral matching position corresponding to the pixel position.
For example, the configuration module is specifically configured to, when configuring the reference weight value for the peripheral position outside the current block according to the weight configuration parameter: and configuring a reference weight value of the peripheral position according to the coordinate value of the peripheral position, the coordinate value of the initial position of the weight transformation and the weight transformation rate aiming at the peripheral position outside the current block.
For example, when the obtaining module obtains the weighted prediction angle of the current block, the obtaining module is specifically configured to: if the frame type of the current frame where the current block is located is a B frame, acquiring the weight prediction angle of the current block from a first angle list; if the frame type of the current frame where the current block is located is a P frame, acquiring a weight prediction angle of the current block from a second angle list; wherein the weighted prediction angles included in the second angle list are a subset of the weighted prediction angles included in the first angle list; the obtaining module, when obtaining the weight prediction position of the current block, is specifically configured to: if the frame type of the current frame where the current block is located is a B frame, acquiring a weight prediction position of the current block from a first position list; if the frame type of the current frame where the current block is located is a P frame, acquiring a weight prediction position of the current block from a second position list; wherein the weighted predicted positions included in the second location list are a subset of the weighted predicted positions included in the first location list.
Illustratively, if an inter-frame AWP mode is started for the current block, the mode information candidate list is a motion information candidate list, the motion information candidate list includes at least one candidate motion information, the first target mode information is first target motion information, and the second target mode information is second target motion information; the obtaining module is specifically configured to, when obtaining the motion information candidate list created for the current block: acquiring at least one piece of available motion information to be added into the motion information candidate list of the current block; obtaining the motion information candidate list based on the at least one available motion information; wherein the at least one available motion information comprises at least one of the following motion information: temporal motion information; spatial domain motion information; and presetting motion information.
For example, the obtaining module, when obtaining at least one available motion information to be added to the motion information candidate list of the current block, is specifically configured to: if the frame type of the current frame where the current block is located is a P frame, determining a co-located frame of the current frame, and determining a co-located block of the current block from the co-located frame; if the co-located block is a non-inter-frame prediction block, deriving unidirectional zero motion information pointing to a reference frame with a reference index value of 0 in a first reference frame list; otherwise, if the motion information of the co-located block pointing to the first reference frame list exists, acquiring the unidirectional motion information of the reference frame pointing to the reference index value 0 in the first reference frame list through telescopic operation based on the unidirectional motion information pointing to the first reference frame list; alternatively, the first and second electrodes may be,
if the frame type of the current frame where the current block is located is a P frame, determining a co-located frame of the current frame, and determining a co-located block of the current block from the co-located frame; if the co-located block is a non-inter-frame prediction block, deriving unidirectional motion information pointing to a reference frame with a reference index value of 0 in a first reference frame list by using an airspace neighboring block; otherwise, if the motion information of the co-located block pointing to the first reference frame list exists, based on the unidirectional motion information pointing to the first reference frame list, unidirectional motion information pointing to a reference frame with a reference index value of 0 in the first reference frame list is obtained through a scaling operation.
For example, the obtaining module is specifically configured to, when obtaining the first target motion information and the second target motion information of the current block based on the motion information candidate list: if the frame type of the current frame where the current block is located is a B frame, selecting candidate motion information from the motion information candidate list as first original motion information of the current block, and selecting candidate motion information from the motion information candidate list as second original motion information of the current block; determining first target motion information of the current block according to the first original motion information; and determining second target motion information of the current block according to the second original motion information. And if the frame type of the current frame where the current block is located is a P frame, selecting one candidate motion information from the motion information candidate list as the first target motion information of the current block, and selecting another candidate motion information from the motion information candidate list as the second target motion information of the current block.
Based on the same application concept as the method, the decoding side device (also referred to as a video decoder) provided by the embodiment of the present application includes, from a hardware level, a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor; the processor is configured to execute machine executable instructions to implement the methods disclosed in embodiments 1-18 of the present application. For example, a processor is used to execute machine executable instructions to implement the steps of:
When the weighted prediction of a current block is determined, acquiring a weighted prediction angle and a weighted configuration parameter of the current block; wherein the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the method for determining the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B-frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining that the weight conversion rate is a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate;
configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
for each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; determining a target weight value of the pixel position according to a reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
Obtaining a mode information candidate list created for a current block, the mode information candidate list including at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
determining a first predicted value of the pixel position according to the first target mode information, and determining a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value;
and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
Based on the same application concept as the method described above, the encoding end device (also referred to as a video encoder) provided in the embodiments of the present application includes, from a hardware level, a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is configured to execute machine executable instructions to implement the methods disclosed in embodiments 1-18 described above. For example, a processor is used to execute machine executable instructions to implement the steps of:
When determining to start weighted prediction on a current block, acquiring a weighted prediction angle and a weighted configuration parameter of the current block; wherein the weight configuration parameters comprise weight transformation rate and initial position of weight transformation; the method for determining the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a B-frame and the current block supports weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining that the weight conversion rate is a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate;
configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
for each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
Obtaining a mode information candidate list created for a current block, the mode information candidate list including at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
determining a first predicted value of the pixel position according to the first target mode information, and determining a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value;
and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
Based on the same application concept as the method, embodiments of the present application further provide a machine-readable storage medium, where several computer instructions are stored on the machine-readable storage medium, and when the computer instructions are executed by a processor, the method disclosed in the above examples of the present application, such as the encoding and decoding method in the above embodiments, can be implemented.
Based on the same application concept as the method, the embodiment of the present application further provides a computer application program, and when the computer application program is executed by a processor, the computer application program can implement the encoding and decoding method disclosed in the above example of the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. The present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.

Claims (28)

1. A method of decoding, the method comprising:
when determining to start weighted prediction on a current block, acquiring a weighted prediction angle and a weighted configuration parameter of the current block; wherein the weight configuration parameters comprise a weight transformation rate and a weight transformation starting position, and the weight transformation starting position is determined by at least one of the following parameters: the weighted prediction angle, the weighted prediction position of the current block, and the size of the current block; the method for determining the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein, if the frame type is a P frame, the weight transformation ratio is a maximum value of a reference weight value; or, if the frame type is a B frame and the current block supports a weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining that the weight conversion rate is a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate; wherein the obtaining of the weighted prediction angle of the current block comprises: if the frame type of the current frame where the current block is located is a B frame, acquiring the weight prediction angle of the current block from a first angle list; if the frame type of the current frame where the current block is located is a P frame, acquiring a weight prediction angle of the current block from a second angle list; the weighted prediction angles included in the second angle list are a subset of the weighted prediction angles included in the first angle list; wherein the obtaining the weighted prediction position of the current block comprises: if the frame type of the current frame where the current block is located is a B frame, acquiring the weight prediction position of the current block from a first position list; if the frame type of the current frame where the current block is located is a P frame, acquiring the weight prediction position of the current block from a second position list; the weighted predicted positions included in the second location list are a subset of the weighted predicted positions included in the first location list;
Configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
for each pixel position of the current block, determining a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weight prediction angle; determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
obtaining a mode information candidate list created for a current block, the mode information candidate list including at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
determining a first predicted value of the pixel position according to the first target mode information, and determining a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value;
and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
2. The method of claim 1, further comprising:
selecting partial weight prediction angles from the first angle list based on the size of the current block, and constructing the second angle list based on the selected partial weight prediction angles; selecting partial weight prediction positions from the first position list based on the size of the current block, and constructing a second position list based on the selected partial weight prediction positions;
wherein the size of the current block includes a width of the current block and a height of the current block.
3. The method of claim 1, wherein the determining the matching position of the periphery corresponding to the pixel position from the periphery positions outside the current block based on the weight prediction angle comprises:
if the frame type of the current frame where the current block is located is a B frame, determining a peripheral matching position pointed by the pixel position from peripheral positions outside the current block based on the weight prediction angle; alternatively, the first and second electrodes may be,
if the frame type of the current frame where the current block is located is a P frame, determining the sub-block where the pixel position is located from all sub-blocks included in the current block; and determining the peripheral position pointed by the preset position in the sub-block from the peripheral positions outside the current block based on the weight prediction angle, and determining the peripheral position as a peripheral matching position corresponding to the pixel position.
4. The method of claim 1,
configuring a reference weight value for a peripheral position outside the current block according to the weight configuration parameter, including:
and configuring a reference weight value of the peripheral position for the peripheral position outside the current block according to the coordinate value of the peripheral position, the coordinate value of the initial position of the weight transformation and the weight transformation rate.
5. The method of any of claims 1-4, wherein the number of peripheral locations outside the current block is determined by at least one of the following parameters: the size of the current block, the weighted prediction angle; the peripheral location outside the current block comprises: the peripheral position of the upper line outside the current block; or, the peripheral position of the left column outside the current block;
wherein the reference weight value of the peripheral position outside the current block is monotonically increased or monotonically decreased;
if the peripheral position outside the current block comprises the peripheral position of the upper side line outside the current block, the reference weight value in the sequence from left to right is monotonically increased or monotonically decreased; or, if the peripheral position outside the current block includes a peripheral position in a column on the left side outside the current block, the reference weight value in the order from top to bottom is monotonically increasing or monotonically decreasing;
Wherein the peripheral location outside the current block comprises a target region, a first vicinity of the target region, a second vicinity of the target region; the reference weight values of the first adjacent area are all first reference weight values, the reference weight values of the second adjacent area are all second reference weight values, and the first reference weight values are different from the second reference weight values; the target area comprises one reference weight value or at least two reference weight values; if the target area comprises at least two reference weight values, the at least two reference weight values of the target area are monotonically increased or monotonically decreased;
wherein the weighted prediction angle of the current block is a horizontal angle; or, the weighted prediction angle of the current block is a vertical angle; or the absolute value of the slope of the weighted prediction angle of the current block is the nth power of 2, and n is an integer.
6. The method of any of claims 1-4, wherein if inter AWP mode is enabled for the current block, the mode information candidate list is a motion information candidate list, the motion information candidate list comprises at least one candidate motion information, the first target mode information is first target motion information, and the second target mode information is second target motion information; wherein the obtaining of the motion information candidate list created for the current block includes:
Acquiring at least one available motion information to be added into the motion information candidate list of the current block;
obtaining the motion information candidate list based on the at least one available motion information;
wherein the at least one available motion information comprises at least one of the following motion information:
temporal motion information; spatial domain motion information; and presetting motion information.
7. The method of claim 6,
the obtaining at least one available motion information to be added to the motion information candidate list of the current block includes:
if the frame type of the current frame where the current block is located is a P frame, determining a co-located frame of the current frame, and determining a co-located block of the current block from the co-located frame; if the co-located block is a non-inter-frame prediction block, deriving unidirectional zero motion information pointing to a reference frame with a reference index value of 0 in a first reference frame list; otherwise, if the motion information of the co-located block pointing to the first reference frame list exists, based on the unidirectional motion information pointing to the first reference frame list, unidirectional motion information pointing to a reference frame with a reference index value of 0 in the first reference frame list is obtained through a scaling operation.
8. The method of claim 6,
said obtaining the motion information candidate list based on the at least one available motion information comprises:
for available motion information to be added to the motion information candidate list, adding unidirectional motion information to the motion information candidate list if the available motion information is unidirectional motion information, or adding unidirectional motion information to the motion information candidate list if the available motion information is unidirectional motion information and the unidirectional motion information is not repeated with candidate motion information already existing in the motion information candidate list;
for available motion information to be added into the motion information candidate list, if the available motion information is bidirectional motion information, cutting the available motion information into unidirectional motion information according to the attribute of the available motion information; and adding the unidirectional motion information into the motion information candidate list, or adding the unidirectional motion information into the motion information candidate list when the unidirectional motion information is not repeated with the candidate motion information existing in the motion information candidate list.
9. The method of claim 8,
the clipping the available motion information into unidirectional motion information according to the attribute of the available motion information includes: clipping the available motion information into unidirectional motion information according to the odd-even attribute of the serial number of the available motion information;
the cropping the available motion information into unidirectional motion information according to the parity attribute of the number of the available motion information comprises: determining a number of the available motion information based on a traversal order of neighboring blocks of the current block if the available motion information is motion information of the neighboring blocks; wherein the adjacent blocks are spatial adjacent blocks and/or temporal adjacent blocks;
if the odd-even attribute of the number is an even number, the available motion information is cut into unidirectional motion information pointing to a reference frame in list 0; and if the odd-even attribute of the number is an odd number, cutting the available motion information into unidirectional motion information pointing to a reference frame in list 1.
10. The method of claim 8,
the duplication checking operation for the unidirectional motion information and the candidate motion information existing in the motion information candidate list comprises the following steps:
If the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information, and the motion vector of the unidirectional motion information is the same as the motion vector of the candidate motion information, determining that the unidirectional motion information is repeated with the candidate motion information; otherwise, determining that the unidirectional motion information and the candidate motion information are not repeated;
wherein the determining process of whether the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information comprises:
if the reference frame list pointed by the unidirectional motion information is the same as the reference frame list pointed by the candidate motion information, and the reference frame index pointed by the unidirectional motion information is the same as the reference frame index pointed by the candidate motion information, determining that the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information; otherwise, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information;
or, if the display order POC of the reference frame pointed to by the unidirectional motion information is the same as the POC of the reference frame pointed to by the candidate motion information, determining that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information; otherwise, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information;
Or if the reference frame pointed by the unidirectional motion information is a knowledge base frame, the reference frame pointed by the candidate motion information is a non-knowledge base frame, or the reference frame pointed by the unidirectional motion information is a non-knowledge base frame, and the reference frame pointed by the candidate motion information is a knowledge base frame, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information; if the reference frame pointed to by the unidirectional motion information and the reference frame pointed to by the candidate motion information are both non-knowledge base frames, comparing whether the POC of the reference frame pointed to by the unidirectional motion information is the same as the POC of the reference frame pointed to by the candidate motion information, if so, determining that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information, and if not, determining that the reference frame pointed to by the unidirectional motion information is different from the reference frame pointed to by the candidate motion information; if the reference frame pointed by the unidirectional motion information and the reference frame pointed by the candidate motion information are knowledge base frames, determining that the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information;
Or if the reference frame pointed by the unidirectional motion information is a knowledge base frame, the reference frame pointed by the candidate motion information is a non-knowledge base frame, or the reference frame pointed by the unidirectional motion information is a non-knowledge base frame, and the reference frame pointed by the candidate motion information is a knowledge base frame, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information; if the reference frame pointed to by the unidirectional motion information and the reference frame pointed to by the candidate motion information are both non-knowledge base frames, comparing whether the POC of the reference frame pointed to by the unidirectional motion information is the same as the POC of the reference frame pointed to by the candidate motion information, if so, determining that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information, and if not, determining that the reference frame pointed to by the unidirectional motion information is different from the reference frame pointed to by the candidate motion information; if the reference frame pointed by the unidirectional motion information and the reference frame pointed by the candidate motion information are knowledge base frames, comparing whether the knowledge base frame index of the reference frame pointed by the unidirectional motion information is equal to the knowledge base frame index of the reference frame pointed by the candidate motion information, if so, determining that the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information, and if not, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information.
11. The method of claim 6, wherein obtaining the first target motion information and the second target motion information of the current block based on the motion information candidate list comprises:
if the frame type of the current frame where the current block is located is a B frame, selecting candidate motion information from the motion information candidate list as first original motion information of the current block, and selecting candidate motion information from the motion information candidate list as second original motion information of the current block; determining first target motion information of the current block according to the first original motion information; determining second target motion information of the current block according to the second original motion information; alternatively, the first and second electrodes may be,
and if the frame type of the current frame where the current block is located is a P frame, selecting one candidate motion information from the motion information candidate list as the first target motion information of the current block, and selecting another candidate motion information from the motion information candidate list as the second target motion information of the current block.
12. The method of claim 11,
the determining the first target motion information of the current block according to the first original motion information includes:
Acquiring a first motion vector difference corresponding to a first original motion vector; determining a first target motion vector according to the first motion vector difference and the first original motion vector, or determining the first original motion vector as a first target motion vector;
the determining the second target motion information of the current block according to the second original motion information includes:
acquiring a second motion vector difference corresponding to a second original motion vector; determining a second target motion vector according to the second motion vector difference and the second original motion vector, or determining the second original motion vector as a second target motion vector;
the obtaining a first motion vector difference corresponding to a first original motion vector comprises: acquiring direction information and amplitude information of a first motion vector difference, and determining the first motion vector difference according to the direction information and the amplitude information of the first motion vector difference;
the obtaining a second motion vector difference corresponding to a second original motion vector comprises: and acquiring direction information and amplitude information of the second motion vector difference, and determining the second motion vector difference according to the direction information and the amplitude information of the second motion vector difference.
13. The method of any of claims 1-4, wherein after determining the weighted predictor of the current block based on the weighted predictors for all pixel positions of the current block, the method further comprises:
for each mode information storage unit of the current block, determining a storage mode of the mode information storage unit according to the coordinates of the mode information storage unit, the weight prediction angle and the weight prediction position of the current block; and storing the first target pattern information as target pattern information of the pattern information storage unit or storing the second target pattern information as target pattern information of the pattern information storage unit based on a storage manner of the pattern information storage unit.
14. A decoding apparatus, applied to a decoding side, the decoding apparatus comprising:
the device comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring a weight prediction angle and a weight configuration parameter of a current block when determining that the weighted prediction is started on the current block; wherein the weight configuration parameters comprise a weight transformation rate and a weight transformation starting position, and the weight transformation starting position is determined by at least one of the following parameters: the weighted prediction angle, the weighted prediction position of the current block, and the size of the current block; the determination method of the weight transformation rate comprises the following steps: determining the weight transformation rate based on the frame type of the current frame where the current block is located; wherein if the frame type is a P frame, the weight transformation rate is the maximum value of the reference weight value; or, if the frame type is a B frame and the current block supports a weighted transform rate switching mode, then: acquiring weight transformation rate indication information of the current block; if the weight conversion rate indication information is first indication information, determining the weight conversion rate as a first weight conversion rate; if the weight conversion rate indication information is second indication information, determining that the weight conversion rate is a second weight conversion rate; the obtaining module is specifically configured to, when obtaining the weight prediction angle of the current block: if the frame type of the current frame where the current block is located is a B frame, acquiring the weight prediction angle of the current block from a first angle list; if the frame type of the current frame where the current block is located is a P frame, acquiring the weight prediction angle of the current block from a second angle list; the weighted prediction angles included in the second angle list are a subset of the weighted prediction angles included in the first angle list; wherein, when the obtaining module obtains the weight prediction position of the current block, the obtaining module is specifically configured to: if the frame type of the current frame where the current block is located is a B frame, acquiring the weight prediction position of the current block from a first position list; if the frame type of the current frame where the current block is located is a P frame, acquiring the weight prediction position of the current block from a second position list; the weighted predicted positions included in the second location list are a subset of the weighted predicted positions included in the first location list;
The configuration module is used for configuring a reference weight value for the peripheral position outside the current block according to the weight configuration parameter;
a determining module, configured to determine, for each pixel position of the current block, a peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weighted prediction angle; determining a target weight value of the pixel position according to the reference weight value associated with the peripheral matching position, and determining an associated weight value of the pixel position according to the target weight value of the pixel position;
the obtaining module is further configured to obtain a mode information candidate list created for the current block, where the mode information candidate list includes at least one candidate mode information; acquiring first target mode information and second target mode information of the current block based on the mode information candidate list;
the determining module is further configured to determine a first predicted value of the pixel position according to the first target mode information, and determine a second predicted value of the pixel position according to the second target mode information; determining a weighted predicted value of the pixel position according to the first predicted value, the target weight value, the second predicted value and the associated weight value; and determining the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.
15. The apparatus of claim 14, wherein the obtaining module is further configured to:
selecting partial weight prediction angles from the first angle list based on the size of the current block, and constructing the second angle list based on the selected partial weight prediction angles; selecting partial weight prediction positions from the first position list based on the size of the current block, and constructing a second position list based on the selected partial weight prediction positions;
wherein the size of the current block includes a width of the current block and a height of the current block.
16. The apparatus of claim 14, wherein the determining module is configured to determine the peripheral matching position corresponding to the pixel position from peripheral positions outside the current block based on the weighted prediction angle, and is further configured to:
if the frame type of the current frame where the current block is located is a B frame, determining a peripheral matching position pointed by the pixel position from peripheral positions outside the current block based on the weight prediction angle; alternatively, the first and second electrodes may be,
if the frame type of the current frame where the current block is located is a P frame, determining the sub-block where the pixel position is located from all sub-blocks included in the current block; and determining the peripheral position pointed by the preset position in the sub-block from the peripheral positions outside the current block based on the weight prediction angle, and determining the peripheral position as a peripheral matching position corresponding to the pixel position.
17. The apparatus of claim 14, wherein the configuration module, when configuring the reference weight values for the peripheral locations outside the current block according to the weight configuration parameters, is specifically configured to:
and configuring a reference weight value of the peripheral position according to the coordinate value of the peripheral position, the coordinate value of the initial position of the weight transformation and the weight transformation rate aiming at the peripheral position outside the current block.
18. The apparatus according to any of claims 14-17, wherein the number of peripheral locations outside the current block is determined by at least one of the following parameters: the size of the current block, the weighted prediction angle; the peripheral location outside the current block comprises: the peripheral position of the upper line outside the current block; or, the peripheral position of the left column outside the current block; wherein the reference weight values of the peripheral positions outside the current block are monotonically increasing or monotonically decreasing;
if the peripheral position outside the current block comprises the peripheral position of the upper line outside the current block, the reference weight value in the sequence from left to right is monotonically increased or monotonically decreased; or, if the peripheral position outside the current block includes a peripheral position in a column on the left side outside the current block, the reference weight value in the order from top to bottom is monotonically increasing or monotonically decreasing;
Wherein the peripheral location outside the current block comprises a target region, a first vicinity of the target region, a second vicinity of the target region; the reference weight values of the first adjacent area are all first reference weight values, the reference weight values of the second adjacent area are all second reference weight values, and the first reference weight values are different from the second reference weight values; the target area comprises one reference weight value or at least two reference weight values; if the target area comprises at least two reference weight values, the at least two reference weight values of the target area are monotonically increased or monotonically decreased;
wherein the weighted prediction angle of the current block is a horizontal angle; or, the weighted prediction angle of the current block is a vertical angle; or the absolute value of the slope of the weighted prediction angle of the current block is the nth power of 2, and n is an integer.
19. The apparatus of any of claims 14-17, wherein if inter AWP mode is enabled for the current block, the mode information candidate list is a motion information candidate list, the motion information candidate list comprises at least one candidate motion information, the first target mode information is first target motion information, and the second target mode information is second target motion information; the obtaining module, when obtaining the motion information candidate list created for the current block, is specifically configured to:
Acquiring at least one available motion information to be added into the motion information candidate list of the current block;
obtaining the motion information candidate list based on the at least one available motion information;
wherein the at least one available motion information comprises at least one of the following motion information:
temporal motion information; spatial domain motion information; and presetting motion information.
20. The apparatus of claim 19, wherein the obtaining module, when obtaining at least one available motion information to be added to the motion information candidate list of the current block, is specifically configured to:
if the frame type of the current frame where the current block is located is a P frame, determining a co-located frame of the current frame, and determining a co-located block of the current block from the co-located frame; if the co-located block is a non-inter-frame prediction block, deriving unidirectional zero motion information pointing to a reference frame with a reference index value of 0 in a first reference frame list; otherwise, if the motion information of the co-located block pointing to the first reference frame list exists, based on the unidirectional motion information pointing to the first reference frame list, unidirectional motion information pointing to a reference frame with a reference index value of 0 in the first reference frame list is obtained through a scaling operation.
21. The apparatus of claim 19,
the obtaining module is specifically configured to, when obtaining the motion information candidate list based on the at least one available motion information:
for available motion information to be added to the motion information candidate list, adding the unidirectional motion information to the motion information candidate list if the available motion information is unidirectional motion information, or adding the unidirectional motion information to the motion information candidate list if the available motion information is unidirectional motion information and the unidirectional motion information is not repeated with candidate motion information already existing in the motion information candidate list;
for available motion information to be added into the motion information candidate list, if the available motion information is bidirectional motion information, cutting the available motion information into unidirectional motion information according to the attribute of the available motion information; and adding the unidirectional motion information into the motion information candidate list, or adding the unidirectional motion information into the motion information candidate list when the unidirectional motion information is not repeated with the candidate motion information existing in the motion information candidate list.
22. The apparatus of claim 21, wherein the obtaining module, when clipping the available motion information into one-way motion information according to the attribute of the available motion information, is specifically configured to: clipping the available motion information into unidirectional motion information according to the odd-even attribute of the serial number of the available motion information; the obtaining module is specifically configured to, when the available motion information is clipped to the unidirectional motion information according to the parity attribute of the number of the available motion information: determining a number of the available motion information based on a traversal order of neighboring blocks of the current block if the available motion information is motion information of the neighboring blocks; wherein the adjacent blocks are spatial adjacent blocks and/or temporal adjacent blocks; if the odd-even attribute of the number is an even number, the available motion information is cut into unidirectional motion information pointing to a reference frame in list 0; and if the odd-even attribute of the number is an odd number, cutting the available motion information into unidirectional motion information pointing to a reference frame in list 1.
23. The apparatus of claim 21, wherein the obtaining module is configured to, when performing a duplication checking operation on the uni-directional motion information and candidate motion information already existing in the motion information candidate list:
If the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information, and the motion vector of the unidirectional motion information is the same as the motion vector of the candidate motion information, determining that the unidirectional motion information is repeated with the candidate motion information; otherwise, determining that the unidirectional motion information and the candidate motion information are not repeated;
wherein the determining process of whether the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information comprises:
if the reference frame list pointed by the unidirectional motion information is the same as the reference frame list pointed by the candidate motion information, and the reference frame index pointed by the unidirectional motion information is the same as the reference frame index pointed by the candidate motion information, determining that the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information; otherwise, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information;
or if the display order POC of the reference frames pointed to by the unidirectional motion information is the same as the POC of the reference frames pointed to by the candidate motion information, determining that the reference frames pointed to by the unidirectional motion information are the same as the reference frames pointed to by the candidate motion information; otherwise, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information;
Or if the reference frame pointed by the unidirectional motion information is a knowledge base frame, the reference frame pointed by the candidate motion information is a non-knowledge base frame, or the reference frame pointed by the unidirectional motion information is a non-knowledge base frame, and the reference frame pointed by the candidate motion information is a knowledge base frame, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information; if the reference frame pointed to by the unidirectional motion information and the reference frame pointed to by the candidate motion information are both non-knowledge base frames, comparing whether the POC of the reference frame pointed to by the unidirectional motion information is the same as the POC of the reference frame pointed to by the candidate motion information, if so, determining that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information, and if not, determining that the reference frame pointed to by the unidirectional motion information is different from the reference frame pointed to by the candidate motion information; if the reference frame pointed by the unidirectional motion information and the reference frame pointed by the candidate motion information are knowledge base frames, determining that the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information;
Or if the reference frame pointed by the unidirectional motion information is a knowledge base frame, the reference frame pointed by the candidate motion information is a non-knowledge base frame, or the reference frame pointed by the unidirectional motion information is a non-knowledge base frame, and the reference frame pointed by the candidate motion information is a knowledge base frame, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information; if the reference frame pointed to by the unidirectional motion information and the reference frame pointed to by the candidate motion information are both non-knowledge base frames, comparing whether the POC of the reference frame pointed to by the unidirectional motion information is the same as the POC of the reference frame pointed to by the candidate motion information, if so, determining that the reference frame pointed to by the unidirectional motion information is the same as the reference frame pointed to by the candidate motion information, and if not, determining that the reference frame pointed to by the unidirectional motion information is different from the reference frame pointed to by the candidate motion information; if the reference frame pointed by the unidirectional motion information and the reference frame pointed by the candidate motion information are knowledge base frames, comparing whether the knowledge base frame index of the reference frame pointed by the unidirectional motion information is equal to the knowledge base frame index of the reference frame pointed by the candidate motion information, if so, determining that the reference frame pointed by the unidirectional motion information is the same as the reference frame pointed by the candidate motion information, and if not, determining that the reference frame pointed by the unidirectional motion information is different from the reference frame pointed by the candidate motion information.
24. The apparatus of claim 19, wherein the obtaining module is configured to, when obtaining the first target motion information and the second target motion information of the current block based on the motion information candidate list, specifically:
if the frame type of the current frame where the current block is located is a B frame, selecting candidate motion information from the motion information candidate list as first original motion information of the current block, and selecting candidate motion information from the motion information candidate list as second original motion information of the current block; determining first target motion information of the current block according to the first original motion information; determining second target motion information of the current block according to the second original motion information; alternatively, the first and second electrodes may be,
and if the frame type of the current frame where the current block is located is a P frame, selecting one candidate motion information from the motion information candidate list as the first target motion information of the current block, and selecting another candidate motion information from the motion information candidate list as the second target motion information of the current block.
25. The apparatus of claim 24, wherein the first original motion information comprises a first original motion vector, wherein the first target motion information comprises a first target motion vector, and wherein the obtaining module, when determining the first target motion information of the current block according to the first original motion information, is specifically configured to: acquiring a first motion vector difference corresponding to a first original motion vector; determining a first target motion vector according to the first motion vector difference and the first original motion vector, or determining the first original motion vector as a first target motion vector; the second original motion information includes a second original motion vector, the second target motion information includes a second target motion vector, and the obtaining module is specifically configured to, when determining the second target motion information of the current block according to the second original motion information: acquiring a second motion vector difference corresponding to a second original motion vector; determining a second target motion vector according to the second motion vector difference and the second original motion vector, or determining the second original motion vector as a second target motion vector;
Wherein, when the obtaining module obtains the first motion vector difference corresponding to the first original motion vector, the obtaining module is specifically configured to: acquiring direction information and amplitude information of a first motion vector difference, and determining the first motion vector difference according to the direction information and the amplitude information of the first motion vector difference; wherein, when the obtaining module obtains the second motion vector difference corresponding to the second original motion vector, the obtaining module is specifically configured to: and acquiring direction information and amplitude information of a second motion vector difference, and determining the second motion vector difference according to the direction information and the amplitude information of the second motion vector difference.
26. The apparatus of any one of claims 14-17, wherein the determining module is further configured to:
for each mode information storage unit of the current block, determining a storage mode of the mode information storage unit according to the coordinates of the mode information storage unit, the weight prediction angle and the weight prediction position of the current block; and storing the first target pattern information as target pattern information of the pattern information storage unit or storing the second target pattern information as target pattern information of the pattern information storage unit based on a storage manner of the pattern information storage unit.
27. A decoding device, characterized by comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; wherein the processor is configured to execute the machine executable instructions to implement the method of any of claims 1-13.
28. A machine-readable storage medium comprising, in combination,
the machine-readable storage medium stores machine-executable instructions executable by a processor; wherein the processor is configured to execute the machine executable instructions to implement the method of any of claims 1-13.
CN202111152790.1A 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment Active CN113709462B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111152790.1A CN113709462B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110397236.3A CN114640848B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment thereof
CN202111152790.1A CN113709462B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202110397236.3A Division CN114640848B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment thereof

Publications (2)

Publication Number Publication Date
CN113709462A CN113709462A (en) 2021-11-26
CN113709462B true CN113709462B (en) 2023-02-28

Family

ID=78668982

Family Applications (3)

Application Number Title Priority Date Filing Date
CN202110397236.3A Active CN114640848B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment thereof
CN202111155087.6A Active CN113794881B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment
CN202111152790.1A Active CN113709462B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment

Family Applications Before (2)

Application Number Title Priority Date Filing Date
CN202110397236.3A Active CN114640848B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment thereof
CN202111155087.6A Active CN113794881B (en) 2021-04-13 2021-04-13 Encoding and decoding method, device and equipment

Country Status (1)

Country Link
CN (3) CN114640848B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114640848B (en) * 2021-04-13 2023-04-28 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment thereof
WO2023197183A1 (en) * 2022-04-12 2023-10-19 Oppo广东移动通信有限公司 Video encoding method and apparatus, video decoding method and apparatus, and device, system and storage medium
WO2024077553A1 (en) * 2022-10-13 2024-04-18 Oppo广东移动通信有限公司 Video encoding method and apparatus, video decoding method and apparatus, device, system, and storage medium
WO2024108391A1 (en) * 2022-11-22 2024-05-30 Oppo广东移动通信有限公司 Video encoding method and apparatus, video decoding method and apparatus, and devices, system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170347102A1 (en) * 2016-05-25 2017-11-30 Arris Enterprises Llc Weighted angular prediction for intra coding
CN111385569A (en) * 2018-12-28 2020-07-07 杭州海康威视数字技术股份有限公司 Coding and decoding method and equipment thereof
CN112543323A (en) * 2019-09-23 2021-03-23 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment
CN112584142A (en) * 2019-09-30 2021-03-30 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533376B (en) * 2012-07-02 2017-04-12 华为技术有限公司 Method and apparatus for motion information processing of interframe prediction coding, and coding and decoding system
US10778989B2 (en) * 2016-02-05 2020-09-15 Blackberry Limited Rolling intra prediction for image and video coding
CN112055203B (en) * 2020-08-22 2024-04-12 浙江大华技术股份有限公司 Inter-frame prediction method, video coding method and related devices
CN114640848B (en) * 2021-04-13 2023-04-28 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170347102A1 (en) * 2016-05-25 2017-11-30 Arris Enterprises Llc Weighted angular prediction for intra coding
CN111385569A (en) * 2018-12-28 2020-07-07 杭州海康威视数字技术股份有限公司 Coding and decoding method and equipment thereof
CN112543323A (en) * 2019-09-23 2021-03-23 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment
CN112584142A (en) * 2019-09-30 2021-03-30 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment

Also Published As

Publication number Publication date
CN113794881A (en) 2021-12-14
CN114640848A (en) 2022-06-17
CN113794881B (en) 2023-03-24
CN114640848B (en) 2023-04-28
CN113709462A (en) 2021-11-26

Similar Documents

Publication Publication Date Title
US11743473B2 (en) Method and apparatus for encoding/decoding a video using a motion compensation
CN109997363B (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN110463201B (en) Prediction method and apparatus using reference block
CN113709462B (en) Encoding and decoding method, device and equipment
KR20190046704A (en) Method and apparatus for asymmetric sub-block based video encoding/decoding
CN112369021A (en) Image encoding/decoding method and apparatus for throughput enhancement and recording medium storing bitstream
CN113709488B (en) Encoding and decoding method, device and equipment
CN113709460B (en) Encoding and decoding method, device and equipment
CN113810686B (en) Encoding and decoding method, device and equipment
CN113709499B (en) Encoding and decoding method, device and equipment
CN114598889B (en) Encoding and decoding method, device and equipment
CN114270828A (en) Method and apparatus for image encoding and image decoding using block type-based prediction
CN113794885B (en) Encoding and decoding method, device and equipment
CN114556922A (en) Method, apparatus and recording medium for encoding/decoding image by using partition

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