PICTURE DATA STORAGE SYSTEM

Abstract: A picture data storage system and an apparatus and a method for compressing picture data including a map memory and a data memory. The map memory contains a plurality of picture unit memory regions while the data memory contains a plurality of picture data memory regions. A pointer is stored in each picture unit memory region of the map memory, one pointer for each corresponding unit of input data. For units of input picture data containing other than all «O»s, the data is stored in a corresponding picture data regidn of the data memo­ ry. On the other hand, for all picture units containing all «O»s (completely white), the pointers point to a single picture data memory region in the data memory which contains all«o»s.

Description: The present invention relates to picture data storage systems. More particularly, the invention relates to a picture data storage system in which binary (black and white) or multi-valued (shaded image) picture data is stored in a memory of relatively small capacity and in which data can be easily inputted, outputted and edited. Heretofore, a picture data storage system has been employed in which picture data outputted serially (element by element) from a sensor array by electronically scanning the array in a main scanning direction is stored directly. In another known system, the data is compressed one-dimensionally (in the main scanning direction) prior to storage. The former system in which the picture data is stored directly suffers from a drawback in that the required memory capacity is relatively large. On the other hand, the latter system in which the data is compressed one dimensionally is advantageous with regard to storage capacity and in the case where the data is to be communicated externally, but is disadvantageous in that it is rather difficult in editing pictures. The term "editing" as used here means that parts of a picture are moved or overlapped, or an image is rotated, or reduced or enlarged. It is already known from US-A-3921135 to store image data in a memory which is divided into two parts. One such part stores actual image data in serially arranged blocks, whilst the other part simply contains a 0 or a 1 to indicate whether image data is present in a corresponding block of the image data memory. By virtue of the serial arrangement of data, editing is a complex task. It is an object of the present invention to provide a picture data storage system in which picture data can be stored in a memory of relatively small capacity and the data can easily be edited. In accordance with the invention there is provided a picture data storage system for storing picture data representing an image; said system comprising: (a) a map memory divided into a plurality (p x q) of memory regions corresponding to (p x q) picture units which may or may not contain image information, said picture units being obtained by two-dimensionally dividing an image, each of said picture units consisting of a matrix of (M x N) bits, where p is the number of picture units in a horizontal scanning direction, q is the number of picture units in a vertical scanning direction; M is the number of bits in one picture unit in the horizontal scanning direction and N is the number of bits in one picture unit in the vertical scanning direction; and (b) a data memory for storing picture data representing said picture units; characterised in that each memory region of said map memory stores either a pointer which indicates an address of said data memory at which said picture data are stored when image information exists in the corresponding picture unit or a predetermined number when no image information exists in the corresponding picture unit. Figs. 1 and 4 are explanatory diagrams showing methods of dividing pictures into units; Figs.2 and 5 are explanatory diagrams showing examples of a map memory; Figs. 3 and 6 are explanatory diagrams showing examples of a data memory; Figs. 7A-7C, 8A-8E and 9A and 9B are explanatory diagrams showing operational relationships between the map memory and the data memory; Fig. 10 is a block diagram of a preferred embodiment of a picture data conversion system according to the invention; Figs. 11A and 11B are explanatory diagrams for a data memory in a system of the invention; Figs. 12A-12C, taken together, are a flowchart for a description of the operation of the system of Figs. 11A and 11B; Fig. 13 is a block diagram showing another embodiment of a picture data conversion apparatus according to the invention; Figs. 14, 15A and 15B are flowcharts for a description of the operation of the apparatus in Fig. 13; Fig. 16 is a block diagram showing a further embodiment of an apparatus according to the invention; and Figs. 17A, 17B and 18 are flowcharts for a description of the operation of the apparatus of Fig. 16. The invention will now be described in detail with reference to the accompanying drawings. Fig. 1 is an explanatory diagram showing the division of a picture or image into units. In Fig. 1, reference numeral 1 designates an entire picture. The picture 1 is divided into p x q units with the horizontal side of the picture 1 containing M x p dots and the vertical side containing N x q dots. Fig. 2 is an explanatory diagram showing an example of a map memory. As is apparent from Fig. 2, the map memory 2 is composed of p x q memory regions which correspond in position to respective ones of the picture units of the picture shown in Fig. 1. The following data is stored in the various picture unit memory regions of the map memory: (1) If the picture data of a picture unit contains all "0"s (completely white - no image information), "0" s (or some other predetermined number if desired) are stored in the corresponding picture unit memory region. (2) If the picture data of a picture unit is not composed of all "0"s, there is stored a pointer to a data memory location at which the complete picture data of the corresponding unit is stored. Alternately, a link address, for instance, the top address of a data memory, may be stored. Fig. 3 is an explanatory diagram showing the arrangement of the data memory. The data memory 3 stores the complete picture data of picture units which do not contain all "0"s. Each such unit contains M X N dots. As stated above, addresses for this data are specified by the map memory. For instance in the case where the picture units (i,j) and (l,m) include image information other than all "0"s, the data representing the states of the M X N dots which make up the units is stored in picture data memory regions 3-1 and 3-2, respectively, in Fig. 3. The pointers to these picture data memory region are stored in the picture unit memory regions (i,j) and (l,m) of the map memory. As is clear from the above description, the picture unit memory regions of the map memory 2 must coincide in position with the units of the picture. The picture data memory regions of the data memory 3 of course may, however, be arranged in any order as long as they correspond with the various picture unit memory regions. The picture data storage system according to the invention will now be described in more detail with reference to an example in which a binary (black and white) B4 size picture is read with a resolution of 11 lines/mm and then compressed according to the above-described system in units of 16 dots x 16 dots and stored in a memory having 16 bits/word. The picture 1 in this example is made up of 4064 dots x 2816 dots, or 254 x 176 units, as shown in Fig. 4. Therefore, a map memory 2 having a storage capacity of 254 x 176 words (one memory unit being equivalent to one word) as shown in Fig. 5 is provided. At the maximum, that is, in the case where none of the picture units are "white", the data memory requires a capacity 715K words. The pointers to the data memory, which are stored in the various picture unit memory regions of the map memory 2, preferably point to "top" addresses that is, tops of "stacks", each of which contains the picture data of an entire picture unit. Sixteen bits/word is insufficient in this case for this purpose. Therefore, in this case, taking into consideration the fact that the picture data of each picture unit contains 16 words, the pointers should be equal to the corresponding top address divided by 16. In the example of Fig. 4, units A and D of the picture 1 contain all "0"s, and therefore "0"s are stored in the corresponding picture unit memory regions A-1 and D-1 of the map memory 2 (Fig. 5). Units B and C of the picture 1 include image information (16 dots x 16 dots) and must be stored in the data memory 3 (Fig. 6) at addresses 120₁₆ (that is, 120 to the base 16, or 120 in hexadecimal form) and 270₁₆. Addresses 12₁₆ and 27₁₆ (120₁₆ and 270₁₆ divided by 10₁₆, respectively) are therefore stored in the corresponding picture unit memory regions of the map memory 2, as shown in Fig. 5. In the above-described example, the capacity of the map memory 2 is fixed at 254 X 176 words; however, the capacity of the data memory 3 may be chosen taking into consideration the nature of image information to be processed. Further, in the above-described system, data representing whether or not the picture units each consist of M x N dots, can be stored in the map memory. Complementary data representing a wider range (M' X N' units) may be added to that data if desired. Such complementary data may take the following form: (1) Data indicative of whether or not all the units on a line of the map memory are all "white". This technique increases the overall processing speed. (2) Data indicative of the number of units on each line of the map memory which are not "white". Employment of this technique can also increase the processing speed. Specifically, when, in reading a line, the number of units read containing image information becomes equal to the number of units of stored data, the reading operation can shift to the next line. In addition, an error check can be made using the number of units thus detected. Furthermore, according to the invention, units containing the same image information may share a picture data memory unit. This can be implemented as follows: As shown in Fig. 6, a picture memory region 31 for an all white picture unit is provided in the data memory 3. When a unit is all "white" (all "0"s), the corresponding pointer stored in the map memory 2 points to the region 31 in the data memory 3. This is advantageous in that all "white" units can be handled completely in the same manner as the other units. As described above, in accordance with this embodiment of the invention, the various units of the picture being scanned are identified with the picture unit memory regions of the map memory. Thus, any given position in the picture can be linked with a corresponding picture data memory region of the data memory by means of the pointers stored in a picture unit memory region of the map memory. Furthermore, the memory position for storing the picture data of each unit is not particularly limited. Accordingly, units which contain the same image information can share a common picture data memory region. The above-described sharing of picture data memory regions can be effected between units of multiple pictures as well as those of a single picture. In addition, movement of parts of a picture can be achieved merely by moving the data in the map memory. Thus, the above-described system is simple in construction, and moreover has a high operating speed compared with a system in which picture data is stored directly. Furthermore, ORing and ANDing of binary picture data can be carried out in units. These logical operations can be achieved quickly by utilizing a single (M X N) unit containing all "0"s. This technical concept can be applied not only to a single picture but also to multiple pictures. In the picture data storage system of the invention, after picture data for a entire original document sheet, or for N scanning lines on such a document, has been read and stored, it may be detected whether or not picture data is already available for each unit so that it can be determined whether or not it is necessary to store the picture data in the map memory and data memory. Alternatively, it can be determined whether or not picture data is available for each unit for every scanning line. The latter is effective in reducing the needed buffer memory capacity. A technique of the invention for determining when a picture unit is all "white" and a preferred embodiment of a picture data conversion apparatus of the invention will now be described It is assumed that a symbol "NIL" indicates a pointer should be stored in the map memory which point to the all "0"s picture data memory region 31 in Fig. 6. (1) Referring to Figs. 7A and 7B, in the first line (in the main scanning direction) in Fig. 7A, it is found that the p-th unit includes data other than all "0"s. Therefore, a picture data memory region for the p-th unit is allocated Thus, as shown in the Fig. 8B, instead of "NIL", a pointer b to the appropriate data memory is stored in the p-th memory region in the map memory. As shown in the Fig. 8C, the data of the p-th unit is stored in the first word of the picture data memory region thus allocated. The first lines of the first, second,---- and (p-1) units remain "NIL", being all "0"s. (2) In the second line in Fig. 7A, the second unit includes data other than all "0"s. Therefore, similar to the above-described case (1), a data memory region of N words for the second unit is allocated, and instead of "NIL" , a pointer a is inserted in the corresponding memory region of the map memory. As shown in Fig. 8E, "0"s are stored in the first word of the data memory region thus allocated and the data of the second line stored in the second word position. As for the p-th unit, a data memory region has already been designated with the pointer b . Therefore, the data of the second line of the p-th unit is automatically stored in the second word of the second memory region of the data memory which has been identified with the pointer b . In the first unit, both the first and second lines are all "0"s and therefore the corresponding columns remain "NIL". (3) Continuing on in the same manner, the data of the Fig. 7A is processed line by line up to the N-th line. In the example given, in the first unit, all the N lines are "0"s; that is, the first unit is made up entirely of white picture elements. Accordingly, the map memory region for the first unit remains "NIL". (4) As a result of the process, the assembled map memory and the data memory contents which are produced for the data shown in Fig. 7A are as shown in Figs. 9A and 9B, respectively. The above-described processing is carried out by referring to the input data word by word (each word being composed of 16 bits in the example of Figs. 7A-7C). Therefore, the described processing can be implemented using only one or two buffers each having a capacity of one word. A preferred embodiment of a picture data conversion system of the invention will be described with reference to Fig. 10. More specifically, the system will be described with reference to the case where one unit is made up of M X N bits as shown in Fig. 1 and M = 16 and N = 16, that is, one word is composed of 16 bits, and one unit is made up of 16 words. In this embodiment, it is assumed that signals are processed in hexadecimal form. If, in this case, a value which is obtained by dividing a data memory address by 16 (10₁₆) is used as a pointer, then the amount of data memory address space which can be addressed with each can be increased. For instance, when in a case where addressing is performed using 16 bits and the value which is obtained by dividing the data memory address by 16 is not used as the pointer, the data memory address space which can be accessed with the 16 bits extends only from 0 to FFFF, as shown in Fig. 11A. On the other hand, when values as described above are used as the pointer, the data memory address space which can be addressed is increased to 0 to FFFFF, as shown in Fig. 11B. Thus, the invention will be described with reference to pointer values which are obtained by dividing the data memory address by 16. In Fig. 10, reference numeral 11 designates a FIFO (First In First Out) memory device to which data read by an input scanner is applied in words of 16 bits. Reference numeral 12 indicates a buffer which, in response to a command from a CPU, temporarily stores each data word read out from the FIFO. Reference numeral 13 indicates a binary counter, the count value of which is increased by one each time one word is inputted to the buffer 12 from the FIFO 1. It is detected whether or not the data received in the buffer 12 is all "0"s, and the result of this detection is applied, as a signal DZ, to the CPU. A number equal to the complement of the number of words in the main scanning direction of the picture is inputted to the unit counter 13 in advance. When the count value of the unit counter reaches zero by adding one thereto whenever one word is inputted to the buffer 2 as described above, the unit counter provides a carry UC to indicate the end of a line. Further in Fig. 10, reference numeral 14 designates a line counter in which zero is set as the initial value. The counter 14 is incremented by one whenever the carry UC is generated as described above. The line counter produces a carry LC whenever a carry from its four lower-order bits occurs. Reference numeral 15 designates a map address register, and 16 a main memory including both a map memory area and a data memory area. The map address register 15 temporarily stores the addresses for the map memory for units which include data read out from the FIFO 11. More specifically, first the top address of the map memory is inputted to the map address register 15. The content of the unit counter 13 is then increased by one each time one word is read out of the FIFO 11 and is reset to the initial value upon the generation of the carry UC. Therefore, each unit of the map memory is scanned 16 times. When the carry LC is produced, the top address for the next 16 lines is inputted. Reference numeral 17 designates a pointer register. The content of the map memory which has been addressed by the map address register 15 is stored in the pointer register. If the content thus stored is all "0"s, a signal PZ indicating this fact is raised to a logical "1" level. The pointer inputted to the pointer register 17 is the value which is obtained by dividing the memory address by 16 (10₁₆) as described above. Therefore, if the content of the map memory is not all "0"s, as determined by the four lower-order output bits from the line counter, the data memory in the main memory 16 is addressed. Further in Fig. 10, reference numeral 18 designates a next pointer register. When the pointer inputted to the pointer register 17 is "0" and the data inputted to the buffer 12 includes data other than all "0"s, the content of the register 18 is transferred to the pointer register 17. One is added to the next pointer register 18 after the next pointer is transferred to the pointer register 17. Still further in Fig. 10, reference numerals 19, 20 and 21 designate a memory address bus, a memory read bus, and a memory write bus, respectively. The operation of the system thus constructed will be described with reference to the flowcharts of Figs. 12A to 12C, which are parts of a composite flowchart. Step 1-1 . A map memory top address is placed in the map address register 15. The line counter 14 is reset to zero . A number equal to the complement of the number of words in the main scanning direction of the picture is set in the unit counter 13. Step 1-2 . The data of one word is inputted into the buffer 12 from the FIFO 11. Step 1-3 . It is determined whether or not the data of the word stored in the buffer 12 is all "0"s. If not, step 1-4 is effected. If the data is all "0"s, step 1-10 is carried out. Step 1-4 . The map memory is accessed through the memory read bus 19 from the map address register 15. Step 1-5 . The map memory data, that is, the pointer value, is read out and inputted through the memory read bus 20 to the pointer register 17. The value which is obtained by dividing the data memory address by 16 is stored as the pointer in the map memory as described with reference to Fig. 11B. Step 1-6 . It is determined whether or not the pointer stored in the pointer register 17 is "0". If "yes", step S-7 is carried out. If "no", step 1-9 is performed. Step 1-7 . The data of the next pointer register 18 is stored in the map memory through the memory write bus 21. The data of the next pointer register 18 is transferred to the pointer register 17. The initial value of the next pointer register 18 is set to a predetermined value. Step 1-8 . One is added to the content of the next pointer register 18. Step 1-9 . The data memory in the main memory 16 is accessed through the memory address bus 19 at an address which is obtained by inserting the four lower-order bits of the line counter 14 below the least significant bit of the pointer stored in the pointer register 17. Next, one word of data inputted to the buffer 12 is transferred through the memory write bus 21 to the data memory and stored at the accessed address. Step 1-10 . One is added to the data in the map address register 15. Step 1-11 . One is added to the content of the unit counter. Step 1-12 . It is detected whether or not the count value of the unit counter is "0". If "yes", step 1-13 is carried out. If "no", step 1-2 is carried out again. Step 1-13 . One is added to the content of the line counter 14. Step 1-14 . It is detected whether or not the count value of the line counter is smaller than the number of lines in one page. If "yes", then step 1-15 is carried out. If "no", the operation is ended. Step 1-15 . A number equal to the complement of the number of words in the main scanning direction of the picture is set in the unit counter 13. Step 1-16 . It is determined whether or not the count value of the line counter 14 is a multiple of 16. If "yes", step 1-2 is carried out again. If "no", step 1-17 is executed. Step 1-17 . The value which is obtained by subtracting the number of words in the main scanning direction from the map address is set in the map address register 15. Through steps 1-16 and 1-17, the same part of the map memory is scanned 16 times. As is apparent from the above description, according to the invention, by providing only one or two buffers 12 having a capacity of one word, conversion of input picture data can be achieved such that either "0" or an actual pointer is stored in the map memory, and, for the latter case, picture data of a unit including data other than all "0"s is stored in a region of the data memory which corresponds to the pointer. Accordingly, the buffer employed in the system of the invention can be much smaller in capacity than that in the conventional system. The system of the invention has been described with reference to the case where the input data is stored in a FIFO. However, the FIFO may be omitted if the speed of inputting the data into the buffer 12 is matched with the processing speed of the system. Furthermore, if the data applied to the buffer 12 includes a line end indicating signal, it is possible to eliminate the unit counter 13 which is used for detecting the end of each line. In this case, the line ending signal is separated from the input data and applied to the line counter 14. In the above-described system, adding the four lower-order bits of the line counter 14 to the least significant bit of the pointer in step 1-9 is achieved with a hardware arrangement; however, it may be carried out in software if desired. In addition, the map address register 15 may be controlled by software instead of the unit counter 13 and the line counter 14. While this embodiment of the invention has been described with reference to a case where each unit (picture data region) contains 16 x 16 bits, it should be noted that the invention is not limited thereto or thereby. A further example of a picture data conversion apparatus according to the invention will now be described. The apparatus will be described with reference to the case where the picture data in which a word is 16 bits and a line of 256 words is compressed with 16 bits X 16 words as one unit, that is, M - N - 16 and p - 256 in Fig. 1. In Fig. 13, reference numeral 31 designates an S/P (Serial/Parallel) converter for converting an input signal A (RIS video signal) which is inputted in a serial mode, into a parallel signal; 32a and 32b, input line selecting circuits which are alternately made active and inactive; and 33a and 33b, first and second buffer address registers, respectively. Each of the buffer address registers 33a and 33b in this embodiment is assumed to be 12 bits long, consisting of eight lower-order bits and four higher-order bits. In the registers 33a and 33b, whenever the end of a line is reached, the eight lower-order bits (2⁸ = 256) are cleared and one is carried (added to) to the four higher-order bits. Thus, whenever one complete line (256 words) has been read, the eight lower-order bits are cleared (set to zero), and at the end of 16 lines, the four higher-order bits are cleared. A buffer control circuit 34 outputs an input line selecting signal B used to select one of the input line selecting circuits 32a and 32b, and applies one pulse of the signal B to the buffer address register 33a or 33b whenever one word is written in a memory buffer. First and second memory buffers 35a and 35b, having a capacity of 256 words x 16 lines, receive input signals of 16 bits per word through the input line selecting circuits 32b and 32a. In other words, each of the first and second memory buffers 35a and 35b can store 256 data units at a time. Further in Fig. 13, reference numerals 36a and 36b designate output line selecting circuits one of which is selected by a line selecting signal C from a CPU (not shown); and 37, a "0" detector for detecting whether or not the data of 16 bits passed through the output line selecting circuit is all "0"s. A register 38 temporarily stores the data of 16 words (one unit) read out from either of the memory buffers 25a and 35b. Also in Fig. 13, reference numeral 39 designates a map address register; 40, a data address register; 41, a 16-bit "0" data generator; and 42, a main memory including a map memory area and a data memory area. The map address register 39 is 20 bits long, and is connected to a memory address bus. The data address register 40 is also 20 bits long, consisting of four lower-order bits and 16 higher-order bits, the latter being applied to a memory write bus 44. The 20 bits consisting of the four lower-order bits and the 16 higher-order bits are applied to a memory address bus 43. The operation of the system thus constructed will now be described. First, an operation in which an input signal which has been converted into a 16-bit parallel signal by the S/P converter 31 is stored in one of the memory buffers 35a and 35b will be described with reference to the flowchart of Fig. 14. In this connection, it should be noted that, in the first and second memory buffers 35a and 35b, addresses in the main scanning direction are specified by the eight lower-order bits of the first and second buffer address registers 33a and 33b, and addresses in the auxiliary scanning direction with the four higher-order bits. Step 2-1 . The input line selecting circuit 32a, for instance, is selected by the input line selecting signal B. Step 2-2 . The second buffer register 33b is cleared. Step 2-3 . The S/P converter provides the data of one word, which is stored in the second memory buffer 35b in correspondence with the address specified in step 2-2. Step 2-4 . One is added to the content of the second buffer address register 33b. Step 2-5 . It is determined whether or not a carry has occurred from the second buffer address register 33b. If "no", step 2-3 is effected again. steps 2-3 and 2-4 are repeatedly carried out until the occurrence of a carry from the second buffer address register 33b is detected, whereupon the data of 256 words x 16 bits is stored in the second memory buffer 35b. If "yes" in step 2-5, step 2-6 is effected. Step 2-6 . It is detected whether or not all the picture data has been inputted. If "yes", the operation is ended. If "no", the next step 2-7 is carried out. Step 2-7 . The input line selecting circuit 32b is selected by the input line selecting signal. Step 2-8 . The first buffer address register 33a is cleared to zero. Steps 2-9, 2-10 and 2 11. These steps are similar to steps 2-3 2-4 and 2-5 described above. If a carry occurs in the first buffer address register 33a in step 2-11, that is, if "yes" is found in step 2-11, the data of 256 X 16 words is stored in the first memory buffer 35a. Step 2-12 . It is detected whether or not all the picture data has been inputted. If "yes", the operation is ended. If "no", step 2-1 is effected again to repeat the above-described operation. The data stored in the second memory buffer 35b is read out while input data is being written into the memory buffer 35a, while on the other hand, the data stored in the first memory buffer 35a is read out while input data is being written in the second memory buffer 35b. A preferred procedure for reading data out of the first and second memories 35a and 35b will be described with reference to the flowchart of Figs. 15A and 15B. Step 3-1 . The first address of the map memory in the main memory 42 is set in the map address register 39, and the first address of the data memory is set in the data address register 40. In this case, the first address of the data memory should be one whose four lower-order bits are "0". Step 3-2 . The output line selecting circuit 36b is selected by the read line selecting signal C. Step 3-3 . The first buffer address register 13a is cleared to zero. Step 3-4 . One word is read out of the first memory buffer 35a and is stored in the 16-word register 38. Step 3-5 . One is added to the four higher-order bits of the first buffer address register 33a. Step 3-6 . It is detected whether or not a carry has occurred from the four higher-order bits of the first buffer address register 33. If "no", step 3-4 is effected again. If "yes", the next step 3-7 is performed. It can be readily understood that, when "yes" occurs in step 3-6, the data of one unit will have been transferred from the first memory buffer 35a to the 16-word register 38. Step 3-7 . It is detected by the "0" detector 37 whether or not the data inputted to the 16-word register 38 is all "0"s. If "no", step 3-8 is carried out, and if "yes" , step 3-12 is carried out. Step 3-8 . A pointer, which is the 16 higher-order bits of the data address register 40, is written at the address of the map memory in the main memory 42 which has been specified by the content of the map address register 39. Step 3-9 . One word of the 16-word register 18 is written at the address of the data memory specified by all the bits (20 bits) of the data address register 40. Step 3-10 . One is added to the content of the data address register 20. Step 3-11 . It is detected whether a carry has occurred from the four lower-order bits of the data address register 40. If "no", step 3-9 is carried out again. If "yes", steps 3-9 and 3-10 are repeatedly carried out until the occurrence of the carry is detected, that is, until an answer of "yes" is obtained. At that time, all of the data stored in the 16-word register 38 will have been transferred to the data memory. Step 3-12 . If it is determined in step 3-7 that the data stored in the 16-word register 38 is all "0"s, "0"s generated by the "0" data generator are stored in the address of the map memory specified by the map address register 39. Step 3-13 . One is added to the content of the map address register 19. Step 3-14 . It is detected whether or not all words have been read out of the first memory buffer 35a. If "no", step 34 is effected again, and steps 3-4 through 3-13 are repeated. If "yes", the next step 3-15 is carried out. Step 3-15 . It is detected whether or not new data has been inputted into the second memory buffer 35b. If "no", the operation is ended. If "yes", step 3-16 is conducted. Step 3-16 . The output line selecting circuit 36a is selected. Step 3-17 . The second buffer register 33b is cleared to zero. Step 3-18 . One word is read out of the second memory buffer 35b and stored in the 16-word register 38. The same procedures as those in steps 3-5 through 3-13 are repeated. Step 3-19 . It is detected whether or not all words have been read out of the second memory buffer 35b. If "no", step 3-18 is effected again, and if "yes" the next step 3-20 is carried out. Step 3-20 . It is detected whether or not new data has been inputted into the first memory buffer 35a. If "yes", step 3-2 is effected again, and if "no" the operation is ended. As is apparent from the above description, according to the invention, when the data of each unit of a picture (as shown in Fig. 1) is all "0"s, "0"s are inputted to the respective region in the map memory, and when the data of each unit is other than all "0"s, an actual pointer is inputted thereto. Only when the unit includes data other than "0"s can all the data of the unit be stored in the data memory region which corresponds to the pointer. In the above-described embodiment of a picture data conversion apparatus of the invention, two memory buffer& of 256 x 16 words are provided, and writing and reading thereinto and therefrom are carried out alternately. Therefore, compression of picture data can be achieved at a high speed. Another embodiment of an apparatus of the invention in which data is not only compressed but also restored will be described with reference to Fig. 16. In Fig. 16, reference numeral 45 designates a memory read bus; 46, a data bus; 47a and 47b, first and second load line selecting circuits which are opened and closed by control signals C from a CPU; 48a and 48b, first and second output line selecting circuits; and 49, a P/S (parallel/serial) converter. The other components are the same as in Fig. 13 The data compressing process of this embodiment will not be described here because it is the same as that of the embodiment of Fig. 13. The operation of restoring data which has been compressed will be described with reference to the flowchart of Figs. 17A and 17B. The term "restoration" or "restoring" is intended to mean formation of original data as shown in Fig. 1 from compressed data stored in the map memory and the data memory as shown in Figs. 2 and 3. First, an operation will be described in which the "0" data generator 41 and the corresponding data memory region in the main memory 42 are accessed with the pointer and data "0" (NIL), which are stored in the map memory in the main memory 42, and data read out of the "0" data generator 41 and the data memory is stored in the first or second memory buffer 35a or 35b. Step 4-1 . The top address of the map memory is inputted to the map address register 39 and "0"s are set in the four lower-order bits of the data address register 20. Step 4-2 . One of the first and second load line selecting circuits 47a and 47b, for instance, the circuit 47a, is selected by the control signal C from the CPU (not shown). Step 4-3 . The second buffer address register 33b is cleared to zero. Step 4-4 . The map memory in the main memory 42 is accessed, through the memory address bus 43, with a map address in the map address register 3a. Step 4-5 . It is detected whether or not the data of the map memory is all "0"s. If "no", the next step 4-6 is effected. If "yes", step 4-13 is carried out. Step 4-6 . The data of the map memory, that is, the pointer, is set in the 16 higher-order bits of the data address register 40. Step 4-7 . The data memory is accessed to read one word therefrom, and the word thus read is inputted to the 16-word register 38. Step 4-8 . One is added to the content of the data address register 40. Step 4-9 . It is detected whether or not a carry from the four lower-order bits into the higher-order bits of the data address register 40 has occurred. If "no", step 4-7 is effected again, and steps 4-7 and 4-8 are repeatedly carried out until the carry occurs. Thus, the data of 16 words which correspond to the pointer stored in the data memory are stored in the 16-word register 38. Step 4-10 . One word of data is transferred from the 16-word register 38 through the first load line selecting circuit 47a to the second memory buffer 35b. Steps 4-13 . One is added to four higher-order bits of the second buffer address register 33b. Steps 4-12 . It is detected whether or not a carry has occurred from the four higher-order bits of the second buffer address register 33b. If "no", step 4-10 is effected again. Steps 4-10 and 4-11 are repeatedly carried out until the occurrence of the carry is detected. As a result, the data of one unit stored in the 16-word register 38 is stored, in the form of one word in the main scanning direction and 16 lines in the auxiliary scanning direction in the second memory buffer 35b. Step 4-13 . When the data of the map memory is all "0"s in step 4-5, the "0" data generator 41 transfers 16 "0"s to the second memory buffer 35b. Step 4-14 . One is added to the four higher-order bits of the second buffer address register 33b. Step 4-15 . It is detected whether or not a carry has occurred from the four higher-order bits of the second buffer address register 33b. If "no", step 4-13 is effected again, and steps 4-13 and 4-14 are repeatedly carried out until the occurrence of the carry is detected. As a result, all "0"s are stored in the form of one word in the main scanning direction and 16 lines in the auxiliary scanning direction in the second memory buffer 35b. Step 4-16 . One is added to the content of the map address register 39. Step 4-17 . It is detected whether or not a carry has occurred from the eight lower-order bits of the second buffer address register 33b. If "no", step 4-4 is effected again, and steps 4-4 through 4-7 are repeatedly carried out until the carry is detected. As a result, data is stored in the second memory buffer 35b in the format of 256 words in the main scanning direction and 16 lines in the auxiliary scanning direction. If "yes", in step 4-17, the next step 4-18 is performed. Step 4-18 . It is determined whether or not the content of the map address register 39 is larger than a value which is obtained by adding the number of units in one page to the top address set in step 4-1. If "yes", the operation is ended because the picture data of one page will then have been read out. If "no", the next step 4-19 is affected, Step 4-19 . The load line selecting circuit 47b is selected by the control signal C from the CPU so that the first memory buffer 35a is selected. Step 4-20 . The first buffer address register 33a is cleared to zero. The same procedures as those of steps 4-4 through 4-16 are carried out. Steps 4-21 . It is detected whether or not a carry has occurred from the eight lower-order bits of the first buffer address register 33a. If "no", step 4-20 is effected. If "yes", the data is stored, in the format of 256 words in the main scanning direction and 16 lines in the auxiliary scanning direction, in the first memory buffer 35a. Step 4-22 . As in step 4-18, it is determined whether or not the content of the map address register 39 is larger than the value which is obtained by adding the number of units in one page to the top address. If "no", step 4-2 is carried out and the above-described operations are performed again. If "yes", the procedure is ended. Thus, the compressed picture data stored in the map memory and the data memory are stored in original form (before compression) in the first and second memory buffers. An operation in which the data thus stored in the original form is outputted through the first and second output line selecting circuits 48a and 48b to the P/S converter 49 will be described with reference to the flowchart of Fig. 18. Step 5-1 . The second output line selecting circuit 48b is selected. Step 5-2 . The first buffer address register 33a is cleared to zero. Step 5-3 . One word is read out of the first memory buffer 35a. Step 5-4 . One is added to the content of the first buffer address register 33a. Step 5-5 . It is detected whether or not a carry has occurred in the first buffer address register 33a. If "no", step 5-3 is carried out again. Steps 5-3 and 5-4 are repeatedly performed until a carry is detected. As a result, 256 words in the main scanning direction are read. After this reading operation, the operation in the auxiliary scanning direction is performed, and 256 words in the main scanning operation are read. In this manner, data in the format of 256 words in the main scanning direction and 16 lines in the auxiliary scanning direction is read out of the first memory buffer 35a. Step 5-6 . It is detected whether or not new data has been stored in the second memory buffer 35B. If "no", the operation is ended. If "yes", the next step 5-7 is performed. Step 5-7 . The first output line selecting circuit is selected. Thereafter, the same procedure as those in steps 5-2 through 5-5 are repeated. As a result, data of 256 words in the main scanning direction and 16 lines in the auxiliary scanning direction is read out of the second memory buffer. When all the data has been read out of the second memory buffer 35b, the next step 5-8 is performed. Step 5-8 . It is determined whether or not new data has been inputted to the first memory buffer 35a. If "yes", step 5-1 is repeated. That is, the same procedures are carried out beginning with step 5-1. If "no", the operation is ended. As described above, the data stored in the first and second memory buffers 35a and 35b is read in the main scanning direction word by word and inputted to the P/S converter 49. When 256 words have been read, the reading operation is shifted in the auxiliary scanning direction, whereupon another 256 words are read in the main scanning direction. In this manner, 16 lines are read in the auxiliary scanning direction. When the picture data of one page has been read, the operation is ended. In the above-described embodiments, a "0" detector 37 and 16-word register 38 are provided. However, the provision of these elements is not always required. That is, the "0" detector 37 may be eliminated if the apparatus is so designed that the CPU detects the "0"s. In addition, the 16-word register may be eliminated if the apparatus is so designed that data is transferred directly between the memory buffers 35a and 35b and the main memory 42. While examples of an apparatus of the invention have been described with reference to the case where picture data is divided into units each consisting of 16 dots x 16 words, it should be noted that the invention is not limited thereto or thereby. That is, in general, the memory buffer should have a capacity of 2 M x N, with 2 M ≧ L, where L is the number of words in one line in the main scanning direction and N is the number of lines in the auxiliary scanning direction which form one unit. Thus, instead of the 16-word register 38, in general, an N-word register can be employed. As is apparent from the above description, according to the invention, two memory buffers having a capacity of 2 M words x N lines are provided. While data is being loaded into one of the memory buffers, data is simultaneously being read out of the other. In reading data out of the memory buffer, picture data is read in the format of N lines (corresponding to one unit) in the auxiliary scanning direction, and it is detected whether or not the data of each line is all "0"s.

Claims: A picture data storage system for storing picture data representing an image; said system comprising: (a) a map memory (16a or 42a) divided into a plurality (p x q) of memory regions corresponding to (p x q) picture units which may or may not contain image information, said picture units being obtained by two-dimensionally dividing an image, each of said picture units consisting of a matrix of (M x N) bits, where p is the number of picture units in a horizontal scanning direction, q is the number of picture units in a vertical scanning direction; M is the number of bits in one picture unit in the horizontal scanning direction and N is the number of bits in one picture unit in the vertical scanning direction; and (b) a data memory (16b or 42b) for storing picture data representing said picture units; characterised in that each memory region of said map memory (16a or 42a) stores either a pointer which indicates an address of said data memory at which said picture data are stored when image information exists in the corresponding picture unit or a predetermined number when no image information exists in the corresponding picture unit. A picture data storage system as claimed in Claim 1 further comprising a data detecting means (37) for detecting whether said picture data representing a corresponding one of the picture units is all "0"s. A picture data storage system as claimed in claim 1 or claim 2 in which said predetermined number is "0". A picture data storage system as claimed in any preceding claim wherein said pointer indicates a top address of a part of said data memory in which the corresponding picture data is stored. A picture data storage system as claimed in any preceding claim in which, where a plurality of picture units are identical, the picture data in respect thereof is written only once in the data memory and the pointers stored at the respective map memory regions are the same. A picture data storage system as claimed in any preceding claim further comprising a pair of memory buffers (35a, 35b) and means for continuously reading picture data, wherein picture data is written into and read out of the two buffers alternately.

Inventors: FUJIWARA, FUKUMI
Applicants: FUJI XEROX CO., LTD.
Application year: 1983
Main classification: H04N1
IPC codes: H04N1