# US 12,015,763 B2 · Video encoding method, video decoding method, and related apparatuses

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

- Number: US 12,015,763 B2
- Document ID: US12015763B2
- Status: Granted
- Kind: B2
- Application number: 17/503,161
- Filed: 2021-09-17
- Published: 2022-02-24
- Granted: 2024-06-18
- Earliest claimed: 2019-09-27
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Xinwei Gao; Xunan Mao
- Web page: https://patentgrep.com/patent/US12015763B2

## 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/159: Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
- H04N 19/172: the region being a picture, frame or field
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/30: using hierarchical techniques, e.g. scalability (H04N19/63 takes precedence)
- H04N 19/44: Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
- 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: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A video decoding method, a video encoding method, and related apparatuses. The method includes: determining a current video frame; determining a reference frame corresponding to the current video frame from video frames that have been decoded, and obtaining a target quantity of blocks that are decoded in a skip mode in the reference frame and a total block quantity of blocks in the reference frame; determining, according to a relationship between the target quantity and the total block quantity, a target resolution used for decoding the current video frame; and decoding the current video frame by using the target resolution. For different current video frames, different resolutions used for decoding can be adaptively selected, to simplify operations of determining the target resolution for decoding the current video frame, thereby resolving the technical problem of relatively low video encoding and decoding efficiency caused by complex processing operations in the related art.

## Claims

### Claim 1

A video decoding method performed by an electronic device, the method comprising:
determining a current video frame;
determining a reference frame corresponding to the current video frame from video frames that have been decoded, and obtaining a target quantity of blocks that are decoded in a skip mode in the reference frame and a total block quantity of blocks in the reference frame;
determining, according to a relationship between the target quantity and the total block quantity, a target resolution used for decoding the current video frame, further comprising:
determining a first resolution as the target resolution for decoding the current video frame when a reciprocal of a ratio of the target quantity to the total block quantity is greater than or equal to a preset threshold; and
determining a second resolution as the target resolution for decoding the current video frame when the reciprocal of the ratio of the target quantity to the total block quantity is less than the preset threshold, the second resolution being greater than the first resolution; and
decoding the current video frame by using the target resolution and the reference frame.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising:
before decoding the current video frame:
determining a group of thresholds from a value interval greater than the preset threshold when the reciprocal of the ratio of the target quantity to the total block quantity is greater than the preset threshold;
comparing the reciprocal of the ratio of the target quantity to the total block quantity with thresholds comprised in the group of thresholds;
determining a sampling ratio according to a result of the comparison; and
downsampling the second resolution according to the sampling ratio, to determine the first resolution.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the determining a sampling ratio according to a result of the comparison comprises:
obtaining, when it is determined that the reciprocal of the ratio of the target quantity to the total block quantity falls within a target interval defined by a pair of a first threshold and a second threshold that are adjacent in the group of thresholds, a target sampling ratio configured for the target interval, the first threshold being less than the second threshold; and
the downsampling the second resolution according to the sampling ratio comprises:
downsampling a width and a height of the second resolution according to the target sampling ratio, to obtain the first resolution.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the determining a reference frame corresponding to the current video frame from video frames that have been decoded, and obtaining a target quantity of blocks that are decoded in a skip mode in the reference frame and a total block quantity of blocks in the reference frame comprises:
determining a video frame (t−k) as one reference frame when the current video frame is a video frame t, k being a predetermined positive integer, t being a positive integer, t being greater than k; and
obtaining the target quantity and the total block quantity from the video frame (t−k).

### Claim 5 (depends on 1)

The method according to claim 1, wherein the determining a reference frame corresponding to the current video frame from video frames that have been decoded, and obtaining a target quantity of blocks that are decoded in a skip mode in the reference frame and a total block quantity of blocks in the reference frame comprises:
determining a plurality of reference frames from the video frames that have been decoded; and
obtaining the target quantity in the plurality of reference frames and the total block quantity in the plurality of reference frames.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the determining a plurality of reference frames from the video frames that have been decoded comprises:
determining a plurality of consecutive video frames or a plurality of nonconsecutive video frames from the video frames that have been decoded as the plurality of reference frames.

### Claim 7 (depends on 5)

The method according to claim 5, wherein the determining a plurality of reference frames from the video frames that have been decoded comprises:
determining a video frame (t−k1) to a video frame (t−k2) as the plurality of reference frames when the current video frame is a video frame t, k1 and k2 being predetermined positive integers, t being a positive integer, t being greater than k1, k1 being greater than k2; and
the obtaining the target quantity in the plurality of reference frames and the total block quantity in the plurality of reference frames comprises:
obtaining the target quantity and the total block quantity from the video frame (t−k1) to the video frame (t−k2).

### Claim 8 (depends on 1)

The method according to claim 1, wherein the target resolution is further determined in the following manner:
parsing a bitstream to obtain a decoding flag bit corresponding to the current video frame; and
obtaining the target resolution indicated by the decoding flag bit.

### Claim 9

A video encoding method performed by an electronic device, the method comprising:
determining a current video frame;
determining a reference frame corresponding to the current video frame from video frames that have been encoded, and obtaining a target quantity of blocks that are encoded in a skip mode in the reference frame and a total block quantity of blocks in the reference frame;
determining, according to a relationship between the target quantity and the total block quantity, a target resolution used for encoding the current video frame, further including:
determining a first resolution as the target resolution for encoding the current video frame when a reciprocal of a ratio of the target quantity to the total block quantity is greater than or equal to a preset threshold; and
determining a second resolution as the target resolution for encoding the current video frame when the reciprocal of the ratio of the target quantity to the total block quantity is less than the preset threshold, the second resolution being greater than the first resolution; and
encoding the current video frame by using the target resolution and the reference frame.

### Claim 10 (depends on 9)

The method according to claim 9, further comprising:
before encoding the current video frame:
determining a group of thresholds from a value interval greater than the preset threshold when the reciprocal of the ratio of the target quantity to the total block quantity is greater than the preset threshold;
comparing the reciprocal of the ratio of the target quantity to the total block quantity with thresholds comprised in the group of thresholds;
determining a sampling ratio according to a result of the comparison; and
downsampling the second resolution according to the sampling ratio, to determine the first resolution.

### Claim 11

An electronic device, comprising:
a processor, a communication interface, a memory, and a communication bus;
the processor, the communication interface, and the memory communicating with each other by using the communication bus, the communication interface being an interface of a communication module;
the memory storing computer-readable instructions, wherein the computer-readable instructions, when executed by the processor, cause the electronic device to perform a plurality of operations including:
determining a current video frame;
determining a reference frame corresponding to the current video frame from video frames that have been decoded, and obtaining a target quantity of blocks that are decoded in a skip mode in the reference frame and a total block quantity of blocks in the reference frame;
determining, according to a relationship between the target quantity and the total block quantity, a target resolution used for decoding the current video frame, further comprising:
determining a first resolution as the target resolution for decoding the current video frame when a reciprocal of a ratio of the target quantity to the total block quantity is greater than or equal to a preset threshold; and
determining a second resolution as the target resolution for decoding the current video frame when the reciprocal of the ratio of the target quantity to the total block quantity is less than the preset threshold, the second resolution being greater than the first resolution; and
decoding the current video frame by using the target resolution and the reference frame.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein the plurality of operations further comprise:
before decoding the current video frame:
determining a group of thresholds from a value interval greater than the preset threshold when the reciprocal of the ratio of the target quantity to the total block quantity is greater than the preset threshold;
comparing the reciprocal of the ratio of the target quantity to the total block quantity with thresholds comprised in the group of thresholds;
determining a sampling ratio according to a result of the comparison; and
downsampling the second resolution according to the sampling ratio, to determine the first resolution.

### Claim 13 (depends on 12)

The electronic device according to claim 12, wherein the determining a sampling ratio according to a result of the comparison comprises:
obtaining, when it is determined that the reciprocal of the ratio of the target quantity to the total block quantity falls within a target interval defined by a pair of a first threshold and a second threshold that are adjacent in the group of thresholds, a target sampling ratio configured for the target interval, the first threshold being less than the second threshold; and
the downsampling the second resolution according to the sampling ratio comprises:
downsampling a width and a height of the second resolution according to the target sampling ratio, to obtain the first resolution.

### Claim 14 (depends on 11)

The electronic device according to claim 11, wherein the determining a reference frame corresponding to the current video frame from video frames that have been decoded, and obtaining a target quantity of blocks that are decoded in a skip mode in the reference frame and a total block quantity of blocks in the reference frame comprises:
determining a video frame (t−k) as one reference frame when the current video frame is a video frame t, k being a predetermined positive integer, t being a positive integer, t being greater than k; and
obtaining the target quantity and the total block quantity from the video frame (t−k).

### Claim 15 (depends on 11)

The electronic device according to claim 11, wherein the determining a reference frame corresponding to the current video frame from video frames that have been decoded, and obtaining a target quantity of blocks that are decoded in a skip mode in the reference frame and a total block quantity of blocks in the reference frame comprises:
determining a plurality of reference frames from the video frames that have been decoded; and
obtaining the target quantity in the plurality of reference frames and the total block quantity in the plurality of reference frames.

### Claim 16 (depends on 15)

The electronic device according to claim 15, wherein the determining a plurality of reference frames from the video frames that have been decoded comprises:
determining a plurality of consecutive video frames or a plurality of nonconsecutive video frames from the video frames that have been decoded as the plurality of reference frames.

### Claim 17 (depends on 11)

The electronic device according to claim 11, wherein the target resolution is further determined in the following manner:
parsing a bitstream to obtain a decoding flag bit corresponding to the current video frame; and
obtaining the target resolution indicated by the decoding flag bit.
