# US 11,451,787 B2 · Method and apparatus for video encoding and decoding

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

- Number: US 11,451,787 B2
- Document ID: US11451787B2
- Status: Granted
- Kind: B2
- Application number: 16/996,850
- Filed: 2020-08-18
- Published: 2020-12-03
- Granted: 2022-09-20
- Earliest claimed: 2018-06-20
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Xinwei Gao; Xunan Mao; Chenchen Gu
- Web page: https://patentgrep.com/patent/US11451787B2

## CPC

- H04N 19/146: Data rate or code amount at the encoder output
- H04N 19/124: Quantisation
- H04N 19/13: Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
- 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/172: the region being a picture, frame or field
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/42: characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation (H04N19/635 takes precedence)
- H04N 19/44: Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
- H04N 19/61: in combination with predictive coding
- H04N 19/91: Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A video coding method is provided. The method includes obtaining an input video frame, obtaining a sampling parameter corresponding to the input video frame, determining downsampling information according to the sampling parameter, and encoding the input video frame according to the downsampling information to obtain encoded data corresponding to the input video frame, where determining the downsampling information includes: in response to determining the input video frame includes a B-frame, selecting a first downsampling proportion for the B-frame; and in response to determining the input video frame includes a P-frame, selecting a second downsampling proportion for the P-frame, the second downsampling proportion is lower than the first downsampling proportion, and the first and the second downsampling proportions are part of the downsampling information.

## Claims

### Claim 1

A method, applied to a computer device, the method comprising:
obtaining an input video frame;
obtaining a sampling parameter corresponding to the input video frame, the sampling parameter including an average of resolutions of a plurality of preceding video frames;
determining downsampling information corresponding to the input video frame according to the sampling parameter, wherein determining the downsampling information comprises:
in response to determining the input video frame includes a B-frame, selecting a first downsampling proportion for the B-frame; and
in response to determining the input video frame includes a P-frame, selecting a second downsampling proportion for the P-frame, the second downsampling proportion is lower than the first downsampling proportion, and the first and the second downsampling proportions are part of the downsampling information, and
wherein determining the downsampling information further comprises:
obtaining an application type corresponding to the input video frame, and obtaining hardware processing capabilities of two communication parties in response to determining the application type is a real-time application type, the real-time application type including a real-time video call application, and the two communication parties engage in the real-time video call to each other as two call terminals; and
determining a downsampling method according to the hardware processing capabilities of the two communication parties; and
encoding the input video frame according to the downsampling information to obtain encoded data corresponding to the input video frame.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the sampling parameter comprises at least one of: frame information of the input video frame and encoding information of a preceding video frame corresponding to the input video frame.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the encoding information of the preceding video frame comprises resolution information of the preceding video frame.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the encoding the input video frame according to the downsampling information to obtain encoded data corresponding to the input video frame comprises:
processing the input video frame according to the first downsampling proportion or the second downsampling to obtain a current frame to be encoded;
and
encoding the current frame to obtain the encoded data corresponding to the input video frame.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the encoding the current frame comprises:
obtaining a target reference frame; and
encoding the current frame according to the target reference frame to obtain the encoded data corresponding to the input video frame.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the input video frame is a first input video frame corresponding to a first application program running on the computer device, the method further comprises:
obtaining a second input video frame corresponding to a second application program running on the computer device, the second application program being different than the first application program;
encoding the first input video frame according to a first downsampling method, and encoding the second input video frame according to a second downsampling method, the first downsampling method is different than the second downsampling method, and the first and the second downsampling methods are part of the downsampling information.

### Claim 7 (depends on 6)

The method according to claim 6, wherein the first application program includes a real-time application program, and the second application program includes a non-real-time application program.

### Claim 8 (depends on 1)

The method according to claim 1, wherein the two communication parties are each with both encoding and decoding functionalities via the real-time application type.

### Claim 9 (depends on 1)

The method according to claim 1, further comprising:
obtaining a correspondence between candidate hardware processing capabilities and candidate downsampling methods;
storing the correspondence as a preset; and
determining the downsampling method further according to the correspondence.

### Claim 10

A video decoding method, applied to a computer device, the method comprising:
receiving encoded data corresponding to a current frame to be decoded;
obtaining a sampling parameter corresponding to the current frame, the sampling parameter including an average of resolutions of a plurality of preceding video frames;
determining downsampling information corresponding to the current frame according to the sampling parameter, wherein downsampling information is determined by:
in response to determining the current frame frame includes a B-frame, selecting a first downsampling proportion for the B-frame; and
in response to determining the current frame includes a P-frame, selecting a second downsampling proportion for the P-frame, the second downsampling proportion is lower than the first downsampling proportion, and the first and the second downsampling proportions are part of the downsampling information, and
wherein the downsampling information is further determined by:
obtaining an application type corresponding to the input video frame, and obtaining hardware processing capabilities of two communication parties in response to determining the application type is a real-time application type, the real-time application type including a real-time video call application, and the two communication parties engage in the real-time video call to each other as two call terminals; and
determining a downsampling method according to the hardware processing capabilities of the two communication parties; and
decoding the encoded data according to the downsampling information corresponding to the video to be decoded to obtain a decoded video frame.

### Claim 11 (depends on 10)

The method according to claim 10, wherein the sampling parameter comprises at least one of: a frame type of the current frame and encoding information of a preceding video frame corresponding to the current frame.

### Claim 12 (depends on 11)

The method according to claim 11, wherein the encoding information of the preceding video frame comprises resolution information of the preceding video frame.

### Claim 13 (depends on 10)

The method according to claim 10, wherein the decoding the encoded data according to the downsampling information corresponding to the video to be decoded to obtain a corresponding decoded video frame comprises:
decoding the encoded data according to the first downsampling proportion or the second downsampling proportion to obtain a reconstructed video frame; and
upsampling the reconstructed video frame to obtain the decoded video frame.

### Claim 14 (depends on 13)

The method according to claim 13, wherein the decoding the encoded data comprises:
obtaining a reference frame corresponding to the current frame; and
determining resolution information corresponding to the current frame;
processing the reference frame according to the resolution information to obtain a target reference frame; and
decoding the encoded data according to the target reference frame to obtain the reconstructed video frame corresponding to the current frame.

### Claim 15 (depends on 13)

The method according to claim 13, wherein upsampling the reconstructed video frame comprises:
upsampling the reconstructed video frame by using an upsampling method corresponding to the downsampling method.

### Claim 16

A non-transitory computer-readable storage medium, storing a computer program, the computer program, when executed by a processor, causing the processor to perform:
obtaining an input video frame;
obtaining a sampling parameter corresponding to the input video frame, the sampling parameter including an average of resolutions of a plurality of preceding video frames;
determining downsampling information corresponding to the input video frame according to the sampling parameter, wherein determining the downsampling information comprises:
in response to determining the input video frame includes a B-frame, selecting a first downsampling proportion for the B-frame; and
in response to determining the input video frame includes a P-frame, selecting a second downsampling proportion for the P-frame, the second downsampling proportion is lower than the first downsampling proportion, and the first and the second downsampling proportions are part of the downsampling information, and
wherein determining the downsampling information further comprises:
obtaining an application type corresponding to the input video frame, and obtaining hardware processing capabilities of two communication parties in response to determining the application type is a real-time application type, the real-time application type including a real-time video call application, and the two communication parties engage in the real-time video call to each other as two call terminals; and
determining a corresponding sampling method according to the hardware processing capabilities of the two communication parties; and
encoding the input video frame according to the downsampling information to obtain encoded data corresponding to the input video frame.

### Claim 17 (depends on 16)

The computer-readable storage medium of claim 16, the processor further performing:
receiving encoded data of a current frame;
obtaining a sampling parameter corresponding to the current frame, and determining downsampling information corresponding to the current frame according to the sampling parameter; and
decoding the encoded data according to the downsampling information corresponding to the current frame to obtain a decoded video frame.
