CN102801987B - Format conversion method for computer desktop video from YUV444 to YUV420 based on chrominance information classification - Google Patents

Format conversion method for computer desktop video from YUV444 to YUV420 based on chrominance information classification Download PDF

Info

Publication number
CN102801987B
CN102801987B CN201210254360.5A CN201210254360A CN102801987B CN 102801987 B CN102801987 B CN 102801987B CN 201210254360 A CN201210254360 A CN 201210254360A CN 102801987 B CN102801987 B CN 102801987B
Authority
CN
China
Prior art keywords
component data
chromatic component
chromatic
class
data block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210254360.5A
Other languages
Chinese (zh)
Other versions
CN102801987A (en
Inventor
朱威
王则浪
郑雅羽
陈朋
汪磊
俞立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN201210254360.5A priority Critical patent/CN102801987B/en
Publication of CN102801987A publication Critical patent/CN102801987A/en
Application granted granted Critical
Publication of CN102801987B publication Critical patent/CN102801987B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a format conversion method for a computer desktop video from YUV444 to YUV420 based on chrominance information classification, comprising the following steps of: (1) inputting one frame of YUV444 video format data to be converted; (2) taking out an unconverted 2*2 chrominance component data block; (3) determining a belonging type of the 2*2 chrominance component data block and converting the 2*2 chrominance component data block into one chrominance component datum corresponding to a YUV420 format according to the belonging type; (4) taking out a next unconverted 2*2 chrominance component data block and repeating the steps (2)-(3) until all the 2*2 chrominance component data blocks of the current frame are converted; and (5) taking out all chrominance component data of the video data of the frame obtained from the step (1) to be combined with the converted chrominance component data to form YUV420 format video data. The computer desktop video with the YUV420 format has a good chrominance visual effect.

Description

A kind of computer desktop YUV video 444 based on chrominance information classification turns the format conversion method of YUV420
Technical field
The present invention relates to video information process field, be specifically related to a kind of YUV444 for computer desktop video and turn the format conversion method of YUV420.
Background technology
YUV is a kind of video format with expression together with luminance component (Y component) and chromatic component (U component and V component), according to Y component, the difference of ratio between U component and V component, can be divided into YUV444, YUV422, the dissimilar form such as YUV420 (is shown in Bi Houjie, Wang Jian. video compression coding standard of new generation: H.264/AVC. People's Telecon Publishing House .2009), the wherein Y of YUV444 video format, U, tri-components of V have same horizontal and vertical resolution, each location of pixels, there are 3 components, Y component, U component and V component, be corresponding 1 the 2x2 colourity U component data piece of each 2x2 luminance component data piece and 1 2x2 colourity V component data piece.And in YUV420 video format, aspect horizontal and vertical resolution, U chromatic component resolution and V chromatic component resolution are all half of Y component resolution, i.e. corresponding 1 the colourity U component data of each 2x2 luminance component data piece and 1 colourity V component data.Thereby, YUV444 video format is in the transfer process to YUV420 video format, chromatic component is 1 the corresponding chroma data that is converted to YUV420 form by the each 2x2 chroma data piece in YUV444 formatted data, and 1/2nd ratios that realize horizontal direction and vertical direction resolution are dwindled conversion and (seen Iain E.G.Richardson.Video Codec Design.John Wiley & Sons Ltd.2002; See again Iain E.G.Richardon.H.264 and MPEG-4 Video Compression Video Coding for Next Generation Multimedia.Wiley Press.2003).
Although YUV420 video format is compared with other yuv video form, its chrominance information is minimum, but for the colourity sensation of human eye, the visual effect of this form and other yuv video forms are very approaching, and due to chrominance information still less, its overall the video data volume is less, and therefore YUV420 video format is selected (to see Iain E.G.Richardson.Video Codec Design.John Wiley & Sons Ltd.2002 as the input of Video coding by a lot of video encoding standards; See again Atul Puri, Xuemin Chen, H.264/MPEG-4 AVCcompression standard.Signal Processing:Image Communication 19 (2004) 793-849 of Ajay Luthra.Video coding using the), be widely used in the fields such as Digital Television, video conference, DVR.
Computer desktop video is that computer desktop vision signal is gathered to the video data that storage obtains, for recording the operation of computer desktop and carrying out situation.Because resolution and the refreshing frequency of computer desktop are all higher, the computer desktop the video data volume directly gathering is huge.Therefore need computer desktop video to carry out compression coding to reduce the data volume of storage.Under normal circumstances, carrying out before the coding of computer desktop video, to be first that YUV444 video format (is shown in Keith Jack.Video Demystified:A Handbook for the Digital Engineer.LLH Technology Publishing by the rgb video such as RGB888 or the RGB565 format conversion directly gathering, 2001), then be the YUV420 video format that is more suitable for generic video encoder input by YUV444 video format conversion.The conversion method that the YUV444 form that generic video is conventional turns YUV420 form mainly contains two kinds, a kind of is the method that directly extracts 1 chromatic component data in 4 chromatic component data from each 2x2 chromatic component data block, realize the conversion of YUV444 form to YUV420 form, another kind is the method for calculating the mean value of 4 chromatic component data in each 2x2 chroma data piece, obtain 1 corresponding chromatic component data, realize the conversion of YUV444 form to YUV420 form.On computer desktop screen, have more bulk and bar-shaped zone, often there is identical color, and the visual importance with same color is higher, and in desktop screen, there is more single pixel lines and character data, although it is low that conventional direct extraction and the YUV444 directly averaging turn the method amount of calculation of YUV420, but due to the conversion of all chrominance block is all adopted to single processing, make chrominance information loss more, the chromaticity deviation of the lines of desktop video and word is larger, can not meet the computer desktop videograph application higher to colourity effect requirements completely.This paper is for the feature of computer desktop video data, the YUV444 that proposes a kind of computer desktop video based on chrominance information classification turns the format conversion method of YUV420, the YUV420 computer desktop video obtaining keeps more chrominance information than the YUV420 computer desktop video of taking direct extraction and direct mean value method to obtain, for the compression of computer desktop video provides the YUV420 form input video with good colourity quality, to improve the picture quality of compression rear video stream.
Summary of the invention
In order to overcome, existing YUV444 turns the direct abstracting method of YUV420 computer desktop video format and the method for directly averaging is single to chromatic component conversion process, cause chrominance information to lose more problem, the invention provides the format conversion method that a kind of computer desktop YUV video 444 based on chrominance information classification turns YUV420, can make the desktop video of changing rear YUV420 form keep more chrominance information, for the compression of computer desktop video provides the YUV420 form input video with good colourity quality, to improve the picture quality of the rear computer desktop video flowing of compression.
For the technical scheme that solves the problems of the technologies described above employing is:
Computer desktop YUV video 444 based on chrominance information classification turns a format conversion method of YUV420, and described format conversion method comprises the following steps:
(1) input one frame YUV444 video formatted data to be converted;
(2) take out a non-switched 2x2 chromatic component data block, use P 1, P 2, P 3and P 4represent that current 2x2 chromatic component data block is by from top to bottom and from left to right tactic 4 chromatic component data, i.e. P 1the chromatic component data in the upper left corner of 2x2 chromatic component data block, P 2the chromatic component data in the upper right corner of 2x2 chromatic component data block, P 3the chromatic component data in the lower left corner of 2x2 chromatic component data block, P 4the chromatic component data in the lower right corner of 2x2 chromatic component data block; Described 2x2 chromatic component data block is the 2x2 data block of colourity U component type or the 2x2 data block of colourity V component type;
(3) determine type under this 2x2 chromatic component data block according to the data relation of equality between 4 chromatic component data in 2x2 chromatic component data block, then according to affiliated type, 2x2 chromatic component data block is converted to 1 the chromatic component data P corresponding with YUV420 form t, detailed process is as follows:
Data relation of equality between 4 chromatic component data of 2x2 chromatic component data block is divided into 5 kinds of situations: 1) four chromatic component data are all unequal each other; 2) only have two chromatic component data to equate, remain between two chromatic component data unequally, and it is all unequal to remain the chromatic component data that two chromatic component data equate with two respectively; 3) two pairs of colourity component datas equate, but unequal between two pairs of colourity component datas; 4) among four chromatic component data, have three chromatic component data equate, another chromatic component data and other three unequal; 5) between four chromatic component data, all equate;
These 5 kinds of situations are classified, by above-mentioned situation 1) and 5) be classified as a class, be designated as a class, for the processing of this class, adopt four chromatic component data are directly averaged and obtained a chromatic component data P corresponding with YUV420 form tmethod; By situation 2) be classified as a class, be designated as b class, for this class, give the overall weight of two equal chromatic component data 0.70, two other and other chromatic component data all unequal chromatic component data give 0.15 weight separately, then according to distributed weight, four chromatic component data are weighted on average, obtain a chromatic component data P corresponding with YUV420 form t; By situation 3) be classified as a class, be designated as c class, for this class, determine the weight of distributing according to the difference of the chromatic component data of contrast 2x2 chromatic component data block and its spatial neighbor, then according to the weight of distributing, four chromatic component data are weighted on average, obtain a chromatic component data P corresponding with YUV420 form t; By situation 4) be classified as a class, be designated as d class, for this class, give the overall weight of the chromatic component data 0.85 that three chromatic component data values are equal, another one chromatic component data give 0.15 weight, then according to distributed weight, four chromatic component data are weighted on average, obtain the chromatic component value P corresponding with YUV420 form t;
(4) take out next non-switched 2x2 chromatic component data block, repeating step (2)-(3), until all 2x2 chromatic component data blocks of present frame are changed complete;
(5) take out all luminance component data of this frame video data obtaining in step (1), be combined as YUV420 form computer desktop video data with the chromatic component data after conversion by step (2)-(4) obtain.
Further, in described step (3), the concrete format conversion of every class 2x2 chromatic component data block is as follows:
For the 2x2 chromatic component data block that belongs to a class, calculate the chromatic component value P corresponding with YUV420 form according to formula (I) t:
P T=0.25*(P 1+P 2+P 3+P 4) (I)
For the 2x2 chromatic component data block that belongs to b class, calculate the chromatic component value P corresponding with YUV420 form according to formula (II) t:
P T=0.70*X 1+0.15*X 2+0.15*X 3 (II)
X in formula (II) 1represent P 1, P 2, P 3and P 4in equate that to chromatic component data in colourity component data, X 2and X 3represent respectively two other respectively with all unequal chromatic component data of other chromatic component data value, give X 1the overall weight of distribution be 0.70, give X 2and X 3distribute separately 0.15 weight;
For the 2x2 chromatic component data block that belongs to c class, first determine the distribution situation of two pairs of equal chromatic component data, be divided into 3 kinds of situations, the first situation is that two chromatic component data that are positioned at the first row equate, two chromatic component data that are positioned at the second row equate; The second situation is that two chromatic component data that are positioned at first row equate, two chromatic component data that are positioned at secondary series equate; The third situation is that the chromatic component data that are positioned at the upper left corner equate with the chromatic component data that are positioned at the lower right corner, and the chromatic component data that are positioned at the upper right corner equate with the chromatic component data that are positioned at the lower left corner;
Note T 1and T 2two chromatic component data that from left to right arrange the top of current 2x2 chromatic component data block, B 1and B 2two chromatic component data that from left to right arrange the below of current 2x2 chromatic component data block, L 1and L 2two chromatic component data of arranging from top to bottom on the left side of current 2x2 chromatic component data block, R 1and R 2two chromatic component data of arranging from top to bottom on the right of current 2x2 chromatic component data block;
For the first situation in c class, two chromatic component data of the first row that calculating is positioned at current 2x2 chromatic component data block (are P 1and P 2) (be T with being positioned at the chromatic component data of top separately 1and T 2) absolute difference and D 1, shown in (III); Calculating two chromatic component data that are positioned at current 2x2 chromatic component data block the second row again (is P 3and P 4) (be B with being positioned at the chromatic component data of below separately 1and B 2) absolute difference and D 2, shown in (IV); Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V):
D 1=|P 1-T 1|+|P 2-T 2| (III)
D 2=|P 3-B 1|+|P 4-B 2| (IV)
P T=0.70*X 1+0.30*X 2 (V)
In formula (V), X 1that that represents to be assigned with 0.70 overall weight is to chromatic component data in colourity component data, X 2that that represents to be assigned with 0.30 overall weight is to chromatic component data in colourity component data; If current 2x2 chromatic component data block does not exist top (there is not T in chromatic component data 1and T 2), or do not exist below chromatic component data (not have B 1and B 2), or D 1and D 2while equating, adopt the conversion method of directly getting average identical with a class, shown in (I);
For the second situation in c class, two chromatic component data calculating the first row that is positioned at current 2x2 chromatic component data block (are P 1and P 3) (be L with being positioned at the chromatic component data of left separately 1and L 2) absolute difference and D 3, shown in (VI); Two chromatic component data calculating again the secondary series that is positioned at current 2x2 chromatic component data block (are P 2and P 4) (be R with being positioned at separately right-hand chromatic component data 1and R 2) absolute difference and D 4, shown in (VII); Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V); If current 2x2 chromatic component data block does not exist left chromatic component data (not have L 1and L 2), or do not exist right-hand chromatic component data (not have R 1and R 2), or D 3and D 4while equating, adopt the conversion method of directly getting average identical with a class, shown in (I);
D 3=|P 1-L 1|+|P 3-L 2| (VI)
D 4=|P 2-R 1|+|P 4-R 2| (VII)
For the third situation in c class, calculate the lower left corner chromatic component data P that is positioned at current 2x2 chromatic component data block 3with upper right corner chromatic component data P 2respectively with upper left corner chromatic component data P 1be positioned at P 2the chromatic component data T of top 2absolute difference and D 5, shown in (VIII); Calculate again the lower right corner chromatic component data P that is positioned at current 2x2 chromatic component data block 4with upper left corner chromatic component data P 1respectively with upper right corner chromatic component data P 2be positioned at P 1the chromatic component data T of top 1absolute difference and D 6, shown in (IX).Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V).If current 2x2 chromatic component data block does not exist top (there is not T in chromatic component data 1and T 2) or D 5and D 6while equating, adopt the conversion method of directly getting average identical with a class, shown in (I);
D 5=|P 3-P 1|+|P 2-T 2| (VIII)
D 6=|P 4-P 2|+|P 1-T 1| (IX)
For the 2x2 chromatic component data block that belongs to d class, calculate the chromatic component data P corresponding with YUV420 form according to formula (X) t:
P T=0.85*X 1+0.15*X 2 (X)
X in formula (X) 1represent P 1, P 2, P 3and P 4in equate three chromatic component data in chromatic component data, X 2represent and all unequal chromatic component data of other three chromatic component data, distribute to X 1overall weighted value be 0.85, X 2distribute 0.15 weighted value.
The technical conceive of this method is: because existing YUV444 turns the direct abstracting method of YUV420 computer desktop video format and the method for directly averaging is too single, cause the chrominance information loss of conversion rear video larger, therefore this method, through the data relation of equality in 2x2 chromatic component data block is analyzed, is distributed to 4 weights that chromatic component data are different to different relation of equality.In 5 kinds of situations of relation of equality, situation 1 is that 4 chromatic component data values are all unequal, gives the weight that they are some or certain some chromatic component data is larger or less all improper, and the ratio that this situation occurs is less; Situation 5 is that the value of 4 chromatic component data equates, allows the chromatic component value of YUV420 and the chromatic component data value of YUV444 after conversion equate, it is comparatively rational therefore above two kinds of situations (being a class) being adopted to the method for averaging.Situation 3(is c class) be to have two pairs of colourity component datas to equate, this very common in computer desktop video data (in many single pixel lines and word, all can occur), this method conducts in-depth analysis to situation 3, distributes weight separately according to the difference size of every pair of colourity component data and its proximity data.Situation 2(is b class) and situation 4(be d class) in, owing to having 2 or 3 chromatic component data that data value is equal in 4 chromatic component data, the number of these data is greater than the number of other chromatic component data, therefore, for these situations, give the data that chromatic component data value is equal larger weight.
Compared with prior art, this method has following beneficial effect:
This method provides a kind of computer desktop YUV video 444 based on chrominance information classification to turn the format conversion method of YUV420.The method is applicable to the computer desktop video format conversion of YUV444 form to YUV420 form, compared with prior art, there is following characteristics and advantage: first classify according to the relation of equality between 4 chromatic component data, determine corresponding conversion method according to affiliated type again, make the computer desktop video of changing rear YUV420 form keep more chrominance information, for the compression of computer desktop video provides the YUV420 form input video with good colourity quality, to improve the picture quality of compression rear video stream.
Brief description of the drawings
Fig. 1 is the block diagram that a kind of computer desktop YUV video 444 based on chrominance information classification turns the format conversion method of YUV420.
Fig. 2 is the position view of current 2x2 chromatic component data block and contiguous colourity component data thereof.
Embodiment
Describe the present invention in detail below in conjunction with embodiment and accompanying drawing.
Hereinafter described Y component is the luminance component in vision signal YUV color space, and U and V component are two chromatic components in vision signal YUV color space.
As shown in Figure 1, a kind of computer desktop YUV video 444 based on chrominance information classification turns the format conversion method of YUV420, comprises the following steps:
(1) input one frame YUV444 video formatted data to be converted.
(2) take out a non-switched 2x2 chromatic component data block.Use P 1, P 2, P 3and P 4represent that current 2x2 chromatic component data block is by from top to bottom and from left to right tactic 4 chromatic component data, i.e. P 1the chromatic component data in the upper left corner of 2x2 chromatic component data block, P 2the chromatic component data in the upper right corner of 2x2 chromatic component data block, P 3the chromatic component data in the lower left corner of 2x2 chromatic component data block, P 4the chromatic component data in the lower right corner of 2x2 chromatic component data block.Described 2x2 chromatic component data block is the 2x2 data block of colourity U component type or the 2x2 data block of colourity V component type.
(3) determine type under this 2x2 chromatic component data block according to the data relation of equality between 4 chromatic component data in 2x2 chromatic component data block, then according to affiliated type, 2x2 chromatic component data block is converted to 1 the chromatic component data P corresponding with YUV420 form t.
Divide 5 kinds of situations by the data relation of equality between 4 chromatic component data of 2x2 chromatic component data block: 1) four chromatic component data are all unequal each other; 2) only have two chromatic component data to equate, remain between two chromatic component data unequally, and it is all unequal to remain the chromatic component data that two chromatic component data equate with two respectively; 3) two pairs of colourity component datas equate, but unequal between two pairs of colourity component datas; 4) among four chromatic component data, have three chromatic component data equate, another chromatic component data and other three unequal; 5) between four chromatic component data, all equate.
This method is classified to these 5 kinds of situations, and above-mentioned situation 1 and 5 is classified as to a class, is designated as a class, for the processing of this class, adopts four chromatic component data are directly averaged and obtained a chromatic component data P corresponding with YUV420 form tmethod; Situation 2 is classified as to a class, be designated as b class, for this class, rule of thumb give the overall weight of two equal chromatic component data 0.70, two other and other chromatic component data all unequal chromatic component data give 0.15 weight separately, then according to distributed weight, four chromatic component data are weighted on average, obtain a chromatic component data P corresponding with YUV420 form t; Situation 3 is classified as to a class, be designated as c class, for this class, determine the weight of distributing according to the difference of the chromatic component data of contrast 2x2 chromatic component data block and its spatial neighbor, then according to the weight of distributing, four chromatic component data are weighted on average, obtain a chromatic component data P corresponding with YUV420 form t; Situation 4 is classified as to a class, be designated as d class, for this class, rule of thumb give the overall weight of the chromatic component data 0.85 that three chromatic component data values are equal, another one chromatic component data give 0.15 weight, then according to distributed weight, four chromatic component data are weighted on average, obtain the chromatic component value P corresponding with YUV420 form t.The concrete format conversion of every class 2x2 chromatic component data block is as follows:
For the 2x2 chromatic component data block that belongs to a class, calculate the chromatic component value P corresponding with YUV420 form according to formula (I) t:
P T=0.25*(P 1+P 2+P 3+P 4) (I)
For the 2x2 chromatic component data block that belongs to b class, calculate the chromatic component value P corresponding with YUV420 form according to formula (II) t:
P T=0.70*X 1+0.15*X 2+0.15*X 3 (II)
X in formula (II) 1represent P 1, P 2, P 3and P 4in equate that to chromatic component data in colourity component data, X 2and X 3represent respectively two other respectively with all unequal chromatic component data of other chromatic component data value, give X 1the overall weight of distribution be 0.70, give X 2and X 3distribute separately 0.15 weight.
For the 2x2 chromatic component data block that belongs to c class, first determine the distribution situation of two pairs of equal chromatic component data, this wherein only has 3 kinds of situations, and the one, two chromatic component data that are positioned at the first row are equal, and two chromatic component data that are positioned at the second row equate; The 2nd, two chromatic component data that are positioned at first row are equal, and two chromatic component data that are positioned at secondary series equate; The 3rd, the chromatic component data that are positioned at the upper left corner equate with the chromatic component data that are positioned at the lower right corner, and the chromatic component data that are positioned at the upper right corner equate with the chromatic component data that are positioned at the lower left corner.Note T 1and T 2two chromatic component data that from left to right arrange the top of current 2x2 chromatic component data block, B 1and B 2two chromatic component data that from left to right arrange the below of current 2x2 chromatic component data block, L 1and L 2two chromatic component data of arranging from top to bottom on the left side of current 2x2 chromatic component data block, R 1and R 2two chromatic component data of arranging from top to bottom on the right of current 2x2 chromatic component data block, concrete distribution as shown in Figure 2.
For the first situation in c class, two chromatic component data of the first row that calculating is positioned at current 2x2 chromatic component data block (are P 1and P 2) (be T with being positioned at the chromatic component data of top separately 1and T 2) absolute difference and D 1, shown in (III); Calculating two chromatic component data that are positioned at current 2x2 chromatic component data block the second row again (is P 3and P 4) (be B with being positioned at the chromatic component data of below separately 1and B 2) absolute difference and D 2, shown in (IV).Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V):
D 1=|P 1-T 1|+|P 2-T 2| (III)
D 2=|P 3-B 1|+|P 4-B 2| (IV)
P T=0.70*X 1+0.30*X 2 (V)
In formula (V), X 1that that represents to be assigned with 0.70 overall weight is to chromatic component data in colourity component data, X 2that that represents to be assigned with 0.30 overall weight is to chromatic component data in colourity component data.If current 2x2 chromatic component data block does not exist top (there is not T in chromatic component data 1and T 2), or do not exist below chromatic component data (not have B 1and B 2), or D 1and D 2while equating, adopt the conversion method of directly getting average identical with a class, shown in (I).
For the second situation in c class, two chromatic component data calculating the first row that is positioned at current 2x2 chromatic component data block (are P 1and P 3) (be L with being positioned at the chromatic component data of left separately 1and L 2) absolute difference and D 3, shown in (VI); Two chromatic component data calculating again the secondary series that is positioned at current 2x2 chromatic component data block (are P 2and P 4) (be R with being positioned at separately right-hand chromatic component data 1and R 2) absolute difference and D 4, shown in (VII).Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V).If current 2x2 chromatic component data block does not exist left chromatic component data (not have L 1and L 2), or do not exist right-hand chromatic component data (not have R 1and R 2), or D 3and D 4while equating, adopt the conversion method of directly getting average identical with a class, shown in (I).
D 3=|P 1-L 1|+|P 3-L 2| (VI)
D 4=|P 2-R 1|+|P 4-R 2| (VII)
For the third situation in c class, calculate the lower left corner chromatic component data P that is positioned at current 2x2 chromatic component data block 3with upper right corner chromatic component data P 2respectively with upper left corner chromatic component data P 1be positioned at P 2the chromatic component data T of top 2absolute difference and D 5, shown in (VIII); Calculate again the lower right corner chromatic component data P that is positioned at current 2x2 chromatic component data block 4with upper left corner chromatic component data P 1respectively with upper right corner chromatic component data P 2be positioned at P 1the chromatic component data T of top 1absolute difference and D 6, shown in (IX).Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V).If current 2x2 chromatic component data block does not exist top (there is not T in chromatic component data 1and T 2) or D 5and D 6while equating, adopt the conversion method of directly getting average identical with a class, shown in (I).
D 5=|P 3-P 1|+|P 2-T 2| (VIII)
D 6=|P 4-P 2|+|P 1-T 1| (IX)
For the 2x2 chromatic component data block that belongs to d class, calculate the chromatic component data P corresponding with YUV420 form according to formula (X) t:
P T=0.85*X 1+0.15*X 2 (X)
X in formula (X) 1represent P 1, P 2, P 3and P 4in equate three chromatic component data in chromatic component data, X 2represent and all unequal chromatic component data of other three chromatic component data, distribute to X 1overall weighted value be 0.85, X 2distribute 0.15 weighted value.
(4) take out next non-switched 2x2 chromatic component data block, repeating step (2)-(3), until all 2x2 chromatic component data blocks of present frame are changed complete.
(5) take out all luminance component data of this frame video data obtaining in (1), be combined as YUV420 form computer desktop video data with the chromatic component data after conversion by step (2)-(4) obtain.

Claims (1)

1. the computer desktop YUV video 444 based on chrominance information classification turns a format conversion method of YUV420, it is characterized in that: described format conversion method comprises the following steps:
(1) input one frame YUV444 video formatted data to be converted;
(2) take out a non-switched 2x2 chromatic component data block, use P 1, P 2, P 3and P 4represent that current 2x2 chromatic component data block is by from top to bottom and from left to right tactic 4 chromatic component data, i.e. P 1the chromatic component data in the upper left corner of 2x2 chromatic component data block, P 2the chromatic component data in the upper right corner of 2x2 chromatic component data block, P 3the chromatic component data in the lower left corner of 2x2 chromatic component data block, P 4be the chromatic component data in the lower right corner of 2x2 chromatic component data block, described 2x2 chromatic component data block is the 2x2 data block of colourity U component type or the 2x2 data block of colourity V component type;
(3) determine type under this 2x2 chromatic component data block according to the data relation of equality between 4 chromatic component data in 2x2 chromatic component data block, then according to affiliated type, 2x2 chromatic component data block is converted to 1 the chromatic component data P corresponding with YUV420 form t, detailed process is as follows:
Data relation of equality between 4 chromatic component data of 2x2 chromatic component data block is divided into 5 kinds of situations: 1) four chromatic component data are all unequal each other; 2) only have two chromatic component data to equate, remain between two chromatic component data unequally, and it is all unequal to remain the chromatic component data that two chromatic component data equate with two respectively; 3) two pairs of colourity component datas equate, but unequal between two pairs of colourity component datas; 4) among four chromatic component data, have three chromatic component data equate, another chromatic component data and other three unequal; 5) between four chromatic component data, all equate;
These 5 kinds of situations are classified, by above-mentioned situation 1) and 5) be classified as a class, be designated as a class, for the processing of this class, adopt four chromatic component data are directly averaged and obtained a chromatic component data P corresponding with YUV420 form tmethod; By situation 2) be classified as a class, be designated as b class, for this class, give the overall weight of two equal chromatic component data 0.70, two other and other chromatic component data all unequal chromatic component data give 0.15 weight separately, then according to distributed weight, four chromatic component data are weighted on average, obtain a chromatic component data P corresponding with YUV420 form t; By situation 3) be classified as a class, be designated as c class, for this class, determine the weight of distributing according to the difference of the chromatic component data of contrast 2x2 chromatic component data block and its spatial neighbor, then according to the weight of distributing, four chromatic component data are weighted on average, obtain a chromatic component data P corresponding with YUV420 form t; By situation 4) be classified as a class, be designated as d class, for this class, give the overall weight of the chromatic component data 0.85 that three chromatic component data values are equal, another one chromatic component data give 0.15 weight, then according to distributed weight, four chromatic component data are weighted on average, obtain the chromatic component value P corresponding with YUV420 form t;
In described step (3), the concrete format conversion of every class 2x2 chromatic component data block is as follows:
For the 2x2 chromatic component data block that belongs to a class, calculate the chromatic component value P corresponding with YUV420 form according to formula (I) t:
P T=0.25*(P 1+P 2+P 3+P 4) (I)
For the 2x2 chromatic component data block that belongs to b class, calculate the chromatic component value P corresponding with YUV420 form according to formula (II) t:
P T=0.70*X 1+0.15*X 2+0.15*X 3 (II)
X in formula (II) 1represent P 1, P 2, P 3and P 4in equate that to chromatic component data in colourity component data, X 2and X 3represent respectively two other respectively with all unequal chromatic component data of other chromatic component data value, give X 1the overall weight of distribution be 0.70, give X 2and X 3distribute separately 0.15 weight;
For the 2x2 chromatic component data block that belongs to c class, first determine the distribution situation of two pairs of equal chromatic component data, be divided into 3 kinds of situations, the first situation is that two chromatic component data that are positioned at the first row equate, two chromatic component data that are positioned at the second row equate; The second situation is that two chromatic component data that are positioned at first row equate, two chromatic component data that are positioned at secondary series equate; The third situation is that the chromatic component data that are positioned at the upper left corner equate with the chromatic component data that are positioned at the lower right corner, and the chromatic component data that are positioned at the upper right corner equate with the chromatic component data that are positioned at the lower left corner;
Note T 1and T 2two chromatic component data that from left to right arrange the top of current 2x2 chromatic component data block, B 1and B 2two chromatic component data that from left to right arrange the below of current 2x2 chromatic component data block, L 1and L 2two chromatic component data of arranging from top to bottom on the left side of current 2x2 chromatic component data block, R 1and R 2two chromatic component data of arranging from top to bottom on the right of current 2x2 chromatic component data block;
For the first situation in c class, calculate the first row two chromatic component data, i.e. P of being positioned at current 2x2 chromatic component data block 1and P 2with the chromatic component data that are positioned at separately top, i.e. T 1and T 2absolute difference and D 1, shown in (III); Calculate again two chromatic component data, i.e. P being positioned at current 2x2 chromatic component data block the second row 3and P 4with the chromatic component data that are positioned at separately below, i.e. B 1and B 2absolute difference and D 2, shown in (IV); Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V):
D 1=|P 1-T 1|+|P 2-T 2| (III)
D 2=|P 3-B 1|+|P 4-B 2| (IV)
P T=0.70*X 1+0.30*X 2 (V)
In formula (V), X 1that that represents to be assigned with 0.70 overall weight is to chromatic component data in colourity component data, X 2that that represents to be assigned with 0.30 overall weight is to chromatic component data in colourity component data; If current 2x2 chromatic component data block does not exist top chromatic component data, there is not T 1and T 2, or there are not below chromatic component data, there is not B 1and B 2, or D 1and D 2while equating, adopt the conversion method of directly getting average identical with a class, shown in (I);
For the second situation in c class, calculate two chromatic component data, i.e. P of the first row that is positioned at current 2x2 chromatic component data block 1and P 3be positioned at the chromatic component data of left separately, i.e. L 1and L 2absolute difference and D 3, shown in (VI); Calculate again two chromatic component data, i.e. P of the secondary series that is positioned at current 2x2 chromatic component data block 2and P 4be positioned at separately right-hand chromatic component data, i.e. R 1and R 2absolute difference and D 4, shown in (VII); Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V); If current 2x2 chromatic component data block does not exist left chromatic component data, there is not L 1and L 2, or there are not right-hand chromatic component data, there is not R 1and R 2, or D 3and D 4while equating, adopt the conversion method of directly getting average identical with a class, shown in (I);
D 3=|P 1-L 1|+|P 3-L 2| (VI)
D 4=|P 2-R 1|+|P 4-R 2| (VII)
For the third situation in c class, calculate the lower left corner chromatic component data P that is positioned at current 2x2 chromatic component data block 3with upper right corner chromatic component data P 2respectively with upper left corner chromatic component data P 1be positioned at P 2the chromatic component data T of top 2absolute difference and D 5, shown in (VIII); Calculate again the lower right corner chromatic component data P that is positioned at current 2x2 chromatic component data block 4with upper left corner chromatic component data P 1respectively with upper right corner chromatic component data P 2be positioned at P 1the chromatic component data T of top 1absolute difference and D 6, shown in (IX); Relatively two absolute difference and size, give the overall weight of absolute difference and larger a pair of chromatic component data allocations 0.70, give the overall weight of absolute difference and less a pair of chromatic component data allocations 0.30, shown in (V), if current 2x2 chromatic component data block does not exist top chromatic component data, there is not T 1and T 2, or D 5and D 6while equating, adopt the conversion method of directly getting average identical with a class, shown in (I);
D 5=|P 3-P 1|+|P 2-T 2| (VIII)
D 6=|P 4-P 2|+|P 1-T 1| (IX)
For the 2x2 chromatic component data block that belongs to d class, calculate the chromatic component data P corresponding with YUV420 form according to formula (X) t:
P T=0.85*X 1+0.15*X 2 (X)
X in formula (X) 1represent P 1, P 2, P 3and P 4in equate three chromatic component data in chromatic component data, X 2represent and all unequal chromatic component data of other three chromatic component data, distribute to X 1overall weighted value be 0.85, X 2distribute 0.15 weighted value;
(4) take out next non-switched 2x2 chromatic component data block, repeating step (2)-(3), until all 2x2 chromatic component data blocks of present frame are changed complete;
(5) take out all luminance component data of this frame video data obtaining in step (1), be combined as YUV420 form computer desktop video data with the chromatic component data after conversion by step (2)-(4) obtain.
CN201210254360.5A 2012-07-20 2012-07-20 Format conversion method for computer desktop video from YUV444 to YUV420 based on chrominance information classification Active CN102801987B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210254360.5A CN102801987B (en) 2012-07-20 2012-07-20 Format conversion method for computer desktop video from YUV444 to YUV420 based on chrominance information classification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210254360.5A CN102801987B (en) 2012-07-20 2012-07-20 Format conversion method for computer desktop video from YUV444 to YUV420 based on chrominance information classification

Publications (2)

Publication Number Publication Date
CN102801987A CN102801987A (en) 2012-11-28
CN102801987B true CN102801987B (en) 2014-08-27

Family

ID=47200942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210254360.5A Active CN102801987B (en) 2012-07-20 2012-07-20 Format conversion method for computer desktop video from YUV444 to YUV420 based on chrominance information classification

Country Status (1)

Country Link
CN (1) CN102801987B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024403B (en) * 2012-12-31 2015-06-03 Tcl集团股份有限公司 Conversion method and device for data format of video
CN104104897B (en) * 2014-06-27 2018-10-23 北京奇艺世纪科技有限公司 A kind of video editing method and device of mobile terminal
CN107172406A (en) * 2017-04-21 2017-09-15 西安诺瓦电子科技有限公司 Image processing method and device
CN110798705A (en) * 2018-08-01 2020-02-14 深信服科技股份有限公司 Video image transmission method, device and equipment
CN113538607B (en) * 2021-09-15 2021-12-24 北京小鸟科技股份有限公司 YUV image conversion method and system based on invariance of Y component of artificial image

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7002627B1 (en) * 2002-06-19 2006-02-21 Neomagic Corp. Single-step conversion from RGB Bayer pattern to YUV 4:2:0 format
CN102118624A (en) * 2011-03-08 2011-07-06 天脉聚源(北京)传媒科技有限公司 Method for converting an image from an RGB color space to a YUV color space

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7002627B1 (en) * 2002-06-19 2006-02-21 Neomagic Corp. Single-step conversion from RGB Bayer pattern to YUV 4:2:0 format
CN102118624A (en) * 2011-03-08 2011-07-06 天脉聚源(北京)传媒科技有限公司 Method for converting an image from an RGB color space to a YUV color space

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Emil Dumic ET AL.Image Quality of 4:2:2 and 4:2:0 Chroma Subsampling Formats.《IEEE XPLORE DIGITAL LIBRARY》.2009,19-24.
Image Quality of 4:2:2 and 4:2:0 Chroma Subsampling Formats;Emil Dumic ET AL;《IEEE XPLORE DIGITAL LIBRARY》;20090930;19-24 *
何彪.手机中的图像压缩编解码软件实现技术研究.《CNKI中国优秀硕士学位论文全文数据库信息科技缉》.2011,24-32.
手机中的图像压缩编解码软件实现技术研究;何彪;《CNKI中国优秀硕士学位论文全文数据库信息科技缉》;20111231;24-32 *

Also Published As

Publication number Publication date
CN102801987A (en) 2012-11-28

Similar Documents

Publication Publication Date Title
CN102801987B (en) Format conversion method for computer desktop video from YUV444 to YUV420 based on chrominance information classification
CN102801988B (en) Video format conversion method of converting YUV444 to YUV420 based on chrominance component amplitude
TWI629892B (en) Rgb to yuv format conversion and inverse conversion method and circuit for depth packing and depacking
CN102881026B (en) Palette device and generation method for image with transparency information
US20060170798A1 (en) Method for color filter array interpolation using color correlation similarity and multi-direction edge information
CN101556791B (en) Method for converting and processing format of YCbCr data captured and driven by DSP video
CN104618703A (en) White balance adjusting method
EP4195655A1 (en) Video processing method, video processing device, and display device
CN101505432B (en) Chroma enhancing system and method
CN101500066B (en) Method and system for image sampling format conversion
CN103456280A (en) Method for displaying RGB color image
CN101923455B (en) Method for displaying and analyzing digital image in YUV format
Monteiro et al. Light field image coding with flexible viewpoint scalability and random access
CN108305216A (en) A kind of image magnification method of bilateral four interpolation
CN106408617B (en) Interactive single image material obtaining system and method based on YUV color space
CN110719484B (en) Image processing method
WO2021007742A1 (en) Compression method for obtaining video file, decompression method, system, and storage medium
CN204929035U (en) High -definition audio and video collector
WO2023279560A1 (en) Method for implementing coding and decoding of yuv444 image on basis of h.265
EP2956928B1 (en) Video conversion technology
CN102075750B (en) Method, device and system for encoding and decoding videos of red green and blue (RGB) space
CN1538748A (en) Method of interleave and line by line conversion of mixing two dimensional and three dimensional
CN103533322A (en) Method for transcoding YUV frame to RGB frame and device thereof
CN2922341Y (en) Video meeting terminal capable of realizing high-definition rideo signal input and output
CN101877794B (en) Method for promoting picture quality and color compensating device and image processing device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant