The application is the 94101514.9th divides an application.
R, G, B and Y, Cb, the conversion of Cr color space mainly is to be applied to the front-end processing (PREPROCESSING) of digital image compression (COMPRESSION) and back-end processing (POSTPROCESSING) process of decompress (DECOMPRESSION), because R, G, B is widely used in capture equipment such as scanner and video camera, and video picture equipment, color space as computer monitor and video signal monitor etc., yet symmetrical digital image compression, the color space that is used for all standardization algorithms but is the Y of CCIR 601 definition, Cb, Cr space (repeating after the appearance), therefore, one image extremely must be with color space by R between the compression by capture, G, B is converted to Y, Cb, the Cr space, this is a ring of digital image compression front-end processing, and decompress to also often carrying out back-end processing between the video picture, wherein a ring is by Y with color space, Cb, Cr is converted to R, G, the B space.
Aforesaid CCTR 601, wherein CCIR is the abbreviation of Consultative Committee on International Radio (CCIR) (Con-sultative committee of International Radio), and 601 be that code is recommended in one of its issue, in CCIR 601, defined the mode that R, G, B and Y, Cb, Cr color space are changed.
Definition according to CCIR 601, briliancy Y has 220 quantization levels (QUANTIZATION LEVEL) in briliancy Y (LUMINANCE), three code elements of chrominance C b, Cr (CHROMINANCE), its numerical value is from 16 to 235,16 expression black levels (BLACK LEVEL), 235 expression peak whites (PEAK WHITELEVEL), chrominance C b, Cr then respectively have 225 quantization levels, and numerical value all from 16 to 240 is wherein with the colourless level of 128 expressions.As desire to make R, G, the B composition of a natural color to turn to above-mentioned Y, Cb, Cr coding, need R, C, B three primary colors also are quantified as 220 level uniformly-spaced, its numerical value all from 16 to 235, wherein 16 expressions are the lightest, and 235 expressions are the denseest, so, the component in R, G, B and Y, Cb, Cr two color spaces is all with its quantized values of 8 bit representations, and both transformational relations are promptly shown in the equation group of CCIR 601:
The transformational relation of above-mentioned equation group (1) expression R, G, B to Y, Cb, Cr can calculate inverse matrix by the coefficient matrix of equation group (1) and gets as for the transformational relation of Y, Cb, Cr to R, G, B:
R in the past, G, B and Y, Cb, Cr color space converter are promptly according to above-mentioned equation group (1), (2), utilize the design of hardware again, multiplier etc. for example, yet because of the multiplier complex structure, on the volume circuit design, quite account for area, though and with complete test, though and the color of encoding is entirely inspected the design of table and is had 1. the structure of rule, 2. tight aggregation and 3. the being easy to advantage of testing, but all have only the function of unidirectional conversion in the past, and can't do the conversion of break-in.
Main purpose of the present invention, be to be to provide a kind of color space R, G, B to be converted to briliancy Y, chrominance C b, Cr space, and can be a kind of device of doing the break-in conversion of color space R, G, B briliancy Y, chrominance C b, Cr space conversion with the conversion of asymmetric encoding realization color space.
Secondary objective of the present invention, be to provide a kind of hardware structure better simply can be with briliancy Y, chrominance C b, Cr space conversion color space R, G, B with asymmetric encoding, realize the device of color space conversion.
The present invention is characterized in odd function (ODD FUNCTION) symmetrical manner coding, only get each color component (COMPONENT) on the occasion of or negative value be encoded radio, coding schedule is reduced by half, and when encoded radio is exported, recovers its original polarity.
For achieving the above object, the invention provides a kind of asymmetric encoding and realize the device of color space conversion, it comprises in order to color space R, G line by line, the B bi-directional conversion to briliancy Y, chrominance C b, Cr space and briliancy Y, chrominance C b, Cr space to color space R, G, B:
-the first color is inspected the table memory, and it deposits the encoded radio of luv space first color component corresponding to transformed space first color component;
-the second color is inspected the table memory, and it deposits the encoded radio of luv space first color component corresponding to transformed space second color component;
-Di three colors are inspected the table memory, and it deposits the encoded radio of luv space first color component corresponding to transformed space the 3rd color component;
-Di four colors are inspected the table memory, and it deposits the encoded radio of luv space second color component corresponding to transformed space first color component;
-Di five colors coloured silk is inspected the table memory, and it deposits the encoded radio of luv space second color component corresponding to transformed space second color component;
-Di six colors are inspected the table memory, and it deposits the encoded radio of luv space second color component corresponding to transformed space the 3rd color component;
-Di seven colors are inspected the table memory, and it deposits the encoded radio of luv space the 3rd color component corresponding to transformed space first color component;
-Di eight colors are inspected the table memory, and it deposits the encoded radio of luv space the 3rd color component corresponding to transformed space second color component;
-Di nine colors are inspected the table memory, and it deposits the encoded radio of luv space the 3rd color component corresponding to transformed space the 3rd color component;
-the first output polarity controller, it inspects original polarity of table output encoder value in order to recover above-mentioned first color, and is 128 o'clock in the quantized values of luv space first color component, forces to be output as 0;
-the second output polarity controller, it inspects original polarity of table output encoder value in order to recover above-mentioned second color, and is 128 o'clock in the quantized values of luv space first color component, forces to be output as 0;
-Di three output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned the 3rd color, and is 128 o'clock in the quantized values of luv space first color component, forces to be output as 0;
-Di four output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned the 4th color, and is 128 o'clock in the quantized values of luv space second color component, forces to be output as 0;
-Di five output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned multicolored coloured silk, and is 128 o'clock in the quantized values of luv space second color component, forces to be output as 0;
-Di six output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned the 6th color, and is 128 o'clock in the quantized values of luv space the 3rd color component, forces to be output as 0;
-Di seven output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned the 7th color, and is 128 o'clock in the quantized values of luv space the 3rd color component, forces to be output as 0;
-Di eight output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned the 8th color, and is 128 o'clock in the quantized values of luv space the 3rd color component, forces to be output as 0;
-Di nine output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned the 9th color, and is 128 o'clock in the quantized values of luv space the 3rd color component, forces to be output as 0;
-the first symmetrical address decoder, it is inspected and shows shared character address in order to produce corresponding first, second and third color of luv space first color component institute;
-the second symmetrical address decoder, it is inspected and shows shared character address in order to produce corresponding the 4th, the 5th and the 6th color of luv space second color component institute;
-Di three symmetrical address decoders, it is inspected and shows shared character address in order to produce corresponding the 7th, the 8th and the 9th color of luv space the 3rd color component institute;
-first adder, it carries out add operation in order to the output to the above-mentioned first and the 4th output polarity controller;
-second adder, it carries out add operation in order to the output to the above-mentioned first and the 7th output polarity controller;
-Di three adders, it carries out add operation in order to the output to the above-mentioned second and the 5th output polarity controller;
-Di four adders, it carries out add operation in order to the output to the above-mentioned the 3rd and the 8th output polarity controller;
-Di slender acanthopanax musical instruments used in a Buddhist or Taoist mass, it carries out add operation in order to the output to the above-mentioned the 3rd and the 6th output polarity controller;
-Di six adders, it carries out add operation in order to the output to the above-mentioned the 5th and the 9th output polarity controller;
-the first compensation and the restricting circuits, its output to above-mentioned second adder are carried out constant 128 compensation and codomain restriction, output transformed space first color component;
-the second compensation and the restricting circuits, its output to above-mentioned the 4th adder are carried out constant 128 compensation and codomain restriction, output transformed space first color component;
-Di three compensation and restricting circuits, its output to above-mentioned the 6th adder are carried out constant 128 compensation and codomain restriction, output transformed space the 3rd color component.
The invention allows for a kind of device,, it is characterized in that it comprises in order to the unidirectional conversion of briliancy Y, chrominance C b, Cr space to color space R, G, B line by line with the conversion of asymmetric encoding realization color space:
-the first color is inspected the table memory, and it deposits the encoded radio of Cb component corresponding to the G component in;
-the second color is inspected the table memory, and it deposits the encoded radio of Cb component corresponding to the G component in;
-Di three colors are inspected the table memory, and it deposits the encoded radio of Cr component corresponding to the G component in;
-Di four colors are inspected the table memory, and it deposits the encoded radio of Cr component corresponding to the G component in;
-the first output polarity controller, it inspects original polarity of table output encoder value in order to recover above-mentioned first color, and is 128 o'clock in the quantized values of Cb component, forces to be output as 0;
-the second output polarity controller, it inspects original polarity of table output encoder value in order to recover above-mentioned second color, and is 128 o'clock in the quantized values of Cb component, forces to be output as 0;
-Di three output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned the 3rd color, and is 128 o'clock in the quantized values of Cb component, forces to be output as 0;
-Di four output polarity controllers, it inspects original polarity of table output encoder value in order to recover above-mentioned the 4th color, and is 128 o'clock in the quantized values of Cb component, forces to be output as 0;
-the first symmetrical address decoder, its in order to produce the Cb component first and second symmetrical color inspect the shared character address of table;
-the second symmetrical address decoder, its in order to produce the Cr component the 3rd and the 4th symmetrical color inspect the shared character address of table;
-first adder, it carries out add operation in order to the output to Y element quantization numerical value and above-mentioned the 3rd output polarity controller;
-second adder, it carries out add operation in order to the output to the above-mentioned first and the 4th output polarity controller;
-Di three adders, it carries out add operation in order to the output to Y element quantization numerical value and aforementioned second adder;
-Di four adders, it carries out add operation in order to the output to Y element quantization numerical value and aforementioned second adder;
-the first restricting circuits, its output to above-mentioned first adder are carried out the codomain restriction, the quantized values of output R component;
-the second restricting circuits, its output to above-mentioned the 3rd adder are carried out the codomain restriction, the quantized values of output G component;
-Di three restricting circuits, its output to above-mentioned the 4th adder are carried out the codomain restriction, the quantized values of output B component.
The present invention is described in detail for following structure drawings and Examples:
Table one is the tabular form of asymmetric encoding algorithm in the embodiment of the invention.
According to aforementioned equation group (1) and (2), can be converted into respectively:
And
Above-mentioned two equation group (3), (4) but integrating representation be:
3POn=∑Cnm(PIm-128)+128,n=1,2,3 (5)
M=1 wherein is defined as PIm, POn and Cnm respectively:
PIm, the color space that it constituted are defined as luv space (ORIGINALSPACE), so PIm is called the color component (COMPONENT) of luv space, can represent Y, Cb, Cr or R, G, B this its.
POn, its color space after the conversion that constitutes, be defined as transformed space (CON-VERTED SPACE), so POn is called the color component of transformed space, can represent R, G, B or Y, Cb, Cr this its.
Cnm, because the color component (COMPONENT) that element PIm that above color space is formed or POn are called each space, so Cnm is the coefficient of transformed space n color component corresponding to luv space m color component.
In this case embodiment, as P01, P02, P03, when representing Y, Cb, the Cr component in YCbCr space respectively, PI1 then, PI2, PI3 represent R, G, the B component of rgb space respectively, opposite, as P01, P02, P03, when representing R, G, the B component of rgb space respectively, then PI1, PI2, PI3 represent Y, Cb, the Cr component in YCbCr space respectively.
By above-mentioned equation group (5) as can be known, the any color component POn of transformed space is that the linear combination by luv space three color components adds a constant 128 compensation again and forms, and each color component PIm of luv space is the center with constant 128 all in transformational relation, being odd function (Odd function) is symmetrically distributed, be that each equates and the different symmetric relation of sign symbol all form absolute value from 128 equidistant numerical value, therefore, with the PIm numerical value of 8 bit representations except 0 and 128, all the other are 1 years old, 2,3,127 with, 129,130,131,255, totally 254 numerical value are symmetrical one by one respectively, 1 and 255 symmetries wherein, 2 and 254 symmetries, the rest may be inferred by analogy.
Utilize this feature, only taking absolute value | the product of PIm-128| and coefficient of correspondence Cnm thereof is encoded with 2 complement representation, though CCIR 601 has the restriction of its quantized interval, the present invention still provides the coding of all 8 possibility numerical value, thereby above-mentioned 254 numerical value that are the odd function symmetry are to form 127 encoded radios, remaining 0 also need account for an encoded radio, and 128 because of making encoded radio be fixed as 0, so will not encode, only forcing its output valve when output is 0, therefore, need 128 encoded radios altogether, this is with respect to full coding method in the past (be about to whole numerical value all Methods for Coding) one by one, really can make coding schedule reduce half, and the addressing mode that reduces by half for the matching coding table, the PIm numerical value of aforementioned symmetry must be reflected to same coded address, remaining 0 need reflect to its coded address, 128 also need reflect to the address identical with 0, this is the symmetrical address (SYMMETRICALADDRESS) that PIm numerical value produces, usefulness for the coding addressing, the PIm numerical value that makes per two symmetries all mapping to same encoded radio, and when output, recover the polarity of Cnm (PIm-128) with respect to Cnm|PIm-128|, all PIm all carry out polarity inversion less than 128, and it keeps same polarity greater than 128, and when PIm equals 128, then forcing output valve is 0, and this is the method for symmetric code.
Please refer to shown in Figure 1ly, is the block diagram of realizing the asymmetric encoding algorithm in a preferred embodiment of the present invention, and it comprises:
One color is inspected table 1, a symmetrical address decoder 2 and an output polarity controller 3, wherein:
Color is inspected table 1, it deposits the coding Cnm|PIm-128| of luv space color component PIm corresponding to transformed space color component POn, be one to have the random access memory of 128 characters, can be according to R, G, B to Y, Cb, Cr conversion or Y, Cb, Cr to R, its corresponding codes value of G, B conversion formula rule.
Symmetry address decoder 2 is to inspect the character address of table 1 in order to produce above-mentioned color, and its detailed inside please refer to shown in Figure 2, and it comprises 2 complement code generator 21a of 1. each control and 7. address decoder 22a; Wherein: 1. first controllable 2 complement code generator 21a utilizes the highest order PIm7 of PIm numerical value to be enable signal, control all the other 7 than low level PIm6, PIm5, PIm4, whether PIm0 carries out 2 complement arithmetic, to produce the symmetrical address of 7 bits, inspect the usefulness of table 1 addressing for above-mentioned color, when PIm7=0, start 2 complement arithmetic, input PIm6, PIm5, PIm4,2 the complement code of PIm0, when PIm7=1, directly pass through PIm6, PIm5, PIm4, the value of PIm0, so, can make PIm numerical value in twos corresponding to an identical address, as shown in Table 1,2. and address decoder 22 to be symmetrical addresses with above-mentioned first controllable 2 complement code generator 21a output be decoded as Am0, Am1, Am2, Am127 is totally 128 address wires.
Output polarity controller 3, it places above-mentioned color to inspect the output of table 1, in order to recover original polarity of its encoded radio, and when PIm=128, force to be output as 0, its detailed inside please refer to shown in Figure 3, and it comprises 1. one second controllable 2 complement code generator 31a, 2.-128 detector 32a reaches a 3. output and covers circuit 33a; Wherein: 1. second controllable 2 complement code generator 31a and above-mentioned first controllable 2 complement code generator 21a synchronization action, also utilize PIm7 to be enable signal, controlling above-mentioned color inspects the encoded radio of table 1 output and whether carries out 2 complement arithmetic, when PIm7=0 then for being, then be not when PIm7=1, also as shown in Table 1,2. 128 detector 32a are that to utilize Am0 and PIm7 two input PIm numerical value be 128 situation, as for being then to export an inhibit signal.3. to cover circuit 33a be the output of whether covering the complement code generator 31a of above-mentioned second may command 2 by the inhibit signal control of above-mentioned 128 detector 32a output in output, as for being, when being PIm=128, then force it to be output as 0, otherwise directly the output code of the complement code generator 31a by above-mentioned second may command 2 is to output.
Please refer to shown in Figure 4, combination luv space three color components are the structure block diagram of the arbitrary color component of transformed space, comprise 1. three asymmetric encoding essential structure S1, S2, S3 as shown in Figure 1,2. two adders 4,5 and 3. compensation and restricting circuits 6, wherein: 1. three asymmetric encoding essential structure S1, S2, S3, correspond respectively to luv space three color component PI1, PI2, PI3, provide three color components corresponding to the required asymmetric encoding device for carrying out said of transformed space color component POn; 2. two adders the 4, the 5th serially add computing in order to the output number of above-mentioned three asymmetric encoding essential structures is carried out, wherein first adder 4 is with from the digital addition in advance of the two-component output of PI1, PI2, itself and again with from digital second adder 4 additions of the output of PI3 component; 3. and compensation and restricting circuits 6 are that constant 128 compensation and codomain restriction are carried out in the output of above-mentioned second adder 5, the numerical value of transformed space color component POn is confined to 8 scope, promptly between 0 and 255, thereby the POn numerical value after the compensation is as surpassing 255, then be defined in 255, negative then is defined in 0 in this way, and this is to overflow (OVERELOW) and design for preventing to serially add codomain that computing may cause.
Please refer to shown in Figure 5ly, is that conversion spatial color component POn among Fig. 4 is expanded into P01, P02, P03 state, and for the present invention realizes the method for color space conversion and a preferred embodiment of device with asymmetric encoding, it comprises:
1. nine colors are as shown in Figure 1 inspected table, are mainly used to deposit respectively the encoded radio of luv space and each corresponding color component of transformed space; It is respectively, and first color is inspected table 11, and it is to deposit the encoded radio of the luv space first color component PI1 corresponding to the transformed space first color component P01; Second color is inspected table 12, and it is to deposit the encoded radio of the luv space first color component PI1 corresponding to the transformed space second color component P02; The 3rd color is inspected table 13, and it is to deposit the encoded radio of the luv space first color component PI1 corresponding to transformed space the 3rd color component P03; The 4th color is inspected table 14, and it is to deposit the encoded radio of the luv space second color component PI2 corresponding to the transformed space first color component P01; Multicolored coloured silk is inspected table 15, and it is to deposit the encoded radio of the luv space second color component PI2 corresponding to the transformed space second color component P02; The 6th color is inspected table 16, and it is to deposit the encoded radio of the luv space second color component PI2 corresponding to transformed space the 3rd color component P03; The 7th color is inspected table 17, and it is to deposit the encoded radio of luv space the 3rd color component PI3 corresponding to the transformed space first color component P01; The 8th color is inspected table 18, and it is to deposit the encoded radio of luv space the 3rd color component PI3 corresponding to the transformed space second color component P02; The 9th color is inspected table 19, and it is to deposit the encoded radio of luv space the 3rd color component PI2 corresponding to transformed space the 3rd color component P03.
2. nine output polarity controllers as shown in Figure 1, it is to follow above-mentioned nine colors respectively to inspect table, in order to recovering original polarity of its encoded radio, and when the numerical value of luv space color component is 128, forces to be output as 0; It is respectively, and the first output polarity controller 31 is to inspect original polarity of table 11 output encoder value in order to recover above-mentioned first color, and is 128 o'clock in the quantized values of the luv space first color component PI1, forces to be output as 0; The second output polarity controller 32 is to inspect original polarity of table 12 output encoder value in order to recover above-mentioned second color, and is 128 o'clock in the quantized values of the luv space first color component PI1, forces to be output as 0; The 3rd output polarity controller 33 is to inspect original polarity of table 13 output encoder value in order to recover above-mentioned the 3rd color, and is 128 o'clock in the quantized values of the luv space first color component PI1, forces to be output as 0; The 4th output polarity controller 34 is to inspect original polarity of table 14 output encoder value in order to recover above-mentioned the 4th color, and is 128 o'clock in the quantized values of the luv space second color component PI2, forces to be output as 0; The 5th output polarity controller 35 is to inspect original polarity of table 15 output encoder value in order to recover above-mentioned multicolored coloured silk, and is 128 o'clock in the quantized values of luv space the 3rd color component PI2, forces to be output as 0; The 6th output polarity controller 36, it is to inspect original polarity of table 16 output encoder value in order to recover above-mentioned the 6th color, and is 128 o'clock in the quantized values of the luv space second color component PI2, forces to be output as 0; The 7th output polarity controller 37, it is to inspect original polarity of table 17 output encoder value in order to recover above-mentioned the 7th color, and is 128 o'clock in the quantized values of luv space the 3rd color component PI3, forces to be output as 0; The 8th output polarity controller 38, it is to inspect original polarity of table 18 output encoder value in order to recover above-mentioned the 8th color, and is 128 o'clock in the quantized values of luv space the 3rd color component PI3, forces to be output as 0; The 9th output polarity controller 39, it is to inspect original polarity of table 19 output encoder value in order to recover above-mentioned the 7th color, and is 128 o'clock in the quantized values of luv space the 3rd color component PI3, forces to be output as 0.
3. three symmetrical address decoders as shown in Figure 1, it is to correspond respectively to luv space three color components, inspects the shared character address of table in order to produce all corresponding colors of each component; It is respectively: the first symmetrical address decoder 21, its in order to produce the luv space first color component PI1 corresponding first, second and third color inspect table 11,12,13 shared character address; The second symmetrical address decoder 22, it inspects table 14,15,16 shared character addresses in order to produce luv space second color component PI2 institute correspondence the 4th, the 5th and the 6th color; The 3rd symmetrical address decoder 23, it inspects table 17,18,19 shared character addresses in order to produce luv space the 3rd color component PI3 institute correspondence the 7th, the 8th and the 9th color.
4. six adders as shown in Figure 4, it is to be in series in twos, corresponds respectively to transformed space three color components, in order to serially add the output code of each component from luv space three corresponding color components; It is respectively, first adder 41, and it carries out add operation in order to the output to the above-mentioned first and the 4th output polarity controller 31,34; Second adder 42, it carries out add operation in order to the output to above-mentioned first adder 41 and the 7th output polarity controller 37; The 3rd adder 43, it carries out add operation in order to the output to the above-mentioned first and the 5th output polarity controller 32,35; The 4th adder 44, it carries out add operation in order to the output to above-mentioned the 3rd adder 43 and the 8th output polarity controller 38; Slender acanthopanax musical instruments used in a Buddhist or Taoist mass 45, it carries out add operation in order to the output to the above-mentioned the 3rd and the 6th output polarity controller 33,36; The 6th adder 46, its in order to above-mentioned first and the output of slender acanthopanax musical instruments used in a Buddhist or Taoist mass 45 and the 9th output polarity controller 39 carry out add operation.
5. and three compensation and restricting circuits as shown in Figure 4, it corresponds respectively to transformed space three color components, in order to the above-mentioned result who serially adds computing is carried out 128 compensation and codomain restriction; It is respectively: first compensation and the restricting circuits 61, its output to above-mentioned second adder 42 are carried out constant 128 compensation and codomain restriction, the output transformed space first color component P01; Second compensation and the restricting circuits 62, its output to above-mentioned the 4th adder 44 are carried out constant 128 compensation and codomain restriction, the output transformed space second color component P02; The 3rd compensation and restricting circuits 63, its output to above-mentioned the 6th adder 46 are carried out constant 128 compensation and codomain restriction, output transformed space the 3rd color component P03.
The above-mentioned circuit of forming to carry out R, G, B to Y, Cb, Cr or Y, Cb, Cr to R, G, B bi-directional conversion; When carrying out R, G, B to Y, Cb, during the Cr conversion, above-mentioned nine colors are inspected table must plan its encoded radio according to equation group (3) formula, and when carrying out Y, Cb, Cr to R, G, during the B conversion, aforementioned 9 colors are inspected table and are then planned its encoded radio according to equation group (4) formula, if the above-mentioned circuit application of forming is in the environment of unidirectional conversion, then color is inspected table and can be used read-only memory device, can handled easily and the area of reduced volume circuit, and particularly very, when only being applied to Y, Cb, Cr to R, G, during the unidirectional conversion of B, can simplify its structure according to equation group (2), this moment, the Y component was corresponding to R, G, the three-component coefficient of B is 1, so need not encode, and the Cb component is all very little corresponding to the coefficient of B component corresponding to R component and Cr component, can ignore, need not encode yet, therefore only need carry out asymmetric encoding to Cb and Cr two components, and two each only use two coding schedules, be respectively that the Cb component is corresponding to G, B two components and Cr component are corresponding to R, G two components.And after Y, Cb, Cr three-component linear combination becoming R, G, B are three-component, do not need in addition constant compensation yet, and the scope that directly limits its codomain in 0 to 255 gets final product, its device for carrying out said is as shown in Figure 6.
Fig. 6 is a simplified embodiment of the present invention, and in order to Y, Cb, Cr to R, the unidirectional purpose that is converted to of G, B line by line, it comprises:
Four colors are inspected table 101 to 104, deposit the Cb component respectively corresponding to the G component, the corresponding B component of Cb component, and the Cr component is corresponding to the R component, and the Cr component is corresponding to the encoded radio of G component.
Four output polarity controllers 301 to 304, it is followed above-mentioned four colors respectively and inspects table, in order to recovering original polarity of its encoded radio, and when corresponding Cb or Cr component values are 128, forces to be output as 0.
Two symmetrical address decoders 201,202, it corresponds respectively to Cb and Cr component, inspects the shared character address of table in order to produce all corresponding colors of each component.
Four adders 401 to 404, wherein adder 401 is corresponding to the R component, the add operation of and Y component values digital in order to the output of carrying out its corresponding Cr component, adder 402,403 2 is corresponding to the G component, its two-phase serially adds in order to connect it from two-component output number of corresponding Cb, Cr and Y component values, adder 404 is corresponding to the B component, in order to the output numerical value of carrying out its corresponding Cb component and the add operation of Y component values.And
Three restricting circuits 71 to 73, its compensation as shown in Figure 4 and the restricting circuits part of restricting circuits 6 correspond respectively to R, G, B three-component, as the usefulness of output codomain restriction.
The present invention, provide a kind of and color space R, G, B can be converted to briliancy Y, chrominance C b, Cr space, and can be a kind of method and device of making bi-directional conversion of color space R, G, B briliancy Y, chrominance C b, Cr space conversion with the conversion of asymmetric encoding realization color space; And provide a kind of hardware construction better simply can be with briliancy Y, chrominance C b, Cr space conversion color space R, G, B realize the device of color space conversion with asymmetric encoding.
In sum, the present invention realizes method and the device that color space is changed with asymmetric encoding, really can reach its intended purposes.
Table 1
| Plm numerical value | The symmetrical address of coding schedule | Export the polarity of digital Cnm (Plm-128) with respect to encoded radio Cnm/Plm-128 | Remarks |
| 0 1 2 3 126 127 | 0 127 126 125 2 1 | - - - - - - | Cnm(Plm-128)= -Cnm|Plm-128| |
| 128 | 0 | 0 | Cnm(Plm-128)=0 |
| 129 130 . . . . 253 254 255 | 1 2 . . . . 125 126 127 | + + . . . . + + + | Cnm(Plm-128)= Cnm |Plm-128| |