# US 2023/0056211 A1 · Video encoding method and apparatus, video decoding method and apparatus, computer program product, computer-readable storage medium, and electronic device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0056211 A1
- Document ID: US20230056211A1
- Status: Published application
- Kind: A1
- Application number: 17/981,323
- Filed: 2022-11-04
- Published: 2023-02-23
- Earliest claimed: 2021-02-05
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Yingbin WANG
- Web page: https://patentgrep.com/patent/US20230056211A1

## CPC

- H04N 19/105: Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
- H04N 19/132: Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
- H04N 19/157: Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N 19/159: Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/46: Embedding additional information in the video signal during the compression process (H04N19/517, H04N19/68, H04N19/70 take precedence)
- H04N 19/70: characterised by syntax aspects related to video coding, e.g. related to compression standards
- H04N 21/4402: involving reformatting operations of video signals for household redistribution, storage or real-time display {(details of conversion of video standards at pixel level H04N7/01; video transcoding H04N19/40; adapting incoming signals to the display format of the display terminal G09G5/005; media handling at the source in data packet switching networks H04L65/764)}
- H04N 19/593: involving spatial prediction techniques
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

The present disclosure provides a video decoding method performed by an electronic device. The method includes: decoding a bitstream to obtain a first flag, a first index value, and a second index value; determining a target intra prediction mode in a first intra prediction mode list according to the first index value and a target weighting list in a weighting list set according to the second index value when the first flag satisfying a first preset condition; determining reference samples of a first category and reference samples of a second category according to reference samples corresponding to the current block, and weighting the reference samples of the first category and the reference samples of the second category based on the target weighting list to obtain weighted reference samples; and predicting samples the in the current block according to the weighted reference samples and the target intra prediction mode.

## Claims

### Claim 1

A video decoding method performed at an electronic device, comprising:
decoding a bitstream to obtain a first flag, a first index value, and a second index value, the first flag being used for identifying whether to use an intra weighted prediction mode for a current block;
determining a target intra prediction mode in a first intra prediction mode list according to the first index value and a target weighting list in a weighting list set according to the second index value, in response to a value of the first flag satisfying a first preset condition;
determining reference samples of a first category and reference samples of a second category according to reference samples corresponding to the current block, and weighting the reference samples of the first category and the reference samples of the second category based on the target weighting list to obtain weighted reference samples; and
predicting samples the in the current block according to the weighted reference samples and the target intra prediction mode to obtain predicted samples of the current block.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the first intra prediction mode list comprises a plurality of intra prediction modes and serial numbers corresponding to each of the intra prediction modes; and
the determining a target intra prediction mode in a first intra prediction mode list according to the first index value comprises:
matching the first index value against the serial numbers in the first intra prediction mode list to obtain a target serial number matching the first index value; and
determining the intra prediction mode corresponding to the target serial number as the target intra prediction mode.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the method further comprises:
obtaining a second flag;
determining the target intra prediction mode in the first intra prediction mode list according to the first index value in response to determining according to the second flag that the target intra prediction mode is in the first intra prediction mode list; and
decoding the bitstream to obtain a third index value and determining the target intra prediction mode in a second intra prediction mode list according to the third index value, in response to determining according to the second flag that the target intra prediction mode is not in the first intra prediction mode list,
the intra prediction modes comprised in the first intra prediction mode list being different from those comprised in the second intra prediction mode list.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the first intra prediction mode list comprises one or more of an intra prediction mode, a preset angular mode, a bilinear mode, or a plane mode corresponding to a decoded block, the decoded block is adjacent or non-adjacent to the current block to be decoded, and the intra prediction modes comprised in the first intra prediction mode list are different from each other.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the weighting list set comprises a plurality of weighting lists and serial numbers corresponding to the weighting lists, the serial numbers corresponding to the weighting lists are generated based on index values, intra prediction modes, and a width and a height of the block, and the index values being of a same type as a type of the second index value; and
the determining a target weighting list in a weighting list set according to the second index value comprises:
determining an identifier according to the second index value, the width and the height of the current block, and the target intra prediction mode; and
mapping the identifier to each of the serial numbers in the weighting list set to obtain a target serial number, and determining the weighting list corresponding to the target serial number as the target weighting list.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the method further comprises: determining a weight list corresponding to the block to be decoded according to an intra prediction mode corresponding to the block to be decoded and the width and the height of the block to be decoded.

### Claim 7 (depends on 3)

The method according to claim 3, wherein the method further comprises:
determining a length of the reference samples corresponding to the block according to the width and the height of the block;
determining valid reference samples and a valid reference sample length in a length direction of the reference samples according to the intra prediction mode corresponding to the block;
setting one or more preset points in the valid reference samples based on the valid reference sample length, determining a first position in the valid reference samples according to the index values and the preset points, and determining second position according to a position of a preset reference sample; and
setting weights of the reference samples according to a relationship between the first position and the second position to obtain a weighting list corresponding to the block.

### Claim 8 (depends on 4)

The method according to claim 4, wherein the determining valid reference samples and a valid reference sample length in a length direction of the reference samples according to the intra prediction mode corresponding to the block comprises:
obtaining a predicted angle and determining the valid reference samples and the valid reference sample length according to the width and the height of the block and the predicted angle, in response to the intra prediction mode being an angular mode; and
determining the valid reference samples as the reference samples and determining the valid reference sample length as the length of the reference samples, in response to the intra prediction mode being a non-angular mode.

### Claim 9 (depends on 4)

The method according to claim 4, wherein the setting weights of the reference samples according to a relationship between the first position and the second position comprises:
setting weights of the preset reference sample and the reference sample whose position coordinates are less than the coordinates of the first position as first weights and setting weights of the remaining reference samples as second weights, in response to coordinates of the first position being less than coordinates of the second position; and
setting the weights of the preset reference sample and the reference sample whose position coordinates are less than the coordinates of the first position as the second weights and setting the weights of the remaining reference samples as the first weights, in response to the coordinates of the first position being greater than or equal to the coordinates of the second position.

### Claim 10 (depends on 4)

The method according to claim 4, wherein the setting weights of the reference samples according to a relationship between the first position and the second position comprises:
adding a transition weight at the first position, wherein a transition weight of a reference sample located before the first position is any weight in a weight value range, a transition weight of a reference sample located after the first position varies with a distance between a position of the reference sample and the first position, and the transition weight of the reference sample after the first position is greater than a weight of the reference sample before the first position and less than or equal to a maximum weight in the weight value range; or
adding a transition weight at the first position, wherein a transition weight of a reference sample located before the first position varies with an absolute distance between a position of the reference sample and the first position, a transition weight of a reference sample located after the first position is any weight in the weight value range, and the transition weight of the reference sample before the first position is greater than a weight of the reference sample after the first position and less than or equal to the maximum weight in the weight value range.

### Claim 11 (depends on 1)

The method according to claim 1, wherein the determining reference samples of a first category and reference samples of a second category according to reference samples corresponding to the current block comprises:
determining auxiliary reference samples of a same size according to the reference samples, and performing target processing on pixel values of the reference samples to obtain pixel values of pixels among the auxiliary reference samples; and
classifying the reference samples and the auxiliary reference samples according to a preset rule to obtain the reference samples of the first category and the reference samples of the second category.

### Claim 12 (depends on 8)

The method according to claim 8, wherein the classifying the reference samples and the auxiliary reference samples according to a preset rule to obtain the reference samples of the first category and the reference samples of the second category comprises:
determining the reference samples as the reference samples of the first category and determining the auxiliary reference samples as the reference samples of the second category; or
decoding the bitstream to obtain a third flag;
determining the reference samples as the reference samples of the first category and determining the auxiliary reference samples as the reference samples of the second category, in response to a value of the third flag satisfying a second preset condition; and
determining the auxiliary reference samples as the reference samples of the first category and determining the reference samples as the reference samples of the second category, in response to the value of the third flag not satisfying the second preset condition.

### Claim 13 (depends on 1)

The method according to claim 1, wherein the reference samples comprise luminance reference samples and chrominance reference samples, and the weighted reference samples comprise weighted luminance reference samples and weighted chrominance reference samples.

### Claim 14 (depends on 1)

The method according to claim 1, wherein before the obtaining a first flag, the method further comprises:
obtaining the width and the height of the current block, and decoding the bitstream to obtain the first flag in response to the width and the height of the current block satisfying a third preset condition; or
decoding the bitstream to obtain an image header flag, and decoding the bitstream to obtain the first flag in response to the image header flag satisfying a fourth preset condition; or
decoding the bitstream to obtain a sequence header flag, and decoding the bitstream to obtain the first flag or the image header flag and the first flag in response to the sequence header flag satisfying a fifth preset condition.

### Claim 15 (depends on 1)

The method according to claim 1, wherein the method further comprises:
storing an intra weighted prediction mode corresponding to the current block as a final intra prediction mode; or
decomposing the current block into a plurality of sub-decoding blocks according to a preset value;
determining a storage mode index value according to a preset pixel in each of the sub-decoding blocks, the target intra prediction mode, and the target weighting list; and
determining an intra prediction mode corresponding to the sub-decoding block according to the storage mode index value, and storing the sub-decoding block and the intra prediction mode corresponding to the sub-decoding block in a correspondence.

### Claim 16 (depends on 12)

The method according to claim 12, wherein the determining a storage mode index value according to a preset pixel in each of the sub-decoding blocks, the target intra prediction mode, and the target weighting list comprises:
in response to the target intra prediction mode being an angular mode, projecting the preset pixel in a direction of the valid reference samples according to a predicted angle in the angular mode to obtain a target reference sample;
obtaining a weight corresponding to the target reference sample in the target weighting list;
marking the storage mode index value as a first value in response to the weight corresponding to the target reference sample being greater than or equal to a first preset threshold; and marking the storage mode index value as a second value different from the first value, in response to the weight corresponding to the target reference sample being less than the first preset threshold.

### Claim 17 (depends on 13)

The method according to claim 13, wherein the determining a storage mode index value according to a preset pixel in each of the sub-decoding blocks, the target intra prediction mode, and the target weighting list comprises:
in response to the target intra prediction mode being a non-angular mode, classifying reference samples corresponding to the sub-decoding blocks according to the target weighting list and a second preset threshold to obtain a first number of reference samples whose weights are less than the second preset threshold and a second number of reference samples whose weights are greater than or equal to the second preset threshold among the reference samples corresponding to the sub-decoding blocks;
marking the storage mode index value as the first value in response to the first number being less than or equal to the second number; and marking the storage mode index value as the second value in response to the first number being greater than the second number.

### Claim 18 (depends on 13)

The method according to claim 13, wherein the determining an intra prediction mode corresponding to the sub-decoding block according to the storage mode index value comprises:
determining that the intra prediction mode corresponding to the sub-decoding block is an intra prediction mode corresponding to the reference samples of the first category in response to the storage mode index value being the first value; and
determining that the intra prediction mode corresponding to the sub-decoding block is an intra prediction mode corresponding to the reference samples of the second category in response to the storage mode index value being the second value.

### Claim 19

An apparatus for video decoding, comprising:
one or more processors; and
a storage apparatus, configured to store one or more programs, the one or more programs, when executed by the one or more processors, causing the electronic device to implement a video encoding method including:
decoding a bitstream to obtain a first flag, a first index value, and a second index value, the first flag being used for identifying whether to use an intra weighted prediction mode for a current block;
determining a target intra prediction mode in a first intra prediction mode list according to the first index value and a target weighting list in a weighting list set according to the second index value, in response to a value of the first flag satisfying a first preset condition;
determining reference samples of a first category and reference samples of a second category according to reference samples corresponding to the current block, and weighting the reference samples of the first category and the reference samples of the second category based on the target weighting list to obtain weighted reference samples; and
predicting samples the in the current block according to the weighted reference samples and the target intra prediction mode to obtain predicted samples of the current block.

### Claim 20

A non-transitory computer readable storage medium, storing executable instructions, the executable instructions, when executed by a processor of an electronic device, causing the electronic device to implement a video encoding method including:
decoding a bitstream to obtain a first flag, a first index value, and a second index value, the first flag being used for identifying whether to use an intra weighted prediction mode for a current block;
determining a target intra prediction mode in a first intra prediction mode list according to the first index value and a target weighting list in a weighting list set according to the second index value, in response to a value of the first flag satisfying a first preset condition;
determining reference samples of a first category and reference samples of a second category according to reference samples corresponding to the current block, and weighting the reference samples of the first category and the reference samples of the second category based on the target weighting list to obtain weighted reference samples; and
predicting samples the in the current block according to the weighted reference samples and the target intra prediction mode to obtain predicted samples of the current block.
