# US 11,445,201 B2 · Video encoding and decoding method, device, and system, and storage medium

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

- Number: US 11,445,201 B2
- Document ID: US11445201B2
- Status: Granted
- Kind: B2
- Application number: 17/052,256
- Filed: 2019-04-28
- Published: 2021-12-02
- Granted: 2022-09-13
- Earliest claimed: 2018-05-02
- Assignees: Zte Corporation
- Applicants: Zte Corporation
- Inventors: Junping Gao
- Web page: https://patentgrep.com/patent/US11445201B2

## CPC

- H04N 19/12: Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
- H04N 19/14: Coding unit complexity, e.g. amount of activity or edge presence estimation (H04N19/146 takes precedence)
- H04N 19/124: Quantisation
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/182: the unit being a pixel
- H04N 19/186: the unit being a colour or a chrominance component
- H04N 19/188: {the unit being a video data packet, e.g. a network abstraction layer [NAL] unit}
- H04N 19/85: using pre-processing or post-processing specially adapted for video compression
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Provided are video encoding and decoding methods and apparatuses, a video encoding and decoding system, and a storage medium. The video encoding method includes: performing macroblock division on pixel data of a screen change area, classifying, according to pixel data in a divided macroblock, the divided macroblock as a text macroblock or an image macroblock; determining a compression type of the text macroblock according to color data in the text macroblock; and performing encoding and compression, according to the compression type of the text macroblock, on the text macroblock with a corresponding compression quality.

## Claims

### Claim 1

A video encoding method, comprising:
performing macroblock division on pixel data of a screen change area;
classifying, according to pixel data in a divided macroblock, the divided macroblock as a text macroblock or an image macroblock;
determining a compression type of the text macroblock according to color data in the text macroblock; and
performing encoding and compression, according to the compression type of the text macroblock, on the text macroblock with a corresponding compression quality;
wherein the step of determining the compression type of the text macroblock according to the color data in the text macroblock comprises:
establishing statistical information according to pixel data of the text macroblock;
performing clarification on the text macroblock according to a color feature in the statistical information; wherein a category of the classified text macroblock comprises at least one of: an achromatic text macroblock, a red text macroblocks, a blue text macroblock, or a mixed color text macroblock; and
determining the compression type of each category of text macroblock according to a difference between a foreground color and a background color in color features of different categories of text macroblocks;
wherein the determining the compression type of each category of text macroblock according to a difference between a foreground color and a background color in color features of different categories of text macroblocks comprises at least one of the following:
determining the compression type of the achromatic text macroblock whose difference between the foreground color and the background color is greater than a first threshold value as a high lossy compression;
determining the compression type of the achromatic text macroblock whose difference between the foreground color and the background color is less than or equal to the first threshold value and greater than a second threshold value as a moderate lossy compression;
determining the compression type of the blue text macroblock or the red text macroblock as a lossy compression requiring compensation; or
determining the compression type of the mixed color macroblock as a lossless compression;
wherein compression ratios of the high lossy compression, the moderate lossy compression, the high definition lossy compression, the lossy compression requiring compensation, and the lossless compression sequentially decrease.

### Claim 2 (depends on 1)

The video encoding method of claim 1, wherein the step of classifying, according to the pixel data in the divided macroblock, the divided macroblock as the text macroblock or the image macroblock comprises:
analyzing a gradient feature of pixel data distribution in the divided macroblock, and classifying, according to the gradient feature, the divided macroblock as the image macroblock or the text macroblock.

### Claim 3 (depends on 1)

The video encoding method of claim 1, wherein the step of performing encoding and compression, according to the compression type of the text macroblock, on the text macroblock with the corresponding compression quality comprises:
performing encoding and compression, according to the compression type of the text macroblock, on the text macroblock with a corresponding compression ratio.

### Claim 4 (depends on 1)

The video encoding method of claim 1, further comprising:
encapsulating an encoded and compressed text macroblock in a packet, wherein a compression type of the encoded and compressed text macroblock is carried in data of the encapsulated packet; and
sending the encapsulated packet to a video decoding apparatus so that the video decoding apparatus performs decoding on the encapsulated packet.

### Claim 5

A video encoding apparatus, comprising:
a first processor; and
a first memory for storing instructions executable by the first processor,
wherein the first processor is configured to:
perform macroblock division on pixel data of a screen change area;
classify, according to pixel data in a divided macroblock, the divided macroblock as a text macroblock or an image macroblock;
establish statistical information according to pixel data of the text macroblock;
perform clarification on the text macroblock according to a color feature in the statistical information; wherein a category of the classified text macroblock comprises at least one of: an achromatic text macroblock, a red text macroblocks, a blue text macroblock, or a mixed color text macroblock;
determine a compression type of each category of text macroblock according to a difference between a foreground color and a background color in color features of different categories of text macroblocks; and
perform encoding and compression, according to the compression type of the text macroblock, on the text macroblock with a corresponding compression quality;
wherein the first processor is configured to determine a compression type of each category of text macroblock according to a differences between a foreground color and a background color in color features of different categories of text macroblocks in at least one of the followings manners;
wherein the determining the compression type of each category of text macroblock according to a difference between a foreground color and a background color in color features of different categories of text macroblocks comprises at least one of the following;
determining the compression type of the achromatic text macroblock whose difference between the foreground color and the background color is greater than a first threshold value as a high lossy compression;
determining the compression type of the achromatic text macroblock whose difference between the foreground color and the background color is less than or equal to the first threshold value and greater than a second threshold value as a moderate lossy compression;
determining the compression type of the blue text macroblock or the red text macroblock as a lossy compression requiring compensation; or
determining the compression type of the mixed color macroblock as a lossless compression;
wherein compression ratios of the high lossy compression, the moderate lossy compression, the high definition lossy compression, the lossy compression requiring compensation, and the lossless compression sequentially decrease.

### Claim 6 (depends on 5)

The video encoding apparatus of claim 5, wherein the first processor is configured to classify, according to pixel data in a divided macroblock, the divided macroblock as a text macroblock or an image macroblock in the following manner:
analyzing a gradient feature of pixel data distribution in the divided macroblock, and classifying, according to the gradient feature, the divided macroblock as the image macroblock or the text macroblock.

### Claim 7 (depends on 5)

The video encoding apparatus of claim 5, wherein the first processor is configured to perform encoding and compression, according to the compression type of the text macroblock, on the text macroblock with the corresponding compression quality in the following manner: performing encoding and compression, according to the compression type of the text macroblock, on the text macroblock with a corresponding compression ratio.

### Claim 8 (depends on 5)

The video encoding apparatus of claim 5, wherein the first processor is further configured to:
encapsulate an encoded and compressed text macroblock in a packet, wherein a compression type of the encoded and compressed text macroblock is carried in data of the encapsulated packet; and
send the encapsulated packet to a video decoding apparatus so that the video decoding apparatus performs decoding on the encapsulated packet.

### Claim 9 (depends on 5)

A video encoding and decoding system, comprising the video encoding apparatus of claim 5 and a video decoding apparatus:
wherein the video decoding apparatus comprises:
a second processor; and
a second memory for storing instructions executable by the processor,
wherein the second processor is configured to:
receive an encapsulated packet sent by a video encoding apparatus, wherein the encapsulated packet carries compression data and a compression type of the compression data;
parse the encapsulated packet and acquire the compression type; and
perform decoding processing on the compression data according to the compression type.

### Claim 10

A non-transitory storage medium storing one or more programs which, when executed by one or more processors, cause the one or more processors to:
perform macroblock division on pixel data of a screen change area;
classify, according to pixel data in a divided macroblock, the divided macroblock as a text macroblock or an image macroblock;
establish statistical information according to pixel data of the text macroblock;
perform clarification on the text macroblock according to a color feature in the statistical information; wherein a category of the classified text macroblock comprises at least one of: an achromatic text macroblock, a red text macroblocks, a blue text macroblock, or a mixed color text macroblock;
determine a compression type of each category of text macroblock according to a difference between a foreground color and a background color in color features of different categories of text macroblocks; and
perform encoding and compression, according to the compression type of the text macroblock, on the text macroblock with a corresponding compression quality;
wherein the one or more programs which, when executed by one or more processors, cause the one or more processors to determine a compression type of each category of text macroblock according to a difference between a foreground color and a background color in color features of different categories of text macroblocks in at least one of the followings manners:
wherein the determining the compression type of each category of text macroblock according to a difference between a foreground color and a background color in color features of different categories of text macroblocks comprises at least one of the following:
determining the compression type of the achromatic text macroblock whose difference between the foreground color and the background color is greater than a first threshold value as a high lossy compression;
determining the compression type of the achromatic text macroblock whose difference between the foreground color and the background color is less than or equal to the first threshold value and greater than a second threshold value as a moderate lossy compression;
determining the compression type of the blue text macroblock or the red text macroblock as a lossy compression requiring compensation; or
determining the compression type of the mixed color macroblock as a lossless compression;
wherein compression ratios of the high lossy compression, the moderate lossy compression, the high definition lossy compression, the lossy compression requiring compensation, and the lossless compression sequentially decrease.

### Claim 11 (depends on 10)

The non-transitory storage medium of claim 10, wherein the processor is caused to classify, according to pixel data in a divided macroblock, the divided macroblock as a text macroblock or an image macroblock in the following manner:
analyzing a gradient feature of pixel data distribution in the divided macroblock, and classifying, according to the gradient feature, the divided macroblock as the image macroblock or the text macroblock.

### Claim 12 (depends on 10)

The non-transitory storage medium of claim 10, wherein the processor is caused to perform encoding and compression, according to the compression type of the text macroblock, on the text macroblock with the corresponding compression quality in the following manner: performing encoding and compression, according to the compression type of the text macroblock, on the text macroblock with a corresponding compression ratio.

### Claim 13 (depends on 10)

The non-transitory storage medium of claim 10, wherein the processor is further caused to:
encapsulate an encoded and compressed text macroblock in a packet, wherein a compression type of the encoded and compressed text macroblock is carried in data of the encapsulated packet; and
send the encapsulated packet to a video decoding apparatus so that the video decoding apparatus performs decoding on the encapsulated packet.
