Prediction methods and a method for bitstream transmission
View Patent ↗Methods for video encoding/decoding and bitstream transmission are provided. A weight derivation mode of a current block is determined; K templates are determined according to at least one of a size of the current block and the weight derivation mode; K prediction modes are determined according to the K templates; and a prediction value is determined according to the K prediction modes and the weight derivation mode. The K templates are determined according to the size of the current block and/or the weight derivation mode.
1 . A prediction method, applied to a decoder and comprising:
decoding a bitstream to determine a weight derivation mode of a current block;
determining K templates according to at least one of a size of the current block and the weight derivation mode, wherein K is a positive integer and K>1;
determining K prediction modes according to the K templates; and
determining a prediction value according to the K prediction modes and the weight derivation mode;
wherein determining the K templates according to at least one of the size of the current block and the weight derivation mode comprises:
partitioning the template of the current block into M sub-templates, M being a positive integer greater than or equal to K; and
mapping the M sub-templates into the K templates according to the weight derivation mode.
2 . The method of claim 1 , wherein partitioning the template of the current block into the M sub-templates comprises:
partitioning the template of the current block into the M sub-templates according to the weight derivation mode.
3 . The method of claim 2 , wherein partitioning the template of the current block into the M sub-templates according to the weight derivation mode comprises:
determining a boundary line of weights according to the weight derivation mode; and
partitioning the template of the current block into the M sub-templates by extending the boundary line into the template of the current block.
4 . The method of claim 3 , wherein partitioning the template of the current block into the M sub-templates by extending the boundary line into the template of the current block comprises:
obtaining an extended line of the boundary line in the template of the current block by extending the boundary line into the template of the current block; and
partitioning the template of the current block into M rectangular sub-templates with the extended line.
5 . The method of claim 1 , wherein partitioning the template of the current block into the M sub-templates comprises at least one of:
partitioning a top template of the current block into P sub-templates; and
partitioning a left template of the current block into Q sub-templates;
wherein P and Q are integers less than or equal to M, and a sum of P and Q equals to M.
6 . The method of claim 5 , wherein partitioning the top template of the current block into the P sub-templates comprises:
partitioning the top template into the P sub-templates along a vertical direction, or
partitioning the top template into the P sub-templates with n columns of samples being a minimum partitioning unit, n being a positive integer, wherein n is determined according to a length of the current block.
7 . The method of claim 5 , wherein partitioning the left template of the current block into the Q sub-templates comprises:
partitioning the left template into the Q sub-templates along a horizontal direction; or
partitioning the left template into the Q sub-templates with m rows of samples being a minimum partitioning unit, m being a positive integer, wherein m is determined according to a width of the current block.
8 . The method of claim 1 , wherein mapping the M sub-templates into the K templates according to the weight derivation mode comprises:
for a j th sub-template in the M sub-templates, determining a weight of a first point in the j th sub-template with respect to an i th prediction mode according to the weight derivation mode, wherein the i th prediction mode is any one of the K prediction modes; and
mapping the j th sub-template into the K templates according to the weight of the first point in the j th sub-template with respect to the i th prediction mode.
9 . The method of claim 8 , wherein determining the weight of the first point in the j th sub-template with respect to the i th prediction mode according to the weight derivation mode comprises:
determining an angle index and a distance index according to the weight derivation mode; and
determining the weight of the first point in the j th sub-template with respect to the i th prediction mode according to the angle index and the distance index.
10 . The method of claim 8 , wherein mapping the j th sub-template into the K templates according to the weight of the first point in the j th sub-template with respect to the i th prediction mode comprises:
mapping the j th sub-template into the i th template, and the i th template is one of the K templates, when the weight of the first point with respect to the i th prediction mode is greater than a first preset value.
11 . The method of claim 1 , wherein determining the K templates according to at least one of the size of the current block and the weight derivation mode comprises:
determining a target first correspondence for the current block from a first correspondence for different preset block-sizes, wherein the first correspondence comprises a correspondence between different angle indexes or different weight derivation modes and the K templates; and
determining the K templates corresponding to the weight derivation mode from the target first correspondence.
12 . The method of claim 1 , wherein determining the K prediction modes according to the K templates comprises:
for an i th prediction mode in the K prediction modes, obtaining at least one candidate prediction modes;
predicting an i th template in the K templates by using the candidate prediction modes to obtain a prediction value of the i th template;
determining a cost of the candidate prediction mode according to a prediction value and a reconstructed value of the i th template; and
determining the i th prediction mode according to the cost of the at least one candidate prediction mode.
13 . The method of claim 1 , wherein determining the prediction value according to the K prediction modes and the weight derivation mode comprises:
determining a weight according to the weight derivation mode;
determining K prediction values according to the K prediction modes; and
determining the prediction value by weighting the K predicted values according to the weight.
14 . A prediction method, applied to an encoder and comprising:
determining a weight derivation mode of a current block;
determining K templates according to at least one of a size of the current block and the weight derivation mode, wherein K is a positive integer and K>1;
determining K prediction modes according to the K templates; and
determining a prediction value according to the K prediction modes and the weight derivation mode;
wherein determining the K templates according to at least one of the size of the current block and the weight derivation mode comprises:
partitioning the template of the current block into M sub-templates, M being a positive integer greater than or equal to K; and
mapping the M sub-templates into the K templates according to the weight derivation mode.
15 . The method of claim 14 , wherein mapping the M sub-templates into the K templates according to the weight derivation mode comprises:
for a j th sub-template in the M sub-templates, determining a weight of a first point in the j th sub-template with respect to an i th prediction mode according to the weight derivation mode, wherein the i th prediction mode is any one of the K prediction modes; and
mapping the j th sub-template into the K templates according to the weight of the first point in the j th sub-template with respect to the i th prediction mode.
16 . The method of claim 15 , wherein determining the weight of the first point in the j th sub-template with respect to the i th prediction mode according to the weight derivation mode comprises:
determining an angle index and a distance index according to the weight derivation mode; and
determining the weight of the first point in the j th sub-template with respect to the i th prediction mode according to the angle index and the distance index.
17 . The method of claim 15 , wherein mapping the j th sub-template into the K templates according to the weight of the first point in the j th sub-template with respect to the i th prediction mode comprises:
mapping the j th sub-template into the i th template, and the i th template is one of the K templates, when the weight of the first point with respect to the i th prediction mode is greater than a first preset value.
18 . A method for bitstream transmission, comprising:
obtaining, by a processor, a bitstream; and
transmitting the bitstream;
wherein the bitstream is generated by performing steps of:
determining, by the processor, a weight derivation mode of a current block;
determining, by the processor, K templates according to at least one of a size of the current block and the weight derivation mode, wherein K is a positive integer and K>1;
determining, by the processor, K prediction modes according to the K templates; and
determining, by the processor, a prediction value according to the K prediction modes and the weight derivation mode;
wherein determining the K templates according to at least one of the size of the current block and the weight derivation mode comprises:
partitioning the template of the current block into M sub-templates, M being a positive integer greater than or equal to K; and
mapping the M sub-templates into the K templates according to the weight derivation mode.
19 . The method of claim 1 , wherein the weight derivation mode is used to determine a weight matrix or weights.
20 . The method of claim 14 , wherein the weight derivation mode is used to determine a weight matrix or weights.