Coding and decoding method, codec, code stream and storage medium

CN120303924APending Publication Date: 2025-07-11GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280102178.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-12-01
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In existing video encoding and decoding technologies, the weight values ​​of inter-frame weighted prediction are fixed at the slice or coding unit level, which fails to adapt to changes in lighting conditions in the video sequence content, resulting in low encoding efficiency.

Method used

The pixel-level weight parameters of the current block are determined by the type indicator parameter and/or geometric mode parameter, and adaptive weighted prediction processing is performed.

Benefits of technology

It improves the accuracy of weighted prediction, thereby enhancing coding efficiency and compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120303924A_ABST
    Figure CN120303924A_ABST
Patent Text Reader

Abstract

The invention provides a coding and decoding method, a codec, a code stream and a storage medium. The codec determines at least one piece of motion vector information of a current block, and a type indication parameter and / or a geometric mode parameter (101); determining at least one reference prediction value of the current block according to the at least one piece of motion vector information, and determining at least one weight parameter of the current block according to a type indication parameter and / or a geometric mode parameter (102); a prediction value of the current block is determined based on the at least one reference prediction value and the at least one weight parameter (103). According to the method, the accuracy of weighted prediction is greatly improved, so that the coding efficiency and the compression performance are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, codec, code stream and storage medium Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a coding and decoding method, a codec, a bit stream, and a storage medium. Background Art

[0002] In the field of video coding and decoding, in addition to intra-frame prediction, inter-frame prediction can also be used in the coding and decoding process of the current block. Inter-frame prediction can include Geometric Partitioning Mode (GPM) and translational prediction.

[0003] In natural videos, factors such as lighting changes in sequence content may not necessarily follow the influence of overall consistent changes. When performing inter-frame weighted prediction, the weight values ​​used are often determined in units of slices or coding units / coding blocks. This will lead to the problem of low accuracy of inter-frame prediction values, thereby reducing compression performance.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide a coding and decoding method, a codec, a bit stream, and a storage medium, which greatly improve the accuracy of weighted prediction, thereby improving coding efficiency and compression performance.

[0006] The technical solution of the embodiment of the present application can be implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:

[0008] Decoding the code stream, determining at least one motion vector information, and a type indication parameter and / or a geometric mode parameter of the current block;

[0009] Determining at least one reference prediction value of the current block according to the at least one motion vector information, and determining at least one weight parameter of the current block according to the type indication parameter and / or the geometric mode parameter;

[0010] A prediction value of the current block is determined based on the at least one reference prediction value and the at least one weight parameter.

[0011] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:

[0012] Determine at least one motion vector information, and a type indication parameter and / or a geometry mode parameter of the current block;

[0013] Determining at least one reference prediction value of the current block according to the at least one motion vector information, and determining at least one weight parameter of the current block according to the type indication parameter and / or the geometric mode parameter;

[0014] A prediction value of the current block is determined based on the at least one reference prediction value and the at least one weight parameter.

[0015] In a third aspect, an embodiment of the present application provides an encoder, comprising: a first determining unit,

[0016] The first determination unit is configured to determine at least one motion vector information, and a type indication parameter and / or a geometric mode parameter of the current block; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter.

[0017] In a fourth aspect, an embodiment of the present application provides an encoder, which includes a first processor and a first memory storing instructions executable by the first processor. When the instructions are executed, the first processor implements the method described in the second aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a decoder, comprising: a decoding unit, a second determining unit,

[0019] The decoding unit is configured to decode the code stream;

[0020] The second determination unit is configured to determine at least one motion vector information, and a type indication parameter and / or a geometric mode parameter of the current block; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter.

[0021] In a sixth aspect, an embodiment of the present application provides a decoder comprising a second processor and a second memory storing instructions executable by the second processor. When the instructions are executed, the second processor implements the method described in the first aspect.

[0022] In the seventh aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on the information to be encoded; wherein the information to be encoded includes at least: inter-frame prediction mode parameters of the current block, at least one motion vector information of the current block, type indication parameters and / or geometric mode parameters.

[0023] In an eighth aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a first processor, it implements the method as described in the second aspect, or when the computer program is executed by a second processor, it implements the method as described in the first aspect.

[0024] The embodiment of the present application provides a coding and decoding method, a codec, a code stream and a storage medium, wherein the codec can determine at least one motion vector information of the current block, as well as a type indication parameter and / or a geometric mode parameter; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter. It can be understood that in the embodiment of the present application, the codec can determine the pixel-level weight parameters of the current block through the type indication parameter and / or the geometric mode parameter, and then perform prediction processing on the current block based on the pixel-level weight parameters. It can be seen that in the embodiment of the present application, the weights used for prediction processing are no longer fixed, but pixel-level weight values ​​that adapt to changes in pixel points are selected, which greatly improves the accuracy of weighted prediction, thereby improving coding efficiency and compression performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a schematic diagram of adjacent blocks;

[0026] FIG2 is a schematic block diagram of the encoder;

[0027] FIG3 is a schematic block diagram of the decoder;

[0028] FIG4 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application;

[0029] FIG5 is a schematic diagram of the implementation flow of the decoding method;

[0030] FIG6 is a schematic diagram of a gradient mode;

[0031] FIG7 is a second schematic diagram of the gradient mode;

[0032] FIG8 is a third schematic diagram of the gradient mode;

[0033] FIG9 is a fourth schematic diagram of a gradient mode;

[0034] FIG10 is a fifth schematic diagram of a gradient mode;

[0035] FIG11 is a sixth schematic diagram of the gradient mode;

[0036] FIG12 is a seventh schematic diagram of a gradient mode;

[0037] FIG13 is a schematic diagram eight of the gradient mode;

[0038] FIG14 is a schematic diagram of a pre-stored matrix;

[0039] FIG15 is a second schematic diagram of a pre-stored matrix;

[0040] FIG16 is a schematic diagram of interpolation processing 1;

[0041] FIG17 is a second schematic diagram of interpolation processing;

[0042] FIG18 is a third schematic diagram of interpolation processing;

[0043] FIG19 is a fourth schematic diagram of interpolation processing;

[0044] FIG20 is a schematic diagram of the implementation flow of the encoding method;

[0045] FIG21 is a schematic diagram of the structure of the encoder;

[0046] Figure 22 is a schematic diagram of the second structure of the encoder;

[0047] FIG23 is a schematic diagram of the structure of the decoder;

[0048] FIG24 is a second schematic diagram of the decoder structure. DETAILED DESCRIPTION

[0049] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to explain the related applications and are not intended to limit the applications. It should also be noted that for ease of description, only the parts relevant to the related applications are shown in the drawings.

[0050] Currently, common video coding standards are based on a block-based hybrid coding framework. Each frame in a video image is divided into square Largest Coding Units (LCUs) or Coding Tree Units (CTUs) of the same size (e.g., 128×128, 64×64, etc.). Each Largest Coding Unit or Coding Tree Unit can also be divided into rectangular Coding Units (CUs) according to rules; and Coding Units may be further divided into smaller Prediction Units (PUs). Specifically, the hybrid coding framework may include modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. Among them, the prediction module may include intra-frame prediction and inter-frame prediction, and inter-frame prediction may include motion estimation and motion compensation. Since there is a strong correlation between adjacent pixels in a frame of a video image, the use of intra-frame prediction in video coding and decoding technology can eliminate the spatial redundancy between adjacent pixels; however, since there is also a strong similarity between adjacent frames in a video image, the use of inter-frame prediction in video coding and decoding technology can eliminate the temporal redundancy between adjacent frames, thereby improving coding and decoding efficiency.

[0051] The basic process of a video codec is as follows: On the encoder side, a frame is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a predicted block for the current block. The predicted block is subtracted from the original block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​entropy encoded and output to the bitstream. On the decoder side, intra-frame prediction or inter-frame prediction is used on the current block to generate a predicted block for the current block. The decoded bitstream is then decoded to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​inversely quantized and inversely transformed to obtain a residual block. The predicted block and residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to obtain the decoded image. The encoder side also performs similar operations to the decoder side to obtain the decoded image. The decoded image can serve as a reference frame for inter-frame prediction in subsequent frames. Block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined by the encoder are output to the bitstream if necessary. The decoding end determines the same block division information as the encoding end by parsing and analyzing the existing information, as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end. The decoded image obtained by the encoding end is also usually called a reconstructed image. The current block can be divided into prediction units during prediction, and can be divided into transformation units during transformation. The division of prediction units and transformation units can be different. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The embodiment of the present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.

[0052] The current block may be a current coding unit (CU) or a current prediction unit (PU), etc.

[0053] The Versatile Video Coding (VVC) standard uses slice-level weighted prediction and bi-prediction with CU-level weights (BCW). With slice-level weighted prediction, all CUs in a slice share the same set of parameters, which is considered explicit prediction. With BCW, each CU uses an index to determine the weight value, which is considered default weighting.

[0054] In addition, when Slice-level weighted prediction and BCW are not used, the calculated pixel prediction value is also classified as the default weighted prediction (when Slice-level weighted prediction is not enabled). The default weighted prediction method is relatively simple. It does not use weights and offset values. It is divided into three cases based on the difference in reference lists:

[0055] The first case is to use only the forward reference list List0, and the predicted pixels are calculated as follows:

[0056] PredSamples=Clip((PredSampleL0+offset1)>>shift1) (1)

[0057] The second case is to use only the forward reference list List1, and the predicted pixels are calculated as follows:

[0058] PredSamples=Clip((PredSampleL1+offset1)>>shift1) (2)

[0059] The third case is that both the forward reference list List0 and the backward reference list List1 are used, and the predicted pixels are calculated as follows:

[0060] PredSamples=Clip((PredSampleL0+PredSampleL1+offset2)>>shift2) (3)

[0061] Among them, PredSampleL0 and PredSampleL1 are reference pixel values ​​in reference lists List0 and List1 respectively.

[0062]

[0063] It is worth noting that the reference pixel values ​​PredSampleL0 and PredSampleL1 have been amplified during pixel-wise interpolation (the integer pixel values ​​have also been amplified), and the above operation is rounding.

[0064] For slice-level weighted prediction (Weighted Prediction), when the light intensity changes, the same scene in the video will show global or local brightness changes, such as aperture changes during shooting, or artificial fade-in and fade-out effects in editing. In such videos, the content of adjacent images is still similar, but the corresponding pixel values ​​are quite different, and the residuals obtained by traditional motion compensation prediction technology are large. Therefore, for such scenes with overall gradual changes in brightness, slice-level weighted prediction can effectively deal with it, that is, the predicted value is obtained by performing a linear transformation (a linear function defined by a weight and an offset value) on the reconstructed pixel values ​​of the reference image.

[0065] Among them, for the use conditions and syntax element parsing of slice-level weighted prediction, H.266 / VVC restricts the use of slice-level weighted prediction technology. CUs that meet the following conditions can use slice-level weighted prediction:

[0066] (1) When the value of the SPS parameter sps_weighted_pred_flag s is 1, P Slice is allowed to use Slice-level weighted prediction.

[0067] (2) When the value of the PPS parameter pps_weighted_pred_flag is 1, the corresponding P Slice uses Slice-level weighted prediction.

[0068] (3) When the value of the SPS parameter sps_weighted_bipred_flag is 1, B Slice is allowed to use Slice-level weighted prediction.

[0069] (4) When the value of the PPS parameter pps_weighted_bipred_flag is 1, the corresponding B slice uses slice-level weighted prediction.

[0070] (5) CU does not use decoder motion vector refinement (DMVR).

[0071] When the value of the PPS syntax element pps_wp_info_in_ph_flag is 1, the weighting coefficients are included in the picture header; otherwise, they are included in the slice header. For P slices, each reference picture in reference picture list L0 can have a set of weighting coefficients. For B slices, in addition to reference picture list L0, each reference frame in reference picture list L1 can also have a set of weighting coefficients. Different weighting coefficients are used for the luma component and the chroma component.

[0072] Among them, for the acquisition of reference pixel values ​​for Slice-level weighted prediction, Slice-level weighted prediction can be used for both unidirectional prediction and bidirectional prediction. For the unidirectionally predicted CU, the reference pixel values ​​are obtained in the following three cases: when only the forward reference list List0 is used, the forward motion information MVL0 of the current CU is obtained, and the forward motion vector information MVL0 is used to perform motion compensation prediction to obtain the forward prediction value PredSampleL0; when only the backward reference list List1 is used, the backward motion information MVL1 of the current CU is obtained, and the backward motion vector information is used to perform motion compensation prediction to obtain the backward prediction value PredSampleL1; for bidirectional prediction, both the forward reference list List0 and the backward reference list List1 are used, and the forward motion vector information is used to perform motion compensation prediction to obtain the forward prediction value PredSampleL0, and the backward motion vector information is used to perform motion compensation prediction to obtain the backward prediction value PredSampleL1.

[0073] For obtaining the slice-level weighted prediction value, when performing slice-level weighted prediction, the slice header information includes multiple sets of weighting parameters, and all CUs in the slice use one or two sets of weighting parameters.

[0074] In one-way prediction, there is

[0075]

[0076] or

[0077]

[0078] In bidirectional prediction, there is

[0079]

[0080] For luminance blocks, there are

[0081] log2W d =luma_log2_weight_denom+shift1 (8)

[0082] For chroma blocks, there are

[0083] log2W d =chroma_log2_weight_denom+shift1 (9)

[0084] Among them, PredSampleL0 and PredSampleL1 are the reference pixel values ​​in the reference lists list0 and list1 respectively. L0 and w L1are the weights of the forward and backward blocks, respectively, and o_L0 and o_L0 represent the corresponding offsets. In order to improve the prediction accuracy, the intermediate operation results have higher precision than the reference pixel values. log2_weight_denom and chroma_log2_weight_denom indicate the increased precision of the weighting coefficients. shift1 is the increased precision of the reference pixel value during the pixel-by-pixel interpolation calculation process (the integer pixel value is also amplified). The Clip() operation clamps the pixel value to within the valid range, such as the valid value of 8-bit is [0, 255], and the valid value of 10-bit is [0, 1023].

[0085] Regarding the usage conditions and syntax element parsing of CU-level bidirectional weighted prediction (BCW), H.266 / VVC restricts the use of BCW technology. Only CUs that meet the following conditions can use BCW:

[0086] (1) The value of the SPS syntax element sps_bcw_enabled_flag is 1, which means that the use of BCW is allowed.

[0087] (2) The current CU is bidirectionally predicted.

[0088] (3) Neither the luminance nor the chrominance components of the current CU use slice-level weighted prediction.

[0089] (4) The product of the width and height of the current coding block is not less than 256.

[0090] BCW uses only a small number of predefined weights, and the weight set varies depending on the configuration. For Low Delay B (LDB) configuration, the weight set is {4, 5, 3, 10, -2}. For Random Access (RA) configuration, the weight set is {4, 5, 3}. The decoder can determine whether the configuration is LDB or RA by checking the NoBackwardPredFlag.

[0091] The BCW weight set is determined by encoding the weight index bcw_idx. If it does not exist, it defaults to 0, and the forward and backward bidirectional prediction signals are weighted averaged with equal weights.

[0092] For CUs in Merge mode, the BCW weight is directly obtained from the Merge candidate. For CUs in Affine Merge mode, the BCW weight corresponding to the first CPMV is used. In CUs encoded using DMVR, BDOF, and CIIP modes, the BCW index defaults to 0, corresponding to an equal weighted average of the forward and backward prediction signals.

[0093] Among them, the weighted prediction value of the CU-level bidirectional weighted prediction is obtained. For bidirectional prediction, both the forward reference list List0 and the backward reference list List1 are used. The forward motion vector information MV0 in the forward reference list List0 is used for motion compensation prediction to obtain the forward prediction value PredSampleL0, and the backward motion vector information MV1 in the backward reference list List1 is used for motion compensation prediction to obtain the backward prediction value PredSampleL1.

[0094] For CUs using bidirectional prediction, BCW is only enabled for bidirectional prediction CUs, using only a small number of predefined weights and encoding their indexes.

[0095] When BCW is used, the weighted forecast value is

[0096]

[0097] Where PredSampleL0 and PredSampleL1 are the reference pixel values ​​in reference lists List0 and List1 respectively, and w is the weight of the backward reference pixel value.

[0098] In H.266 / VVC, a new prediction coding tool in Merge mode that can use intra-frame prediction values ​​is introduced, namely Combined inter and intra prediction (CIIP). As the name suggests, this technology combines intra-frame prediction signals and inter-frame prediction signals, where the intra-frame prediction value P intra The current block is obtained by performing conventional intra-frame prediction processing through the Planar mode, and the inter-frame prediction value P inter The current block is predicted by the conventional Merge mode. Then the weighted average of the intra-frame and inter-frame prediction values ​​is used to obtain the final intra-frame and inter-frame joint prediction value.

[0099] Regarding the usage conditions and syntax element analysis of the joint intra-frame and inter-frame prediction technology CIIP, in VVC, the conditions under which the CIIP technology is allowed to be applied to the current CU are: if the current CU is encoded in Merge mode, if the size of the current CU is greater than 64 and less than 128, the current CU is allowed to indicate the use of CIIP technology.

[0100] The acquisition of CIIP intra-frame prediction weight wt is related to the coding mode of the adjacent blocks above and to the left of the current CU. The coding mode of the adjacent blocks is identified by two flags, isIntraTop and isIntraLeft. When isIntraTop is 1, the upper adjacent block is available and is in intra-frame mode. When isIntraLeft is 1, it indicates that the left adjacent block is available and is in intra-frame mode.

[0101] Among them, for obtaining the CIIP weighted prediction value, after obtaining the intra-frame prediction value and inter-frame prediction value of the current CU, it is necessary to perform a weighted average of the two prediction values. Among them, the weight used in the weighted calculation depends on the coding mode of the adjacent blocks above and to the left of the current CU. For example, Figure 1 is a schematic diagram of adjacent blocks. As shown in Figure 1, the specific judgment is as follows: if (isIntraLeft+isIntraLeft) is equal to 2, the weight wt of the intra-frame prediction block is equal to 3; otherwise, if (isIntraLeft+isIntraLeft) is equal to 1, the weight wt of the intra-frame prediction corresponding to the current CU is equal to 2; otherwise, the weight wt of the intra-frame prediction is equal to 1.

[0102] The final CIIP prediction value is calculated as follows, where P intra It is the intra-frame prediction value obtained by the current block through the Planar mode for conventional intra-frame prediction processing, P inter is the prediction value between frames, and wt is the weight of intra-frame prediction.

[0103] P CIIP =((4-wt)*P inter +wt*P intra +2)>>2 (11)

[0104] In VVC and the Enhanced Compression Model (ECM), weights used in inter-frame weighted prediction are fixed per slice, coding unit, or coding block. Given that factors such as lighting changes in sequence content may not consistently change across the entire frame, using a fixed weight for the entire slice or coding block during weighted prediction is suboptimal, resulting in low coding efficiency.

[0105] To address the above issues, in an embodiment of the present application, the codec can determine the pixel-level weight parameters of the current block through the type indicator parameter and / or the geometric mode parameter, and then perform prediction processing on the current block based on the pixel-level weight parameters. As can be seen, in an embodiment of the present application, the weights used for prediction processing are no longer fixed, but pixel-level weight values ​​that adapt to changes in pixel points are selected, greatly improving the accuracy of weighted prediction, thereby improving coding efficiency and compression performance.

[0106] Referring to Figure 2, which shows a schematic block diagram of the composition of an encoder provided in an embodiment of the present application. As shown in Figure 2, the encoder (specifically, a "video encoder") 50 may include a transform and quantization unit 501, an intra-frame estimation unit 502, an intra-frame prediction unit 503, an inter-frame prediction unit 504, a motion estimation unit 505, an inverse transform and inverse quantization unit 506, a filter control analysis unit 507, a filtering unit 508, an encoding unit 509, and a decoded image cache unit 510, etc., wherein the filtering unit 508 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 509 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 501, including transforming the residual information from the pixel domain to the transform domain and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-frame estimation unit 502 and the intra-frame prediction unit 503 are used to perform intra-frame prediction on the video coding block; specifically, the intra-frame estimation unit 502 and the intra-frame prediction unit 503 are used to determine the intra-frame prediction mode to be used to encode the video coding block; the inter-frame prediction unit 504 and the motion estimation unit 505 are used to perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 505 is the process of generating motion vectors, The motion vector can estimate the motion of the video coding block, and then the inter-frame prediction unit 504 performs motion compensation based on the motion vector determined by the motion estimation unit 505, so the inter-frame prediction unit 504 can also be called a motion compensation unit; after determining the intra-frame prediction mode, the intra-frame prediction unit 503 is also used to provide the selected intra-frame prediction data to the encoding unit 509, and the motion estimation unit 505 also sends the calculated and determined motion vector data to the encoding unit 509; in addition, the inverse transform and inverse quantization unit 506 is used to reconstruct the video coding block, reconstruct the residual block in the pixel domain, and the reconstruction The reconstructed residual block passes through the filter control analysis unit 507 and the filtering unit 508 to remove blocking artifacts. The reconstructed residual block is then added to a prediction block in the frame of the decoded image cache unit 510 to generate a reconstructed video coding block. The coding unit 509 is used to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode and output the bitstream of the video signal. The decoded image cache unit 510 is used to store the reconstructed video coding block for prediction reference. As the video image encoding progresses, new reconstructed video coding blocks are continuously generated, and these reconstructed video coding blocks are all stored in the decoded image cache unit 510.

[0107] Referring to FIG3 , which shows a block diagram of a decoder provided in an embodiment of the present application, the decoder (specifically, a “video decoder”) 60 includes a decoding unit 601, an inverse transform and inverse quantization unit 602, an intra-frame prediction unit 603, an inter-frame prediction unit 604, a filtering unit 605, and a decoded image buffer unit 606. The decoding unit 601 can implement header information decoding and CABAC decoding, and the filtering unit 605 can implement deblocking filtering and SAO filtering. After the input video signal is encoded as shown in FIG2 , a code stream of the video signal is output; the code stream is input to the decoder 60 and first passes through the decoding unit 601 to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 602 to generate a residual block in the pixel domain; the intra-frame prediction unit 603 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and the data of the previously decoded block from the current frame or picture; the inter-frame prediction unit 604 is to determine the prediction information for the video decoding block by parsing the motion vector and other associated syntax elements, and use The prediction information is used to generate a prediction block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 602 with the corresponding prediction block generated by the intra-frame prediction unit 603 or the inter-frame prediction unit 604; the decoded video signal passes through the filtering unit 605 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 606, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0108] Furthermore, an embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder. FIG4 is a schematic diagram of a network architecture of a coding and decoding system provided by an embodiment of the present application. As shown in FIG4 , the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic device can be various types of devices with video coding and decoding functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a server, etc., which is not specifically limited in the embodiment of the present application. Here, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.

[0109] The coding and decoding methods in the embodiments of the present application can be applied to both video coding systems and video decoding systems, and can even be applied to both video coding systems and video decoding systems simultaneously, but this is not specifically limited in the embodiments of the present application. It should also be noted that when the coding and decoding methods are applied to video coding systems, the "current block" specifically refers to the current coding block in inter-frame prediction; when the coding and decoding methods are applied to video decoding systems, the "current block" specifically refers to the current decoding block in inter-frame prediction.

[0110] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.

[0111] An embodiment of the present application provides a decoding method, which is applied to a decoder. FIG5 is a schematic diagram of an implementation flow of the decoding method. As shown in FIG5 , the decoding method performed by the decoder may include the following steps:

[0112] Step 101: Decode a code stream to determine at least one motion vector information of a current block, as well as a type indication parameter and / or a geometric mode parameter.

[0113] In an embodiment of the present application, when decoding a code stream, a decoder may first determine at least one motion vector information of a current block, and may also determine a type indication parameter and / or a geometric mode parameter.

[0114] It should be noted that, in the embodiments of the present application, since the coding and decoding scheme of the present application can be applied to both unidirectional and bidirectional predictions, the at least one motion vector information of the current block may include a forward motion vector and / or a backward motion vector. The forward motion vector of the current block can be used to perform forward prediction on the predicted value of the current block, and the backward motion vector of the current block can be used to perform backward prediction on the predicted value of the current block.

[0115] Illustratively, in an embodiment of the present application, the forward motion vector may be expressed as MVL0, and the backward motion vector may be expressed as MVL1.

[0116] It should be noted that, in the embodiment of the present application, the type indication parameter is a type index parameter, wherein the type indication parameter can be used to select the type of pixel-level weighting parameter, that is, it can be used to select the method for determining the pixel-level weighting parameter.

[0117] It can be understood that in the embodiments of the present application, the type of pixel-level weighting parameters, that is, the method of determining the pixel-level weighting parameters may include but is not limited to the following types (methods): weighting parameters defined by a pre-stored matrix (pre-stored matrix), and weighting parameters defined by geometric pattern parameters.

[0118] That is, in the embodiments of the present application, the type indication parameter can be used to determine whether to use a pre-stored matrix to derive pixel-level weighting parameters or to use geometric mode parameters to derive pixel-level weighting parameters. It can also be understood that the type indication parameter is used to determine whether to use a pre-stored matrix to derive pixel-level weighting parameters, or whether to use geometric mode parameters to derive pixel-level weighting parameters.

[0119] It should be noted that, in embodiments of the present application, geometric pattern parameters may include one or more of the following parameters: gradient pattern information, gradient intensity information, change direction information, change start position information, change center position information, change end position information, gradient upper / lower limit information (i.e., lower limit weight and upper limit weight, which can be derived from other geometric pattern parameters or pre-set), change range width information, and change segment information. In some embodiments, gradient intensity information may also be expressed as change range width information.

[0120] It should be noted that, in the embodiment of the present application, the gradient mode information may be determined using modeParm, wherein the gradient mode information modeParm may indicate the gradient mode, that is, may indicate the type of the gradient mode.

[0121] For example, in an embodiment of the present application, the types of gradient patterns may include but are not limited to horizontal gradient weighting, vertical gradient weighting, oblique gradient weighting, radial gradient weighting, affine gradient weighting, and the like.

[0122] For example, Figure 6 is a schematic diagram of the gradient mode one, and Figure 7 is a schematic diagram of the gradient mode two. As shown in the figures, the horizontal gradient mode can include two different changing directions; Figure 8 is a schematic diagram of the gradient mode three, and Figure 9 is a schematic diagram of the gradient mode four. As shown in Figures 8 and 9, the vertical gradient mode can include two different changing directions; Figure 10 is a schematic diagram of the gradient mode five, and Figure 11 is a schematic diagram of the gradient mode six. As shown in Figures 10 and 11, the oblique gradient mode not only has multiple different changing directions, but also can include multiple different gradient intensity information; Figure 12 is a schematic diagram of the gradient mode seven. As shown in Figure 12, the radial gradient mode involves the center position of the change; Figure 13 is a schematic diagram of the gradient mode eight, as shown in Figure 13, two affine gradient modes.

[0123] Furthermore, in an embodiment of the present application, the optimal gradient mode for the current coding unit / coding block can be determined by template matching. Specifically, the pixels in the upper row and / or left column of the current coding unit / block are used as a template. In the process of constructing the template predicted pixel value, a gradient weighting process is performed on the prediction values ​​from different sources, and the geometric parameters of the most appropriate gradient weighting scheme are selected as the parameters of the gradient weighting scheme for the current coding unit / block.

[0124] Furthermore, in an embodiment of the present application, for a small-sized coding unit / coding block, some gradient modes with a large gradient width range may be skipped. For a large-sized coding unit / coding block, some gradient modes with a small gradient width range may be skipped.

[0125] Furthermore, in an embodiment of the present application, for a sequence with a higher resolution or a block with a larger size, the number of segments of the gradient pattern can be adaptively increased, thereby making the prediction more accurate.

[0126] It should be noted that in an embodiment of the present application, the gradient intensity information can be determined using slopeParm, wherein the gradient intensity information slopeParm can indicate the speed of change, that is, it can indicate the speed of change of the gradient weight parameter as the pixel distance specifies the position (the position of the point or line).

[0127] It should be noted that in the embodiments of the present application, the linear gradient intensity information can be indicated by an index method. For example, 0 represents no gradient, a direct jump; m means that the gradient weight parameter reaches the maximum or minimum when the distance reaches the specified position of (2m-1) / M pixel positions, and a linear gradient is used when the distance is closer, and the maximum or minimum is maintained when the distance is farther, where the value of M can be 2, 1, 1 / 2, etc.

[0128] For example, in the embodiments of this application, it is assumed that linear gradient strength information is indicated in an indexed manner. 0 indicates that w is constant, with no gradient or jump; m indicates that the gradient weight parameter reaches its maximum or minimum when the distance reaches t×width / (2m-1), where width is the unit width corresponding to the calculation of the gradient weight parameter (slice width or coding block width), and t is a constant.

[0129] It should be noted that, in an embodiment of the present application, the change direction information can be determined by dirParm, wherein the change direction information dirParm can indicate the direction in which the change intensity changes, that is, it can indicate the direction in which the gradient intensity information of the weight parameter for the first predicted pixel changes.

[0130] Exemplarily, in the embodiment of the present application, it is assumed that the change direction information is indicated in an index manner, for example, 0 represents from minimum to maximum, and 1 represents from maximum to minimum.

[0131] It should be noted that in the embodiments of the present application, the change starting position information can be determined by startPosParm. Depending on the gradient type, the change starting position information startPosParm can include different numbers of parameters. In other words, the number of parameters included in the change starting position information corresponds to the gradient type (gradient mode information).

[0132] For example, in an embodiment of the present application, when the gradient mode information indicates a horizontal gradient mode, the change starting position information may include a horizontal axis coordinate position; when the gradient mode information indicates an oblique gradient mode, the change starting position information may include a set of Cartesian coordinate system parameters representing a straight line, one of which represents a slope and the other represents an intercept; for example, in an oblique gradient mode, the change starting position information may include a set of polar coordinate system parameters representing a straight line, one representing an angle and the other representing a distance; when the gradient mode information indicates a radial gradient mode, the change starting position information may include a set of parameters representing a radial shape and its corresponding position, for example, in the case of a circle, when the starting position is a point, the Cartesian coordinate system is the horizontal and vertical coordinates, and the polar coordinate system is the angle and distance; when the gradient mode information indicates an affine gradient mode, the change starting position information may include a set of parameters representing the positions of multiple control points or multiple control lines. Note that oblique gradients can include horizontal and vertical gradient modes.

[0133] It should be noted that in an embodiment of the present application, the change center position information can be determined by centerPosParm, wherein the change center position information centerPosParm is the position of the median of the weight parameter of the gradient area. For example, when the gradient interval is 0 to 1, the median is 0.5, and the weight parameter is based on this position and gradually increases or decreases to both sides.

[0134] It is understood that in the embodiment of the present application, the change center position information centerPosParm may include different numbers of parameters depending on the gradient type. In other words, the number of parameters included in the change center position information corresponds to the gradient type (gradient mode information).

[0135] Exemplarily, in an embodiment of the present application, when the gradient mode information indicates a horizontal gradient mode, the change center position information may include a horizontal axis coordinate position; when the gradient mode information indicates an oblique gradient mode, the change center position information may include a set of parameters for a straight line represented by a Cartesian coordinate system, one for the slope and one for the intercept; when the gradient mode information indicates an oblique gradient mode, the change center position information may include a set of parameters for a straight line represented by a polar coordinate system, one for the angle and one for the distance; when the gradient mode information indicates a radial gradient mode, the change center position information may include a set of parameters representing the radial shape and its corresponding position, such as in the case of a circle, when the center position is a circle, the Cartesian coordinate system contains the horizontal and vertical coordinates and the radius, and the polar coordinate system contains the center point position information and the radius. When the center point is aligned with the zero point, there may be only radius information; when the gradient mode information indicates an affine gradient mode, the change center position information may include a set of parameters representing the positions of multiple control points or multiple control lines.

[0136] It should be noted that in the embodiments of the present application, the endPosParm information can be determined by , where the endPosParm information can include different numbers of parameters depending on the gradient type. That is, the number of parameters included in the endPosParm information corresponds to the gradient type (gradient mode information).

[0137] Exemplarily, in an embodiment of the present application, when the gradient mode information indicates a horizontal gradient mode, the change cutoff position information may include a horizontal axis coordinate position; when the gradient mode information indicates an oblique gradient mode, the change cutoff position information may include a set of parameters for representing a straight line in a Cartesian coordinate system, one for representing a slope, and one for representing an intercept; when the gradient mode information indicates an oblique gradient mode, the change cutoff position information may include a set of parameters for representing a straight line in a polar coordinate system, one for representing an angle, and one for representing a distance; when the gradient mode information indicates a radial gradient mode, the change cutoff position information may include a set of parameters representing a radial shape and its corresponding position. For example, in the case of a circle, when the cutoff position is a circle, in the Cartesian coordinate system, the cutoff position information refers to the horizontal and vertical coordinates and the radius, and in the polar coordinate system, it refers to the center point position information and the radius. When the center point is aligned with the zero point, there may be only radius information; when the gradient mode information indicates an affine gradient mode, the change cutoff position information may include a set of parameters representing the positions of multiple control points or multiple control lines.

[0138] It should be noted that in an embodiment of the present application, the gradient upper / lower limit information (lower limit weight and upper limit weight) can be determined by maxWvalue / minWvalue, wherein the gradient upper / lower limit information maxWvalue / minWvalue can be used to indicate the upper / lower limit information of the weight parameter, which can be derived from other geometric pattern parameters or pre-set.

[0139] For example, in an embodiment of the present application, the gradient upper / lower limit information maxWvalue / minWvalue may be the values ​​corresponding to weights 0 and 1 under corresponding precision requirements. For example, assuming a precision of 3 binary digits, then after fixed-point conversion, the lower limit 0 corresponds to 0, and the upper limit 1 corresponds to 8; assuming a precision of 5 binary digits, then after fixed-point conversion, the lower limit 0 corresponds to 0, and the upper limit 1 corresponds to 32.

[0140] It can be understood that in the embodiments of the present application, the lower limit of the weighting parameter generally corresponds to 0, that is, the reference pixels at the corresponding position are not used during weighting, and the upper limit of the weighting parameter generally corresponds to 1, that is, all reference pixels at the corresponding position are used during weighting.

[0141] It should be noted that, in the embodiment of the present application, the gradient upper / lower limit information maxWvalue / minWvalue may not be the weights corresponding to 0 and 1. For example, it may be the values ​​corresponding to 0.2 and 0.4 under the corresponding accuracy requirements.

[0142] Furthermore, in an embodiment of the present application, the change segment information may be determined by segParm, wherein the change segment information segParm may indicate relevant information of a continuous gradient consisting of multiple segments, and may include information whose meaning covers the aforementioned multiple parameters.

[0143] For example, in an embodiment of the present application, the change segment information segParm may include multiple segments, including information such as gradient intensity information (change range width information), change direction information, change start position information, and change end position information for each segment. Alternatively, the change segment information segParm may include multiple segments, including information such as change direction information, change start position information, change end position information, gradient upper limit information, and gradient lower limit information for each segment.

[0144] Furthermore, in an embodiment of the present application, any information in the geometric pattern parameters, namely, gradient pattern information, gradient intensity information, change direction information, change starting position information, change center position information, change end position information, gradient upper / lower limit information, change range width information, and change segment information, can be converted into an index form through quantization.

[0145] It is understood that, in the embodiment of the present application, the geometry mode parameter can be used to indicate a geometry change set, wherein the geometry change set includes change start position information, change center position information, and change end position information.

[0146] For example, in an embodiment of the present application, the change start position information, change center position information, and change end position information can specify different possibilities, and each possible line is predefined as an ordered set, so these positions can be specified by only one index. One index can correspond to one ordered set, thereby specifying the corresponding position information.

[0147] Furthermore, in an embodiment of the present application, the type indication parameter may be used to determine whether to use a pre-stored matrix to derive pixel-level weighting parameters or to use a geometric pattern parameter to derive pixel-level weighting parameters.

[0148] It is understood that in the embodiments of the present application, in the weighting mode defined by the pre-stored matrix (pre-stored matrix), the number and dimensions of the pre-defined matrices are limited. Figure 14 is a schematic diagram of the pre-stored matrix 1, and Figure 15 is a schematic diagram of the pre-stored matrix 2. As shown in the figure, the pre-stored matrix is ​​a pre-defined weighted matrix of two different dimensions. For the weighted matrix of the pre-defined dimensions, it can be applied to a variety of areas with different dimensions and different accuracy requirements through interpolation and other methods.

[0149] For example, in an embodiment of the present application, FIG16 is a schematic diagram of interpolation processing 1, FIG17 is a schematic diagram of interpolation processing 2, FIG18 is a schematic diagram of interpolation processing 3, and FIG19 is a schematic diagram of interpolation processing 4. As shown in FIG16, the weighted matrix obtained by interpolating weighting matrix 1 under a smaller dimensional requirement, and as shown in FIG17, the weighted matrix obtained by interpolating weighting matrix 1 under a larger dimensional requirement. As shown in FIG18, the weighted matrix obtained by interpolating weighting matrix 2 under a higher precision requirement, and as shown in FIG19, the weighted matrix obtained by interpolating weighting matrix 2 under a lower precision requirement.

[0150] Furthermore, in the embodiment of the present application, the weighting parameter defined by the geometric parameters (geometric mode parameters) refers to the weighting parameter calculated by the geometric parameters. The weighting parameter on the plane changes with the pixel position according to a certain geometric law. The weighting parameter wtParm that changes according to a certain geometric law can be expressed by at least one parameter of the gradient mode information modeParm, gradient intensity information slopeParm, change direction information dirParm, change start position information startPosParm, change center position information centerPosParm, change end position information endPosParm, gradient upper / lower limit information minParm / maxParm, and change segment information segParm.

[0151] Furthermore, in an embodiment of the present application, if the geometric pattern parameters of different image blocks are the same, for example, the geometric pattern parameters such as the gradient intensity information and the change direction information of each CU are basically consistent, then one or more weight matrices can be predefined first, and the coding unit block can upsample, downsample, or truncate the predefined weight matrix based on the pixel-level weighted weights.

[0152] It should be noted that, in the embodiments of the present application, the mode type for deriving pixel-level weighting parameters can be selected in an indexed manner based on the type indication parameter. For example, a mode index number is determined based on the type indication parameter, and then the mode type for deriving pixel-level weighting parameters is determined based on the mode index number, that is, whether the weighting parameters are defined by a pre-stored matrix or by geometric parameters.

[0153] For example, in an embodiment of the present application, when the weighting parameters are obtained by a pre-stored matrix or calculated by a gradient weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in the table:

[0154] Table 1

[0155] Mode index number Mode type 0 Weighting parameters defined by pre-stored matrix 1 Linear gradient weighting mode defined by geometric parameters 1...N Linear gradient weighting mode defined by geometric parameters N

[0156] For example, in an embodiment of the present application, when the weighting parameter is calculated only by a certain gradual weighting mode defined by the geometric parameters, the weighting mode indicated by the index method is shown in the table:

[0157] Table 2

[0158] Mode index number Mode type 0 Linear gradient weighting mode defined by geometric parameters 11 Linear gradient weighting mode defined by geometric parameters 2 ... N-1 Linear gradient weighting mode N defined by geometric parameters

[0159] For example, in an embodiment of the present application, when the weighting parameter is calculated by a certain nonlinear weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in the table:

[0160] Table 3

[0161] Mode index number Mode type

[0162] 0 Nonlinear gradient weighting pattern defined by geometric parameters 12 Nonlinear gradient weighting pattern defined by geometric parameters 2 ... N-1 Nonlinear gradient weighting pattern N defined by geometric parameters

[0163] For example, in an embodiment of the present application, when the weighting parameter is calculated by a certain nonlinear weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in the table:

[0164] Table 4

[0165] Mode index number Mode type 0 Multi-segment gradient weighting mode defined by geometric parameters 12 Multi-segment gradient weighting mode defined by geometric parameters 2 ... N-1 Multi-segment gradient weighting mode defined by geometric parameters N

[0166] Furthermore, in an embodiment of the present application, when decoding the code stream, the inter-frame prediction mode parameters of the current block can be determined first; if the inter-frame prediction mode parameters indicate the use of pixel-level weight values ​​to determine the inter-frame prediction value of the current block, then the determination process of the execution type indication parameters and / or geometric mode parameters can be selected.

[0167] That is to say, in an embodiment of the present application, an identification information (such as an inter-frame prediction mode parameter) can be used to indicate whether to use the coding and decoding method proposed in the embodiment of the present application that uses pixel-level weight values ​​for prediction processing. If the inter-frame prediction value of the current block is determined based on the inter-frame prediction mode parameter using the pixel-level weight value, then the type indication parameter and / or the geometric mode parameter can be determined, thereby further completing the determination of at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter.

[0168] Step 102: Determine at least one reference prediction value of the current block based on at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter.

[0169] In an embodiment of the present application, after determining at least one motion vector information of the current block, as well as the type indication parameter and / or the geometric mode parameter, at least one reference prediction value of the current block can be further determined based on the at least one motion vector information, and at the same time, at least one weight parameter of the current block can be determined based on the type indication parameter and / or the geometric mode parameter.

[0170] It is understood that in the embodiments of the present application, at least one weight parameter of the current block may be a pixel-level weight parameter. The at least one weight parameter may include at least one pixel weight value, and may also include at least one pixel offset value. That is, the at least one weight parameter may include at least one pixel-level weight coefficient, or may include at least one pixel-level weight coefficient and an offset value.

[0171] It should be noted that, in the embodiments of the present application, since the coding and decoding scheme of the present application can be applied to both unidirectional and bidirectional predictions, the at least one reference prediction value of the current block may include a forward reference value and / or a backward reference value. The forward reference value of the current block may be a prediction result obtained by performing a forward prediction on the current block, and the backward reference value of the current block may be a prediction result obtained by performing a backward prediction on the current block.

[0172] Illustratively, in an embodiment of the present application, the forward reference value may be expressed as PredSamplesL0, and the backward reference value may be expressed as PredSamplesL1.

[0173] Furthermore, in the embodiments of the present application, since the type indication parameter (type index parameter) can be used to select the type of pixel-level weighting parameters, that is, the weighting parameters defined by the pre-stored matrix can be selected, or the weighting parameters defined by the geometric mode parameters can be selected. Therefore, whether to use the geometric mode parameters can be determined based on the type indication parameter, that is, whether to use the geometric mode parameters to determine the weighting parameters can be determined based on the type indication parameter.

[0174] It can be understood that in an embodiment of the present application, if the type indication parameter indicates that the geometric mode parameters are not used, then the pre-stored matrix can be further determined, and then at least one weight parameter can be determined based on the pre-stored matrix; correspondingly, if the type indication parameter indicates that the geometric mode parameters are used, then at least one weight parameter can be directly determined based on the geometric mode parameters.

[0175] Furthermore, in an embodiment of the present application, when at least one weight parameter of the current point is at least one pixel weight value (at least one pixel weight coefficient), the position information of the sampling point in the current block can be combined with the geometric pattern parameters to further determine at least one weight parameter.

[0176] It should be noted that, in the embodiment of the present application, at least one pixel weight value may be determined based on the position information and geometric pattern parameters of the sampling point in the current block.

[0177] Furthermore, in an embodiment of the present application, it is possible to select to derive weighting parameters (at least one weight parameter) at different levels. For example, pixel-level weights can be derived at the slice level, or at the coding unit / coding block level. The weighting parameters have certain precision and upper and lower limits. The weighting parameters of pixel precision can be obtained by interpolation filtering of the derived integer pixel weighting parameters.

[0178] It should be noted that, in the embodiments of the present application, different methods may be used to determine at least one weight parameter for different levels.

[0179] Furthermore, in an embodiment of the present application, when deriving at least one weight parameter of the current block at the slice level, the lower limit weight and the upper limit weight can be first determined based on the gradient mode information, the change starting position information, the change ending position information, the change direction information, and the predefined calculation accuracy; then, the first distance can be determined based on the position information of the sampling point in the current block and the change starting position information, and the second distance can be determined based on the position information of the sampling point in the current block and the change ending position information; finally, at least one pixel weight value can be further determined based on the first distance, the second distance, the lower limit weight, and the upper limit weight.

[0180] It is understandable that in the embodiments of the present application, the upper limit weight and the lower limit weight may be determined based on the geometric pattern parameters in combination with the predefined calculation accuracy.

[0181] It should be noted that in the embodiments of the present application, the upper limit weight and the lower limit weight can be determined by one or more parameters in the geometric mode parameters, or can be predefined. That is, the pre-set upper limit weight and lower limit weight can be used directly without referring to the geometric mode parameters.

[0182] Exemplarily, in an embodiment of the present application, the lower limit weight can be predefined as 0 and the upper limit weight can be predefined as 8; or, the upper limit weight can be determined as 16 based on a predefined calculation accuracy; or, the upper limit weight can be determined as 32 based on geometric mode parameters.

[0183] It should be noted that, in the embodiment of the present application, when performing slice-level weighting based on pixel-level weights, the gradient mode information modeParm, the slice-level change direction information sliceDirParm, the slice-level change start position information sliceStartPosParm, the slice-level change end position information sliceEndPosParm, the slice-level gradient lower limit information minWvalue, the slice-level gradient upper limit information maxWvalue and other geometric pattern parameters related to weights are determined based on the current slice. These geometric pattern parameters can be used to determine a comprehensive weight parameter sliceewtParm for the current slice, and the weight wLX used in the slice-level weighted prediction is ij and offset o_LX ij Derived from this parameter. Where X is the reference list index. When X is 0, it indicates the forward reference list List0, otherwise it indicates the backward reference list List1.

[0184] Exemplarily, in an embodiment of the present application, the gradient mode information modeParm may be used to indicate that the gradient mode is a single-segment linear oblique gradient mode defined by geometric parameters.

[0185] Exemplarily, in an embodiment of the present application, the slice-level change direction information sliceDirParm can be used to indicate that the change direction is that the weighted value of the first predicted pixel is from left to right or from right to left, from top to bottom, from bottom to top, and other different possibilities, such as gradually increasing from the upper left (calculated distance is negative) to the lower right (calculated distance is positive).

[0186] Exemplarily, in an embodiment of the present application, the slice-level change starting position information sliceStartPosParm can be used to indicate that the gradient starting position is a straight line with a slope of α1 and an intercept of β1 (or expressed in polar coordinates as an angle of θ1 and a distance of d1), that is, the straight line is used as the starting gradient position, and this position takes the upper left as the upper / lower limit weight. Combined with the direction specified by sliceDirParm, the weight of the position specified by the parameter can be determined as the lower limit weight minWvalue, that is, the gradient lower limit information is determined.

[0187] Exemplarily, in an embodiment of the present application, the slice-level change start and end information sliceEndPosParm can be used to indicate that the gradient end position is a straight line with a slope of α2 and an intercept of β2 (or expressed in polar coordinates as an angle of θ2 and a distance of d2), that is, the gradient ends from this straight line, and this position takes the lower right as the lower / upper limit weight. Combined with the direction specified by sliceDirParm, the weight of the position specified by the parameter can be determined as the upper limit weight maxWvalue, that is, the gradient upper limit information is determined.

[0188] That is, in an embodiment of the present application, the lower limit weight and the upper limit weight can be determined based on the gradient mode information, the change start position information, the change end position information, the change direction information, and the predefined calculation accuracy. At the same time, the distance between the pixel point and the gradient start position and the gradient end position needs to be further determined with reference to the position information of the sampling point in the current block. The first distance can be determined based on the position information of the sampling point in the current block and the change start position information, and the second distance can be determined based on the position information of the sampling point in the current block and the change end position information.

[0189] For example, in an embodiment of the present application, if the gradient mode information indicates that the gradient mode is a linear oblique gradient mode, for each CU in the slice, the first distance d between the position information of the sampling point in the current block and the gradient start position sliceStartPosParm and the gradient end position sliceEndPosParm can be calculated respectively. L0s [x0][y0] and the second distance d L0e [x0][y0], so that the weight parameter w of the pixel point can be further determined based on the first distance and the second distance L0 [x0][y0], wherein at least one pixel weight value may be determined according to the first distance, the second distance, the lower limit weight, and the upper limit weight.

[0190] Further, in the embodiment of the present application, according to the first distance d L0s [x0][y0] and the second distance d L0e [x0][y0] determines the weight parameter w of the pixel L0 When [x0][y0], you can refer to the following formula:

[0191]

[0192] Among them, maxWvalue is the upper limit weight, that is, the gradient upper limit information; minWvalue is the lower limit weight, that is, the gradient lower limit information.

[0193] Furthermore, in an embodiment of the present application, for bidirectional prediction, the first prediction weight can be first determined based on the first distance, the second distance, the lower limit weight and the upper limit weight; then the weight sum value can be determined based on the lower limit weight and the upper limit weight; finally, the second prediction weight can be determined based on the first prediction weight and the weight sum value.

[0194] It should be noted that, in the embodiment of the present application, if the slice-level weighted prediction is a bidirectional weighted prediction, then the sum of the forward weight value and the backward weight value of the pixel point is the same as the sum of the upper limit weight value and the lower limit weight value, that is, according to the following formula, after determining the weight sum value sumValue, a weight value of the pixel point that has been determined (such as the forward weight value w L0 [x0][y0]), determine another weight value of the pixel (such as the backward weight value w L1 [x0][y0]):

[0195] sumValue=minWvalue+maxWvalue (13)

[0196] w L1 [x0][y0]=sumValue-w L0 [x0][y0] (14)

[0197] Furthermore, in an embodiment of the present application, at least one weight parameter of the current block may include at least one pixel weight value, and may also include at least one pixel offset value. The pixel offset value may be set as a constant for transmission, or may be obtained using a previously determined pixel weight value.

[0198] It is understood that in the embodiments of the present application, at least one pixel offset value of the current block can be determined by decoding the code stream. Taking bidirectional prediction as an example, the offset parameters (offset values) o_L0[x0][y0] and o_L1[x0][y0] can be constants and transmitted separately.

[0199] It is understood that, in the embodiment of the present application, at least one pixel offset value may also be determined according to at least one pixel weight value. Taking bidirectional prediction as an example, the offset parameters (offset values) o_L0[x0][y0] and o_L1[x0][y0] may be respectively L0 [x0][y0]、w L1 [x0][y0] have a linear relationship.

[0200] Furthermore, in an embodiment of the present application, when deriving at least one weight parameter of the current block at the CU level, such as BCW weighting based on pixel-level weights, the lower limit weight and the upper limit weight can be first determined based on the gradient pattern information, gradient intensity information, change direction information, change center position information and predefined calculation accuracy, and the change center position weight can be determined based on the upper limit weight and the lower limit weight; then, the third distance can be determined based on the position information of the sampling point in the current block and the change center position information; finally, at least one pixel point weight value can be determined based on the third distance and the change center position weight.

[0201] It is understandable that in the embodiments of the present application, the upper limit weight and the lower limit weight may be determined based on the geometric pattern parameters in combination with the predefined calculation accuracy.

[0202] It should be noted that in the embodiments of the present application, the upper limit weight and the lower limit weight can be determined by one or more parameters in the geometric mode parameters, or can be predefined. That is, the pre-set upper limit weight and lower limit weight can be used directly without referring to the geometric mode parameters.

[0203] Exemplarily, in an embodiment of the present application, the lower limit weight can be predefined as 0 and the upper limit weight can be predefined as 8; or, the upper limit weight can be determined as 16 based on a predefined calculation accuracy; or, the upper limit weight can be determined as 32 based on geometric mode parameters.

[0204] It should be noted that in the embodiment of the present application, when performing CU-level weighting based on pixel-level weights, several weight-related geometric pattern parameters such as gradient mode information modeParm, CU-level gradient intensity information cbSlopeParm, CU-level change direction information cbDirParm, and CU-level change center position information cbCenterPosParm are determined based on the forward reference block of the current CU. These geometric pattern parameters can be used to determine a comprehensive weight parameter cbwtParm for the current CU. Among them, the weight wL0 used in CU-level bidirectional weighted prediction is ij 、wL1 ij and offset o_L0 ij 、o_L1 ij Derived from this parameter.

[0205] Exemplarily, in an embodiment of the present application, the gradient mode information modeParm may be used to indicate that the gradient mode is a single-segment linear oblique gradient mode defined by geometric parameters.

[0206] For example, in an embodiment of the present application, the CU-level gradient strength information cbSlopeParm may be used to indicate the gradient strength of the gradient mode. For example, cbSlopeParm may be the gradient weight reaching a maximum or minimum when the distance from the specified position is n pixels.

[0207] Exemplarily, in an embodiment of the present application, the CU-level change direction information cbDirParm can be used to indicate that the change direction is that the weighted value of the first predicted pixel is from left to right or from right to left, from top to bottom, from bottom to top, and other different possibilities, such as gradually increasing from the upper left (calculated distance is negative) to the lower right (calculated distance is positive).

[0208] For example, cbDirParm is 1, which means that the weighted value of the first pixel gradually decreases as the distance value changes from negative to positive, and is 0, which means that the weighted value of the first pixel gradually increases as the distance value changes from negative to positive. Here, the value is 0.

[0209] For example, in an embodiment of the present application, the CU-level change center position information cbCenterPosParm can be determined based on the slope and intercept of the center position in the oblique gradient mode, for example, a straight line with a slope of α and an intercept of β (or an angle of θ and a distance of d in polar coordinates).

[0210] For example, in an embodiment of the present application, based on the change center position information cbCenterPosParm, combined with the information provided by cbDirParm and cbSlopeParm, the gradient lower limit information is determined by taking the starting position of the gradient -n pixels from the line and the left or bottom of this starting position as the lower weight value minWvalue. The gradient lower limit information is determined by taking the ending position of the gradient n pixels from the line and the right or top of the ending position as the upper weight value maxWvalue. The weight gradient is performed within the range from the starting position to the ending position.

[0211] That is to say, in the embodiment of the present application, based on modeParm, cbSlopeParm and cbDirParm, the gradient range range[-n, n] and the gradient direction can be determined, and then the gradient range range[-n, n] and the gradient direction can be used to determine the lower limit weight minWvalue and the upper limit weight maxWvalue. Then, in the case of linear gradient, the change center position weight can be determined based on the upper and lower limits minWvalue, maxWvalue and the change center position information cbCenterPosParm. Among them, the weight wCenterPos of the change center position information cbCenterPosParm should be the average of the lower and upper limits minWvalue and maxWvalue of the weight, as shown in the following formula:

[0212] wCenterPos=(maxWvalue+minWvalue+1)>>1 (15)

[0213] Assume minWvalue is 0 and maxWvalue is 1.

[0214] Furthermore, in an embodiment of the present application, if the gradient mode information indicates that the gradient mode is a linear oblique gradient mode, a third distance must be determined before calculating the weight value w[x0][y0] of at least one pixel point for a distance-based linear gradient. The third distance can be determined based on the position information of the sampling point and the position information of the change center in the current block.

[0215] Exemplarily, in an embodiment of the present application, for each pixel point in the forward reference block of the current coding unit CU, a distance parameter L1, i.e., a third distance, between the pixel point and the determined pixel point of the gradient center position cbCenterPosParm of the forward reference block is calculated based on the position information of the sampling point in the current block, as shown in the following formula:

[0216]

[0217] Where ρ is the distance between the center of the gradient and the origin. Assuming the origin is at the center of the entire block area, that is, for a block with a width of cbWidth and a height of cbHeight, the distance dx and dy relative to the upper left corner pixel can be expressed as follows:

[0218] dx = cbWidth / 2 - 0.5 pixels (17)

[0219] dy = cbHeight / 2-0.5 pixels (18)

[0220] Then, the third distance L1 can be determined by calculating according to the following formula:

[0221]

[0222] The offset values ​​offsetX and offsetY describe the horizontal and vertical components of the distance between the gradient center line and the origin, respectively.

[0223] Furthermore, in the embodiment of the present application, after determining the third distance, the third distance and the weight of the change center position can be used to finally determine at least one pixel weight value, which may include a first prediction weight value (such as the weight of the forward reference block pixel or the weight of the reference block pixel for intra-frame prediction, etc.) L0[x0][y0] and the second prediction weight value (such as the weight of the backward reference block pixel point or the weight of the reference block pixel point for intra-frame prediction, etc.) w L1 [x0][y0].

[0224] For example, in the embodiment of the present application, the first prediction weight value w is calculated using the third distance L1. L0 [x0][y0], you can refer to the following formula:

[0225] wl=cbDirParm? (n+L1):(n-L1) (20)

[0226] w L0 [x0][y0]=Clip3(0, 1, wl*wCenterPos / n) (21)

[0227] It is understood that in the embodiments of the present application, in order to maintain the calculation accuracy, the intermediate calculation results of the above calculation process can be appropriately enlarged and restored to an appropriate size before the clip operation, that is, the intermediate calculation process can be fixed-point and the enlargement operation can be performed according to the accuracy requirements. For example:

[0228]

[0229] wl=cbDirParm? (n<<(shift0+1)+L1):(n<<(shift0+1)-L1) (23)

[0230] w L0 [x0][y0]=Clip3(0,1<<shift1,((wl*wCenterPos)> >(shift0+1)) / n) (24)

[0231] Among them, shift0 is a factor related to data amplification for retaining sufficient accuracy for intermediate calculations.

[0232] When the values ​​of n, shift0, and shift1 are fixed, most of the data in the above formula except x0, offsetX, y0, and offsetY are constants, and the calculation can be combined and simplified. For example, when maxWvalue and n are both powers of 2, the calculation process can be changed to:

[0233]

[0234] wl=cbDirParm? (n<<(shift0+1)+L1):(n<<(shift0+1)-L1) (26)

[0235] wL0 [x0][y0]=Clip3(0,1<<shift1,wl> >(shift0+1+log2n-log2wCenterPos)) (27)

[0236] It can be understood that in the embodiments of the present application, the intermediate calculation results are amplified to ensure accuracy, including the weight value itself, which can also be appropriately amplified. In the formula, shift1 corresponds to this amplification operation, and then restored to the appropriate pixel value range when calculating the weighted prediction value below.

[0237] Furthermore, in the embodiment of the present application, after determining the first prediction weight value (eg, the weight value of the forward reference block pixel point or the weight value of the reference block pixel point for intra-frame prediction, etc.) w L0 [x0][y0], we can further use w L0 [x0][y0] derive the second prediction weight value (such as the weight of the backward reference block pixel point or the weight of the reference block pixel point for intra-frame prediction, etc.) w L1 [x0][y0], as follows:

[0238] w L1 [x0][y0]=1< <shift1-w L0 [x0][y0] (28)

[0239] Furthermore, in an embodiment of the present application, based on the CIIP weighting of pixel-level weights, when deriving at least one weight parameter of the current block, the lower limit weight and the upper limit weight can be first determined according to the gradient pattern information, gradient intensity information, change direction information, change center position information and predefined calculation accuracy, and the change center position weight can be determined according to the upper limit weight and the lower limit weight; then the fourth distance can be determined according to the position information of the sampling point in the current block and the change center position information; finally, at least one pixel point weight value can be determined based on the fourth distance, the lower limit weight, the upper limit weight and the change center position weight.

[0240] It is understandable that in the embodiments of the present application, the upper limit weight and the lower limit weight may be determined based on the geometric pattern parameters in combination with the predefined calculation accuracy.

[0241] It should be noted that in the embodiments of the present application, the upper limit weight and the lower limit weight can be determined by one or more parameters in the geometric mode parameters, or can be predefined. That is, the pre-set upper limit weight and lower limit weight can be used directly without referring to the geometric mode parameters.

[0242] Exemplarily, in an embodiment of the present application, the lower limit weight can be predefined as 0 and the upper limit weight can be predefined as 8; or, the upper limit weight can be determined as 16 based on a predefined calculation accuracy; or, the upper limit weight can be determined as 32 based on geometric mode parameters.

[0243] It should be noted that, in the embodiment of the present application, the determination of the pixel-level CIIP intra prediction weight wt is not only related to the modeParm, cbSlopeParm, cbDirParm, and cbCenterPosParm of the current CU, but also to the coding modes of the upper and left adjacent blocks of the current CU. The coding modes of the adjacent blocks can be identified using the two flags isIntraTop and isIntraLeft. When isIntraTop is 1, the upper adjacent block is available and is in intra mode. When isIntraLeft is 1, it indicates that the left adjacent block is available and is in intra mode.

[0244] A comprehensive parameter cbwtParm is determined by the modeParm, cbSlopeParm, cbDirParm, cbCenterPosParm and the coding mode information isIntraTop and isIntraLeft of the adjacent blocks. This parameter can be used to determine the weight wt[x0][y0] of each pixel point when the current block adopts the intra-frame mode, where x0=0...cbWidth-1, y0=0...cbHeight-1.

[0245] Exemplarily, in an embodiment of the present application, the gradient mode information modeParm may be used to indicate that the gradient mode is a single-segment linear oblique gradient mode defined by geometric parameters.

[0246] For example, in an embodiment of the present application, the gradient strength information cbSlopeParm can be used to indicate the gradient strength of the gradient mode. For example, cbSlopeParm can indicate that the gradient weight reaches a maximum or minimum when the distance from the specified position is 4 pixels.

[0247] Exemplarily, in an embodiment of the present application, the change direction information cbDirParm can be used to indicate that the change direction of the weighted value of the first predicted pixel is from left to right or from right to left, from top to bottom, from bottom to top, etc., for example, gradually increasing from the upper left (calculated distance is negative) to the lower right (calculated distance is positive).

[0248] For example, cbDirParm is 1, which means that the weighted value of the first pixel gradually decreases as the distance value changes from negative to positive, and is 0, which means that the weighted value of the first pixel gradually increases as the distance value changes from negative to positive. Here, the value is 0.

[0249] For example, in an embodiment of the present application, the change center position information cbCenterPosParm can be determined based on the slope and intercept of the center position in the oblique gradient mode, for example, a straight line with a slope of α and an intercept of β (or an angle of θ and a distance of d in polar coordinates).

[0250] For example, in an embodiment of the present application, based on the change center position information cbCenterPosParm, combined with the information provided by cbDirParm and cbSlopeParm, the gradient lower limit information is determined by taking the starting position of the gradient -n pixels from the line and the left or bottom of this starting position as the lower weight value minWvalue. The gradient lower limit information is determined by taking the ending position of the gradient n pixels from the line and the right or top of the ending position as the upper weight value maxWvalue. The weight gradient is performed within the range from the starting position to the ending position.

[0251] That is to say, in the embodiment of the present application, based on modeParm, cbSlopeParm and cbDirParm, the gradient range range[-n, n] and the gradient direction can be determined, and then the gradient range range[-n, n] and the gradient direction can be used to determine the lower limit weight minWvalue and the upper limit weight maxWvalue. Then, in the case of linear gradient, the change center position weight can be determined based on the upper and lower limits minWvalue, maxWvalue and the change center position information cbCenterPosParm. Among them, the weight wCenterPos of the change center position information cbCenterPosParm should be the average of the lower and upper limits minWvalue and maxWvalue of the weight, as shown in the following formula:

[0252] wCenterPos=(maxWvalue+minWvalue+1)>>1 (29)

[0253] Assume minWvalue is 0 and maxWvalue is 1.

[0254] Furthermore, in an embodiment of the present application, if the gradient mode information indicates that the gradient mode is a linear oblique gradient mode, a fourth distance must be determined before calculating the weight value w[x0][y0] of at least one pixel point for a distance-based linear gradient. The fourth distance can be determined based on the position information of the sampling point and the position information of the change center in the current block.

[0255] Exemplarily, in an embodiment of the present application, for each pixel point in the forward reference block of the current coding unit CU, a distance parameter L2, i.e., a fourth distance, between the pixel point and the determined pixel point of the gradient center position cbCenterPosParm of the forward reference block is calculated based on the position information of the sampling point in the current block, as shown in the following formula:

[0256]

[0257] Where ρ is the distance between the center of the gradient and the origin. Assuming the origin is at the center of the entire block area, that is, for a block with a width of cbWidth and a height of cbHeight, the distance dx and dy relative to the upper left corner pixel can be expressed as follows:

[0258] dx = cbWidth / 2 - 0.5 pixels (31)

[0259] dy = cbHeight / 2-0.5 pixels (32)

[0260] Then, the fourth distance L2 can be calculated according to the following formula:

[0261]

[0262] The offset values ​​offsetX and offsetY describe the horizontal and vertical components of the distance between the gradient center line and the origin, respectively.

[0263] Furthermore, in an embodiment of the present application, after determining the fourth distance, the fourth distance, the upper limit weight, the lower limit weight, and the change center position weight can be used to finally determine at least one pixel weight value, which may include a first prediction weight value (such as the weight of a forward reference block pixel or the weight of an intra-frame prediction reference block pixel, etc.) L0 [x0][y0] and the second prediction weight value (such as the weight of the backward reference block pixel point or the weight of the reference block pixel point for intra-frame prediction, etc.) w L1 [x0][y0].

[0264] For example, in the embodiment of the present application, the first prediction weight value w is calculated using the fourth distance L2. L0 [x0][y0], you can refer to the following formula:

[0265] wl=cbDirParm? (n+L2):(n-L2) (34)

[0266]

[0267] The number of gradient pixels on both sides of the gradient center position is n, and the offset values ​​offsetX and offsetY of the current CU block are determined according to the size of the current CU block and the gradient mode.

[0268] It is understood that in the embodiment of the present application, in order to improve the calculation accuracy, the weight value here can be appropriately multiplied by a coefficient, or shifted left by 3 bits to be amplified. Or when specifying minWvalue and maxWvalue, the amplification of the weight value is considered in advance, such as they are respectively amplified by 2 compared to the actual weight value. shift3 times.

[0269] It should be noted that, in the embodiment of the present application, for bidirectional weighted prediction, the sum of the forward weight value and the backward weight value of the pixel point is the same as the sum of the upper limit weight value and the lower limit weight value, that is, according to the following formula, after determining the weight sum value sumValue, a weight value of the pixel point that has been determined (such as the forward weight value w L0 [x0][y0]), determine another weight value of the pixel (such as the backward weight value w L1 [x0][y0]):

[0270] sumValue=minWvalue+maxWvalue (36)

[0271] w L1 [x0][y0]=sumValue-w L0 [x0][y0] (37)

[0272] Furthermore, in an embodiment of the present application, at least one weight parameter of the current block can be either a pixel-level weight parameter or a weight parameter of at least one sub-block of the current block, that is, at least one weight parameter can also include a weight value of at least one sub-block of the current block.

[0273] It is understood that in the embodiments of the present application, when applying weighting parameters to derive predicted pixel values, a weighting parameter that varies pixel-by-pixel can be used for calculations for pixels at different locations. Alternatively, to reduce computational complexity, a method can be employed where the same weighting value is applied to each sub-block (e.g., a 2x2 or 4x4 sub-block).

[0274] Furthermore, in the embodiments of the present application, the weighting parameters on the plane can vary according to a certain geometric rule with reference to the position of the pixel point, or can also combine multiple different geometric rule changes. For example, the pixel-level weight value can vary with the distance of the pixel point from the center change position. When the distance value is between [0, L1], it is a gradual change method; when the distance is between (L1, L2], it is a second gradual change method.

[0275] Furthermore, in the embodiments of the present application, the pixel-level weight value may not only vary with the distance of the pixel from the center change position, but also determine different linear or nonlinear gradient modes for different positions. For example, when the distance value is between [0, L1], the gradient mode is a linear gradient mode, and when the distance is between (L1, L2], the gradient mode is a nonlinear gradient mode, etc.

[0276] It can be seen that the encoding and decoding method proposed in the embodiment of the present application can be used for unidirectional prediction or bidirectional prediction, and can be used in the case where all predictions are derived from inter-frame prediction or in the case where some or all predicted pixel values ​​are derived from intra-frame prediction.

[0277] It can be understood that in the embodiment of the present application, the situation for unidirectional prediction is similar to the WP mode, and pixel-level weighting parameters (weight parameters) are derived only for one prediction source, which may include weighting coefficients (weight values) and offsets.

[0278] It can be understood that in the embodiments of the present application, the situation for bidirectional prediction can be similar to the WP mode, and pixel-level weighting parameters (weight parameters) for the two prediction sources can be derived, which may include weighting coefficients (weight values) and offsets; or it can be similar to BCW or CIIP, and only pixel-level weighting coefficients (weight values) for the two prediction sources are derived.

[0279] Furthermore, in an embodiment of the present application, when determining at least one weight parameter at the pixel level of the current block, the weight of the pixel point can be calculated using the coordinates of the pixel point, or can be generated by selecting predefined weight parameters using a preset matrix, or can be derived from the weight parameters of the pixel points adjacent to the upper and left positions of the pixel point.

[0280] That is, in an embodiment of the present application, for the position information of a sampling point in the current block, the pixel weight of the position information of the sampling point can be determined based on the pixel weights of the position information of other sampling points adjacent to the position information of the sampling point.

[0281] For example, in the embodiment of the present application, the weight w of a pixel is c The weight w of the pixel points adjacent to the upper and left positions of the pixel coordinates can be obtained t 、w l Derived:

[0282] w c =(w l +w t +1) / 2 (38)

[0283] Step 103: Determine a prediction value of the current block based on at least one reference prediction value and at least one weight parameter.

[0284] In an embodiment of the present application, after determining at least one reference prediction value of the current block based on at least one motion vector information and determining at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter, the prediction value of the current block can be further determined based on the at least one reference prediction value and the at least one weight parameter.

[0285] Furthermore, in an embodiment of the present application, after determining at least one weight parameter of the current block, which includes at least one pixel weight value, or includes at least one pixel weight value and at least one pixel offset value, the prediction processing can be completed based on the at least one pixel weight value (at least one pixel weight value and at least one pixel offset value) and further combined with at least one reference prediction value of the current block to obtain the prediction value of the current block.

[0286] It can be understood that in an embodiment of the present application, in the process of calculating the prediction value of slice-level weighted prediction, the prediction value of the current block can be determined based on at least one reference prediction value, at least one pixel weight and at least one pixel offset value.

[0287] For example, in an embodiment of the present application, after obtaining the syntax elements of slice-level weighted prediction and the reference pixel value (reference prediction value) of each CU of the current slice, if it is a unidirectional prediction, taking the forward prediction as an example, the weighted prediction processing can be performed according to the following formula to determine the prediction value Pred of the current block WP :

[0288]

[0289] For example, in an embodiment of the present application, after obtaining the syntax elements of slice-level weighted prediction and the reference pixel value (reference prediction value) of each CU of the current slice, if it is a unidirectional prediction, taking the backward prediction as an example, the weighted prediction processing can be performed according to the following formula to determine the prediction value Pred of the current block WP :

[0290]

[0291] For example, in an embodiment of the present application, after obtaining the syntax elements of slice-level weighted prediction and the reference pixel value (reference prediction value) of each CU of the current slice, if bidirectional prediction is used, weighted prediction processing can be performed according to the following formula to determine the prediction value Pred of the current block: WP :

[0292]

[0293] It should be noted that, in the embodiment of the present application, for the luminance block, there are:

[0294] log2W d =luma_log2_weight_denom+shift1 (42)

[0295] It should be noted that, in the embodiment of the present application, for the chroma block, there are:

[0296] log2W d =chroma_log2_weight_denom+shift1 (43)

[0297] Among them, PredSamplesL0 and PredSamplesL1 are the reference pixel values ​​in the reference lists List0 and List1 respectively. L0 [x0][y0] and w L1 [x0][y0] are the pixel-level weights of the forward and backward reference blocks, that is, the pixel-level weight values ​​of the current block. o_L0[x0][y0] and o_L1[x0][y0] represent the corresponding offsets, that is, the pixel-level offset values ​​of the current block.

[0298] It is understood that in the embodiments of the present application, in order to improve the prediction accuracy, the intermediate calculation results have a higher accuracy than the reference pixel value, and log2_weight_denom and chroma_log2_weight_denom indicate the improved accuracy of the weighting coefficient. shift1 is the improved accuracy of the reference pixel value during the calculation process of pixel interpolation (the integer pixel value is also amplified). The Clip() operation clamps the pixel value to within the valid range, such as the valid value of 8-bit is [0, 255], and the valid value of 10-bit is [0, 1023].

[0299] It can be understood that in the embodiments of the present application, based on the BCW weighting of the pixel level weight, during the prediction value calculation process, the prediction value of the current block can be determined based on at least one reference prediction value and at least one pixel point weight.

[0300] It should be noted that in an embodiment of the present application, for bidirectional prediction, both the forward reference list List0 and the backward reference list List1 are used, and the forward motion vector information MV0 in the forward reference list List0 is used to perform motion compensation prediction to obtain the forward prediction value (forward reference value) PredSamplesL0, and the backward motion vector information MV1 in the backward reference list List1 is used to perform motion compensation prediction to obtain the backward prediction value (backward reference value) PredSamplesL1.

[0301] It can be understood that in the embodiment of the present application, BCW is only enabled for bidirectionally predicted CUs, only a small number of predefined weights are used, and their indexes are encoded.

[0302] For example, in an embodiment of the present application, when the pixel-level weighted BCW is used, the prediction value of the current block, that is, the weighted prediction value, is:

[0303]

[0304] Among them, PredSamplesL0 and PredSamplesL1 are the reference pixel values ​​in the reference lists List0 and List1 respectively. L1 [x0][y0] is the weight of the backward reference pixel value at the relative position (x0, y0) of the block, w L0 [x0][y0] are the weights of the forward reference pixel value at the block relative position (x0, y0), where x0 = 0...cbWidth-1, y0 = 0...cbHeight-1. maxTempBitDepth is the maximum bit depth allowed during the operation.

[0305] It can be understood that in the embodiments of the present application, based on the CIIP weighting of the pixel-level weight, during the prediction value calculation process, the prediction value of the current block can be determined based on at least one reference prediction value and at least one pixel point weight.

[0306] It should be noted that, in the embodiment of the present application, when calculating the CIIP weighted prediction value based on pixel-level weight, the P used is intra It is the intra-frame prediction value obtained by the current block through the Planar mode for conventional intra-frame prediction processing, P inter is the prediction value between frames, and wt[x0][y0] is the weight of intra-frame prediction.

[0307] For example, in the embodiment of the present application, when the pixel-level weighted CIIP is used, the prediction value of the current block, that is, the weighted prediction value Predsamples CIIP for:

[0308]

[0309] Among them, w L0 [x0][y0] is the weight of the forward reference pixel value, w L1 [x0][y0] is the weight of the backward reference pixel value, shift3 is the parameter used to amplify the weight in the previous step to improve the calculation accuracy, and the right shift is to restore the predicted pixel value to a reasonable value range. If there is no amplification, it can be simply written as:

[0310] Predsamples CIIP =w L1 [x0][y0]*P inter +w L0 [x0][y0]*P intra (46)

[0311] It can be seen that in the embodiments of the present application, when the coding and decoding methods proposed in the present application are respectively applied to slice-level weighting, two Inter prediction quantity weightings (BCW) at the CU level, and one Inter and one Intra prediction quantity weighting (CIIP) at the CU level, the determination of pixel-level weighting parameters can be completed, thereby improving the coding efficiency and performance of weighted prediction.

[0312] That is, in the embodiments of the present application, the pixel-level weight values ​​used in the weighted prediction process are no longer fixed to a fixed value for the entire forward reference block or backward reference block. Instead, the weighting parameters of the current slice or CU can be adaptively adjusted based on factors such as changes in lighting in the sequence content. That is, using pixel-level weight values ​​for inter-frame weighted prediction, rather than a fixed value for each reference block, further improves the accuracy of inter-frame weighted prediction, thereby improving the coding efficiency of weighted prediction.

[0313] It should be noted that in the embodiments of the present application, although slice-level weighting, CU-level weighting of two Inter prediction quantities, and CU-level weighting of one Inter and one Intra prediction quantity are exemplified, the encoding and decoding method proposed in the embodiments of the present application does not have different designs for the slice level or CU level alone, nor does it have different designs because each prediction quantity involved in the weighting comes from the Inter or Intra prediction method.

[0314] The embodiment of the present application proposes a decoding method, in which the decoder can determine at least one motion vector information of the current block, as well as a type indication parameter and / or a geometric mode parameter; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter. It can be understood that in the embodiment of the present application, the codec can determine the pixel-level weight parameters of the current block through the type indication parameter and / or the geometric mode parameter, and then perform prediction processing on the current block based on the pixel-level weight parameters. It can be seen that in the embodiment of the present application, the weights used for prediction processing are no longer fixed, but pixel-level weight values ​​that adapt to changes in pixel points are selected, which greatly improves the accuracy of weighted prediction, thereby improving coding efficiency and compression performance.

[0315] An embodiment of the present application provides an encoding method, which is applied to an encoder. FIG20 is a schematic diagram of an implementation flow of the encoding method. As shown in FIG20 , the encoding method performed by the encoder may include the following steps:

[0316] Step 201: Determine at least one piece of motion vector information, and a type indication parameter and / or a geometric mode parameter of a current block.

[0317] In an embodiment of the present application, the encoder may first determine at least one motion vector information of the current block, and may also determine a type indication parameter and / or a geometric mode parameter.

[0318] It should be noted that, in the embodiments of the present application, since the coding and decoding scheme of the present application can be applied to both unidirectional and bidirectional predictions, the at least one motion vector information of the current block may include a forward motion vector and / or a backward motion vector. The forward motion vector of the current block can be used to perform forward prediction on the predicted value of the current block, and the backward motion vector of the current block can be used to perform backward prediction on the predicted value of the current block.

[0319] Illustratively, in an embodiment of the present application, the forward motion vector may be expressed as MVL0, and the backward motion vector may be expressed as MVL1.

[0320] It should be noted that, in the embodiment of the present application, the type indication parameter is a type index parameter, wherein the type indication parameter can be used to select the type of pixel-level weighting parameter, that is, it can be used to select the method for determining the pixel-level weighting parameter.

[0321] It can be understood that in the embodiments of the present application, the type of pixel-level weighting parameters, that is, the method of determining the pixel-level weighting parameters may include but is not limited to the following types (methods): weighting parameters defined by a pre-stored matrix (pre-stored matrix), and weighting parameters defined by geometric pattern parameters.

[0322] That is, in the embodiments of the present application, the type indication parameter can be used to determine whether to use a pre-stored matrix to derive pixel-level weighting parameters or to use geometric mode parameters to derive pixel-level weighting parameters. It can also be understood that the type indication parameter is used to determine whether to use a pre-stored matrix to derive pixel-level weighting parameters, or whether to use geometric mode parameters to derive pixel-level weighting parameters.

[0323] It should be noted that, in embodiments of the present application, geometric pattern parameters may include one or more of the following parameters: gradient pattern information, gradient intensity information, change direction information, change start position information, change center position information, change end position information, gradient upper / lower limit information (i.e., lower limit weight and upper limit weight, which can be derived from other geometric pattern parameters or pre-set), change range width information, and change segment information. In some embodiments, gradient intensity information may also be expressed as change range width information.

[0324] It should be noted that, in the embodiment of the present application, the gradient mode information may be determined using modeParm, wherein the gradient mode information modeParm may indicate the gradient mode, that is, may indicate the type of the gradient mode.

[0325] For example, in an embodiment of the present application, the types of gradient patterns may include but are not limited to horizontal gradient weighting, vertical gradient weighting, oblique gradient weighting, radial gradient weighting, affine gradient weighting, and the like.

[0326] For example, the horizontal gradient mode can include two different change directions; the vertical gradient mode can include two different change directions; the oblique gradient mode not only has multiple different change directions, but also can include multiple different gradient intensity information; the radial gradient mode involves the change center position.

[0327] Furthermore, in an embodiment of the present application, the optimal gradient mode for the current coding unit / coding block can be determined by template matching. Specifically, the pixels in the upper row and / or left column of the current coding unit / block are used as a template. In the process of constructing the template predicted pixel value, a gradient weighting process is performed on the prediction values ​​from different sources, and the geometric parameters of the most appropriate gradient weighting scheme are selected as the parameters of the gradient weighting scheme for the current coding unit / block.

[0328] Furthermore, in an embodiment of the present application, for a small-sized coding unit / coding block, some gradient modes with a large gradient width range may be skipped. For a large-sized coding unit / coding block, some gradient modes with a small gradient width range may be skipped.

[0329] Furthermore, in an embodiment of the present application, for a sequence with a higher resolution or a block with a larger size, the number of segments of the gradient pattern can be adaptively increased, thereby making the prediction more accurate.

[0330] It should be noted that in an embodiment of the present application, the gradient intensity information can be determined using slopeParm, wherein the gradient intensity information slopeParm can indicate the speed of change, that is, it can indicate the speed of change of the gradient weight parameter as the pixel distance specifies the position (the position of the point or line).

[0331] It should be noted that in the embodiments of the present application, the linear gradient intensity information can be indicated by an index method. For example, 0 represents no gradient, a direct jump; m means that the gradient weight parameter reaches the maximum or minimum when the distance reaches the specified position of (2m-1) / M pixel positions, and a linear gradient is used when the distance is closer, and the maximum or minimum is maintained when the distance is farther, where the value of M can be 2, 1, 1 / 2, etc.

[0332] For example, in the embodiments of this application, it is assumed that linear gradient strength information is indicated in an indexed manner. 0 indicates that w is constant, with no gradient or jump; m indicates that the gradient weight parameter reaches its maximum or minimum when the distance reaches t×width / (2m-1), where width is the unit width corresponding to the calculation of the gradient weight parameter (slice width or coding block width), and t is a constant.

[0333] It should be noted that, in an embodiment of the present application, the change direction information can be determined by dirParm, wherein the change direction information dirParm can indicate the direction in which the change intensity changes, that is, it can indicate the direction in which the gradient intensity information of the weight parameter for the first predicted pixel changes.

[0334] Exemplarily, in the embodiment of the present application, it is assumed that the change direction information is indicated in an index manner, for example, 0 represents from minimum to maximum, and 1 represents from maximum to minimum.

[0335] It should be noted that in the embodiments of the present application, the change starting position information can be determined by startPosParm. Depending on the gradient type, the change starting position information startPosParm can include different numbers of parameters. In other words, the number of parameters included in the change starting position information corresponds to the gradient type (gradient mode information).

[0336] Exemplarily, in an embodiment of the present application, when the gradient mode information indicates a horizontal gradient mode, the change starting position information may include a horizontal axis coordinate position; when the gradient mode information indicates an oblique gradient mode, the change starting position information may include a set of parameters representing a straight line in a Cartesian coordinate system, one of which represents a slope and the other represents an intercept; for example, in an oblique gradient mode, the change starting position information may include a set of parameters representing a straight line in a polar coordinate system, one representing an angle and the other representing a distance; when the gradient mode information indicates a radial gradient mode, the change starting position information may include a set of parameters representing a radial shape and its corresponding position, for example, in the case of a circle, when the starting position is a point, the Cartesian coordinate system is the horizontal and vertical coordinates, and the polar coordinate system is the angle and distance; when the gradient mode information indicates an affine gradient mode, the change starting position information may include a set of parameters representing the positions of multiple control points or multiple control lines. Note that oblique gradients can include horizontal and vertical gradient modes.

[0337] It should be noted that in an embodiment of the present application, the change center position information can be determined by centerPosParm, wherein the change center position information centerPosParm is the position of the median of the weight parameter of the gradient area. For example, when the gradient interval is 0 to 1, the median is 0.5, and the weight parameter is based on this position and gradually increases or decreases to both sides.

[0338] It is understood that in the embodiment of the present application, the change center position information centerPosParm may include different numbers of parameters depending on the gradient type. In other words, the number of parameters included in the change center position information corresponds to the gradient type (gradient mode information).

[0339] Exemplarily, in an embodiment of the present application, when the gradient mode information indicates a horizontal gradient mode, the change center position information may include a horizontal axis coordinate position; when the gradient mode information indicates an oblique gradient mode, the change center position information may include a set of parameters for a straight line represented by a Cartesian coordinate system, one for the slope and one for the intercept; when the gradient mode information indicates an oblique gradient mode, the change center position information may include a set of parameters for a straight line represented by a polar coordinate system, one for the angle and one for the distance; when the gradient mode information indicates a radial gradient mode, the change center position information may include a set of parameters representing the radial shape and its corresponding position, such as in the case of a circle, when the center position is a circle, the Cartesian coordinate system contains the horizontal and vertical coordinates and the radius, and the polar coordinate system contains the center point position information and the radius. When the center point is aligned with the zero point, there may be only radius information; when the gradient mode information indicates an affine gradient mode, the change center position information may include a set of parameters representing the positions of multiple control points or multiple control lines.

[0340] It should be noted that in the embodiments of the present application, the endPosParm information can be determined by , where the endPosParm information can include different numbers of parameters depending on the gradient type. That is, the number of parameters included in the endPosParm information corresponds to the gradient type (gradient mode information).

[0341] Exemplarily, in an embodiment of the present application, when the gradient mode information indicates a horizontal gradient mode, the change cutoff position information may include a horizontal axis coordinate position; when the gradient mode information indicates an oblique gradient mode, the change cutoff position information may include a set of parameters for representing a straight line in a Cartesian coordinate system, one for representing a slope, and one for representing an intercept; when the gradient mode information indicates an oblique gradient mode, the change cutoff position information may include a set of parameters for representing a straight line in a polar coordinate system, one for representing an angle, and one for representing a distance; when the gradient mode information indicates a radial gradient mode, the change cutoff position information may include a set of parameters representing a radial shape and its corresponding position. For example, in the case of a circle, when the cutoff position is a circle, in the Cartesian coordinate system, the cutoff position information refers to the horizontal and vertical coordinates and the radius, and in the polar coordinate system, it refers to the center point position information and the radius. When the center point is aligned with the zero point, there may be only radius information; when the gradient mode information indicates an affine gradient mode, the change cutoff position information may include a set of parameters representing the positions of multiple control points or multiple control lines.

[0342] It should be noted that in an embodiment of the present application, the gradient upper / lower limit information (lower limit weight and upper limit weight) can be determined by maxWvalue / minWvalue, wherein the gradient upper / lower limit information maxWvalue / minWvalue can be used to indicate the upper / lower limit information of the weight parameter, which can be derived from other geometric pattern parameters or pre-set.

[0343] For example, in an embodiment of the present application, the gradient upper / lower limit information maxWvalue / minWvalue may be the values ​​corresponding to weights 0 and 1 under corresponding precision requirements. For example, assuming a precision of 3 binary digits, then after fixed-point conversion, the lower limit 0 corresponds to 0, and the upper limit 1 corresponds to 8; assuming a precision of 5 binary digits, then after fixed-point conversion, the lower limit 0 corresponds to 0, and the upper limit 1 corresponds to 32.

[0344] It can be understood that in the embodiments of the present application, the lower limit of the weighting parameter generally corresponds to 0, that is, the reference pixels at the corresponding position are not used during weighting, and the upper limit of the weighting parameter generally corresponds to 1, that is, all reference pixels at the corresponding position are used during weighting.

[0345] It should be noted that, in the embodiment of the present application, the gradient upper / lower limit information maxWvalue / minWvalue may not be the weights corresponding to 0 and 1. For example, it may be the values ​​corresponding to 0.2 and 0.4 under the corresponding accuracy requirements.

[0346] Furthermore, in an embodiment of the present application, the change segment information may be determined by segParm, wherein the change segment information segParm may indicate relevant information of a continuous gradient consisting of multiple segments, and may include information whose meaning covers the aforementioned multiple parameters.

[0347] For example, in an embodiment of the present application, the change segment information segParm may include multiple segments, including information such as gradient intensity information, change direction information, change start position information, and change end position information for each segment. Alternatively, the change segment information segParm may include multiple segments, including information such as change direction information, change start position information, change end position information, and gradient upper and lower limit information for each segment.

[0348] Furthermore, in an embodiment of the present application, any information in the geometric pattern parameters, namely, gradient pattern information, gradient intensity information (change range width information), change direction information, change starting position information, change center position information, change end position information, gradient upper / lower limit information, and change segment information, can be converted into an index form through quantization.

[0349] It is understood that, in the embodiment of the present application, the geometry mode parameter can be used to indicate a geometry change set, wherein the geometry change set includes change start position information, change center position information, and change end position information.

[0350] For example, in an embodiment of the present application, the change start position information, change center position information, and change end position information can specify different possibilities, and each possible line is predefined as an ordered set, so these positions can be specified by only one index. One index can correspond to one ordered set, thereby specifying the corresponding position information.

[0351] Furthermore, in an embodiment of the present application, the type indication parameter may be used to determine whether to use a pre-stored matrix to derive pixel-level weighting parameters or to use a geometric pattern parameter to derive pixel-level weighting parameters.

[0352] It is understood that in the embodiments of the present application, in the weighting mode defined by the pre-stored matrix (pre-stored matrix), the number and dimensions of the pre-defined matrices are limited. For the weighting matrix of the pre-defined dimensions, it can be applied to a variety of areas with different dimensions and different accuracy requirements through interpolation and other methods.

[0353] Furthermore, in the embodiment of the present application, the weighting parameter defined by the geometric parameters (geometric mode parameters) refers to the weighting parameter calculated by the geometric parameters. The weighting parameter on the plane changes with the pixel position according to a certain geometric law. The weighting parameter wtParm that changes according to a certain geometric law can be expressed by at least one parameter of the gradient mode information modeParm, gradient intensity information slopeParm, change direction information dirParm, change start position information startPosParm, change center position information centerPosParm, change end position information endPosParm, gradient upper / lower limit information minParm / maxParm, and change segment information segParm.

[0354] Furthermore, in an embodiment of the present application, if the geometric pattern parameters of different image blocks are the same, for example, the geometric pattern parameters such as the gradient intensity information and the change direction information of each CU are basically consistent, then one or more weight matrices can be predefined first, and the coding unit block can upsample, downsample, or truncate the predefined weight matrix based on the pixel-level weighted weights.

[0355] It should be noted that, in the embodiments of the present application, the mode type for deriving pixel-level weighting parameters can be selected in an indexed manner based on the type indication parameter. For example, a mode index number is determined based on the type indication parameter, and then the mode type for deriving pixel-level weighting parameters is determined based on the mode index number, that is, whether the weighting parameters are defined by a pre-stored matrix or by geometric parameters.

[0356] Illustratively, in an embodiment of the present application, when the weighting parameters are obtained through a pre-stored matrix or calculated by a gradual weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in Table 1. Illustratively, in an embodiment of the present application, when the weighting parameters are calculated only by a certain gradual weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in Table 2.

[0357] For example, in an embodiment of the present application, when the weighting parameter is calculated by a certain nonlinear weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in Table 3. For example, in an embodiment of the present application, when the weighting parameter is calculated by a certain nonlinear weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in Table 4.

[0358] Furthermore, in an embodiment of the present application, the inter-frame prediction mode parameters of the current block can be determined first; if the inter-frame prediction mode parameters indicate the use of pixel-level weight values ​​to determine the inter-frame prediction value of the current block, then the determination process of the execution type indication parameters and / or geometric mode parameters can be selected.

[0359] That is to say, in an embodiment of the present application, an identification information (such as an inter-frame prediction mode parameter) can be used to indicate whether to use the coding and decoding method proposed in the embodiment of the present application that uses pixel-level weight values ​​for prediction processing. If the inter-frame prediction value of the current block is determined based on the inter-frame prediction mode parameter using the pixel-level weight value, then the type indication parameter and / or the geometric mode parameter can be determined, thereby further completing the determination of at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter.

[0360] Step 202: Determine at least one reference prediction value of the current block based on at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter.

[0361] In an embodiment of the present application, after determining at least one motion vector information of the current block, as well as the type indication parameter and / or the geometric mode parameter, at least one reference prediction value of the current block can be further determined based on the at least one motion vector information, and at the same time, at least one weight parameter of the current block can be determined based on the type indication parameter and / or the geometric mode parameter.

[0362] It is understood that in the embodiments of the present application, at least one weight parameter of the current block may be a pixel-level weight parameter. The at least one weight parameter may include at least one pixel weight value, and may also include at least one pixel offset value. That is, the at least one weight parameter may include at least one pixel-level weight coefficient, or may include at least one pixel-level weight coefficient and an offset value.

[0363] It should be noted that, in the embodiments of the present application, since the coding and decoding scheme of the present application can be applied to both unidirectional and bidirectional predictions, the at least one reference prediction value of the current block may include a forward reference value and / or a backward reference value. The forward reference value of the current block may be a prediction result obtained by performing a forward prediction on the current block, and the backward reference value of the current block may be a prediction result obtained by performing a backward prediction on the current block.

[0364] Illustratively, in an embodiment of the present application, the forward reference value may be expressed as PredSamplesL0, and the backward reference value may be expressed as PredSamplesL1.

[0365] Furthermore, in the embodiments of the present application, since the type indication parameter (type index parameter) can be used to select the type of pixel-level weighting parameters, that is, the weighting parameters defined by the pre-stored matrix can be selected, or the weighting parameters defined by the geometric mode parameters can be selected. Therefore, whether to use the geometric mode parameters can be determined based on the type indication parameter, that is, whether to use the geometric mode parameters to determine the weighting parameters can be determined based on the type indication parameter.

[0366] It can be understood that in an embodiment of the present application, if the type indication parameter indicates that the geometric mode parameters are not used, then the pre-stored matrix can be further determined, and then at least one weight parameter can be determined based on the pre-stored matrix; correspondingly, if the type indication parameter indicates that the geometric mode parameters are used, then at least one weight parameter can be directly determined based on the geometric mode parameters.

[0367] Furthermore, in an embodiment of the present application, when at least one weight parameter of the current point is at least one pixel weight value (at least one pixel weight coefficient), the position information of the sampling point in the current block can be combined with the geometric pattern parameters to further determine at least one weight parameter.

[0368] It should be noted that, in the embodiment of the present application, at least one pixel weight value may be determined based on the position information and geometric pattern parameters of the sampling point in the current block.

[0369] Furthermore, in an embodiment of the present application, it is possible to select to derive weighting parameters (at least one weight parameter) at different levels. For example, pixel-level weights can be derived at the slice level, or at the coding unit / coding block level. The weighting parameters have certain precision and upper and lower limits. The weighting parameters of pixel precision can be obtained by interpolation filtering of the derived integer pixel weighting parameters.

[0370] It should be noted that, in the embodiments of the present application, different methods may be used to determine at least one weight parameter for different levels.

[0371] Furthermore, in an embodiment of the present application, when deriving at least one weight parameter of the current block at the slice level, the lower limit weight and the upper limit weight can be first determined based on the gradient mode information, the change starting position information, the change ending position information, the change direction information, and the predefined calculation accuracy; then, the first distance can be determined based on the position information of the sampling point in the current block and the change starting position information, and the second distance can be determined based on the position information of the sampling point in the current block and the change ending position information; finally, at least one pixel weight value can be further determined based on the first distance, the second distance, the lower limit weight, and the upper limit weight.

[0372] It is understandable that in the embodiments of the present application, the upper limit weight and the lower limit weight may be determined based on the geometric pattern parameters in combination with the predefined calculation accuracy.

[0373] It should be noted that in the embodiments of the present application, the upper limit weight and the lower limit weight can be determined by one or more parameters in the geometric mode parameters, or can be predefined. That is, the pre-set upper limit weight and lower limit weight can be used directly without referring to the geometric mode parameters.

[0374] Exemplarily, in an embodiment of the present application, the lower limit weight can be predefined as 0 and the upper limit weight can be predefined as 8; or, the upper limit weight can be determined as 16 based on a predefined calculation accuracy; or, the upper limit weight can be determined as 32 based on geometric mode parameters.

[0375] It should be noted that, in the embodiment of the present application, when performing slice-level weighting based on pixel-level weights, the gradient mode information modeParm, the slice-level change direction information sliceDirParm, the slice-level change start position information sliceStartPosParm, the slice-level change end position information sliceEndPosParm, the slice-level gradient lower limit information minWvalue, the slice-level gradient upper limit information maxWvalue and other geometric pattern parameters related to weights are determined based on the current slice. These geometric pattern parameters can be used to determine a comprehensive weight parameter sliceewtParm for the current slice, and the weight wLX used in the slice-level weighted prediction is ij and offset o_LX ij Derived from this parameter. Where X is the reference list index. When X is 0, it indicates the forward reference list List0, otherwise it indicates the backward reference list List1.

[0376] Exemplarily, in an embodiment of the present application, the gradient mode information modeParm may be used to indicate that the gradient mode is a single-segment linear oblique gradient mode defined by geometric parameters.

[0377] Exemplarily, in an embodiment of the present application, the slice-level change direction information sliceDirParm can be used to indicate that the change direction is that the weighted value of the first predicted pixel is from left to right or from right to left, from top to bottom, from bottom to top, and other different possibilities, such as gradually increasing from the upper left (calculated distance is negative) to the lower right (calculated distance is positive).

[0378] Exemplarily, in an embodiment of the present application, the slice-level change starting position information sliceStartPosParm can be used to indicate that the gradient starting position is a straight line with a slope of α1 and an intercept of β1 (or expressed in polar coordinates as an angle of θ1 and a distance of d1), that is, the straight line is used as the starting gradient position, and this position takes the upper left as the upper / lower limit weight. Combined with the direction specified by sliceDirParm, the weight of the position specified by the parameter can be determined as the lower limit weight minWvalue, that is, the gradient lower limit information is determined.

[0379] Exemplarily, in an embodiment of the present application, the slice-level change start and end information sliceEndPosParm can be used to indicate that the gradient end position is a straight line with a slope of α2 and an intercept of β2 (or expressed in polar coordinates as an angle of θ2 and a distance of d2), that is, the gradient ends from this straight line, and this position takes the lower right as the lower / upper limit weight. Combined with the direction specified by sliceDirParm, the weight of the position specified by the parameter can be determined as the upper limit weight maxWvalue, that is, the gradient upper limit information is determined.

[0380] That is, in an embodiment of the present application, the lower limit weight and the upper limit weight can be determined based on the gradient mode information, the change start position information, the change end position information, the change direction information, and the predefined calculation accuracy. At the same time, the distance between the pixel point and the gradient start position and the gradient end position needs to be further determined with reference to the position information of the sampling point in the current block. The first distance can be determined based on the position information of the sampling point in the current block and the change start position information, and the second distance can be determined based on the position information of the sampling point in the current block and the change end position information.

[0381] For example, in an embodiment of the present application, if the gradient mode information indicates that the gradient mode is a linear oblique gradient mode, for each CU in the slice, the first distance d between the position information of the sampling point in the current block and the gradient start position sliceStartPosParm and the gradient end position sliceEndPosParm can be calculated respectively. L0s[x0][y0] and the second distance d L0e [x0][y0], so that the weight parameter w of the pixel point can be further determined based on the first distance and the second distance L0 [x0][y0], wherein at least one pixel weight value may be determined according to the first distance, the second distance, the lower limit weight, and the upper limit weight.

[0382] Further, in the embodiment of the present application, according to the first distance d L0s [x0][y0] and the second distance d L0e [x0][y0] determines the weight parameter w of the pixel L0 [x0][y0], you can refer to formula (12). Among them, maxWvalue is the upper limit weight, that is, the gradient upper limit information; minWvalue is the lower limit weight, that is, the gradient lower limit information.

[0383] Furthermore, in an embodiment of the present application, for bidirectional prediction, the first prediction weight can be first determined based on the first distance, the second distance, the lower limit weight and the upper limit weight; then the weight sum value can be determined based on the lower limit weight and the upper limit weight; finally, the second prediction weight can be determined based on the first prediction weight and the weight sum value.

[0384] It should be noted that, in the embodiment of the present application, if the slice-level weighted prediction is a bidirectional weighted prediction, then the sum of the forward weight value and the backward weight value of the pixel point is the same as the sum of the upper limit weight value and the lower limit weight value, that is, according to the following formula, after determining the weight sum value sumValue, a weight value of the pixel point that has been determined (such as the forward weight value w L0 [x0][y0]), determine another weight value of the pixel (such as the backward weight value w L1 [x0][y0]), as shown in formulas (13) and (14).

[0385] Furthermore, in an embodiment of the present application, at least one weight parameter of the current block may include at least one pixel weight value, and may also include at least one pixel offset value. The pixel offset value may be set as a constant for transmission, or may be obtained using a previously determined pixel weight value.

[0386] It is understood that in the embodiment of the present application, at least one pixel offset value of the current block can be determined. Taking bidirectional prediction as an example, the offset parameters (offset values) o_L0[x0][y0] and o_L1[x0][y0] can be constants and transmitted separately.

[0387] It is understood that, in the embodiment of the present application, at least one pixel offset value may also be determined according to at least one pixel weight value. Taking bidirectional prediction as an example, the offset parameters (offset values) o_L0[x0][y0] and o_L1[x0][y0] may be respectively L0 [x0][y0]、w L1 [x0][y0] have a linear relationship.

[0388] Furthermore, in an embodiment of the present application, when deriving at least one weight parameter of the current block at the CU level, such as BCW weighting based on pixel-level weights, the lower limit weight and the upper limit weight can be first determined based on the gradient pattern information, gradient intensity information, change direction information, change center position information and predefined calculation accuracy, and the change center position weight can be determined based on the upper limit weight and the lower limit weight; then, the third distance can be determined based on the position information of the sampling point in the current block and the change center position information; finally, at least one pixel point weight value can be determined based on the third distance and the change center position weight.

[0389] It is understandable that in the embodiments of the present application, the upper limit weight and the lower limit weight may be determined based on the geometric pattern parameters in combination with the predefined calculation accuracy.

[0390] It should be noted that in the embodiments of the present application, the upper limit weight and the lower limit weight can be determined by one or more parameters in the geometric mode parameters, or can be predefined. That is, the pre-set upper limit weight and lower limit weight can be used directly without referring to the geometric mode parameters.

[0391] Exemplarily, in an embodiment of the present application, the lower limit weight can be predefined as 0 and the upper limit weight can be predefined as 8; or, the upper limit weight can be determined as 16 based on a predefined calculation accuracy; or, the upper limit weight can be determined as 32 based on geometric mode parameters.

[0392] It should be noted that in the embodiment of the present application, when performing CU-level weighting based on pixel-level weights, several weight-related geometric pattern parameters such as gradient mode information modeParm, CU-level gradient intensity information cbSlopeParm, CU-level change direction information cbDirParm, and CU-level change center position information cbCenterPosParm are determined based on the forward reference block of the current CU. These geometric pattern parameters can be used to determine a comprehensive weight parameter cbwtParm for the current CU. Among them, the weight wL0 used in CU-level bidirectional weighted prediction is ij 、wL1 ij and offset o_L0 ij 、o_L1 ij Derived from this parameter.

[0393] Exemplarily, in an embodiment of the present application, the gradient mode information modeParm may be used to indicate that the gradient mode is a single-segment linear oblique gradient mode defined by geometric parameters.

[0394] For example, in an embodiment of the present application, the CU-level gradient strength information cbSlopeParm may be used to indicate the gradient strength of the gradient mode. For example, cbSlopeParm may be the gradient weight reaching a maximum or minimum when the distance from the specified position is n pixels.

[0395] Exemplarily, in an embodiment of the present application, the CU-level change direction information cbDirParm can be used to indicate that the change direction is that the weighted value of the first predicted pixel is from left to right or from right to left, from top to bottom, from bottom to top, and other different possibilities, such as gradually increasing from the upper left (calculated distance is negative) to the lower right (calculated distance is positive).

[0396] For example, cbDirParm is 1, which means that the weighted value of the first pixel gradually decreases as the distance value changes from negative to positive, and is 0, which means that the weighted value of the first pixel gradually increases as the distance value changes from negative to positive. Here, the value is 0.

[0397] For example, in an embodiment of the present application, the CU-level change center position information cbCenterPosParm can be determined based on the slope and intercept of the center position in the oblique gradient mode, for example, a straight line with a slope of α and an intercept of β (or an angle of θ and a distance of d in polar coordinates).

[0398] For example, in an embodiment of the present application, based on the change center position information cbCenterPosParm, combined with the information provided by cbDirParm and cbSlopeParm, the gradient lower limit information is determined by taking the starting position of the gradient -n pixels from the line and the left or bottom of this starting position as the lower weight value minWvalue. The gradient lower limit information is determined by taking the ending position of the gradient n pixels from the line and the right or top of the ending position as the upper weight value maxWvalue. The weight gradient is performed within the range from the starting position to the ending position.

[0399] That is, in the embodiment of the present application, based on modeParm, cbSlopeParm, and cbDirParm, the gradient range range[-n, n] and gradient direction can be determined, and then the gradient range range[-n, n] and gradient direction can be used to determine the lower limit weight minWvalue and the upper limit weight maxWvalue. Then, in the case of linear gradient, the change center position weight can be determined based on the upper and lower limits minWvalue, maxWvalue and the change center position information cbCenterPosParm. Among them, the weight wCenterPos of the change center position information cbCenterPosParm should be the average of the weight lower limit and upper limit minWvalue, maxWvalue, as shown in formula (15).

[0400] Assume minWvalue is 0 and maxWvalue is 1.

[0401] Furthermore, in an embodiment of the present application, if the gradient mode information indicates that the gradient mode is a linear oblique gradient mode, a third distance must be determined before calculating the weight value w[x0][y0] of at least one pixel point for a distance-based linear gradient. The third distance can be determined based on the position information of the sampling point and the position information of the change center in the current block.

[0402] Exemplarily, in an embodiment of the present application, for each pixel point in the forward reference block of the current coding unit CU, the distance parameter L1 between the point and the determined pixel point of the gradient center position cbCenterPosParm of the forward reference block is calculated based on the position information of the sampling point in the current block, that is, the third distance, as shown in formula (16).

[0403] Where ρ is the distance between the gradient center and the origin. Assuming the origin is at the center of the entire block area, that is, for a block with width cbWidth and height cbHeight, the distances dx and dy relative to the upper left corner pixel can be as shown in formulas (17) and (18).

[0404] Then, the third distance L1 can be further determined by calculation according to formula (19): wherein the offset values ​​offsetX and offsetY respectively describe the horizontal and vertical components of the distance between the gradient center position line and the origin.

[0405] Furthermore, in the embodiment of the present application, after determining the third distance, the third distance and the weight of the change center position can be used to finally determine at least one pixel weight value, which may include a first prediction weight value (such as the weight of the forward reference block pixel or the weight of the reference block pixel for intra-frame prediction, etc.) L0[x0][y0] and the second prediction weight value (such as the weight of the backward reference block pixel point or the weight of the reference block pixel point for intra-frame prediction, etc.) w L1 [x0][y0].

[0406] For example, in the embodiment of the present application, the first prediction weight value w is calculated using the third distance L1. L0 When [x0][y0], refer to formulas (20) and (21).

[0407] It is understood that in the embodiments of the present application, to maintain computational accuracy, the intermediate computational results of the above calculation process can be appropriately amplified and then restored to an appropriate size before the clip operation. That is, the intermediate computation process can be fixed-point, and the amplification operation can be performed based on the accuracy requirements. For example, in formulas (22) to (24), shift0 is a factor related to the amplification of the intermediate computational data to maintain sufficient accuracy.

[0408] When the values ​​of n, shift0, and shift1 are fixed, most of the data in the above formula, except for x0, offsetX, y0, and offsetY, are constants, allowing for merging and simplification of the calculations. For example, when maxWvalue and n are both powers of 2, the calculation process is as follows: Formulas (25) to (27).

[0409] It can be understood that in the embodiments of the present application, the intermediate calculation results are amplified to ensure accuracy, including the weight value itself, which can also be appropriately amplified. In the formula, shift1 corresponds to this amplification operation, and then restored to the appropriate pixel value range when calculating the weighted prediction value below.

[0410] Furthermore, in the embodiment of the present application, after determining the first prediction weight value (eg, the weight value of the forward reference block pixel point or the weight value of the reference block pixel point for intra-frame prediction, etc.) w L0 [x0][y0], we can further use w L0 [x0][y0] derive the second prediction weight value (such as the weight of the backward reference block pixel point or the weight of the reference block pixel point for intra-frame prediction, etc.) w L1 [x0][y0], as shown in formula (28).

[0411] Furthermore, in an embodiment of the present application, based on the CIIP weighting of pixel-level weights, when deriving at least one weight parameter of the current block, the lower limit weight and the upper limit weight can be first determined according to the gradient pattern information, gradient intensity information, change direction information, change center position information and predefined calculation accuracy, and the change center position weight can be determined according to the upper limit weight and the lower limit weight; then the fourth distance can be determined according to the position information of the sampling point in the current block and the change center position information; finally, at least one pixel point weight value can be determined based on the fourth distance, the lower limit weight, the upper limit weight and the change center position weight.

[0412] It is understandable that in the embodiments of the present application, the upper limit weight and the lower limit weight may be determined based on the geometric pattern parameters in combination with the predefined calculation accuracy.

[0413] It should be noted that in the embodiments of the present application, the upper limit weight and the lower limit weight can be determined by one or more parameters in the geometric mode parameters, or can be predefined. That is, the pre-set upper limit weight and lower limit weight can be used directly without referring to the geometric mode parameters.

[0414] Exemplarily, in an embodiment of the present application, the lower limit weight can be predefined as 0 and the upper limit weight can be predefined as 8; or, the upper limit weight can be determined as 16 based on a predefined calculation accuracy; or, the upper limit weight can be determined as 32 based on geometric mode parameters.

[0415] It should be noted that in the embodiments of the present application, the determination of the pixel-level CIIP intra prediction weight wt is not only related to the modeParm, cbSlopeParm, cbDirParm, and cbCenterPosParm of the current CU, but also to the coding modes of the neighboring blocks above and to the left of the current CU. The coding modes of the neighboring blocks can be identified using the two flags isIntraTop and isIntraLeft. When isIntraTop is 1, the neighboring block above is available and is in intra mode. When isIntraLeft is 1, the neighboring block to the left is available and is in intra mode.

[0416] A comprehensive parameter cbwtParm is determined by the modeParm, cbSlopeParm, cbDirParm, cbCenterPosParm and the coding mode information isIntraTop and isIntraLeft of the adjacent blocks. This parameter can be used to determine the weight wt[x0][y0] of each pixel point when the current block adopts the intra-frame mode, where x0=0...cbWidth-1, y0=0...cbHeight-1.

[0417] Exemplarily, in an embodiment of the present application, the gradient mode information modeParm may be used to indicate that the gradient mode is a single-segment linear oblique gradient mode defined by geometric parameters.

[0418] For example, in an embodiment of the present application, the gradient strength information cbSlopeParm can be used to indicate the gradient strength of the gradient mode. For example, cbSlopeParm can indicate that the gradient weight reaches a maximum or minimum when the distance from the specified position is 4 pixels.

[0419] Exemplarily, in an embodiment of the present application, the change direction information cbDirParm can be used to indicate that the change direction of the weighted value of the first predicted pixel is from left to right or from right to left, from top to bottom, from bottom to top, etc., for example, gradually increasing from the upper left (calculated distance is negative) to the lower right (calculated distance is positive).

[0420] For example, cbDirParm is 1, which means that the weighted value of the first pixel gradually decreases as the distance value changes from negative to positive, and is 0, which means that the weighted value of the first pixel gradually increases as the distance value changes from negative to positive. Here, the value is 0.

[0421] For example, in an embodiment of the present application, the change center position information cbCenterPosParm can be determined based on the slope and intercept of the center position in the oblique gradient mode, for example, a straight line with a slope of α and an intercept of β (or an angle of θ and a distance of d in polar coordinates).

[0422] For example, in an embodiment of the present application, based on the change center position information cbCenterPosParm, combined with the information provided by cbDirParm and cbSlopeParm, the gradient lower limit information is determined by taking the starting position of the gradient -n pixels from the line and the left or bottom of this starting position as the lower weight value minWvalue. The gradient lower limit information is determined by taking the ending position of the gradient n pixels from the line and the right or top of the ending position as the upper weight value maxWvalue. The weight gradient is performed within the range from the starting position to the ending position.

[0423] That is to say, in the embodiment of the present application, based on modeParm, cbSlopeParm and cbDirParm, the gradient range range[-n, n] and the gradient direction can be determined, and then the gradient range range[-n, n] and the gradient direction can be used to determine the lower limit weight minWvalue and the upper limit weight maxWvalue. Then, in the case of linear gradient, the change center position weight can be determined based on the upper and lower limits minWvalue, maxWvalue and the change center position information cbCenterPosParm. Among them, the weight wCenterPos of the change center position information cbCenterPosParm should be the average of the lower and upper limits minWvalue and maxWvalue of the weight, as shown in formula (29). Assume that minWvalue is 0 and maxWvalue is 1.

[0424] Furthermore, in an embodiment of the present application, if the gradient mode information indicates that the gradient mode is a linear oblique gradient mode, a fourth distance must be determined before calculating the weight value w[x0][y0] of at least one pixel point for a distance-based linear gradient. The fourth distance can be determined based on the position information of the sampling point and the position information of the change center in the current block.

[0425] Exemplarily, in an embodiment of the present application, for each pixel point in the forward reference block of the current coding unit CU, the distance parameter L2 between the point and the determined pixel point of the gradient center position cbCenterPosParm of the forward reference block is calculated based on the position information of the sampling point in the current block, that is, the fourth distance, as shown in formula (30).

[0426] Where ρ is the distance between the gradient center and the origin. Assuming the origin is at the center of the entire block area, that is, for a block with width cbWidth and height cbHeight, the distances dx and dy relative to the upper left corner pixel can be as shown in formulas (31) and (32).

[0427] Then further, the fourth distance L2 can be determined by calculation according to formula (33).

[0428] The offset values ​​offsetX and offsetY describe the horizontal and vertical components of the distance between the gradient center line and the origin, respectively.

[0429] Furthermore, in an embodiment of the present application, after determining the fourth distance, the fourth distance, the upper limit weight, the lower limit weight, and the change center position weight can be used to finally determine at least one pixel weight value, which may include a first prediction weight value (such as the weight of a forward reference block pixel or the weight of an intra-frame prediction reference block pixel, etc.) L0[x0][y0] and the second prediction weight value (such as the weight of the backward reference block pixel point or the weight of the reference block pixel point for intra-frame prediction, etc.) w L1 [x0][y0].

[0430] For example, in the embodiment of the present application, the first prediction weight value w is calculated using the fourth distance L2. L0 When [x0][y0], the following formulas (34) and (35) can be referred to.

[0431] The number of gradient pixels on both sides of the gradient center position is n, and the offset values ​​offsetX and offsetY of the current CU block are determined according to the size of the current CU block and the gradient mode.

[0432] It is understood that in the embodiment of the present application, in order to improve the calculation accuracy, the weight value here can be appropriately multiplied by a coefficient, or shifted left by 3 bits to be amplified. Or when specifying minWvalue and maxWvalue, the amplification of the weight value is considered in advance, such as they are respectively amplified by 2 compared to the actual weight value. shift3 times.

[0433] It should be noted that, in the embodiment of the present application, for bidirectional weighted prediction, the sum of the forward weight value and the backward weight value of the pixel point is the same as the sum of the upper limit weight value and the lower limit weight value, that is, according to the following formula, after determining the weight sum value sumValue, a weight value of the pixel point that has been determined (such as the forward weight value w L0 [x0][y0]), determine another weight value of the pixel (such as the backward weight value w L1 [x0][y0]), as shown in formulas (36) and (37).

[0434] Furthermore, in an embodiment of the present application, at least one weight parameter of the current block can be either a pixel-level weight parameter or a weight parameter of at least one sub-block of the current block, that is, at least one weight parameter can also include a weight value of at least one sub-block of the current block.

[0435] It is understood that in the embodiments of the present application, when applying weighting parameters to derive predicted pixel values, a weighting parameter that varies pixel-by-pixel can be used for calculations for pixels at different locations. Alternatively, to reduce computational complexity, a method can be employed where the same weighting value is applied to each sub-block (e.g., a 2x2 or 4x4 sub-block).

[0436] Furthermore, in the embodiments of the present application, the weighting parameters on the plane can vary according to a certain geometric rule with reference to the position of the pixel point, or can also combine multiple different geometric rule changes. For example, the pixel-level weight value can vary with the distance of the pixel point from the center change position. When the distance value is between [0, L1], it is a gradual change method; when the distance is between (L1, L2], it is a second gradual change method.

[0437] Furthermore, in the embodiments of the present application, the pixel-level weight value may not only vary with the distance of the pixel from the center change position, but also determine different linear or nonlinear gradient modes for different positions. For example, when the distance value is between [0, L1], the gradient mode is a linear gradient mode, and when the distance is between (L1, L2], the gradient mode is a nonlinear gradient mode, etc.

[0438] It can be seen that the encoding and decoding method proposed in the embodiment of the present application can be used for unidirectional prediction or bidirectional prediction, and can be used in the case where all predictions are derived from inter-frame prediction or in the case where some or all predicted pixel values ​​are derived from intra-frame prediction.

[0439] It can be understood that in the embodiment of the present application, the situation for unidirectional prediction is similar to the WP mode, and pixel-level weighting parameters (weight parameters) are derived only for one prediction source, which may include weighting coefficients (weight values) and offsets.

[0440] It can be understood that in the embodiments of the present application, the situation for bidirectional prediction can be similar to the WP mode, and pixel-level weighting parameters (weight parameters) for the two prediction sources can be derived, which may include weighting coefficients (weight values) and offsets; or it can be similar to BCW or CIIP, and only pixel-level weighting coefficients (weight values) for the two prediction sources are derived.

[0441] Furthermore, in an embodiment of the present application, when determining at least one weight parameter at the pixel level of the current block, the weight of the pixel point can be calculated using the coordinates of the pixel point, or can be generated by selecting predefined weight parameters using a preset matrix, or can be derived from the weight parameters of the pixel points adjacent to the upper and left positions of the pixel point.

[0442] That is, in an embodiment of the present application, for the position information of a sampling point in the current block, the pixel weight of the position information of the sampling point can be determined based on the pixel weights of the position information of other sampling points adjacent to the position information of the sampling point.

[0443] For example, in the embodiment of the present application, the weight w of a pixel is c The weight w of the pixel points adjacent to the upper and left positions of the pixel coordinates can be obtainedt 、w l The derivation is as shown in formula (38).

[0444] Step 203: Determine a prediction value of the current block based on at least one reference prediction value and at least one weight parameter.

[0445] In an embodiment of the present application, after determining at least one reference prediction value of the current block based on at least one motion vector information and determining at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter, the prediction value of the current block can be further determined based on the at least one reference prediction value and the at least one weight parameter.

[0446] Furthermore, in an embodiment of the present application, after determining at least one weight parameter of the current block, which includes at least one pixel weight value, or includes at least one pixel weight value and at least one pixel offset value, the prediction processing can be completed based on the at least one pixel weight value (at least one pixel weight value and at least one pixel offset value) and further combined with at least one reference prediction value of the current block to obtain the prediction value of the current block.

[0447] It can be understood that in an embodiment of the present application, in the process of calculating the prediction value of slice-level weighted prediction, the prediction value of the current block can be determined based on at least one reference prediction value, at least one pixel weight and at least one pixel offset value.

[0448] For example, in an embodiment of the present application, after obtaining the syntax elements of slice-level weighted prediction and the reference pixel value (reference prediction value) of each CU of the current slice, if it is a unidirectional prediction, taking the forward prediction as an example, the weighted prediction processing can be performed according to the following formula to determine the prediction value Pred of the current block WP is formula (39).

[0449] For example, in an embodiment of the present application, after obtaining the syntax elements of slice-level weighted prediction and the reference pixel value (reference prediction value) of each CU of the current slice, if it is a unidirectional prediction, taking the backward prediction as an example, the weighted prediction processing can be performed according to the following formula to determine the prediction value Pred of the current block WP is formula (40).

[0450] For example, in an embodiment of the present application, after obtaining the syntax elements of slice-level weighted prediction and the reference pixel value (reference prediction value) of each CU of the current slice, if bidirectional prediction is used, weighted prediction processing can be performed according to the following formula to determine the prediction value Pred of the current block: WP is formula (41).

[0451] It should be noted that, in the embodiment of the present application, for the luminance block, there is formula (42).

[0452] It should be noted that, in the embodiment of the present application, for the chrominance block, there is formula (43).

[0453] Among them, PredSamplesL0 and PredSamplesL1 are the reference pixel values ​​in the reference lists List0 and List1 respectively. L0 [x0][y0] and w L1 [x0][y0] are the pixel-level weights of the forward and backward reference blocks, that is, the pixel-level weight values ​​of the current block. o_L0[x0][y0] and o_L1[x0][y0] represent the corresponding offsets, that is, the pixel-level offset values ​​of the current block.

[0454] It is understood that in the embodiments of the present application, in order to improve the prediction accuracy, the intermediate calculation results have a higher accuracy than the reference pixel value, and log2_weight_denom and chroma_log2_weight_denom indicate the improved accuracy of the weighting coefficient. shift1 is the improved accuracy of the reference pixel value during the calculation process of pixel interpolation (the integer pixel value is also amplified). The Clip() operation clamps the pixel value to within the valid range, such as the valid value of 8-bit is [0, 255], and the valid value of 10-bit is [0, 1023].

[0455] It can be understood that in the embodiments of the present application, based on the BCW weighting of the pixel level weight, during the prediction value calculation process, the prediction value of the current block can be determined based on at least one reference prediction value and at least one pixel point weight.

[0456] It should be noted that in an embodiment of the present application, for bidirectional prediction, both the forward reference list List0 and the backward reference list List1 are used, and the forward motion vector information MV0 in the forward reference list List0 is used to perform motion compensation prediction to obtain the forward prediction value (forward reference value) PredSamplesL0, and the backward motion vector information MV1 in the backward reference list List1 is used to perform motion compensation prediction to obtain the backward prediction value (backward reference value) PredSamplesL1.

[0457] It can be understood that in the embodiment of the present application, BCW is only enabled for bidirectionally predicted CUs, only a small number of predefined weights are used, and their indexes are encoded.

[0458] Exemplarily, in an embodiment of the present application, when a BCW with pixel-level weights is adopted, the prediction value of the current block, that is, the weighted prediction value is formula (44).

[0459] Among them, PredSamplesL0 and PredSamplesL1 are the reference pixel values ​​in the reference lists List0 and List1 respectively. L1 [x0][y0] is the weight of the backward reference pixel value at the relative position (x0, y0) of the block, w L0 [x0][y0] are the weights of the forward reference pixel value at the block relative position (x0, y0), where x0 = 0...cbWidth-1, y0 = 0...cbHeight-1. maxTempBitDepth is the maximum bit depth allowed during the operation.

[0460] It can be understood that in the embodiments of the present application, based on the CIIP weighting based on pixel-level weights, during the prediction value calculation process, the prediction value of the current block can be determined based on at least one reference prediction value and at least one pixel point weight.

[0461] It should be noted that, in the embodiment of the present application, when calculating the CIIP weighted prediction value based on pixel-level weight, the P used is intra It is the intra-frame prediction value obtained by the current block through the Planar mode for conventional intra-frame prediction processing, P inter is the prediction value between frames, and wt[x0][y0] is the weight of intra-frame prediction.

[0462] For example, in the embodiment of the present application, when the pixel-level weighted CIIP is used, the prediction value of the current block, that is, the weighted prediction value Predsamples CIIP is formula (45).

[0463] Among them, w L0 [x0][y0] is the weight of the forward reference pixel value, w L1 [x0][y0] are the weights of the backward reference pixel values. Shift3 is the parameter used in the previous step to amplify the weights to improve computational accuracy. The right shift is to restore the predicted pixel values ​​to a reasonable range. If no amplification is performed, the formula can be simply written as (46).

[0464] It can be seen that in the embodiments of the present application, when the coding and decoding methods proposed in the present application are respectively applied to slice-level weighting, two Inter prediction quantity weightings (BCW) at the CU level, and one Inter and one Intra prediction quantity weighting (CIIP) at the CU level, the determination of pixel-level weighting parameters can be completed, thereby improving the coding efficiency and performance of weighted prediction.

[0465] That is, in the embodiments of the present application, the pixel-level weight values ​​used in the weighted prediction process are no longer fixed to a fixed value for the entire forward reference block or backward reference block. Instead, the weighting parameters of the current slice or CU can be adaptively adjusted based on factors such as changes in lighting in the sequence content. That is, using pixel-level weight values ​​for inter-frame weighted prediction, rather than a fixed value for each reference block, further improves the accuracy of inter-frame weighted prediction, thereby improving the coding efficiency of weighted prediction.

[0466] It should be noted that in the embodiments of the present application, although slice-level weighting, CU-level weighting of two Inter prediction quantities, and CU-level weighting of one Inter and one Intra prediction quantity are exemplified, the encoding and decoding method proposed in the embodiments of the present application does not have different designs for the slice level or CU level alone, nor does it have different designs because each prediction quantity involved in the weighting comes from the Inter or Intra prediction method.

[0467] The embodiment of the present application proposes a coding method, in which the encoder can determine at least one motion vector information of the current block, as well as a type indication parameter and / or a geometric mode parameter; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter. It can be understood that in the embodiment of the present application, the codec can determine the pixel-level weight parameters of the current block through the type indication parameter and / or the geometric mode parameter, and then perform prediction processing on the current block based on the pixel-level weight parameters. It can be seen that in the embodiment of the present application, the weights used for prediction processing are no longer fixed, but pixel-level weight values ​​that adapt to changes in pixel points are selected, which greatly improves the accuracy of weighted prediction, thereby improving coding efficiency and compression performance.

[0468] Based on the above embodiments, the encoding and decoding method proposed in the embodiments of the present application can determine pixel-level weighting parameters for the reference block during weighted prediction, and this scheme can be applied to a variety of inter-frame weighted prediction technology scenarios. Among them, the pixel-level weighting parameters are derived from a small number of control parameters. The control parameters include type indexes (type indication parameters) and / or geometric parameters (type indication parameters). The geometric parameters can be given directly according to the geometric meaning, or an alternative in an optional set can be given in the form of an index.

[0469] The type index parameter is used to select the type of pixel-level weighting parameter. The type of pixel-level weighting parameter may include but is not limited to the following types: weighting parameters defined by a pre-stored matrix, and weighting parameters defined by geometric parameters.

[0470] In the pre-stored matrix definition weighting mode, the number and dimensions of pre-defined matrices are limited. For the pre-defined dimensional weighting matrix, interpolation and other methods can be used to apply it to a variety of areas with different dimensions and different accuracy requirements.

[0471] The weighting parameter defined by geometric parameters refers to the weighting parameter calculated from the geometric parameters. The weighting parameter on the plane changes with the pixel position according to a certain geometric law. This weighting parameter wtParm that changes according to a certain geometric law can be expressed by at least one of the following parameters: gradient mode information modeParm, gradient intensity information slopeParm, change direction information dirParm, change start position information startPosParm, change center position information centerPosParm, change end position information endPosParm, gradient upper / lower limit information minParm / maxParm, and change segment information segParm.

[0472] The gradient mode information modeParm may indicate the gradient mode and the type of gradient mode, including but not limited to horizontal gradient weighting, vertical gradient weighting, oblique gradient weighting, radial gradient weighting, affine gradient weighting, etc.

[0473] When the weighting parameters can be obtained by a pre-stored matrix or calculated by a gradient weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in Table 1. When the weighting parameters are calculated only by a gradient weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in Table 2. When the weighting parameters are calculated by a nonlinear weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in Table 3. When the weighting parameters are calculated by a nonlinear weighting mode defined by geometric parameters, the weighting mode indicated by the index method is shown in Table 4.

[0474] The gradient intensity slopeParm can indicate how fast the gradient weight parameter changes as the distance between the pixel and the specified position (the position of the point or line). For example, the linear gradient intensity is indicated by the index method: 0 means no gradient, a direct jump; m means that when the distance reaches the specified position (2 m-1) / M pixels, the gradient weight parameter reaches the maximum or minimum. When the distance is closer, the gradient becomes linear, and when the distance is farther, the gradient remains at the maximum or minimum. The value of M can be 2, 1, 1 / 2, etc. For example, the linear gradient strength is indicated by index: 0 means w is constant, no gradient or jump; m means when the distance reaches t˙width / (2 m-1 ), where width is the unit width (slice width or coding block width) for calculating the gradient weight parameter, and t is a constant.

[0475] The change direction information dirParm may indicate the direction of the gradual change of the weight parameter intensity for the first prediction pixel, for example, 0 represents from minimum to maximum, and 1 represents from maximum to minimum.

[0476] The starting position information startPosParm can contain different numbers of parameters depending on the gradient type. For example, in horizontal gradient mode, it contains a horizontal axis coordinate position; in oblique gradient mode, it contains a set of parameters representing the straight line in the Cartesian coordinate system, one for the slope and one for the intercept; in oblique gradient mode, it contains a set of parameters representing the straight line in the polar coordinate system, one for the angle and one for the distance; in radial gradient mode, it contains a set of parameters representing the radial shape and its corresponding position. For example, in the case of a circle, when the starting position is a point, the Cartesian coordinate system contains the horizontal and vertical coordinates, and the polar coordinate system contains the angle and distance; in affine gradient mode, it contains a set of parameters representing the positions of multiple control points or multiple control lines. Note that oblique gradients can include horizontal and vertical gradient modes.

[0477] The change center position information centerPosParm is the position of the median of the weight parameter of the gradient area (when the gradient interval is 0 to 1, the median is 0.5). The weight parameter is based on this position and gradually increases or decreases to both sides. Depending on the gradient type, different numbers of parameters can be included. For example, in the horizontal gradient mode, it contains a horizontal axis coordinate position; for example, in the oblique gradient mode, it contains a set of parameters for the straight line represented by the Cartesian coordinate system, one for the slope and one for the intercept; for example, in the oblique gradient mode, it contains a set of parameters for the straight line represented by the polar coordinate system, one for the angle and one for the distance; for example, in the radial gradient mode, it contains a set of parameters representing the radial shape and its corresponding position. For example, in the case of a circle, when the center position is a circle, the Cartesian coordinate system contains the horizontal and vertical coordinates and the radius, and the polar coordinate system contains the center point position information and radius. When the center point is aligned with the zero point, there may be only radius information; for example, in the affine gradient mode, it contains a set of parameters representing the positions of multiple control points or multiple control lines.

[0478] The endPosParm information of the changing end position can contain different numbers of parameters depending on the gradient type. For example, in horizontal gradient mode, it contains a horizontal axis coordinate position; in oblique gradient mode, the end position information contains a set of parameters representing the straight line in the Cartesian coordinate system, one for the slope and one for the intercept; in oblique gradient mode, it contains a set of parameters representing the straight line in the polar coordinate system, one for the angle and one for the distance; in radial gradient mode, the end position information contains a set of parameters representing the radial shape and its corresponding position. For example, in the case of a circle, when the end position is a circle, in the Cartesian coordinate system, the end position information refers to the horizontal and vertical coordinates and the radius, and in the polar coordinate system, it refers to the center point position information and the radius. When the center point is aligned with the zero point, only the radius information may be provided; in affine gradient mode, the end position information contains a set of parameters representing the positions of multiple control points or multiple control lines.

[0479] The gradient upper / lower limit information minWvalue / maxWvalue specifically refers to the upper / lower limit information of the weight parameter, such as the values ​​corresponding to weights 0 and 1 under the corresponding precision requirements (if the precision is 3 digits after the binary decimal point, the lower limit 0 corresponds to 0 after fixed-point conversion, and the upper limit 1 corresponds to 8; if the precision is 5 digits after the binary decimal point, the lower limit 0 corresponds to 0 after fixed-point conversion, and the upper limit 1 corresponds to 32); the lower limit of the weighting parameter generally corresponds to 0, that is, the reference pixel at the corresponding position is not used during weighting, and the upper limit weighting parameter generally corresponds to 1, that is, all reference pixels at the corresponding position are used during weighting. The gradient upper / lower limit information minWvalue / maxWvalue may also be weights other than 0 and 1, such as the values ​​corresponding to 0.2 and 0.4 under the corresponding precision requirements.

[0480] The change segment information segParm can indicate information related to a continuous gradient consisting of multiple segments, and can include information covering the meaning of multiple parameters mentioned above. For example, it can include information about the gradient intensity, change direction, change start position, and change end position of each segment. Alternatively, it can include information about the gradient change direction, change start position, change end position, gradient upper limit, and gradient lower limit of each segment.

[0481] Each of these pieces of information can be quantified into an index. For example, the starting, center, and end positions of a change can specify different possibilities. Each possible line is predefined as an ordered set, and these positions can be specified by just one index.

[0482] The derived weighting parameters can be implemented at different levels, for example, at the slice level or at the coding unit / coding block level. Weighting parameters have certain precision and upper and lower bounds. Sub-pixel-precision weighting parameters can be obtained by interpolating and filtering the derived integer-pixel weighting parameters.

[0483] This scheme can be used for unidirectional prediction or bidirectional prediction, and can be used when all predictions are derived from inter-frame prediction or when some or all predicted pixel values ​​are derived from intra-frame prediction.

[0484] The case for unidirectional prediction is similar to the WP mode, and pixel-level weighting parameters for only one prediction source are derived, including weighting coefficients and offsets.

[0485] The case for bidirectional prediction can be similar to the WP mode, deriving pixel-level weighting coefficients and offsets for the two prediction sources, or similar to BCW or CIIP, only deriving pixel-level weighting coefficients for the two prediction sources.

[0486] The codec proposed in the embodiment of the present application takes the bidirectional prediction at the coding unit / coding block level as an example. The weighted prediction process proposed in the embodiment of the present application can first obtain the forward and backward motion vector information MV0 and MV1 of the current block; then use MV0 and MV1 to perform motion compensation respectively to obtain the forward and backward prediction values ​​PredSampleL0 and PredSampleL1 of the current block; then, the set parameters of the current block can be used to determine the weighted weights wL0ij and wL1ij of the forward and backward prediction blocks at the pixel level, or wL0ij, wL1ij and offsets oL0ij and oL1ij, wherein the gradient can be determined first. One or more parameters including intensity parameter slopeParm, change direction parameter dirParm, change segment parameter segParm, change start position parameter startPosParm, change center position parameter centerPOsParm, and change end position parameter endPosParm, and then the obtained one or more parameters are used to determine the forward and backward prediction pixel-level weighted weights wL0ij, wL1ij, or wL0ij, wL1ij and offsets oL0ij, oL1ij; finally, weighted prediction processing can be performed, that is, luminance weighted prediction and chrominance weighted prediction are performed in turn.

[0487] The following describes the specific details of this technical solution by taking three similar weighted technologies, namely slice-level weighted prediction, CU-level bidirectional weighted prediction BCW, and joint intra-frame and inter-frame prediction CIIP, as examples.

[0488] For the Slice-level weighting based on pixel-level weight, in this technical solution, the Slice-level weighting based on pixel-level weight determines six weight-related parameters for the current Slice: modeParm, sliceDirParm, sliceStartPosParm, sliceEndPosParm, minWvalue, and maxWvalue. These six parameters can be used to determine a comprehensive weight parameter sliceewtParm for the current Slice. The weight wLX used in the Slice-level weighted prediction ij and offset o_LX ij Derived from this parameter, X is the reference list index. When X is 0, it indicates the forward reference list L0, otherwise it indicates the backward reference list L1.

[0489] For example, the obtained parameter indication information is as follows:

[0490] modeParm specifies that the mode is a single-segment linear gradient mode defined by geometric parameters;

[0491] sliceDirParm specifies that the weighted value of the first predicted pixel has different possibilities such as from left to right or from right to left, from top to bottom, and from bottom to top. For example, it gradually increases from the upper left (calculated distance is negative) to the lower right (calculated distance is positive);

[0492] sliceStartPosParm specifies the gradient starting position as a straight line with a slope of α1 and an intercept of β1 (or an angle of θ1 and a distance of d1 in polar coordinates). That is, the gradient starts from this straight line. The upper left corner of this position is the upper / lower limit weight. Combined with the direction specified by sliceDirParm, it can be seen that the weight of the position specified by this parameter is the lower limit weight minWvalue;

[0493] sliceEndPosParm specifies that the gradient cutoff position is a straight line with a slope of α2 and an intercept of β2 (or expressed in polar coordinates as an angle of θ2 and a distance of d2), that is, the gradient ends at this straight line. This position takes the lower right as the lower / upper weight. Combined with the direction specified by sliceDirParm, it can be seen that the weight of the position specified by this parameter is the upper limit weight maxWvalue.

[0494] The weight w[x0][y0] of the linear gradient according to the distance can be calculated by the following steps:

[0495] For each CU in the slice, calculate the distance d between the position information of the sampling point in the current block and the gradient starting position sliceStartPosParm and the gradient ending position sliceEndPosParm. L0s [x0][y0] and dL0e [x0][y0], determine the weight parameter w of the pixel point based on this distance L0 [x0][y0], as shown below:

[0496]

[0497] When the slice weighted prediction is bidirectional weighted prediction:

[0498]

[0499] In the embodiment of the present application, the offset parameters o_L0[x0][y0] and o_L1[x0][y0] can be constants and transmitted separately, or respectively transmitted with w L0 [x0][y0]、w L1 [x0][y0] have a linear relationship. The syntax elements of slice-level weighted prediction and the acquisition of reference pixel values ​​for each CU in the current slice remain unchanged. The process of obtaining slice weighted prediction values ​​is as follows.

[0500] In one-way prediction, there is

[0501]

[0502] or

[0503]

[0504] In bidirectional prediction, there is

[0505]

[0506] For luminance blocks, there are

[0507] log2W d =luma_log2_weight_denom+shift1 (52)

[0508] For chroma blocks, there are

[0509] log2W d =chroma_log2_weight_denom+shift1 (53)

[0510] Among them, PredSamplesL0 and PredSamplesL1 are the reference pixel values ​​in the reference lists list0 and list1 respectively. L0 [x0][y0] and w L1[x0][y0] are the weights of the forward and backward reference block pixel levels respectively, and o_L0[x0][y0] and o_L1[x0][y0] represent the corresponding offsets. In order to improve the prediction accuracy, the intermediate calculation results have higher accuracy than the reference pixel values. log2_weight_denom and chroma_log2_weight_denom indicate the increased accuracy of the weighting coefficients. shift1 is the increased accuracy of the reference pixel value during the calculation of pixel-by-pixel interpolation (the integer pixel value is also amplified). The Clip() operation clamps the pixel value within the valid range. For example, the valid value of 8-bit is [0, 255], and the valid value of 10-bit is [0, 1023].

[0511] BCW weighting based on pixel-level weights, for example, BCW weighting based on pixel-level weights determines four weight-related parameters for the current CU: modeParm, cbSlopeParm, cbDirParm, and cbCenterPosParm. These four parameters can be used to determine a comprehensive weight parameter cbwtParm for the current Slice, and the weight wL0 used in CU-level bidirectional weighted prediction ij 、wL1 ij and offset o_L0 ij 、o_L1 ij Derived from this parameter.

[0512] modeParm specifies the mode as single-segment linear oblique gradient mode;

[0513] cbSlopeParm specifies the gradient strength of the gradient mode. The gradient weight reaches the maximum or minimum when the distance to the specified position is n pixels;

[0514] cbDirParm specifies that the weighted value of the first predicted pixel increases from the left or bottom (calculated distance is negative) to the right or top (calculated distance is positive). For example, if cbDirParm is 1, the weighted value of the first pixel decreases as the distance value changes from negative to positive, and if it is 0, the weighted value increases as the distance value changes from negative to positive. Here, the value is 0;

[0515] cbCenterPosParm determines the center position of the gradient according to the slope and intercept of the center position in the oblique gradient mode; it is a straight line with a slope of α and an intercept of β (or an angle of θ and a distance of d in polar coordinates), combined with the information given by cbDirParm and cbSlopeParm, that is, from the straight line - n pixels as the starting gradient position, this starting position has the left or bottom as the lower limit weight, the straight line n pixels is the gradient end position, the end position has the right or top as the upper limit weight, and the weight gradually changes from the starting position to the end position;

[0516] The gradient range range[-n, n] and gradient direction can be determined based on the two parameters cbSlopeParm and cbDirParm;

[0517] According to the upper and lower limits minWvalue and maxWvalue, in the case of linear gradient, it can be known that the weight wCenterPos of the gradient center position cbCenterPosParm should be the average of the upper and lower limits minWvalue and maxWvalue, that is

[0518] wCenterPos=(maxWvalue+minWvalue+1)>>1 (54)

[0519] Assuming minWvalue is 0 and minWvalue is 1, the weight w[x0][y0] of the linear gradient according to distance can be calculated by the following steps:

[0520] For each pixel point in the forward reference block of the current coding unit CU, the distance parameter L between the point and the determined pixel point of the forward reference block gradient center position cbCenterPosParm is calculated according to the position information of the sampling point in the current block.

[0521]

[0522] Where ρ is the distance between the center of the gradient and the origin.

[0523] Assuming that the origin is at the center of the entire block area, that is, for a block with a width of cbWidth and a height of cbHeight, the distance dx and dy relative to the upper left corner pixel are as follows:

[0524] dx = cbWidth / 2 - 0.5 pixels (56)

[0525] dy = cbHeight / 2-0.5 pixels (57)

[0526] The distance can be calculated by the following formula:

[0527]

[0528] The offset values ​​offsetX and offsetY describe the horizontal and vertical components of the distance between the gradient center line and the origin, respectively.

[0529] Determine the weight w of the pixel point of the forward reference block according to this parameter L0 [x0][y0], the weight is obtained as follows:

[0530]

[0531] In order to maintain the calculation accuracy, the intermediate calculation results of the above calculation process can be appropriately enlarged and restored to the appropriate size before the clip operation. That is, the intermediate calculation process can be fixed-point and the enlargement operation can be performed according to the accuracy requirements.

[0532]

[0533] Shift0 is a factor related to data amplification to retain sufficient accuracy for intermediate operations.

[0534] When the values ​​of n, shift0, and shift1 are fixed, most of the data in the above formula except x0, offsetX, y0, and offsetY are constants, and the calculation can be combined and simplified. For example, when maxWvalue and n are both powers of 2, the calculation process can be changed to:

[0535]

[0536] In the embodiments of the present application, the intermediate calculation results are amplified to ensure accuracy, including the weight value itself, which can also be appropriately amplified. In the formula, shift1 corresponds to this amplification operation, and then restored to the appropriate pixel value range when calculating the weighted prediction value below.

[0537] The weights of the pixels in the backward reference block can be obtained from the weights of the forward reference block, namely:

[0538] w L1 [x0][y0]=1< <shift1-w L0 [x0][y0] (62)

[0539] For bidirectional prediction, both the forward reference list List0 and the backward reference list List1 are used. The forward motion vector information MV0 in the forward reference list List0 is used for motion compensation prediction to obtain the forward prediction value PredSamplesL0, and the backward motion vector information MV1 in the backward reference list List1 is used for motion compensation prediction to obtain the backward prediction value PredSamplesL1.

[0540] BCW is only enabled for bidirectionally predicted CUs, uses only a small number of predefined weights, and encodes their indices.

[0541] When using pixel-level weighted BCW, the weighted prediction value is

[0542] Where PredSamplesL0 and PredSamplesL1 are the reference pixel values ​​in reference lists list0 and list1, respectively. w[x0][y0] is the weight of the backward reference pixel value at the block relative position (x0, y0), and (sumWvalue - w[x0][y0]) is the weight of the forward reference pixel value at the block relative position (x0, y0), where x0 = 0...cbWidth-1 and y0 = 0...cbHeight-1. maxTempBitDepth is the maximum bit depth allowed during the operation.

[0543] The pixel-level CIIP intra prediction weight wt is determined not only by the current CU's modeParm, cbSlopeParm, cbDirParm, and cbCenterPosParm parameters, but also by the coding modes of the neighboring blocks to the upper and left of the current CU. The coding modes of the neighboring blocks are indicated by the two flags isIntraTop and isIntraLeft. When isIntraTop is 1, the upper neighboring block is available and in intra mode. When isIntraLeft is 1, the left neighboring block is available and in intra mode. A composite parameter cbwtParm is determined using modeParm, cbSlopeParm, cbDirParm, cbCenterPosParm, and the neighboring block coding mode information isIntraTop and isIntraLeft. This parameter is used to determine the weight wt[x0][y0] of each pixel when the current block uses intra mode, where x0 = 0...cbWidth-1 and y0 = 0...cbHeight-1.

[0544] For example, the obtained parameter indication information is as follows:

[0545] modeParm specifies the mode as single-segment linear oblique gradient mode;

[0546] cbSlopeParm specifies that the gradient strength of the gradient mode is the gradient weight reaching the maximum or minimum when the distance to the specified position is 4 pixels;

[0547] The direction specified by cbDirParm is that the weighted value of the first predicted pixel increases gradually from the upper left (calculated distance is negative) to the lower right (calculated distance is positive);

[0548] cbCenterPosParm determines the center position of the gradient according to the slope and intercept of the center position in the oblique gradient mode; it is a straight line with a slope of α and an intercept of β (or an angle of θ and a distance of d in polar coordinates), combined with the information given by cbDirParm and cbSlopeParm, that is, from the straight line - n pixels as the starting gradient position, this starting position has the left or bottom as the lower limit weight, the straight line n pixels is the gradient end position, the end position has the right or top as the upper limit weight, and the weight gradually changes from the starting position to the end position;

[0549] The weight wt[x0][y0] of the linear gradient according to the distance can be calculated by the following steps:

[0550] Determine the gradient range range[-n, n] and gradient direction based on the two parameters cbSlopeParm and cbDirParm respectively;

[0551] Adaptively derive the upper and lower limits of the weight minWvalue and maxWvalue according to the derived gradient range range[-n, n];

[0552] Ensure that the weight wCenterPos of the gradient center position cbCenterPosParm is the average of the upper and lower limits of the weight minWvalue and maxWvalue, that is

[0553] wCenterPos=(maxWvalue+minWvalue)>>1 (64)

[0554] According to the values ​​of the above variables, the weights of each pixel are calculated as follows:

[0555] For each pixel point in the forward reference block of the current coding unit CU, the distance parameter L between the point and the pixel point determined by the gradient center position cbCenterPosParm of the forward reference block is calculated based on the position information of the sampling point in the current block:

[0556]

[0557] Where ρ is the distance between the center of the gradient and the origin. Assume that the origin is at the center of the entire block area, that is, for a block with a width of cbWidth and a height of cbHeight, the distance from the upper left corner pixel is

[0558] dx = cbWidth / 2 - 0.5 pixels (66)

[0559] dy = cbHeight / 2-0.5 pixels (67)

[0560] The distance can be calculated by the following formula:

[0561]

[0562] The offset values ​​offsetX and offsetY describe the horizontal and vertical components of the distance between the gradient center position line and the origin respectively. The weight w of the forward reference block pixel is determined based on this parameter. L0 [x0][y0], the weight is obtained as shown in the following formula, where the gradient pixels on both sides of the gradient center position are n, and the offset values ​​offsetX and offsetY of the current CU block are determined according to the size of the current CU block and the gradient mode;

[0563]

[0564] In order to improve the calculation accuracy, the weights here can be multiplied by a coefficient or shifted left by 3 bits to amplify them. Or when specifying minWvalue and maxWvalue, the amplification of the weights can be considered in advance, such as they are amplified by 2 compared to the actual weighted values. shift3 The weight of the pixel point of the backward reference block can be obtained from the weight of the forward reference block, that is:

[0565]

[0566] The final calculation of the CIIP weighted prediction value based on pixel-level weight is as follows, where P intra It is the intra-frame prediction value obtained by the current block through the Planar mode for conventional intra-frame prediction processing, P inter is the prediction value between frames, and wt[x0][y0] is the weight of intra-frame prediction.

[0567]

[0568] Shift3 is the parameter used in the previous step to amplify the weights to improve the calculation accuracy. The right shift here is to restore the predicted pixel value to a reasonable value range. If there is no amplification, it can be simply written as:

[0569] Predsamples CIIP =w L1 [x0][y0]*P inter +w L0 [x0][y0]*P intra (72)

[0570] The above three embodiments respectively introduce different calculation methods using slice-level weighting, CU-level weighting of two Inter prediction quantities, and CU-level weighting of one Inter and one Intra prediction quantity. However, in reality, these calculation methods are not designed differently for the slice level or CU level alone, nor are they designed differently because each prediction quantity involved in the weighting comes from the Inter or Intra prediction method.

[0571] In an embodiment of the present application, pixel-level weight values ​​are used in weighted prediction, and the weight values ​​of the entire forward reference block or backward reference block are no longer fixed to a fixed value. The weighting parameters of the current Slice or CU are adjusted according to factors such as light changes in the sequence content, which can further improve the coding efficiency of weighted prediction.

[0572] In an embodiment of the present application, pixel-level weight values ​​are used for inter-frame weighted prediction, rather than a fixed value for each reference block level weight, which further improves the accuracy of inter-frame weighted prediction and is conducive to improving coding efficiency.

[0573] In the embodiments of the present application, when applying weighting parameters to derive predicted pixel values, weighting parameters that vary pixel by pixel are calculated for pixels at different locations. To reduce computational complexity, a method can be employed whereby the same weighting value is assigned to each sub-block (e.g., a 2x2 or 4x4 sub-block).

[0574] In the embodiments of the present application, the weighting parameters on the plane vary with the pixel position according to a certain geometric law, and can also be a combination of multiple different geometric laws. For example, the weight varies with the distance of the pixel from the center change position. When the distance value is between [0, L1], it is a gradual change method; when the distance is between (L1, L2], it is a second gradual change method, and so on.

[0575] In the embodiment of the present application, different linear or nonlinear gradient modes can be determined for different positions. For example, when the distance value is between [0, L1], the gradient mode is a linear gradient mode, and when the distance is between (L1, L2], the gradient mode is a nonlinear gradient mode, etc.

[0576] In an embodiment of the present application, when parameters such as the gradient intensity information and the change direction information of each CU remain basically consistent, one or more weight matrices can be predefined first, and the coding unit block can upsample, downsample, or truncate the predefined weight matrix based on the pixel-level weighted weights.

[0577] In the embodiments of the present application, the weight of the current pixel can be generated not only by calculating the weight based on the coordinates (main solution) or by using predefined weight parameters (the first item in Table 2.1, or extended solution 3), but also by deriving the weight parameters of the pixels immediately above and to the left of the pixel. For example, wc = (wl + wt + 1) / 2.

[0578] In an embodiment of the present application, the optimal gradient mode for the current coding unit / coding block can be determined by template matching. Specifically, the pixels in the upper row and / or left column of the current coding unit / block are used as a template. In the process of constructing the template predicted pixel value, a gradient weighting process is performed on the prediction values ​​from different sources, and the geometric parameters of the most appropriate gradient weighting scheme are selected as the parameters of the gradient weighting scheme for the current coding unit / block.

[0579] In an embodiment of the present application, for small-sized coding units / coding blocks, some gradient modes with a large gradient width range may be skipped. For large-sized coding units / coding blocks, some gradient modes with a small gradient width range may be skipped.

[0580] In an embodiment of the present application, for a sequence with a higher resolution or a block with a larger size, the number of segments of the gradient pattern can be adaptively increased to make the prediction more accurate.

[0581] An embodiment of the present application provides a coding method, in which the codec can determine at least one motion vector information of the current block, as well as a type indication parameter and / or a geometric mode parameter; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter. It can be understood that in the embodiment of the present application, the codec can determine the pixel-level weight parameters of the current block through the type indication parameter and / or the geometric mode parameter, and then perform prediction processing on the current block based on the pixel-level weight parameters. It can be seen that in the embodiment of the present application, the weights used for prediction processing are no longer fixed, but pixel-level weight values ​​that adapt to changes in pixel points are selected, which greatly improves the accuracy of weighted prediction, thereby improving coding efficiency and compression performance.

[0582] Based on the above embodiment, in another embodiment of the present application, based on the same inventive concept as the above embodiment, FIG21 is a schematic diagram of the composition structure of an encoder. As shown in FIG21 , the encoder 30 may include: a first determining unit 31, wherein:

[0583] The first determination unit 31 is configured to determine at least one motion vector information, and a type indication parameter and / or a geometric mode parameter of the current block; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter.

[0584] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.

[0585] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0586] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 30. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.

[0587] Based on the composition of the above-mentioned encoder 30 and the computer-readable storage medium, Figure 22 is a second schematic diagram of the composition structure of the encoder. As shown in Figure 22, the encoder 30 may include: a first memory 32 and a first processor 33, a first communication interface 34 and a first bus system 35. The first memory 32, the first processor 33, and the first communication interface 34 are coupled together through the first bus system 35. It can be understood that the first bus system 35 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 35 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, all buses are labeled as the first bus system 35. Among them,

[0588] The first communication interface 34 is used to receive and send signals during the process of sending and receiving information with other external network elements;

[0589] The first memory 32 is used to store a computer program that can be run on the first processor;

[0590] The first processor 33 is used to determine at least one motion vector information, and a type indication parameter and / or a geometric mode parameter of the current block when running the computer program; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter.

[0591] It is understood that the first memory 32 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 32 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0592] The first processor 33 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 33. The above-mentioned first processor 33 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 32. The first processor 33 reads the information in the first memory 32 and, in conjunction with its hardware, completes the steps of the above method.

[0593] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0594] Optionally, as another embodiment, the first processor 33 is further configured to execute the method described in any one of the aforementioned embodiments when running the computer program.

[0595] FIG23 is a schematic diagram of the first structure of a decoder. As shown in FIG23 , the decoder 40 may include: a decoding unit 41 and a second determining unit 42; wherein,

[0596] The decoding unit 41 is configured to decode the code stream;

[0597] The second determination unit 42 is configured to determine at least one motion vector information, and a type indication parameter and / or a geometric mode parameter of the current block; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter.

[0598] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.

[0599] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0600] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the decoder 40. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.

[0601] Based on the composition of the above-mentioned decoder 40 and the computer-readable storage medium, Figure 24 is a second schematic diagram of the composition structure of the decoder. As shown in Figure 24, the decoder 40 may include: a second memory 43 and a second processor 44, a second communication interface 45 and a second bus system 46. The second memory 43 and the second processor 44, and the second communication interface 45 are coupled together through the second bus system 46. It can be understood that the second bus system 46 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 46 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, all buses are labeled as the second bus system 46. Among them,

[0602] The second communication interface 45 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0603] The second memory 43 is used to store a computer program that can be run on the second processor;

[0604] The second processor 44 is used to decode the code stream when running the computer program, determine at least one motion vector information, and type indication parameter and / or geometric mode parameter of the current block; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter.

[0605] It is understood that the second memory 43 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The second memory 43 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0606] The second processor 44 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the second processor 44. The second processor 44 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the second memory 43. The second processor 44 reads the information in the second memory 43 and, in conjunction with its hardware, completes the steps of the above method.

[0607] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0608] An embodiment of the present application provides a codec, and at the decoding end, the codec can determine at least one motion vector information of the current block, as well as a type indication parameter and / or a geometric mode parameter; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter. It can be understood that in the embodiment of the present application, the codec can determine the pixel-level weight parameters of the current block through the type indication parameter and / or the geometric mode parameter, and then perform prediction processing on the current block based on the pixel-level weight parameters. It can be seen that in the embodiment of the present application, the weights used for prediction processing are no longer fixed, but pixel-level weight values ​​that adapt to changes in pixel points are selected, which greatly improves the accuracy of weighted prediction, thereby improving coding efficiency and compression performance.

[0609] In another embodiment of the present application, the embodiment of the present application further provides a code stream, which is generated by bit encoding based on the information to be encoded; wherein the information to be encoded may include at least one of the following: inter-frame prediction mode parameters of the current block, at least one motion vector information of the current block, type indication parameters and / or geometric mode parameters.

[0610] It should be noted that, in the embodiments of the present application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0611] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0612] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0613] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0614] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0615] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability

[0616] The embodiment of the present application provides a coding and decoding method, a codec, a code stream and a storage medium, wherein the codec can determine at least one motion vector information of the current block, as well as a type indication parameter and / or a geometric mode parameter; determine at least one reference prediction value of the current block based on the at least one motion vector information, and determine at least one weight parameter of the current block based on the type indication parameter and / or the geometric mode parameter; and determine the prediction value of the current block based on the at least one reference prediction value and the at least one weight parameter. It can be understood that in the embodiment of the present application, the codec can determine the pixel-level weight parameters of the current block through the type indication parameter and / or the geometric mode parameter, and then perform prediction processing on the current block based on the pixel-level weight parameters. It can be seen that in the embodiment of the present application, the weights used for prediction processing are no longer fixed, but pixel-level weight values ​​that adapt to changes in pixel points are selected, which greatly improves the accuracy of weighted prediction, thereby improving coding efficiency and compression performance.

Claims

1. A decoding method, applied to a decoder, comprising: Decoding the code stream, determining at least one motion vector information, and a type indication parameter and / or a geometric mode parameter of the current block; Determining at least one reference prediction value of the current block according to the at least one motion vector information, and determining at least one weight parameter of the current block according to the type indication parameter and / or the geometric mode parameter; A prediction value of the current block is determined based on the at least one reference prediction value and the at least one weight parameter.

2. The method according to claim 1, wherein The geometric pattern parameters include one or more of the following parameters: gradient pattern information, gradient intensity information, change direction information, change start position information, change center position information, change end position information, change range width information, and change segment information.

3. The method according to claim 1, wherein The geometric mode parameter is used to indicate a geometric change set, wherein the geometric change set includes change start position information, change center position information, and change end position information.

4. The method according to claim 2 or 3, wherein: The method further comprises: If the type indication parameter indicates that the geometric mode parameter is not to be used, determining a pre-stored matrix, and determining the at least one weight parameter based on the pre-stored matrix; If the type indication parameter indicates the use of the geometric mode parameter, the at least one weight parameter is determined according to the geometric mode parameter.

5. The method according to claim 1, wherein The at least one motion vector information includes a forward motion vector and / or a backward motion vector.

6. The method according to claim 1, wherein The at least one reference prediction value includes a forward reference value and / or a backward reference value.

7. The method according to claim 2, wherein: The at least one weight parameter includes at least one pixel weight value.

8. The method according to claim 7, wherein: The method further comprises: The at least one pixel weight value is determined according to the position information of the sampling point in the current block and the geometric mode parameter.

9. The method according to claim 8, wherein The method further comprises: Determining a lower limit weight and an upper limit weight according to the gradient mode information, the change start position information, the change end position information, the change direction information, and a predefined calculation accuracy; Determine a first distance according to the position information of the sampling point in the current block and the change start position information, and determine a second distance according to the position information of the sampling point in the current block and the change end position information; The at least one pixel weight value is determined according to the first distance, the second distance, the lower limit weight, and the upper limit weight.

10. The method according to claim 8, wherein The method further comprises: Determining a lower limit weight and an upper limit weight according to the gradient mode information, the gradient intensity information, the change direction information, the change center position information, and a predefined calculation accuracy, and determining a change center position weight according to the upper limit weight and the lower limit weight; determining a third distance according to the position information of the sampling point in the current block and the position information of the change center; The weight value of the at least one pixel point is determined according to the third distance and the change center position weight.

11. The method according to claim 8, wherein The method further comprises: Determining a lower limit weight and an upper limit weight according to the gradient mode information, the gradient intensity information, the change direction information, the change center position information, and a predefined calculation accuracy, and determining a change center position weight according to the upper limit weight and the lower limit weight; determining a fourth distance according to the position information of the sampling point in the current block and the position information of the change center; The at least one pixel weight value is determined based on the fourth distance, the lower limit weight, the upper limit weight, and the change center position weight.

12. The method according to any one of claims 9 to 11, wherein: The method further comprises: The upper limit weight and the lower limit weight are preset.

13. The method according to any one of claims 9 to 12, wherein: The pixel weight value includes a first prediction weight and a second prediction weight, and the method further includes: Determining a weight sum value according to the lower limit weight and the upper limit weight; The second prediction weight is determined based on the first prediction weight and the weight sum value.

14. The method according to claim 9, wherein The at least one weight parameter includes at least one pixel offset value.

15. The method according to claim 14, wherein The method further comprises: Decode the code stream and determine the at least one pixel offset value.

16. The method according to claim 14, wherein The method further comprises: The at least one pixel offset value is determined according to the at least one pixel weight value.

17. The method according to claim 15 or 16, wherein The method further comprises: Determine a prediction value of the current block according to the at least one reference prediction value, the at least one pixel weight, and the at least one pixel offset value.

18. The method according to claim 10 or 11, wherein: The method further comprises: Determine a prediction value of the current block according to the at least one reference prediction value and the at least one pixel weight.

19. The method according to claim 2, wherein: The at least one weight parameter includes a weight value of at least one sub-block of the current block.

20. The method according to claim 8, wherein The method further comprises: For the position information of a sampling point in the current block, a pixel weight of the position information of the sampling point is determined according to pixel weights of position information of other sampling points adjacent to the position information of the sampling point.

21. The method according to claim 1, wherein The method further comprises: Decoding a code stream to determine an inter-frame prediction mode parameter of the current block; If the inter-frame prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using a pixel-level weight value, the determination process of the type indication parameter and / or the geometric mode parameter is executed.

22. A coding method, applied to an encoder, comprising: Determine at least one motion vector information, and a type indication parameter and / or a geometry mode parameter of the current block; Determining at least one reference prediction value of the current block according to the at least one motion vector information, and determining at least one weight parameter of the current block according to the type indication parameter and / or the geometric mode parameter; A prediction value of the current block is determined based on the at least one reference prediction value and the at least one weight parameter.

23. The method according to claim 22, wherein The geometric pattern parameters include one or more of the following parameters: gradient pattern information, gradient intensity information, change direction information, change start position information, change center position information, change end position information, change range width information, and change segment information.

24. The method according to claim 22, wherein The geometric mode parameter is used to indicate a geometric change set, wherein the geometric change set includes change start position information, change center position information, and change end position information.

25. The method according to claim 23 or 24, wherein The method further comprises: If the type indication parameter indicates that the geometric mode parameter is not to be used, determining a pre-stored matrix, and determining the at least one weight parameter based on the pre-stored matrix; If the type indication parameter indicates the use of the geometric mode parameter, the at least one weight parameter is determined according to the geometric mode parameter.

26. The method according to claim 21, wherein The at least one motion vector information includes a forward motion vector and / or a backward motion vector.

27. The method according to claim 21, wherein The at least one reference prediction value includes a forward reference value and / or a backward reference value.

28. The method according to claim 23, wherein The at least one weight parameter includes at least one pixel weight value.

29. The method according to claim 28, wherein The method further comprises: The at least one pixel weight value is determined according to the position information of the sampling point in the current block and the geometric mode parameter.

30. The method according to claim 29, wherein The method further comprises: Determining a lower limit weight and an upper limit weight according to the gradient mode information, the change start position information, the change end position information, the change direction information, and a predefined calculation accuracy; Determine a first distance according to the position information of the sampling point in the current block and the change start position information, and determine a second distance according to the position information of the sampling point in the current block and the change end position information; The at least one pixel weight value is determined according to the first distance, the second distance, the lower limit weight, and the upper limit weight.

31. The method according to claim 29, wherein The method further comprises: Determining a lower limit weight and an upper limit weight according to the gradient mode information, the gradient intensity information, the change direction information, the change center position information, and a predefined calculation accuracy, and determining a change center position weight according to the upper limit weight and the lower limit weight; determining a third distance according to the position information of the sampling point in the current block and the position information of the change center; The weight value of the at least one pixel point is determined according to the third distance and the change center position weight.

32. The method of claim 29, wherein: The method further comprises: Determining a lower limit weight and an upper limit weight according to the gradient mode information, the gradient intensity information, the change direction information, the change center position information, and a predefined calculation accuracy, and determining a change center position weight according to the upper limit weight and the lower limit weight; determining a fourth distance according to the position information of the sampling point in the current block and the position information of the change center; The at least one pixel weight value is determined based on the fourth distance, the lower limit weight, the upper limit weight, and the change center position weight.

33. The method according to any one of claims 30 to 32, wherein: The upper limit weight and the lower limit weight are preset.

34. The method according to any one of claims 30 to 33, wherein: The pixel weight value includes a first prediction weight and a second prediction weight, and the method further includes: Determining a weight sum value according to the lower limit weight and the upper limit weight; The second prediction weight is determined based on the first prediction weight and the weight sum value.

35. The method of claim 30, wherein: The at least one weight parameter includes at least one pixel offset value.

36. The method according to claim 35, wherein The method further comprises: Decode the code stream and determine the at least one pixel offset value.

37. The method according to claim 35, wherein The method further comprises: The at least one pixel offset value is determined according to the at least one pixel weight value.

38. The method according to claim 36 or 37, wherein The method further comprises: Determine a prediction value of the current block according to the at least one reference prediction value, the at least one pixel weight, and the at least one pixel offset value.

39. The method according to claim 31 or 32, wherein The method further comprises: Determine a prediction value of the current block according to the at least one reference prediction value and the at least one pixel weight.

40. The method of claim 23, wherein The at least one weight parameter includes a weight value of at least one sub-block of the current block.

41. The method of claim 29, wherein: The method further comprises: For position information of a sampling point in the current block, a pixel weight of the position information of the sampling point is determined according to pixel weights of position information of other sampling points in the current block that are adjacent to the position information of the sampling point.

42. The method of claim 22, wherein: The method further comprises: Determining inter-frame prediction mode parameters of the current block; If the inter-frame prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using a pixel-level weight value, the determination process of the type indication parameter and / or the geometric mode parameter is executed.

43. An encoder, comprising: The first determination unit, The first determining unit is configured to determine at least one motion vector information, a type indication parameter and / or a geometric mode parameter of the current block; Determining at least one reference prediction value of the current block according to the at least one motion vector information, and determining at least one weight parameter of the current block according to the type indication parameter and / or the geometric mode parameter; A prediction value of the current block is determined based on the at least one reference prediction value and the at least one weight parameter.

44. An encoder comprising a first processor and a first memory storing instructions executable by the first processor, wherein when the instructions are executed, the first processor implements the method according to any one of claims 22 to 42.

45. A decoder, comprising: decoding unit, a second determining unit, The decoding unit is configured to decode the code stream; The second determining unit is configured to determine at least one motion vector information, a type indication parameter and / or a geometric mode parameter of the current block; Determining at least one reference prediction value of the current block according to the at least one motion vector information, and determining at least one weight parameter of the current block according to the type indication parameter and / or the geometric mode parameter; A prediction value of the current block is determined based on the at least one reference prediction value and the at least one weight parameter.

46. ​​A decoder, comprising a second processor and a second memory storing instructions executable by the second processor, wherein when the instructions are executed, the second processor implements the method according to any one of claims 1 to 21.

47. A code stream, the code stream being generated by bit encoding based on information to be encoded; wherein, The information to be encoded includes at least one of the following: an inter-frame prediction mode parameter of the current block, at least one motion vector information of the current block, a type indication parameter and / or a geometric mode parameter.

48. A computer storage medium, wherein: The computer storage medium stores a computer program, which implements the method according to any one of claims 22 to 42 when executed by a first processor, or implements the method according to any one of claims 1 to 21 when executed by a second processor.