[go: up one dir, main page]

CN1097962C - A Device for Symmetrical Encoding Realizing Color Space Conversion - Google Patents

A Device for Symmetrical Encoding Realizing Color Space Conversion Download PDF

Info

Publication number
CN1097962C
CN1097962C CN 99123280 CN99123280A CN1097962C CN 1097962 C CN1097962 C CN 1097962C CN 99123280 CN99123280 CN 99123280 CN 99123280 A CN99123280 A CN 99123280A CN 1097962 C CN1097962 C CN 1097962C
Authority
CN
China
Prior art keywords
output
color
space
component
original
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.)
Expired - Lifetime
Application number
CN 99123280
Other languages
Chinese (zh)
Other versions
CN1262584A (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.)
Winbond Electronics Corp
Original Assignee
Winbond Electronics Corp
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 Winbond Electronics Corp filed Critical Winbond Electronics Corp
Priority to CN 99123280 priority Critical patent/CN1097962C/en
Publication of CN1262584A publication Critical patent/CN1262584A/en
Application granted granted Critical
Publication of CN1097962C publication Critical patent/CN1097962C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Color Television Systems (AREA)

Abstract

一种以对称编码实现色彩空间转换的装置,其特征在于以奇函数(ODD FUNCTION)对称的方式编码,仅取各色彩分量(COMPONENT)的正值或负值为编码值,使编码表得以减半,而在编码值输出时恢复其原有极性;借此可实现自然颜色空间R、G、B与辉度/色度(LUMINANCE/CHROMINANCE)空间Y、Cb、Cr两相互转换。

A device for realizing color space conversion by symmetrical encoding, characterized in that it encodes in an odd function (ODD FUNCTION) symmetrical manner, and only takes the positive or negative value of each color component (COMPONENT) as the encoding value, so that the encoding table can be reduced Half, and the original polarity is restored when the coded value is output; in this way, the mutual conversion between the natural color space R, G, B and the luminance/chromaticity (LUMINANCE/CHROMINANCE) space Y, C b , Cr can be realized.

Description

A kind of asymmetric encoding is realized the device of color space conversion
The application is the 94101514.9th divides an application.
The present invention relates to the device of a kind of color space conversion (COLOR SPACE CONVER-SION), particularly relate to a kind of mode and realize nature color space R, G, B and briliancy/colourity (LUMINANCE/CHRO-MI-NACE) space Y, Cb, Cr two device of conversion mutually with asymmetric encoding.
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: Y C b - 128 C r - 128 = 0.299 0.587 0.114 - 0.173 - 0.338 0.511 0.511 - 0.428 - 0.083 R G B - - - ( 1 ) 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 G B ≤ 1 - 0.001 1.370 1 - 0.336 - 0.698 1 1.733 0.001 · Y Cb - 128 Cr - 128 - - - ( 2 ) 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:
Fig. 1 is a block diagram of realizing the asymmetric encoding algorithm in the preferred embodiment of the present invention.
Fig. 2 is the block diagram of the symmetrical address decoder of Fig. 1.
Fig. 3 is the block diagram of the output polarity controller of Fig. 1.
Fig. 4 is that combination luv space three color components are the block diagram of the arbitrary color component of transformed space.
Fig. 5 is the block diagram of preferred embodiment of the present invention.
Fig. 6 is another preferred embodiment block diagram of the present invention.
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: Y C b C r = 0.299 0.587 0.114 - 0.173 - 0.338 0.511 0.511 - 0.428 - 0.083 R - 126 G - 128 B - 128 + 128 128 128 - - - ( 3 ) And R G B = 1 - 0.001 1.370 1 - 0.336 - 0.698 1 1.733 0.001 Y - 128 C b - 128 C r - 128 + 128 128 128 - - - ( 4 )
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|

Claims (5)

1.一种对称编码实现色彩空间转换的装置,其用以逐行彩色空间R、G、B至辉度Y、色度Cb、Cr空间以及辉度Y、色度Cb、Cr空间至彩色空间R、G、B的双向转换,包括:1. A device for symmetric coding to realize color space conversion, which is used for progressive color space R, G, B to luminance Y, chroma Cb, Cr space and luminance Y, chroma Cb, Cr space to color space Two-way conversion of R, G, B, including: -第一色彩检视表存储器,其存放原始空间第一色彩分量对应于转换空间第一色彩分量的编码值;- a first color lookup table memory storing encoded values of the first color component in the original space corresponding to the first color component in the converted space; -第二色彩检视表存储器,其存放原始空间第一色彩分量对应于转换空间第二色彩分量的编码值;- a second color lookup table memory storing encoded values of the first color component in the original space corresponding to the second color component in the converted space; -第三色彩检视表存储器,其存放原始空间第一色彩分量对应于转换空间第三色彩分量的编码值;- a third color view table memory storing the coded values of the first color component in the original space corresponding to the third color component in the transformed space; -第四色彩检视表存储器,其存放原始空间第二色彩分量对应于转换空间第一色彩分量的编码值;- a fourth color view table memory storing encoded values of the second color component in the original space corresponding to the first color component in the converted space; -第五色彩检视表存储器,其存放原始空间第二色彩分量对应于转换空间第二色彩分量的编码值;- a fifth color view table memory storing encoded values of the second color component of the original space corresponding to the second color component of the converted space; -第六色彩检视表存储器,其存放原始空间第二色彩分量对应于转换空间第三色彩分量的编码值;- a sixth color view table memory storing the encoded values of the second color component in the original space corresponding to the third color component in the transformed space; -第七色彩检视表存储器,其存放原始空间第三色彩分量对应于转换空间第一色彩分量的编码值;- a seventh color view table memory storing the coded value of the third color component of the original space corresponding to the first color component of the converted space; -第八色彩检视表存储器,其存放原始空间第三色彩分量对应于转换空间第二色彩分量的编码值;- an eighth color view table memory storing encoded values of the third color component in the original space corresponding to the second color component in the converted space; -第九色彩检视表存储器,其存放原始空间第三色彩分量对应于转换空间第三色彩分量的编码值;- a ninth color view table memory, which stores the encoded value of the third color component of the original space corresponding to the third color component of the converted space; -第一输出极性控制器,其用以恢复上述第一色彩检视表输出编码值的原有极性,并在原始空间第一色彩分量的量化数值为128时,强迫输出为0;- a first output polarity controller, which is used to restore the original polarity of the output coding value of the first color viewing table, and force the output to be 0 when the quantized value of the first color component in the original space is 128; -第二输出极性控制器,其用以恢复上述第二色彩检视表输出编码值的原有极性,并在原始空间第一色彩分量的量化数值为128时,强迫输出为0;- a second output polarity controller, which is used to restore the original polarity of the output coding value of the second color viewing table, and force the output to be 0 when the quantized value of the first color component in the original space is 128; -第三输出极性控制器,其用以恢复上述第三色彩检视表输出编码值的原有极性,并在原始空间第一色彩分量的量化数值为128时,强迫输出为0;- A third output polarity controller, which is used to restore the original polarity of the output coding value of the third color viewing table, and force the output to be 0 when the quantized value of the first color component in the original space is 128; -第四输出极性控制器,其用以恢复上述第四色彩检视表输出编码值的原有极性,并在原始空间第二色彩分量的量化数值为128时,强迫输出为0;- A fourth output polarity controller, which is used to restore the original polarity of the output coding value of the fourth color viewing table, and force the output to be 0 when the quantized value of the second color component in the original space is 128; -第五输出极性控制器,其用以恢复上述第五色彩检视表输出编码值的原有极性,并在原始空间第二色彩分量的量化数值为128时,强迫输出为0;- A fifth output polarity controller, which is used to restore the original polarity of the output code value of the fifth color viewing table, and force the output to be 0 when the quantized value of the second color component in the original space is 128; -第六输出极性控制器,其用以恢复上述第六色彩检视表输出编码值的原有极性,并在原始空间第三色彩分量的量化数值为128时,强迫输出为0;- the sixth output polarity controller, which is used to restore the original polarity of the output coding value of the sixth color viewing table, and force the output to be 0 when the quantized value of the third color component in the original space is 128; -第七输出极性控制器,其用以恢复上述第七色彩检视表输出编码值的原有极性,并在原始空间第三色彩分量的量化数值为128时,强迫输出为0;- the seventh output polarity controller, which is used to restore the original polarity of the output coding value of the seventh color viewing table, and force the output to be 0 when the quantized value of the third color component in the original space is 128; -第八输出极性控制器,其用以恢复上述第八色彩检视表输出编码值的原有极性,并在原始空间第三色彩分量的量化数值为128时,强迫输出为0;- An eighth output polarity controller, which is used to restore the original polarity of the output coding value of the eighth color viewing table, and force the output to be 0 when the quantized value of the third color component in the original space is 128; -第九输出极性控制器,其用以恢复上述第九色彩检视表输出编码值的原有极性,并在原始空间第三色彩分量的量化数值为128时,强迫输出为0;- a ninth output polarity controller, which is used to restore the original polarity of the output coding value of the ninth color viewing table, and force the output to be 0 when the quantized value of the third color component in the original space is 128; -第一对称地址解码器,其用以产生原始空间第一色彩分量所对应第一、第二及第三色彩检视表共用的字元地址;- a first symmetric address decoder, which is used to generate a character address shared by the first, second and third color viewing tables corresponding to the first color component in the original space; -第二对称地址解码器,其用以产生原始空间第二色彩分量所对应第四、第五及第六色彩检视表共用的字元地址;- a second symmetric address decoder, which is used to generate a character address shared by the fourth, fifth and sixth color viewing tables corresponding to the second color component in the original space; -第三对称地址解码器,其用以产生原始空间第三色彩分量所对应第七、第八及第九色彩检视表共用的字元地址;- a third symmetric address decoder, which is used to generate a character address shared by the seventh, eighth and ninth color viewing tables corresponding to the third color component in the original space; -第一加法器,其用以对上述第一及第四输出极性控制器的输出执行加法运算;- a first adder for adding the outputs of said first and fourth output polarity controllers; -第二加法器,其用以对上述第一及第七输出极性控制器的输出执行加法运算;- a second adder for adding the outputs of said first and seventh output polarity controllers; -第三加法器,其用以对上述第二及第五输出极性控制器的输出执行加法运算;- a third adder for adding the outputs of said second and fifth output polarity controllers; -第四加法器,其用以对上述第三及第八输出极性控制器的输出执行加法运算;- a fourth adder for adding the outputs of said third and eighth output polarity controllers; -第五加法器,其用以对上述第三及第六输出极性控制器的输出执行加法运算;- a fifth adder for adding the outputs of said third and sixth output polarity controllers; -第六加法器,其用以对上述第五及第九输出极性控制器的输出执行加法运算;- a sixth adder for adding the outputs of said fifth and ninth output polarity controllers; -第一补偿及限制电路,其对上述第二加法器的输出进行常数128补偿及值域限制,输出转换空间第一色彩分量;- a first compensation and limitation circuit, which performs constant 128 compensation and value range limitation on the output of the second adder, and outputs the first color component of the conversion space; -第二补偿及限制电路,其对上述第四加法器的输出进行常数128补偿及值域限制,输出转换空间第一色彩分量;-The second compensation and limitation circuit, which performs constant 128 compensation and range limitation on the output of the fourth adder, and outputs the first color component of the conversion space; -第三补偿及限制电路,其对上述第六加法器的输出进行常数128补偿及值域限制,输出转换空间第三色彩分量;-The third compensation and limitation circuit, which performs constant 128 compensation and range limitation on the output of the sixth adder, and outputs the third color component of the conversion space; 2.如权利要求1所述的以对称编码实现色彩空间转换的装置,其特征是:每一色彩检视表,其是一具有128字元的随机存取存储器,其可依R、G、B至Y、Cb、Cr或Y、Cb、Cr至R、G、B转换程式规则其对应的编码值,以逐行双向转换。2. The device for realizing color space conversion with symmetric coding as claimed in claim 1, characterized in that: each color viewing table is a random access memory with 128 characters, and it can be configured according to R, G, B To Y, Cb, Cr or Y, Cb, Cr to R, G, B conversion program rules its corresponding coding value, to convert bidirectionally by row. 3.如权利要求1所述的以对称编码实现色彩空间转换的装置,其特征是:每一对称地址解码器包括:3. The device for realizing color space conversion with symmetric coding as claimed in claim 1, characterized in that: each symmetric address decoder comprises: 一可控制的2的补码产生器,其利用原始空间色彩分量量化数值的最高位,控制其余7个较低位是否执行2的补码运算,输出一7位的对称地址,以作为其对应色彩检视表定址之用;以及A controllable 2's complement code generator, which uses the highest bit of the quantized value of the original space color component to control whether the remaining 7 lower bits perform 2's complement code operation, and outputs a 7-bit symmetrical address as its corresponding for the addressing of the color view table; and -地址解码器,其将上述可控制的2的补码产生器输出的7位元对称地址解码为128条地址线。- An address decoder that decodes the 7-bit symmetrical address output by the above-mentioned controllable 2's complement generator into 128 address lines. 4.如权利要求1所述的以对称编码实现色彩空间转换的装置,其特征是:每一输出极性控制器包括:4. The device for realizing color space conversion with symmetrical coding as claimed in claim 1, wherein each output polarity controller comprises: -可控制的2的补码产生器,其是利用原始空间色彩分量量化数值的最高位,控制各对应色彩检视表输出的编码值是否执行2的补码运算,以恢复编码值的原有极性;- A controllable 2's complement code generator, which uses the highest bit of the quantized value of the color component in the original space to control whether to perform 2's complement code operation on the coded value output by each corresponding color view table, so as to restore the original level of the coded value sex; -128检测器,其检测原始空间色彩分量的量化数值是否为128,如为是,则输出一禁止信号;以及- a 128 detector, which detects whether the quantization value of the original space color component is 128, if yes, outputs a prohibition signal; and -输出遮蔽电路,其由上述128检测器输出的禁止信号控制是否遮蔽上述可控制的2的补码产生器的输出,如为是,则强迫其输出为0,否则,直接通过上述可控制的2的补码产生器的输出码至输出端。- output shielding circuit, it controls whether to shield the output of the above-mentioned controllable 2's complement generator by the prohibition signal output by the above-mentioned 128 detectors, if yes, then force its output to be 0, otherwise, directly through the above-mentioned controllable The output code of the 2's complement code generator to the output terminal. 5.一种以对称编码实现色彩空间转换的装置,用以逐行辉度Y、色度Cb、Cr空间至彩色空间R、G、B的单向转换,其特征是,其包括:5. A device for realizing color space conversion with symmetrical coding, used for progressive luminance Y, chromaticity Cb, Cr space to one-way conversion of color space R, G, B, is characterized in that it includes: -第一色彩检视表存储器,其存入Cb分量对应于G分量的编码值;- a first color view table memory, which stores the coded value of the Cb component corresponding to the G component; -第二色彩检视表存储器,其存入Cb分量对应于B分量的编码值;- a second color lookup table memory for storing the coded values of the Cb component corresponding to the B component; -第三色彩检视表存储器,其存入Cr分量对应于R分量的编码值;- a third color view table memory, which stores the coded value of the Cr component corresponding to the R component; -第四色彩检视表存储器,其存入Cr分量对应于G分量的编码值;- a fourth color view table memory, which stores the encoded value of the Cr component corresponding to the G component; -第一输出极性控制器,其用以恢复上述第一色彩检视表输出编码值的原有极性,并在Cb分量的量化数值为128时,强迫输出为0;- a first output polarity controller, which is used to restore the original polarity of the output coding value of the first color viewing table, and force the output to be 0 when the quantized value of the Cb component is 128; -第二输出极性控制器,其用以恢复上述第二色彩检视表输出编码值的原有极性,并在Cb分量的量化数值为128时,强迫输出为0;- a second output polarity controller, which is used to restore the original polarity of the output coded value of the second color view table, and force the output to be 0 when the quantized value of the Cb component is 128; -第三输出极性控制器,其用以恢复上述第三色彩检视表输出编码值的原有极性,并在Cb分量的量化数值为128时,强迫输出为0;- a third output polarity controller, which is used to restore the original polarity of the output coding value of the third color viewing table, and force the output to be 0 when the quantized value of the Cb component is 128; -第四输出极性控制器,其用以恢复上述第四色彩检视表输出编码值的原有极性,并在Cb分量的量化数值为128时,强迫输出为0;- a fourth output polarity controller, which is used to restore the original polarity of the output coding value of the fourth color viewing table, and force the output to be 0 when the quantized value of the Cb component is 128; -第一对称地址解码器,其用以产生Cb分量所对称的第一及第二色彩检视表共用的字元地址;- a first symmetric address decoder, which is used to generate a character address shared by the first and second color view tables symmetrical to the Cb component; -第二对称地址解码器,其用以产生Cr分量所对称的第三及第四色彩检视表共用的字元地址;- a second symmetric address decoder, which is used to generate a character address shared by the third and fourth color view tables symmetrical to the Cr component; -第一加法器,其用以对Y分量量化数值及上述第三输出极性控制器的输出执行加法运算;- a first adder for adding the quantized value of the Y component and the output of the above-mentioned third output polarity controller; -第二加法器,其用以对上述第一及第四输出极性控制器的输出执行加法运算;- a second adder for adding the outputs of said first and fourth output polarity controllers; -第三加法器,其用以对Y分量量化数值及前述第二加法器的输出执行加法运算;- a third adder for performing an addition operation on the quantized value of the Y component and the output of the aforementioned second adder; -第四加法器,其用以对Y分量量化数值及前述第二加法器的输出执行加法运算;- a fourth adder for performing an addition operation on the quantized value of the Y component and the output of the aforementioned second adder; -第一限制电路,其对上述第一加法器的输出进行值域限制,输出R分量的量化数值;- a first limiting circuit, which limits the value range of the output of the above-mentioned first adder, and outputs the quantized value of the R component; -第二限制电路,其对上述第三加法器的输出进行值域限制,输出G分量的量化数值;- a second limiting circuit, which limits the value range of the output of the third adder, and outputs the quantized value of the G component; -第三限制电路,其对上述第四加法器的输出进行值域限制,输出B分量的量化数值。- A third limiting circuit, which limits the value range of the output of the fourth adder, and outputs the quantized value of the B component.
CN 99123280 1999-11-01 1999-11-01 A Device for Symmetrical Encoding Realizing Color Space Conversion Expired - Lifetime CN1097962C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 99123280 CN1097962C (en) 1999-11-01 1999-11-01 A Device for Symmetrical Encoding Realizing Color Space Conversion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 99123280 CN1097962C (en) 1999-11-01 1999-11-01 A Device for Symmetrical Encoding Realizing Color Space Conversion

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN94101514A Division CN1055365C (en) 1994-02-05 1994-02-05 A Method of Realizing Color Space Conversion by Symmetrical Coding

Publications (2)

Publication Number Publication Date
CN1262584A CN1262584A (en) 2000-08-09
CN1097962C true CN1097962C (en) 2003-01-01

Family

ID=5282852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 99123280 Expired - Lifetime CN1097962C (en) 1999-11-01 1999-11-01 A Device for Symmetrical Encoding Realizing Color Space Conversion

Country Status (1)

Country Link
CN (1) CN1097962C (en)

Also Published As

Publication number Publication date
CN1262584A (en) 2000-08-09

Similar Documents

Publication Publication Date Title
CN1148005C (en) Fast Joint Photographic Experts Group Huffman Coding and Decoding Method
JP4360416B2 (en) Image compression method, image compression apparatus, and program
CN1625893A (en) Compression of Palette-Processed Color Images Using Variable-Length Color Codes
CN1516848A (en) Method and system for obtaining coding gain in image codec based on wavelet transform
CN1497503A (en) Image encoding method and device, decoding method and device, encoding and decoding program
CN1139044C (en) A memory based VLSI architecture for image compression
CN101076125A (en) Algorithm for optimizing RGB and YCbCr conversion computing in image compression
JP2011015347A (en) Apparatus and method for processing image, program and recording medium
CN101039374A (en) Image lossless compression and image decompressing method
AU2005338473A1 (en) Repetition and correlation coding
CN1097962C (en) A Device for Symmetrical Encoding Realizing Color Space Conversion
CN1168283C (en) Method and apparatus for compressing data representing an image
CN1055365C (en) A Method of Realizing Color Space Conversion by Symmetrical Coding
CN1710946A (en) Method for overlaying character on digital picture
CN1195449A (en) Image encoding device, image decoding device and image transmission system
JP4906902B2 (en) Image processing apparatus and method
JPS60197072A (en) Coding processing method of color picture information
TWI496442B (en) Image processing method and image display device
CN1664862A (en) Image coding and decoding method
CN119255114A (en) Image processing method, device and storage medium
Trifan et al. A survey on lossless compression of Bayer color filter array images
Naaz et al. Implementation of hybrid algorithm for image compression and decompression
CN105554504A (en) Index map encoding and decoding methods based on ascending and descending tuples
CN1106118C (en) Color space signal conversion device and method
JP3119373B2 (en) Image coding device

Legal Events

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

Ref country code: HK

Ref legal event code: GR

Ref document number: 1062024

Country of ref document: HK

CX01 Expiry of patent term

Expiration termination date: 20140205

Granted publication date: 20030101

CX01 Expiry of patent term