In the following preferred embodiment that discloses, among code presupposition generator and compensation codes generator, one of them uses and inspects table unit (Look-up table unit) at least.If code presupposition generator and compensation codes generator can use the single table unit of inspecting simultaneously, can be better.
As shown in Figure 1, it is first preferred embodiment of color space conversion apparatus of the present invention, comprise a multiplexer 1, one code presupposition generator 2, one compensation codes generator 3, one comprises shift unit 41,43, adder 42,45,46 and the linear combination member of subtracter 44, one first latch 5, one second latch 6, one the 3rd latch 7, one quad latch 8, one first output combining unit 9, one second output combining unit 10 and one the 3rd output combining unit 11, this first output combining unit 9, the second output combining unit 10 and the 3rd output combining unit 11 can be referred to as the output combining unit.And this shift unit 41,43, adder 42,45,46, the detailed implementation detail of subtracter 44 and latch 5,6,7,8 is the circuit engineerings that belong to general, so no longer be described in detail at this.
This multiplexer 1 receives numeral input chrominance color spaces signal Cb and Cr, and responds clock signal (timing select signals) tu and tv, and output Cb or one of them chrominance color spaces signal of Cr.From the chrominance color spaces signal that this multiplexer 1 sends, pass to this code presupposition generator 2 and this compensation codes generator 3, to produce default hand over word and compensation hand over word.
In the present invention's first preferred embodiment, this compensation hand over word is with 0.013 (C-128) expression, be the conversion value of compensation term, and default hand over word is with 1.402 (C-128) expression, is default conversion value.Wherein C when the tu sequential, represents Cb chrominance color spaces signal, when the tv sequential, represents Cr chrominance color spaces signal.If use U and V to replace Cb and Cr, with expression input chrominance color spaces signal, then default hand over word and compensation hand over word become 1.402C and 0.013C respectively.Wherein C when the tu sequential, represents U chrominance color spaces signal, when the tv sequential, represents V chrominance color spaces signal.
As previously mentioned, the conversion formula of standard comprises four groups of initial colourity color items (Chrominance-in-colorterms), just 1.402 (Cr-128), 0.714 (Cr-128), 0.344 (Cb-128) and 1.772 (Cb-128).In the present invention, the conversion formula of standard (a.1) is to (a.3), can be by launching initial colourity color item, be rewritten into to include only default the linear combination with compensation term.
In the present invention's first preferred embodiment, a since initial colourity color item 1.402 (Cr-128) wherein, equaled default, be not need to launch again with this initial colourity color item 1.402 (Cr-128), and other initial colourity color item 0.714 (Cr-128), 0.344 (Cb-128) and 1.772 (Cb-128), and be not equal to default or compensation term, then can launch becomes:
0.714(Cr-128)-1/2(1.402)(Cr-128)+0.013(Cr-128)…(c.1)
0.344(Cb-128)=1/2[1/2(1.402)(Cb-128)+0.013(Cb-128)]-0.013(Cb-128)…(c.2)
1.772(Cb-128)=1.402(Cb-128)+1/2[1/2(1.402)(Cb-128)+0.013(Cb-128)]+0.013(Cb-128)…(c.3)
This linear combination member is to (c.3) according to above-mentioned expansion (c.1), will be from this code presupposition generator 2 and this compensation codes generator 3 and the default hand over word that comes is made up with the compensation hand over word, to obtain the conversion value of these initial colourity color items, allow the conversion of color space, as long as default hand over word of linear combination and compensation hand over word just can reach.Further content please be joined following explanation.
From the default hand over word of this code presupposition generator 2, just 1.402 (C-128) via this shift unit 41, carry out the right dislocation of arithmetic, will preset hand over word divided by two, obtain 1/2 (1.402 (C-128))=0.701 (C-128) value.Compensation hand over word from this compensation codes generator 3, also just become 0.013 (C-128),, add the output valve 0.701 (C-128) of this shift unit 41 through this adder 42, with when the tv sequential, C=Cr obtains the conversion value of initial colourity color item 0.714 (Cr-128).
The arithmetic right dislocation is carried out in the output 0.714 (C-128) of 43 pairs of these adders 42 of this shift unit, just divided by two, obtains exporting 0.357 (C-128).From the output valve 0.357 (C-128) of this shift unit 43, carry out subtractions through this subtracter 44, deduct 0.013 (C-128), with when the tu sequential, C=Cb obtains the conversion value of initial colourity color item 0.344 (Cb-128).
Default hand over word 1.402 (C-128) from this code presupposition generator 2.Pass through this adder 45 again, add 0.357 (C-128) output valve of this shift unit 43, obtain the output of 1.759 (C-128).From the compensation hand over word 0.013 (C-128) of this compensation codes generator 3, through this adder 46, add the output valve 1.759 (C-128) of this adder 45, when the tu sequential, C=Cb obtains the conversion value of initial colourity color item 1.772 (Cb-128).
This first latch 5 when the tv sequential, pins the default hand over word from this code presupposition generator 2, to obtain required Cr-in-R conversion value, and 1.402 (Cr-128) just.
This second latch 6 when the tv sequential, pins the output valve of this adder 42, to obtain required Cr-in-G conversion value, and 0.714 (Cr-128) just.
The 3rd latch 7, when the tu sequential, the output valve of pinning this subtracter 44, to obtain required Cb-in-G conversion value, 0.344 (Cb-128) just.
This quad latch 8 when the tu sequential, pins the output valve of this adder 46, to obtain required Cb-in-B conversion value, and 1.772 (Cb-128) just.
This first output combining unit 9 comprises an adder, adds the output valve and the digital Y luminance signal of this first latch 5, to obtain the R color space signal.
This second output combining unit 10 comprises an adder 101 and a subtracter 102, and this adder 101 is in order to add the output valve of this second latch 6 and the 3rd latch 7.This subtracter 102 is in order to deduct the output valve of this adder 101 from digital Y luminance signal, to obtain the G color space signal.
The 3rd output combining unit 11 comprises an adder, with output valve and the digital Y luminance signal that adds this quad latch 8, to obtain the B color space signal.
Just,, know by (a.1) with the R chrominance signal: R=Y+1.402 (Cr-128) that is with default hand over word 1.402 (C-128), when the tv sequential, add Y brightness, just can obtain.
For the G chrominance signal, by (a.2) G=Y-0.714 (Cr-128)-0.344 (Cb-128) as can be known, with initial colourity color item, behind the formula (c.1) and formula (c.2) of substitution with default item and compensation term expansion, obtain (Cr-128)-0.013 (Cr-128)-1/2[1/2 (1.402) (Cb-128)+0.013 (Cb-128) of G=Y-1/2 (1.402)]+0.013 (Cb-128), be exactly the output 1/2[1/2 (1.402) (Cb-128)+0.013 (Cb-128) of output [1/2 (1.402) (Cr-128)+0.013 (Cr-128)] the-the 3rd latch 7 of G=Y one second latch 6]-0.013 (Cb-128).And the like can obtain the B chrominance signal.So, as long as uses code presupposition and compensation codes to be base components, in addition linear combination, preface obtains the conversion value of initial colourity color item in due course, and the establishing criteria conversion formula adds the Y luminance signal again, just can finish the color space of YCbCr to RGB and change.
As shown in Figure 2, second preferred embodiment of color space signal conversion equipment of the present invention, this color space signal conversion equipment comprises that a multiplexer 1, code presupposition generator 21, a compensation codes generator 31, comprise shift unit 52,53, adder 55,56, the linear combination member of subtracter 51,54, one first latch 5, one second latch 6, one the 3rd latch 7, a quad latch 8, one first output combining unit 9, one second output combining unit 10 and one the 3rd output combining unit 11.
The present invention's second preferred embodiment is similar with above-mentioned first preferred embodiment haply, but, in the present invention's second preferred embodiment, default hand over word is to represent with 0.714 (C-128), conversion value for default, the compensation hand over word then still with 0.013 (C-128) expression, is the conversion value of compensation term.Wherein C when the tu sequential, represents Cb chrominance color spaces signal, when the tv sequential, represents Cr chrominance color spaces signal.If use U and V to replace Cb and Cr, with expression input chrominance color spaces signal, then default hand over word and compensation hand over word become 0.714C and 0.013C respectively.Wherein C when the tu sequential, represents U chrominance color spaces signal, when the tv sequential, represents V chrominance color spaces signal.
For the present invention's second preferred embodiment,, do not need to launch since initial colourity color item 0.714 (Cr-128) has equaled default.And because initial colourity color item 1.402 (Cr-128), 0.344 (Cb-128) and 1.772 (Cb-128), and be not equal to default or compensation term, then can launch becomes:
1.402(Cr-128)=2[0.714(Cr-128)-0.013(Cr-128)]
0.344(Cb-128)=1/2[0.714(Cb-128)]-0.013(Cb-128)
1.772(Cb-128)=2[0.714(Cb-128)-0.013(Cb-128)]+1/2[0.714(Cb-128)]+0.013(Cb-128)
This linear combination member is according to above-mentioned expansion, and the default hand over word and the combination of compensation hand over word that will come from this code presupposition generator 21 and this compensation codes generator 31 are to obtain the conversion value of these three initial colourity color items.
From the default hand over word of this code presupposition generator 21,, deduct compensation hand over word from this compensation codes generator 3 via this subtracter 51.This shift unit 52 is carried out the displacement of arithmetic left-hands, is one and multiply by two computing, with when the tv sequential, obtains the conversion value of initial colourity color item 1.402 (Cr-128).That is to say that the output valve of this first latch 5 is: 2*[0.714 (Cr-128)-0.013 (Cr-128)].And know R=Y+1.402 (Cr-128)=Y+2[0.714 (Cr-128)-0.013 (Cr-128) by (a.1)], just the output valve of first latch 5 adds the Y value, is the R value.
From the default hand over word of this code presupposition generator 21, carry out arithmetic right dislocation (just divided by two) via this shift unit 53.Default hand over word is passed through this subtracter 54 again by divided by after two, deducts the compensation hand over word from this compensation codes generator 31, and when the tu sequential, obtains the conversion value of initial colourity color item 0.344 (Cb-128).
This adder 55 adds the output valve from this shift unit 52 and 53.This adder 56 adds the output valve of this adder 55, and from the compensation hand over word of this compensation codes generator 31, when the tu sequential, obtains the conversion value of initial colourity color item 1.772 (Cb-128).
This first latch 5 in the tv sequential, pins the output valve of this shift unit 52, obtains the conversion value of required Cr-in-R, just 1.402 (Cr-128).
This second latch 6 in the tv sequential, pins the default hand over word from this code presupposition generator 21, to obtain the conversion value of Cr-in-G, and 0.714 (Cr-128) just.
The 3rd latch 7 in the tu sequential, pins the output valve of this subtracter 54, obtaining the conversion value of Cb-in-G, that is 0.344 (Cb-128).
This quad latch 8 in the tu sequential, pins the output valve of this adder 56, to obtain required Cb-in-B conversion value, and 1.772 (Cb-128) just
And this first to the 3rd output combining unit 9,10,11 etc., the effect as having as described above shown in the first embodiment of the invention, same as the prior art, so no longer be described in detail at this.As shown in Figure 3, be the 3rd preferred embodiment of color space signal conversion equipment of the present invention.In the present invention's the 3rd preferred embodiment, this color space signal conversion equipment comprises that a multiplexer 1, code presupposition generator 22, a compensation codes generator 32, comprise shift unit 62,63,65, the linear combination member of adder 66 and subtracter 61,64, one first latch 5, one second latch 6, one the 3rd latch 7, a quad latch 8, one first output combining unit 9, one second output combining unit 10 and one the 3rd output combining unit 11.
The present invention's the 3rd preferred embodiment and aforementioned these embodiment are roughly the same, but in the present invention's the 3rd preferred embodiment, default hand over word be made as 0.357 (C-128) and the compensation hand over word be made as 0.013 (C-128), C wherein, when the tu sequential, represent Cb chrominance color spaces signal, when the tv sequential, represent Cr chrominance color spaces signal.If use U and V to replace Cb and Cr, with expression input chrominance color spaces signal, then default hand over word and compensation hand over word become 0.357C and outer 0.013C respectively.Wherein C when the tu sequential, represents U chrominance color spaces signal, when the tv sequential, represents V chrominance color spaces signal.
Therefore, for the present invention's the 3rd preferred embodiment, initial colourity color item 1.402 (Cr-128), 0.714 (Cr-128), 0.344 (Cb-128) and I.772 (Cb-128), can launch becomes:
0.714(Cr-128)=2(0.357)(Cr-128)
1.402(Cr-128)=2[2(0.357)(Cr-128)-0.013(Cr-128)]
0.344(Cb-128)=0.357(Cb-128)-0.013(Cb-128)
1.772(Cb-128)=2[2(0.357)(Cb-128)]+0.357(Cb-128)-0.013(Cb-128)
This linear combination member is according to above-mentioned expansion, and the default hand over word and the combination of compensation hand over word that will come from this code presupposition generator 22 and this compensation codes generator 32 are to obtain the conversion value of initial colourity color item.
From the default hand over word of this code presupposition generator 22, through this shift unit 63, carry out the displacement of arithmetic left-hand, multiply by two will preset hand over word, in the tv sequential, obtain the conversion value of initial colourity color item 0.714 (Cr-128).
The output 0.714 (C-128) of this shift unit 63 through this subtracter 61, deducts the compensation hand over word from this compensation codes generator 32.This shift unit 62 is carried out the displacement of arithmetic left-hand, multiply by two with the output valve to this subtracter 61, in the tv sequential, obtains the conversion value of initial colourity color item 1.402 (Cr-128).
From the default hand over word of this code presupposition generator 22, deduct compensation hand over word through this subtracter 64 from this compensation codes generator 32, in the tu sequential, obtain the conversion value of initial colourity color item 0.344 (Cb-128).
This shift unit 65 to the output valve 0.714 (C-128) of this shift unit 63, is carried out arithmetic left-hand displacement (multiply by two).And this adder 66 adds and the output valve of this subtracter 64 and this shift unit 65 with in the tu sequential, obtains the conversion value of initial colourity color item 1.772 (Cb-128).
This first latch 5 in the tv sequential, pins the output valve of this shift unit 62, obtains the conversion value of required Cr-in-R, just 1.402 (Cr-128).
This second latch 6 in the tv sequential, pins the output valve of this shift unit 63, to obtain the conversion value of Cr-in-G, and 0.714 (Cr-128) just.
The 3rd latch 7 in the tu sequential, pins the output valve of this subtracter 64, to obtain the conversion value of Cb-in-G, and 0.344 (Cb-128) just.
This quad latch 8 in the tu sequential, pins the output valve of this adder 66, to obtain required Cb-in-B conversion value, and 1.772 (Cb-128) just.
And this first to the 3rd output combining unit 9,10,11 etc. acts on as having as described above shown in these embodiment, and is same as the prior art, so no longer be described in detail at this.
As shown in Figure 4, be the 4th preferred embodiment of color space signal conversion equipment.
In the present invention's the 4th preferred embodiment, the color space signal conversion equipment comprises that a multiplexer 1, code presupposition generator 23, a compensation codes generator 33, comprise shift unit 72,73,74, the linear combination member of adder 76, subtracter 71,75, one first latch 5, one second latch 6, one the 3rd latch 7, a quad latch 8, one first output combining unit 9, one second output combining unit 10 and one the 3rd output combining unit 11.
The present invention's the 4th preferred embodiment is roughly similar to the various embodiments described above.But in the present invention's the 4th preferred embodiment, default hand over word is made as 1.428 (C-128) and the compensation hand over word is made as 0.013 (C-128), C wherein, when the tu sequential, represent Cb chrominance color spaces signal, when the tv sequential, represent Cr chrominance color spaces signal.If use U and V to replace Cb and Cr, with expression input chrominance color spaces signal, then default hand over word and compensation hand over word become 1.428C and outer 0.013C respectively.Wherein C when the tu sequential, represents U chrominance color spaces signal, when the tv sequential, represents V chrominance color spaces signal.
Therefore, for the present invention's the 4th preferred embodiment, initial colourity color item 1.402 (Cr-128), 0.714 (Cr-128), 0.344 (Cb-128) and 1.772 (Cb-128), the equation that can be unfolded as follows:
1.402(Cr-128)=2[1/2(1.428)(Cr-128)-0.013(Cr-128)]
0.714(Cr-128)=1/2(1.428)(Cr-128)
0.344(Cb-128)=1/2[1/2(1.428)(Cb-128)]-0.013(Cb-128)
1.772(Cb-128)=1.428(Cb-128)+1/2[1/2(1.428)(Cb-128)]-0.013(Cb-128)
This linear combination member is according to above-mentioned expansion, and the default hand over word and the combination of compensation hand over word that will come from this code presupposition generator 23 and this compensation codes generator 33 are to obtain the conversion value of initial colourity color item.
From the default hand over word of this code presupposition generator 23, through this shift unit 73, carry out arithmetic right dislocation (divided by two), in the tv sequential, obtain the conversion value of initial colourity color item 0.714 (Cr-128).
The output 0.714 (C-128) of this shift unit 73 through this subtracter 71, deducts the compensation hand over word from this compensation codes generator 33.This shift unit 72 is carried out the displacement of arithmetic left-hand, multiply by two with the output valve to this subtracter 71, in the tv sequential, obtains the conversion value of initial colourity color item 1.402 (Cr-128).
This shift unit 74 is the output valves 0.714 (C-128) to this shift unit 73, carries out arithmetic right dislocation (divided by two).And this subtracter 75 deducts the compensation hand over word from this compensation codes generator 33 with the output valve of this shift unit 74, in the tu sequential, obtains the conversion value of initial colourity color item 0.344 (Cb-128).
This adder 76 adds the default hand over word from this code presupposition generator 23, and the output valve 0.344 (Cb-128) of this subtracter 75, in the tu sequential, obtains the conversion value of initial colourity color item 1.772 (Cb-128).
This first latch 5 in the tv sequential, pins the output valve of this shift unit 72, obtains the conversion value of required Cr-in-R, just 1.402 (Cr-128).
This first latch 6 in the tv sequential, pins the output valve of this shift unit 73, to obtain the conversion value of Cr-in-G, and 0.714 (Cr-128) just.
The 3rd latch 7 in the tu sequential, pins the output valve of this subtracter 75, to obtain the conversion value of Cb-in-G, and 0.344 (Cb-128) just.
This quad latch 8 in the tu sequential, pins the output valve of this adder 76, to obtain required Cb-in-B conversion value, and 1.772 (Cb-128) just.
And this first to the 3rd output combining unit 9,10,11 etc. acts on as having as described above shown in these embodiment, to same as the prior art, so no longer be described in detail at this.
As shown in Figure 5, be the 5th preferred embodiment of color space signal conversion equipment of the present invention.In the present invention's the 5th preferred embodiment, this color space signal conversion equipment comprises a multiplexer 1, code presupposition generator 24, a compensation codes generator 34, one comprises shift unit 82,83, adder 81,84 linear combination members, one first latch 5, one second latch 6, one the 3rd latch 7, a quad latch 8, one first output combining unit 9, one second output combining unit 10 and one the 3rd output combining unit 11.
The present invention's the 5th preferred embodiment is roughly similar to above-mentioned these embodiment, but in the present invention's the 5th preferred embodiment, default hand over word be made as 0.714 (C-128) and the compensation hand over word be made as 0.344 (C-128), C wherein, when the tu sequential, represent Cb chrominance color spaces signal, when the tv sequential, represent Cr chrominance color spaces signal.If use U and V to replace Cb and Cr, with expression input chrominance color spaces signal, then default hand over word and compensation hand over word become 0.714C and 0.334C respectively.Wherein C when the tu sequential, represents U chrominance color spaces signal, when the tv sequential, represents V chrominance color spaces signal.
Therefore, for the present invention's the 5th preferred embodiment,, equal the conversion value of initial colourity color item 0.714 (Cr-28) and 0.344 (Cb-128) respectively since preset hand over word and compensation hand over word.Thereby only need equation that other two initial colourity color items 1.402 (Cr-128) and 1.772 (Cb-128) are unfolded as follows:
1.402(Cr-128)=0.714(Cr-28)+2[0.344(Cr-128)]
1.772(Cb-128)=2[0.714(Cb-128)]+0.344(Cb-128)
This linear combination member is according to above-mentioned expansion, and the default hand over word and the combination of compensation hand over word that will come from this code presupposition generator 24 and this compensation codes generator 34 are to obtain the conversion value of two initial colourity color items.
From the compensation hand over word of this compensation codes generator 34,, carry out left-hand displacement (multiply by two) through this shift unit 83.This adder 81 adds the default hand over word from this code presupposition generator 24, and the output valve of this shift unit 83, in the tv sequential, obtains the conversion value of initial colourity color item 1.402 (Cr-128).
From the default hand over word of this code presupposition generator 24,, carry out arithmetic left-hand displacement (multiply by two) through this shift unit 82.This adder 84 adds the output valve of this shift unit 82, and from the compensation hand over word of this compensation codes generator 34, in the tu sequential, obtains the conversion value of initial colourity color item 1.772 (Cb-128).
This first latch 5 in the tv sequential, pins the output valve of this adder 81, obtains the conversion value of required Cr-in-R, just 1.402 (Cr-128).
This second latch 6 in the tv sequential, pins the default hand over word from this code presupposition generator 24, to obtain the conversion value of Cr-in-G, and 0.714 (Cr-128) just.
The 3rd latch 7 in the tu sequential, pins the compensation hand over word from this compensation codes generator 34, to obtain the conversion value of Cb-in-G, and 0.344 (Cb-128) just.
This quad latch 8 in the tu sequential, pins the output valve of this adder 84, to obtain required Cb-in-B conversion value, and 1.772 (Cb-128) just.
And this first to the 3rd output combining unit 9,10,11 etc. acts on as having as described above shown in these embodiment, and is same as the prior art, so no longer be described in detail at this.
In aforementioned listed each embodiment, code presupposition generator and compensation codes generator can use and inspect table.If with code presupposition generator and compensation codes generator, inspect table unit (unit) with one and implement, as shown in Figure 6, then code presupposition generator and compensation codes generator will include only a simple circuit, therefore memory storage for example can reduce the cost of color space conversion apparatus of the present invention.
As shown in Figure 6, this is inspected table unit 12 and comprises that a code presupposition that comprises default hand over word partly 121 and one comprises the compensation codes part 122 that compensate hand over word.As selected chrominance color spaces signal Cb or Cr, consult this and inspect table unit 12, can be via first output (P) and second output (C), export the character code (codeword) of a correspondence, and this character code comprises a default hand over word from this code presupposition part 121, and a compensation hand over word from this compensation codes part 122.Should default hand over word be to provide, and this compensation hand over word be provided by second output (C) by first output (P).
Though in the embodiment of above-mentioned announcement, be to select for use the conversion value of initial colourity color item as default hand over word, in addition, also can use the conversion value of initial colourity color item, hand over word is same as the prior art by way of compensation, so no longer be described in detail at this.
Specifically, though each preferred embodiment of the present invention is to represent with the calcspar of hardware circuit,, the present invention can use microprocessor (MicroProcessor) and relevant systematic memory body easily and efficiently, to reach the computing of conversion.