Abstract:
An improved apparatus for reducing memory usage of look-up table mapping in an imaging system, a method related to the apparatus is also disclosed. The apparatus receives a digital input signal and processes it through a two-step mapping procedures instead of conventional skill that it uses only one look-up table, each procedure provides a series of mapping outputs. A comparing unit composed of a lot of logical gates is then comparing those mappings with original input signal and choosing the best one for preparing a final output. Finally, a final output corresponding to the best choice is providing for displaying.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to an imaging system, and more particularly to an apparatus for look-up table mapping in a scanning system to improve efficiency in memory usage, furthermore, to apply to a real-time scanning system without loss accuracy of system. 
     2. Description of the Prior Art 
     Up-to-date, there are more and more applications about imaging systems, such as camera and scanner, etc.. As the computer technology and the like are getting more and more progress, it seems impossibly to fit human beings&#39; desire. In recent years, the difference between the computer world and the real is fast vanishing, parts of it appears in imaging systems that images generated by an imaging system are from binary through gray-scales to color though people do not exactly feel this change that is happening each day. 
     Although it is a requirement that an imaging system is capable of imaging a picture in a manner with higher accuracy and resolution, more additional arithmetical operations are required to process such a great deal of image information. In a scanning system, there are lots of important tasks must be processed such as image processing, γ-correction, and high-light shadow, etc.. It is impossible for a scanner to complete such a great deal of tasks in a short time interval only by using hardware implementations even if it contains a powerful CPU (central processing unit) of Pentium-series. It goes without saying that a scanner can complete them as a real-time system. There are some schemes for overcoming the difficulty. One famous method of them is to use a look-up table that it is known as a popular skill in this art. There stores predetermined mapping information in a look-up table that follows a curve (usually, a monotone curve is chosen), and acts as a memory to provide an output each time when it receives an address. All skilled in the art know that this method is flexible, fast, and easy to implement in a real time manner, however, its disadvantages in performance are seldom under our considerations. One of these disadvantages is, while an input signal has more bits than ever, and the size of look-up table will increase incredibly. 
     It is seldom over 10 bits for an output signal in a scanning system owing to the visual of human being is insensitive to detail color differences. Typically, 8 bits for each output signal is enough for displaying. While we increase the bits of an input signal that increases the size of look-up table it will also result a look-up table to contain a lot of redundant mapping terms. Using FIG. I to simply describe this situation: an input signal follows the format of 16-bits per pixel and 8-bits per pixel for an output signal. Clearly, about 256 input signals map into an identity mapping terms on an average, that is, about 255 mapping items seem redundantly in the table. Moreover, if we choose the traditional skill that uses only one look-up table, at least a 2.sup.≠ ×8 memory (that is, a 64 KBytes memory) is necessary for storing the mapping information. Obviously, we hardly can find an ASIC chip containing such a great deal of memory storage, up-to-date (although it should not remain a problem in the future). The present invention just suggests an improvement related to this disadvantage. 
     SUMMARY OF THE INVENTION 
     It is the principal object of the present invention to provide an imaging system to be capable of efficiently reducing memory usage while the scheme of look-up table mapping is applied. 
     Because conventional skill in look-up table mapping is not so efficient while the bits contained in an input signal is more than ever, more memory storage is required for storing the mapping information. Furthermore, there needs an extra memory usage for storing a lot of redundant mapping terms. A more efficient skill is urgent desiring. The present invention suggests a two-step mapping apparatus to overcome this disadvantage, and only need to increase a little bit of logical gates. 
     According to the present invention, there provides a two-step mapping method accompanied by two look-up tables: a first look-up table stores the predetermined mapping information that follows a monotone curve, and a second look-up table stores the predetermined mapping information that follows the inverse function of the monotone curve used in first look-up table. A series of comparing procedures are then processed by means of the operations of the additional logical gate for providing a final output. 
     In operations, an input signal is masked to remain part of the input signal. The remainder parts then seems as an address of the first look-up table to map out a series of first-step mapping outputs. Again, these first-step mapping outputs then seem as addresses of the second look-up table to sequentially map out a series of second-step mapping outputs. A lot of series comparing procedures are then processing to compute the distance between each second-step mapping output and the original input signal, and to find the minimum among these distances. While obtaining the minimum distance, the first-step mapping output that causes the second-step mapping output having the minimum distance with original input signal is routed as the final output. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     Preferred embodiments of the invention will now be described in connection with the accompanying drawings, in which: 
     FIG. 1 represents the situation while input signal contains more bits than ever, and the conventional skill is applied; 
     FIG. 2 represents a block diagram of preferred embodiment according to the invention; 
     FIG. 3 represents a look-up table used in first-step mapping: 
     FIG. 4 represents a look-up table used in second-step mapping: 
     FIG. 5 represents a block diagram showing the configuration of a comparing unit of the preferred embodiment; 
     FIG. 6 describes the operations of a distance providing unit in the comparing unit: and 
     FIG. 7 describes the operations of a final output providing unit in the comparing unit. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     A preferred embodiment of the present invention will be described hereinafter. 
     FIG. 2 represents a block diagram of the improved look-up table mapping apparatus 200 according to the present invention. The apparatus 200 comprises a mask 201 for receiving a 16-bits input signal Si 16  and then removing the lower byte of the input signal S 16  but remaining the upper byte X 8 . Hereinafter, all subscripts represent the bits contained in a signal. A first look-up table 202 stores the predetermined mapping information derived from a monotone curve. The first look-up table 202 receives the upper byte X 8  of the input signal Si 16  to provide a series of first-mapping outputs Y 8 . A second look-up table 203 stores the predetermined mapping information derived from a monotone curve that is the inverse function of the monotone curve used in the first look-up table. The second look-up table 203 receives the first-mapping outputs Y 8  and provides a series of second-step mapping outputs X 16 . A comparing unit 204 composed of a lot of logical gates receives the original input signal Si 6 , the first-mapping outputs Y 8 , and the second-step mapping outputs X 16  to provide a final output So 8 , control unit 205 generates control signals to the first look-up table 202 and the second look-up table 203 for controlling mapping actions, and generates control signals to the comparing unit 204 for controlling a sequential of comparing procedures to provide a final output So 8 . Hereinafter, each time when a signal with an upperbar over it implies that there is a series of outputs containing in the signal. 
     Each time when an input signal Si 16  arrives the mask 201 truncates its lower byte and then provides the upper byte X 8  to the first look-up table 202. The first look-up table 202 receives X 8  and regards it as an address to map out a series of first-step mapping outputs. In FIG. 2, there uses Y 8  to simply represent these first-step mappings outputs Y 8   - , Y 8 , and Y 8   + . There are three parts of outputs containing in Y 8 . Y 8  represents the direct 8-bits mapping output corresponding to X 8  ; Y 8   +   represents an 8-bits mapping output that is the next adjacent value of the Y 8  in the first look-up table 202. Finally, Y 8  represents an 8-bits mapping output that is the last adjacent value of the Y 8  in the first look-up table 202. For example: if Y 8  is equal to 100, then Y 8   -   is 99 and Y 8   +   is 101. FIG. 3 describes the relationships among Y 8   - , Y 8 , and Y 8   + . In other words, an address of first look-up table 202 will cause three first-step mapping outputs. To complete this, the control unit 205 must provide three times of read enabling signals to the first look-up table 202 to read out Y 8   - , Y 8 , and Y 8   +   each time when an &#34;address&#34; X 8  arrives. 
     Referring to FIG. 4, it is obvious that Y 8   - , Y 8 , and Y 8   +   are regarded as addresses of the second look-up table 203, and a series of 16-bits outputs X 16  (including X 16   - , X 16 , and X 16   + ) are mapped out corresponding to Y 8  (including Y 8   - , Y 8 , and Y 8   + ). That is, a series of 16-bits outputs X 16   - , X 16 , and X 16   +   are mapped out by using Y 8   - , Y 8 , and Y 8   + , respectively. Note again that the monotone curve used in the second look-up table 203 must be the inverting function of the one used in the first look-up table 202. This is the reason why a constraint that a monotone curve is used in these look-up tables must be held. In addition, X 16   - , X 16 , and X 16   +   may not be adjacently connected as the relationships among Y 8   - , Y 8 , and Y 8   + . The control unit 205 is capable of easily controlling the series mapping actions because it just follows the conventional steps of memory mappings. All second-step mapping outputs X 16  are then sequentially provided to the comparing unit 204 for further processing. 
     FIG. 5 describes a more detail configuration of the comparing unit 205. Obviously, the comparing unit 205 comprises three principal elements described following. A distance providing unit 501 receives the original input signal Si 16  and the second-step mapping output X 16  to calculate the distance between each second-step mapping output and the original input signal Si 16 . So-called distance here is defined as the absolute value of the difference between a second-step mapping output and the original input signal Si 16 . A series of distances D are then routing out. A minimum providing unit 502 receives the distances D to determine the minimum distance m among D. The minimum distance m is then provided. A final output providing unit 503 receives the minimum distance m and the first-step mapping outputs Y 8 . Finally, output So 8  by means of the minimum distance m. 
     In operations, X 16   - , X 16 , and X 16   +   can be separately applied to find their distances with the original input signal Si 16  in the distance providing unit 501, and named these distances to be D - , D, and D + , respectively. In FIG. 5, there uses a symbol D to simply represent these three distances, D - , D, and D + . FIG. 6 describes the operations of the distance providing unit 501. For example: the absolute value of the difference between X 16   -   and Si 16  is defined as D - , i.e., |X 16   -  -Si 16  |32 D - . These distances D are then routed to the minimum providing unit 502 to determine the minimum distance m. The minimum distance m is then routed to the final output providing unit 503. There still needs the first-step mapping output Y 8  (i.e. Y 8   - , Y 8 , and Y 8   + ) for the final output providing unit 503 to decide the final output So 8 . 
     After finding the minimum distance m, the final output So 8  is fixed by providing the first-step mapping output that results the second-step mapping output having the minimum distance m. FIG. 7 describes the operations of the final output providing unit 503. For example: if D is the minimum distance, then Y 8  will become the final output So 8  because Y 8  results the second-step mapping output X 16  with the minimum distance m. 
     However, traditional circuit designs can easily implement these tasks of the comparing unit 204, such as performing a subtraction operation between two values, and calculating the absolute value for a number by comparing its sign bit, etc.. There are a lot of ready-made logical gates for performing these tasks. 
     One thing must note here is that it is necessary for the first look-up table 202 to provide three series first-step mapping outputs Y 8  when the X 8  arrives. If only a first-step mapping output is used, and assuming the first-step mapping output to be Y 8 , the direct mapping output Y 8  with respect to X 8  may be an improper output. It should be noted that when only parts of an input signal is applied mapping that it may cause more deviations, especially when the truncating and/or rounding operations are unavoidable. A reasonable way is to apply a series of neighboring first-step mapping outputs Y 8  instead of only the Y 8  to be addresses of a second look-up table to inverting-functionally map out a series of second-step mapping outputs X 16 . The X 16  then compare with the original input signal Si 16  to determine which one is most closed to Si 16 . It may be a better choice that provides the one among Y 8  resulting its second-step mapping most closed to Si 16  than direct provides Y 8  without another comparing procedures. 
     While the scheme of the present invention is completely describing, a table following simply compares the memory usage between conventional skill and the new scheme according to the present invention: 
     
         ______________________________________  Conventional Skill (bits)                New Scheme (bits)______________________________________m = 9, n = 8    512 × 8 = 4096                    256 × 9 + 256 × 8 = 4352m = 10, n = 8    1024 × 8 = 8192                    256 × 10 + 256 × 8 = 4608m = 12, n = 8    4096 × 8 = 32768                    256 × 12 + 256 × 8 = 5120m = 16, n = 8    64 × 1024 × 8 = 524288                    256 × 16 + 256 × 8 = 6144m = 16, n = 12    64 × 1024 × 12 = 786432                    256 × 16 + 4096 × 12 =                    114688______________________________________ 
    
     where m represents the bit number of an input signal and n represents the bit number of an output signal. Because the visual of human being is insensitive to detail color differences, the bit number of an output signal is seldom over 10 bits. Typical number is 8 bits. 
     As can be seemed in the table above, while the bit number of an input signal is almost the same with the bit number of an output signal (ex.: (m-n)≦1), the suggested new scheme goes invalid because it causes the memory usage more than conventional skill. The information of the first row in the above table shows the truth that when an input signal contains 9 bits and an output signal contains 8 bits. That is conventional skill requires 4096 bits of memory but new scheme requires 4352 bits. In fact, not only the memory usage is less efficient than conventional skill, but more hardware operations are required when the new scheme is applied. 
     As contrast with the first row of the above table, the information of those remaining rows tell us another truth that the new scheme is powerful as long as the bit number of an input signal is larger than the bit number of an output signal. Typically, the difference between m and n must at least be 2(i.e. (m-n)≧2). For example: the fourth row of the above table describes that while an input signal contains 16 bits and an output signal contains only 8 bits, the conventional skill requires a tremendous usage of memory, 524,288 (512K)bits| In the same time, the new scheme only requires 6144 (6K) bits of memory. This proves that the new scheme is more powerful than conventional skill, especially when the difference bit number between the input and output signal is more than 2 bits. 
     However, the more difference between m (bits in an input signal) and n (bits in an output signal), the more efficient to memory usage we obtain. This also holds the proof of the information through the second row to the fourth row of the above table. Clearly the situation describing in third row of the above table is more efficient in memory usage than the situation describing in the second row.(because we save 32768-5120=27648 bits in the third row`situation but only save 8192-4608=3584 bits in the second row`) A similar event appears between the fourth row and the second row except more memory bits are saved. (in fourth row, 524288-6144=518144 bits are saved but only 3584 bits are saved in the second row`) 
     As the present invention has been described with preferred embodiment it will be obviously to those skilled in the art that various modifications may be made. For example, the minimum providing unit and the final output providing unit in the comparing unit can be combined together for receiving the distances and first-step mappings and providing a final output; the minimum distance can be replaced by other symbol for clearly indicating the first-step mapping that raises the minimum distance. These variations to the described embodiment of the present invention, the scope of which is limited by the following claims.