Method and apparatus for pattern ram sharing color look up table
A method and apparatus for sharing the video memory of a graphic chip includes the steps as follows: when the destination block of a frame buffer executes color expansion, storing a color LUT to a memory shared by both pattern and color LUT in a video memory, so as to provide color expansion; and when the graphic engine accesses a pattern memory, storing a pattern block to the memory shared by both pattern and color LUT for the access of a graphic engine. By the above-mentioned sharing mechanism, the physical layout area of the graphic chip is reduced and the cost also drops.
Latest VIA TECHNOLOGIES, INC. Patents:
- Electronic apparatus and object detection method
- Universal serial bus control device and control method thereof
- Encoding method for key Trie, decoding method for key Trie, and electronic devices
- Object tracking method and object tracking device
- Computing apparatus and data processing method for offloading data processing of data processing task from at least one general purpose processor
[0001] 1. Field of the Invention
[0002] The present invention relates to the usage of video memory, especially to a method and apparatus for sharing the video memory of a graphic chip.
[0003] 2.Description of the Prior Art
[0004] Generally, a graphic engine obtains the graphic block from a source/destination/pattern block and the pattern block from the other source/destination/pattern block to have various logic executions, and then writes back to a frame buffer to be displayed in a screen. Therein, the source block can be obtained from a CPU, main memory and the frame buffer itself. The pattern block can also be obtained from the CPU, pattern memory and pattern register to write back to the destination block after executing a masking operation. But among the obtained blocks, the pattern memory is the largest block in a graphic chip. Taking a 16×16-pixel true color video area as an example, a 768-byte (16×16×3) memory is configured in a graphic chip (in true color, every pixel includes 3 bytes to represent 3 primary colors) to work as a pattern memory. FIG. 1A is the flowchart for the graphic engine of a prior art processing a pattern block. Step 110 is to configure a pattern block in a pattern memory. Step 130 is to access the pattern block in the pattern memory if the graphic engine needs to process the pattern block. And then Step 150 is to store the processed pattern block in a frame buffer.
[0005] In another side, FIG. 1B is the color expansion flowchart of a prior art. Step 120 is to configure a look up table (LUT) in a video memory. Step 140 is to expand colors in accordance with the LUT if the destination block of the frame buffer needs to expand colors. And then Step 160 is to superpose and output the color-expanded destination block and the other graph and video source. In another word, the LUT stored in the video memory of a graphic chip recovers the color index stored in a frame buffer, so called pixel value, into the true color RGB 24-bit pixel value by looking up the table when the displayed colors are 256 or under 256 color-scaled colors (indirect colors). When the displayed colors are the above 256 color-scaled colors, the information of R, G and B is not necessary to be recovered by looking up the LUT, because the information included in R, G and B is already the original information of the colors at this moment. It is called direct color. Therefore, the LUT fails to work when the displayed colors are above 256 color-scaled colors, but the LUT still occupies certain area of the video memory.
[0006] FIG. 2 is the graphic chip block diagram of a prior art, including a graphic engine 220, a video memory 230, and a graph and video superposition unit 240. The video memory 230 includes a pattern memory 231 and a color LUT 232. Besides, a frame buffer can store digitalized images temporarily; therefore, the graphic chip can also include a frame buffer 250. A microprocessor 210 instructs the graphic engine 220 to obtain the graphic block from the pattern memory 231 of the video memory 230 and the frame buffer 250 to write back to the frame buffer 250 after executing the pattern block process, like masking operation, and then the graphic block is sent directly to the graph and video superposition unit 240. If the displayed colors are 256 or under 256 color-scaled colors, a color expansion through the color LUT 232 is needed and then sent graph and video superposition unit 240. Besides, if the input color format is different from the covering color format, a color space conversion (CSC) is also needed. For example, if the input format is Y, Cb and Cr, but the output format is R, G and B, and the output format is Y, Cb and Cr, a process of the color space conversion is necessary to make the color formats in accordance (because it is not the emphasis of this invention, it will not be described in detail).
[0007] Because the usage moment of the pattern memory and color LUT are exclusive and in timing order, and the access paths of the pattern area and the color expansion are overlapped because they both are in the pattern memory, how to reduce the layout of the pattern memory in the graphic chip and how to use the video memory in the graphic chip are the challenges that the technology field has to face.
SUMMARY OF THE INVENTION[0008] The present invention provides a method for sharing the video memory of a graphic chip comprising the steps of storing a color look up table (LUT) in a sharing memory of pattern and color LUT in the video memory of the graphic chip while a destination block of a frame buffer executes color expansion; and storing a plurality of pattern blocks in the sharing memory of pattern and color LUT for the access of the graphic engine while the graphic engine accesses a pattern memory.
[0009] The present invention also provides a design method of a graphic chip comprising a sharing memory of pattern and color LUT is configured in a video memory of the graphic chip, wherein the sharing memory of pattern and color LUT works as a color LUT when a destination block of a frame buffer proceeds to color expansion, and works as a pattern memory when a graphic engine accesses a pattern block.
[0010] Again, the present invention provides a graphic chip sharing video memory comprising a video memory for storing one sharing memory of a pattern and color LUT at least, and the contents of the sharing memory of pattern and color LUT adjusted in accordance with an access apparatus; and a graphic engine for accessing and processing a plurality of pattern blocks of the sharing memory of pattern and color LUT.
[0011] The physical layout area of a graphic chip can be reduced so that the cost drops by a method for sharing the video memory of a graphic chip and the design method of the graphic chip based on the present invention.
BRIEF DESCRIPTION OF THE DRAWINGS[0012] FIG. 1A is the flowchart for the graphic engine of a prior art to process a pattern block;
[0013] FIG. 1B is the flowchart of the color expansion of a prior art;
[0014] FIG. 2 is the block diagram of the graphic of a prior art;
[0015] FIG. 3 is the method for sharing the video memory for a graphic chip in accordance with a preferred embodiment of the present invention; and
[0016] FIG. 4 is the block diagram of a graphic chip in accordance with the present invention.
DESCRIPTION OF THE PREFERRED EMBODIMENT[0017] Some embodiments of the present invention will be described in detail as the following. But, besides the description in detail, the present invention can be implemented in the other embodiments broadly, and the scope of the present invention is not limited, in accordance with the following claims.
[0018] For providing clearer description and understanding the present invention more easily, every part of the drawings is not drew in its relative dimensions. Certain dimensions and the other ratios of the relative scales are exaggerated. The irrelevant details are not drawn completely for the simplicity of the drawings.
[0019] FIG. 3 is the method for sharing the video memory of a graphic chip in accordance with a preferred embodiment of the present invention. Step 310 judges the access apparatus and content of the video memory. If the access apparatus is a graphic engine and the content of the sharing memory of pattern and color LUT is the pattern block, the sharing memory of pattern and color LUT is accessed in Step 350. If the content of the sharing memory of pattern and color LUT is the color LUT, the copy of the pattern block is written to the sharing memory of pattern and color LUT in Step 330, and the sharing memory of pattern and color LUT is accessed in Step 350. In another side, if the destination block of a frame buffer proceeds to color expansion in Step 320, and the content of the sharing memory of pattern and color LUT is the color LUT, the sharing memory of pattern and color LUT is accessed in Step 350. If the content of the sharing memory of pattern and color LUT is the pattern block, the copy of the color LUT is written to the sharing memory of pattern and color LUT in Step 340, and then the sharing memory of pattern and color LUT is accessed in Step 350.
[0020] FIG. 4 is the block diagram of the graphic chip in accordance with the present invention. The graphic chip comprising a graphic engine 420, a video memory 430, and a graph and video overlapping unit 440, wherein the video memory 430 further comprising a sharing memory of pattern and color LUT 431, and the graphic chip can also comprising a frame buffer 450. A microprocessor 410 instructs the graph engine 420 to obtain the graphic block from the sharing memory of pattern and color LUT of the video memory 430 and the frame buffer 450 to write back to the frame buffer 450 after executing the pattern block process, like masking operation, and then the graphic block is sent directly to the graph and video overlapping unit 440. In another side, if the displayed colors in the destination block are 256 or under 256 color-scaled colors, the color LUT stored in the sharing memory of pattern and color LUT 431 is accessed to execute color expansion, and then sent to the graph and video superposition unit 440, including reading the copy of the color LUT 462 in the external memory 460 and then writing to the video memory 430 for color expansion. In another word, because of sharing the sharing memory of pattern and color LUT 431 (like an SRAM), an external memory 460 (like an SDRAM) can be provided to store the copy of the pattern block 461 and the copy of the color LUT 462 for different access needs. If the content of the sharing memory of pattern and color LUT 431 is the pattern block, and the destination block of the frame buffer 450 will execute color expansion, the copy of the color LUT 462 can be written to the sharing the sharing memory of pattern and color LUT 431 for color expansion. In another side, if the content of the sharing memory of pattern and color LUT 431 is the color LUT, and the graphic engine 420 will access the pattern memory, the copy of the pattern block 461 can be written to the sharing memory of pattern and color LUT 431 for the access of the graphic engine 420.
[0021] While the described embodiment represents the preferred form of the present invention, it is to be understood that modifications will occur to those skilled in that art without departing from the spirit of the invention. The scope of the invention is therefore to be determined solely by the appended claims.
Claims
1. A method for sharing a video memory of a graphic chip comprising:
- storing a color look up table (LUT) in a sharing memory of pattern and color LUT of said video memory of said graphic chip while a destination block of a frame buffer executes color expansion; and
- storing a plurality of pattern blocks in said sharing memory of pattern and color LUT of said video memory of said graphic chip while said graphic engine accesses a pattern memory.
2. The method for sharing video memory of a graphic chip as recited in claim 1, further comprising:
- providing an external memory to store a copy of said color LUT and a copy of said plurality of pattern blocks as a backup of said color LUT and said plurality of pattern blocks.
3. The method for sharing video memory of a graphic chip as recited in claim 1, wherein if a content of said sharing memory of pattern and color LUT is said plurality of pattern blocks, said destination block of said frame buffer performing color expansion comprising:
- accessing a copy of a color LUT; and
- writing said copy of said color LUT to said sharing memory of pattern and color LUT.
4. The method for sharing video memory of a graphic chip as recited in claim 1, wherein if the content of said sharing memory of pattern and color LUT is said color LUT, the graphic engine accesses said sharing memory of pattern and color LUT comprising:
- accessing a copy of said plurality of pattern blocks; and
- writing said copy of said plurality of pattern blocks to said sharing memory of pattern and color LUT.
5. A design method of a graphic chip, including:
- configuring a sharing memory of pattern and color LUT in a video memory of said graphic chip, wherein said sharing memory of pattern and color LUT works as a color LUT when a destination block of a frame buffer executes color expansion, and works as a pattern memory when a graphic engine accesses a pattern block.
6. The design method of a graphic chip as recited in claim 5 comprising:
- configuring an external memory outside said graphic chip to store a copy of said color LUT and a copy of said pattern block.
7. A graphic chip with a sharing video memory comprising:
- a video memory for storing one sharing memory of a pattern and color LUT at least, and a content of said sharing memory of pattern and color LUT is adjusted in accordance with an access apparatus; and
- a graphic engine for accessing and processing a plurality of pattern blocks of said sharing memory of pattern and color LUT.
8. The graphic chip with a sharing video memory as recited in claim 7 comprising:
- a graph and video overlapping unit for receiving and overlapping a destination block of a frame buffer and a graph and video source.
9. The graphic chip with a sharing video memory as recited in claim 7 comprising:
- a frame buffer for storing a destination block at least for a graph and video overlapping unit to perform a overlapping procedure.
10. The graphic chip with a sharing video memory as recited in claim 7, wherein if the access apparatus is a frame buffer, said sharing memory of pattern and color LUT provided for storing said color LUT, whereas if the access apparatus is said graphic engine, said sharing memory of pattern and color LUT provided for storing said plurality of said pattern blocks.
Type: Application
Filed: May 24, 2004
Publication Date: Nov 25, 2004
Applicant: VIA TECHNOLOGIES, INC.
Inventors: Roger Lin (Taipei), Hill Cho (Taipei)
Application Number: 10851220
International Classification: G06T001/60; G09G005/00;