Method and apparatus for saving printer memory

Abstract: A page printer uses alternative internal representations for the print data in each of multiple lateral strips that make up the page. Page description language input is converted to an intermediate display list format that is sorted into display commands associated with each strip. If during input the display list representation of the data fills the memory allotted to its storage, one or more of the strips is converted from display list format to raster format and compressed using a lossless compression algorithm. If storage of compressed strips subsequently exceeds available memory, raster data is further compressed using a lossy compression algorithm. Additional display list commands are rasterized by decompressing the compressed strips, processing the new commands and recompressing the data using lossless or lossy compression as required. If the display list does not overflow memory during input, the complete strips are rasterized and compressed one at a time in the order in which they will be printed. The rasterizing time is stored. Should memory overflow at any point in the process, then the rasterizing times for the remaining strips are determined without storing the raster output. A decision can then be made for each strip to rasterize it to the print engine on the fly, pre-compute and store it as lossless compressed raster data, or revert to a lossy-compressed pre-computed version.

Description: FIELD OF THE INVENTION This invention relates to printers and, more particularly, to a method and apparatus for minimizing the amount of memory required for supplying graphical information to a print mechanism which moves at a predetermined speed. BACKGROUND OF THE INVENTION Page printers, such as laser printers, receive data in page description language form before starting the printing process. With a page description language a page is represented using graphics, text, and images that can be specified to be located anywhere on the page, and in any order, using successive commands of the language. The page description language commands reflect the way the page is composed. However, before printing, the received data must be rasterized so the print mechanism ("print engine") in the printer can print the page while moving the paper uniformly in one direction, usually top to bottom. Rasterization is the process of converting data that represents a page or portion of a page into a series of individual dots or pixels across the printed page to form a raster scanline, producing successive scanlines one after another down the page. The complete set of scanlines for a page is the raster data for the page. Rasterization is performed in the page printer by a raster generator. Many page printers rasterize and store the entire raster data for a page before starting to send data to the print engine of the printer. The print engine must run at a predetermined speed. Therefore precomputing the entire page of raster data ensures that each raster scanline is ready to send when needed by the print engine. To store the raster data for an entire page may require substantial memory. Laser printers have commonly printed about 516 sq. cms (80 square inches)of graphic information on a page at a resolution of 120 dots per cm (300 dots per inch), both horizontally and vertically. With one bit indicating each dot to be printed or left unprinted, over 875K bytes (one byte equals eight bits) are required to store the raster data for an entire page. To increase the printer speed, a second page of raster data may be computed and stored in additional memory as the raster data for the first page is being sent incrementally to the print engine, having a second page doubles the memory requirements. New printer technology is enabling 600 x 600 dot (or pixel) resolution continuous tone color printing which may require 24 bits per pixel or more. If full-page storage is used to meet high resolution colour requirements, over 80 million bytes of memory per page is required; 160 million bytes of memory are thus required for storing two pages. This is expensive, even relative to the cost of a high performance color printer. For low-end printers the memory requirements are less, but the portion of the cost of the memory relative to other printer costs is higher. To provide users with improved printers at lower cost, memory requirements must be reduced. Several methods have been employed to reduce printer memory requirements while minimizing "printer overrun" errors. A printer overrun error occurs when rasterization does not keep up with the predetermined speed of the print engine. A printer overrun prevents printing the remainder of the page. One method (referenced by Cuzzo, et. al., U.S. Patent 5,129,049), and which forms the basis of the preamble to the appended independent claims, is to store the second page in a format that is more compact than a raster image, so the memory required for it is less than that required for the first full page raster image. The second page could be stored in its original page description language commands, but doing so would not yield the advantage of overlapping the processing time for rasterizing the second page while the first page is being printed. Instead, the page description language commands for the second page are converted on input to an intermediate representation called a "display list." A display list is a sequence of display list commands. Display list commands are relatively simple drawing commands that are faster to rasterize than the original page description language commands. The display list page representation is more compact than a full page of raster data. Display list commands for the page can be sorted by their position on the page as they are created. By sorting, the display list commands for a page can be separated into multiple sublists. Each sublist is localized for a particular area of the page. This results in display list commands being localized for each area, which leads to another method of saving memory described below. Rather than rasterize the entire display list for a page before printing, the page is divided into contiguous horizontal strips, and only some of the strips are rasterized before the start of the printing process. All the information for a given strip is contained in the display list commands for that strip. Others are rasterized after printing has started but before they are required by the print engine. By measuring or estimating the rasterization times and keeping track of the running total, some strips may be allowed to take longer to rasterize than others of the same size, so long as the cumulative time stays ahead of the print engine. This is described in the Cuzzo, et. al. patent referenced above and incorporated herein by reference. If the rasterization time for rasterization-on-the fly is too large, then one or more strips may be completely pre-rasterized. This approach ensures that the printing process will never fail due to running out of rasterization time, avoiding printer overruns. In the art, rasterization time estimates are often used rather than performing the rasterization and measuring the actual time required. The actual rasterization time may be measured without storing the raster data that results from the process. Good estimates are obtained from formulas based on the parameters that drive the rasterization process. Time estimates must take into account possible processor interruptions for handling unrelated tasks such as communications. While avoiding printer overruns and minimizing average memory requirements, prior art methods still are subject to running out of memory for difficult cases. In the extreme case of a complex page where each strip requires prerasterization, the printer requires as much memory as a printer that employs no memory-saving technique. Even short of this extreme, minimizing the number of cases that fail requires increasing the amount of available memory. An example of a prior art image rendering process and apparatus for a printer is disclosed in EP 0 470 782. According to this approach, a bitmap image for only a portion a complete page is generated from a page description language representation of the page and sent to the printer while the bitmap image of another portion of the page is being generated. The image rendering approach of this reference may provide some cost savings relative to other approaches by converting all page description language commands into graphics orders (which require less memory than corresponding bitmaps), which are subsequently converted into bitmaps, rather than directly converting the page description language commands into the final bitmaps that are sent to the printer for printing. It is therefore an object of this invention to provide an improved method and system for minimizing the memory requirements for page printers. It is another object of this invention to provide an improved method and system for preventing loss of printed output for complex pages printed on page printers having limited memory. SUMMARY OF THE INVENTION A page printer is described which uses alternative representations for the print data in each of multiple lateral strips that make up the page. The printer contains a raster generator which has a processor and a fixed total amount of memory for storing print data in alternative representations within the memory. The raster generator ultimately provides a raster data representation of each strip from which raster scanlines are supplied to the print engine. Data is supplied to the printer as a series of page description language commands. The page description language commands are converted by the raster generator upon input to an intermediate display list of drawing primitives that are then divided and sorted into commands associated with each strip. Depending upon the memory demands of the data for a particular page, the raster generator will keep each strip in its display list representation or convert it into one of several other intermediate representations. If during input the display list representation of the data fills the memory allotted to its storage, one or more of the strips is converted from display list format to raster format and compressed using a lossless compression algorithm. If storage of compressed strips subsequently exceeds available memory, raster data is further compressed using a lossy compression algorithm which can be assured to produce data sets that will fit within the memory allotment. Then additional display list commands are rasterized by decompressing the compressed strips, processing the new display list commands and recompressing the data using lossless or lossy compression as required. If the display list commands do not overflow memory during input, the complete strips are rasterized and compressed one at a time in the order in which they will be printed. The time to rasterize each strip can be estimated by the processor and stored, or the processor may actually compute and store the time for each strip. Should memory for the compressed strips overflow at any point in the process, then the rasterizing times for the remaining strips may be determined or estimated and then stored without storing the raster output. Based on the stored rasterizing times, the processor determines for each strip whether to rasterize it to the print engine on the fly, to pre-compute and store it as a lossless compressed raster data, to revert to a lossy-compressed pre-computed version, or to store it as uncompressed raster data. DESCRIPTION OF THE DRAWINGS FIG. 1 shows how alternative representations of data are used to represent strips on a printed page. FIG. 2 is a block diagram of a printer that embodies the invention. FIG. 3 is a high level flow diagram of the method of the invention. DETAILED DESCRIPTION OF THE INVENTION With reference to FIG. 1, in overview, a page printer incorporating the invention receives page description language commands 12 and converts the page description language commands to display list commands 16. The display list commands are stored into strip representations 14-1 through 14-10 that correspond to strips 15-1 though 15-10 on the printed page and sometimes converted to other representations. If storage becomes a limiting factor, display list commands 16 are converted to raster data or compressed raster data in the strip representations 14-1 through 14-10. Collectively the strip representations 14-1 through 14-10 form an intermediate page representation 5 of the data describing a printed page 10. The page is printed by converting in sequence the various strip representations 14-1 through 14-10 back to raster data. Raster data for a raster scanline or strip temporarily may be stored in a raster buffer 11 before printing. The page data is received from a host computer as a sequence of page description language commands 12 The page description language commands 12 may include a combination of text and graphics commands as well as embedded imagery. Any individual page description language command may place text, graphics, or imagery on any part of the page, so that printing cannot begin until all of the page description language commands 12 for an entire page have been received and processed. In the example illustrated, the page is logically divided into ten lateral strips 15-1 through 15-10. Each strip has predefined upper and lower boundaries across the page. The strips typically are of equal size. Each page description language command is translated, as it is received, into a series of display list commands 16. The display list commands 16 are generated so that each command pertains only to a single strip. The data 14-1 through 14-10 represents the corresponding strips 15-1 through 15-10. Thus if the print contribution from a page description language command extends vertically over the whole page, it will result in at least one display list command being generated in correspondence to each page strip 15-1 through 15-10. As explained below, if memory becomes a limitation, display list commands for a strip may be converted to another type of data representing the strip, but if memory is not a limiting factor, all the representations 14-1 through 14-10 will be in the form of display list commands upon completion of the input of page description language commands 12. If a representation 14-1 is left in display list form it is not copied to a different region of memory, but rather linked to the intermediate representation of the page 5 with a data pointer. As display list commands 16 are generated, each is immediately added to one of the individual strip representations 14-1 to 14-10. Since the printed page 10 can be printed from the display list commands 16 as well as it could have been from the original page description language commands 12, the complete display list for a strip is an alternative representation for that strip, and the whole set of display list commands 16 for all strips is an alternative representation for the complete printed page 10. The use of alternative representations for strips is a key concept of the invention. Ultimately, the print engine requires a raster data representation for each strip which may be stored in a raster buffer 11. In the raster data representation, the page is described as a matrix of numbers, each number corresponding to a single pixel or dot to be printed on the page. The number gives the color or intensity to be printed at that point. The raster data for a strip usually contains regions of repeated pixels or patterns of pixels that can be compressed. As a simple example, between lines of text there are whole raster lines of blank pixels, and using a shorthand notation for a wholly blank line would save storage space for raster data from text. Much effort has been devoted to the subject of image compression, and many elaborate methods developed. The text Digital Image Processing by W.K. Pratt (John Wiley and Sons, 1978) provides an overview of the techniques. Transform Coding of Images by R.J. Clark (Academic Press, 1985) provides more specialized treatment. Compression techniques are described in two categories, lossless and lossy . A lossless compression method allows the data that was compressed to be reconstructed exactly when decompressed. Lossless compression is reversible, as opposed to lossy compression which is irreversible. Lossy techniques provide for only an approximate reconstruction upon decompression. Approximate reconstruction is often acceptable for images because the eye does not detect small anomalies in an image. Lossy techniques are used either to provide greater compression factors than lossless techniques or to provide a predictable ratio of uncompressed to compressed size. Many lossy techniques allow a broad range of trade-offs between accuracy of the restored image and the compression ratio. As a practical matter, a predetermined amount of memory which holds substantially less than a whole page of raster imagery can be provided in a printer while ensuring that the user will receive acceptable printed results. Also key to the invention is that lossless and lossy compressed raster data provide two or more alternative representations of page strips. Lossy compression techniques may provide different representations at different compression factors. Memory savings are traded off against the degree of degradation which the lossy compression techniques will cause. However, highly compressed storage may be used under circumstances when memory is at a premium. For the invention, a suitable example of lossless compression is run length encoding combined with Huffman coding, as is well known in the art. A suitable lossy compression technique is a method provided as a standard from the Joint Photographic Experts Group (JPEG) of the International Standards Organization (ISO). The next key concept is that having identified alternative representations for page strips, it is possible to provide an intermediate representation of a whole page that allows different strip representation types to be included in different combinations that best fit the characteristics of any particular printed page. The method of the invention is distinguished by the selection of alternative types of strip representations so that available memory is never exceeded and print overruns are always avoided. Within those two absolute constraints, the method of the invention first chooses alternatives which minimize the processing time needed to process the page. If a page is simple and does not challenge memory limits, the processing will be fast. If a page is unusually complex and memory use is intensive, the processing may slow substantially and the quality may be reduced, but the user will always receive a full printed page output. Referring to FIG. 2, a printer embodying the invention includes an input/output (I/O) interface 30 for receiving page description language commands over a cable or network from the host computer which outputs page description language commands to the common bus 34. Error messages and control information relating to the transfer of data is communicated back to the host via the I/O interface 30. As each page description language command is received, it is stored in random access memory (RAM) 32 over the common bus 34. A microprocessor 36 on the common bus 34 provides the computation and control for generating raster data and supplying the raster data to the print engine controller 38, which in turn passes the raster data to the electromechanical print engine 40 that applies the image to paper. The program for the microprocessor 36 is permanently stored in a read-only memory (ROM) 42. Input data, intermediate results including the intermediate page representations, the raster buffer data for the current decompressed strip to be sent to the print engine controller and all other variable data are stored in shared RAM 32. A feature of the invention is the ability to make the most efficient use of memory by sharing storage space within a single memory for different representations. Memory allocation is the process of dividing up a memory into portions for different purposes. A table, called an "allocation map," may be kept at a fixed location in memory to record how the rest of the memory is assigned for each purpose. Memory allocations may be changed dynamically during processing. This is an advantage over using separate memories for each representation because each separate memory must be sized for its individual worst case. With separate memories, spare space in one memory cannot be allocated for use by another. The microprocessor 36, ROM 42, RAM 32 and common bus 34 work together as a raster generator to convert the input page description language commands to raster data driving print engine controller 38. A standard commercial microprocessor, such as the Motorola 68000 family or the Intel i860 family may be used as the microprocessor 36. The RAM 32 is built using conventional dynamic random access memory (DRAM) semiconductor chips. Other required components are conventional commercial digital semiconductor chips or application specific integrated circuits (ASICs) known in the art and used with printed circuit interconnection technology. Referring now to FIG. 3, page processing begins with conversion step 52 of page description language commands 50 from the host into display list commands 53. As the display list commands are generated, they are concurrently sorted into sublists by linking new commands to a linked list associated with each strip. The display list is continually tested for overflow at step 54 to see if the maximum allocated memory is about to be exceeded. The rasterizing time for each strip is measured or estimated and stored for later use. If the display list does not overflow the memory during input, the rasterization time estimates are checked to see if there are any problem strips. A problem strip, is a strip thar cannot be rasterized in less time than it takes to print. Problem strips, if any are compressed at step 55, one at a time, in the order in which they are to be printed. As each strip is compressed, the cumulative memory used for storage of the strips is checked at step 56. If all the strips are completed without exhausting memory allotted for the intermediate representation of the page, the complete compressed page is ready for printing at step 74. The time required for decompression for printing at step 74 is predictable and fast enough so that each strip may be decompressed into a raster data buffer in time to transfer the raster data to the print engine controller. Alternatively, some decompression methods work so fast, or can be made fast enough by using an ASIC implementation, that compressed raster data may be decompressed and sent directly to the print engine without being placed into an intermediate raster data buffer. With memory not exceeded either during conversion or compression, processing is easy to estimate and less complex. Should the test at step 56 indicate the memory for the strips stored as compressed raster data is about to overflow at any point in the compression process, then the rasterizing times for the remaining strips are estimated or measured at step 60. Estimates are preferred at this step, but the times may be measured without storing the raster output. The estimates or measurements yield a complete list of the times for rasterizing each of the strips. Using these strip rasterizing times, a decision is made at step 62 on how to proceed with the page. If one or more of the strips can be rasterized faster than the time which the print engine controller will consume a strip of raster data, there is no need to store the compressed data for those strips; instead they may be generated on the fly as they are needed. The memory thus freed may be reallocated to the compressed raster data for other strips that cannot be rasterized in time, or it may reallocated to storage of the next page of incoming data, so that throughput is increased by overlapping the processing. When all the data for the intermediate representation of the page now can be rasterized, strip by strip, at step 65 fast enough to keep ahead of the print engine, the page is printed at step 74. However, if the test at step 62 reveals that memory is still insufficient, compressed raster data strips must be reprocessed using lossy compression at step 63. Lossy compression ensures that the memory requirements will be met even if the printed page quality is slightly degraded. If memory requirements are exceeded before reprocessing all the strips, the intermediate representation of the same page may have a combination of uncompressed raster data, lossy-compressed raster data, lossless-compressed raster data, or display list command representations of different strips. Each representation must be converted to raster data for the strip immediately prior to printing at step 74. This covers all of the cases when the test at step 54 showed the display list commands do not threaten to overflow memory. If the display list commands do threaten to overflow, one or more strips is rasterized and compressed to free up storage for the remaining display list command input. Until the display list is complete, it is possible that display list commands will arrive that affect one or more of the strips previously rasterized and compressed. To complete the rasterizing when one or more new display list commands for a compressed strip arrive so as to again fill the display list memory allocation as determined by the test at step 78, that strip must be decompressed at step 76. Then the new rasterized data added and the strip recompressed at step 66. The cycle of decompression, rasterizing, and compression may occur repeatedly for the same strip and for other strips on a page until all display list commands for the page have been rasterized. Following the compression process at step 66, a test at step 68 is performed to ensure that the compressed raster data does not again threaten to overflow memory. If it does not, the rasterizing will subsequently go to completion through the cycles of decompression at step 76 and of modification and recompression at step 66, as described. The compressed strips are then printed at step 74. If storage of compressed strips is found by the test at step 68 to threaten overflow of available memory, raster data is further compressed at step 72 using a lossy compression algorithm. Again, the compression ratio can be selected to assure that the resulting data sets will fit in the memory allotment. Additional display list commands are rasterized by decompressing the lossy-compressed strips, processing the new commands and recompressing the data using lossy compression as required, all of which is included in step 72. When the active display list for the page has been completed, the page is ready for printing at step 74. Either of the decompression and compression cycles of steps 66 and 72 is likely to require additional processing time compared to the case when the display list commands did not overflow at step 68. The extra time is traded off against the expense of extra memory that would perhaps be used only on very few parts of only a few documents. Thus in every case printing at step 74 is completed without requiring memory equivalent to a whole page of raster data and without a printer overrun. Note that the method of the invention is described in a preferred embodiment using a general scheme of additional alternative strip representations. More alternative representations may further optimize processing time for a given amount of memory. It should be understood that the foregoing description is only illustrative of a preferred embodiment of the invention. While the invention has been described in a laser printer environment, it is equally applicable to other types of page printers. Accordingly, the present invention is intended to embrace all such alternatives and variances which fall within the scope of the appended claims.

Claims: A printer having an input (30) for receiving a page description (12) encoded in a page description language, the input (30) providing to the printer a sequence of successive commands in the page description language, a print engine (40) for printing pages composed of a sequence of raster scanlines, means for converting page description language commands into display list commands and a raster generator (32,34,36,42) for converting received page description language commands (12) into a sequence of raster scanlines in a format required for printing, the printer being characterized by: means for converting page description language commands received at said input (30) into a plurality of intermediate representations (5), said means being operable to convert page description language commands (12) into intermediate representations (5) including said display list commands (16), compressed raster data (14-2,14-3), and uncompressed raster data (14-4), said means operating to select the intermediate representations (5) for the page representation so that available memory in the printer is never exceeded and print overruns are always avoided; means for ordering the plurality of intermediate representations (5) according to their position on the page (10); means for converting the plurality of intermediate representations (5) into raster scanlines; and means for supplying the raster scanlines to the print engine (40) at a predetermined rate. description language commands which the printer converts into a raster data representation of that page (10) for printing, and wherein the printer has means to convert page description language commands into display list commands, the method being characterized by: converting the page description language comments for the page into a plurality of intermediate representations (5), including said display list commands (16), compressed raster data (14-2, 14-3) and uncompressed raster data (14-4), so that available memory in the printer is never exceeded and print overruns are always avoided; rasterizing at least a portion of the intermediate representations (5)to form a raster data representation; and supplying the raster data representation to a print engine (40) for printing. The printer of claim 1, wherein the means for converting page description language commands are operable to convert page description language commands into intermediate representations including lossless-compressed raster data (14-2) and lossy-compressed raster data (14-3). The printer of claim 2, wherein a page (10) is logically subdivided into strips (15), each strip (15-1) corresponding to a predetermined contiguous area of the page (10), and the representation of the page to be printed includes a list of these strips. The printer of claim 3, wherein the raster generator (32,34,36,42) includes means for estimating required memory, rasterizing time, or both, associated with alternative intermediate representations for each strip and determining therefrom the types of intermediate representations for the representation of each strip to minimize storage or time requirements while allowing the conversion of the intermediate representations to raster scanlines at a rate sufficient for providing raster scanlines to the print engine at said predetermined rate. The printer of claim 4, wherein the means for estimating required memory, rasterizing time, or both, uses formulas applied to the intermediate representations. The printer of claim 5, wherein the estimating means computes the estimates by computing alternative intermediate format representations for each strip and storing the resultant time or space information, or both. A method of reducing the memory requirements for a printer, wherein the printer receives a page description language representation (12) of a page (10), said page description language representation (10) comprising a sequence of page The method of reducing the memory requirements for a printer of claim 7, wherein the printer has memory (32) allocated for storing display list commands (16), uncompressed rasterized data (14-4) and compressed rasterized data (14-2, 14-3), the method further comprising: (1) converting the page description language representation (12) of the page (10) into display list commands (16) and storing the display list commands (16) in the memory (32) allocated for display list commands until that memory is exhausted; (2) rasterizing the display list commands (16) from the display list memory allocation to form raster data and storing the raster data in the raster data memory allocation, thus freeing up memory allocated for display list comments (16) for further use; (3) compressing the raster data in the raster data memory allocation to form compressed raster data (14-2,14-3) and storing the compressed raster data (14-2, 14-3) in the compressed raster data memory allocation, thus freeing up the raster data memory allocation for further use; (4) continuing conversion of the page description language commands (12) into second display list commands (16) until either the display list memory allocation is again exhausted or the conversion is complete; (5) decompressing the compressed raster data (14-2,14-3) in the compressed raster data memory allocation and either sending it to the print engine (40) for printing or storing it in the raster data memory (32), in either case freeing up the compressed raster data memory for further use; (6) rasterizing the second display list commands (16) and combining the resulting raster data with the raster data in the raster data memory allocation; (7) if the conversion in step (4) was not complete, carrying out steps (4) through (6) again; or (8) if the conversion in step (4) converted the page description language data (12) for the entire page (10), printing the page from the raster data memory or compressed raster data memory, or both. The method of claim 7, wherein the intermediate representations (5) further comprise a display list representation (16) and an uncompressed raster data representation (14-4). The method of claim 7, further comprising: computing for the portion of the display list representation (16) an estimate of how fast the display list can be rendered; comparing the estimate to a predetermined rate to determine whether to rasterize the portion of the display list representation (16) before printing begins; and rasterizing the portion of the display list representation (16) of the page (10) to form a raster data representation if the comparison determines that the display list cannot be rendered at the predetermined rate. The method of claim 7, wherein the printer has a fixed amount of memory (32), the method further comprising: logically dividing the page into strips (15); identifying each strip (15-1) as raceable or non-raceable, a strip being identified as raceable only if the display list (16) for the strip can be rendered at least as fast as the predetermined rate; rendering the display list (16) of each non-raceable strip into raster data and compressing the raster data for storage in a memory using a lossless compression method (14-3) or a lossy compression method (14-2), the lossy compression method (14-2) being used when the memory (32) does not have enough space available to store the raster data using lossless compression (14-3); storing the compressed raster data (14-2,14-3) into memory (32) ; and printing the page (10) by printing the strips (15) in succession, the raceable strips being rendered from their respective display lists while the compressed raster data for each non-raceable strip is decompressed from the memory.

Inventors: COOPER MICHAEL DAVID, HODGSON MICHAEL L, ONG PATRICK SWEE-HOCK, ROVNER PAUL D, SANDMAN JAMES G JR, COOPER, MICHAEL DAVID, HODGSON, MICHAEL L., ONG, PATRICK SWEE-HOCK, ROVNER, PAUL D., SANDMAN, JAMES G., JR.
Applicants: ADOBE SYSTEMS INC, ADOBE SYSTEMS INC.
Application year: 1994
Main classification: G06K15
IPC codes: G06K15, G06F3, B41J5