Video encoding and decoding method, device, and system, and storage medium
AssigneeZte Corporation
InventorJunping Gao
Life of this patent
Estimating the term…
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.
Claims13
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.
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.
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.
Dependencies are inferred from the claim text.