WO2012032583A1 - Method of forming image data, method of writing image data, and image data processing circuit - Google Patents

Method of forming image data, method of writing image data, and image data processing circuit Download PDF

Info

Publication number
WO2012032583A1
WO2012032583A1 PCT/JP2010/005543 JP2010005543W WO2012032583A1 WO 2012032583 A1 WO2012032583 A1 WO 2012032583A1 JP 2010005543 W JP2010005543 W JP 2010005543W WO 2012032583 A1 WO2012032583 A1 WO 2012032583A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
value
flag
logic
pixels
Prior art date
Application number
PCT/JP2010/005543
Other languages
French (fr)
Japanese (ja)
Inventor
康 洲鎌
Original Assignee
富士通株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 富士通株式会社 filed Critical 富士通株式会社
Priority to PCT/JP2010/005543 priority Critical patent/WO2012032583A1/en
Priority to JP2012532739A priority patent/JP5708653B2/en
Publication of WO2012032583A1 publication Critical patent/WO2012032583A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Definitions

  • the present invention relates to a method for forming image data associated with anti-aliasing, a method for writing the formed image data, and an image data processing circuit, which are performed in the rendering processing of three-dimensional graphics.
  • Anti-aliasing is performed to reduce jaggy (shaking of the outline) that occurs when drawing a three-dimensional graphics image having image data in the depth (depth) direction.
  • SSAA super sampling anti-aliasing
  • MSAA multi-sample anti-aliasing
  • SSAA is a technique for rendering a rendering target at a resolution higher than the display resolution, and reducing the resolution of the resulting image to obtain a display image.
  • MSAA is similar to SSAA in that it renders a rendering target at a resolution higher than the display resolution and reduces the resolution of the obtained image to obtain display pixels, but the pixel colors are all the same. This is a different technique in that the rendering process is simplified.
  • image data in the depth direction is handled in the same manner as SSAA.
  • An image data forming method for reducing the amount of image data used for anti-aliasing processing and a writing method for reducing the number of times of writing the formed image data to an external memory are provided.
  • the image data forming method includes a step of dividing pixels arranged in a matrix included in a three-dimensional graphics image into pixel blocks including the pixels of K rows and L columns, and for each pixel block, Using the coverage indicating the color fill state, if the same color fill is performed for all the included pixels, a flag having the first logic is generated, and some of the included pixels are filled with different colors or not filled. In this case, in the step of generating a flag having the second logic and the pixel block having the flag having the first logic, one pixel value is selected from the pixel values of the included pixels, and is set as the first pixel value.
  • the image data forming method is a method of writing image data including the first pixel value or the first depth value of the first pixel included in the three-dimensional graphics image after the drawing process, and the three-dimensional graphic after the drawing process.
  • a step of reading the corresponding second pixel block and second flag included in the three-dimensional graphics image before processing, and a part of the second pixel including the logic of the second flag are filled with different colors or without filling.
  • the second pixel value of the second pixel block is set to the third pixel value, and the third pixel value, the first logic, and the second logic
  • the present invention it is possible to provide a method for forming image data for reducing the amount of image data used for anti-aliasing processing, and a writing method for reducing the number of times the formed image data is written to an external memory. .
  • FIG. 1 shows a semiconductor device including a drawing circuit 10, an image data processing circuit 20, and an external memory 30.
  • FIG. 2 shows 8 ⁇ 8 pixels divided into 2 ⁇ 2 pixel blocks.
  • FIG. 3 is a diagram showing the relationship between the flag and the pixel value stored in the external memory 30 for 8 ⁇ 8 pixels divided into 2 ⁇ 2 pixel blocks.
  • FIG. 4 is a diagram for explaining the depth value, the flag related to the depth value, and the X and Y increment values related to the depth value.
  • FIG. 5 is a diagram for explaining the operation of the pixel access unit 50 and the pixel access unit 50.
  • 6A and 6B show specific circuit examples of the flag generation unit 51 and the pixel writing unit 52.
  • FIG. 6C shows a specific circuit example of the pixel readout unit 53.
  • FIG. 7 is a diagram for explaining the operation of the pixel access unit 50.
  • FIG. 8 is a flowchart for explaining the entire writing operation of the pixel access unit 50.
  • FIG. 9 is a flowchart for explaining the entire reading operation of the pixel access unit 50.
  • FIG. 10 is a diagram for explaining the operation of the depth access unit 60 and the depth access unit 60.
  • 11A and 11B show specific circuit examples of the flag generation unit 61 and the depth writing unit 62.
  • FIG. FIG. 11C shows a specific circuit example of the depth reading unit 63.
  • FIG. 12 is a diagram for explaining the operation of the depth access unit 60.
  • FIG. 13 is a flowchart for explaining the entire writing operation of the depth access unit 60.
  • FIG. 14 is a flowchart for explaining the entire reading operation of the depth access unit 60.
  • the present invention includes the embodiments described below that have been modified by the design that can be conceived by those skilled in the art, and those in which the components shown in the embodiments have been recombined. Further, the present invention includes those in which the constituent elements are replaced with other constituent elements having the same operational effects, and are not limited to the following embodiments.
  • FIG. 1 shows a semiconductor device including a drawing circuit 10, an image data processing circuit 20, and an external memory 30.
  • the drawing circuit 10 is a circuit that forms a three-dimensional graphics image to be drawn by rendering processing from a three-dimensional model and an original image.
  • the rendering process includes, for example, a projection process, a rasterization process, a hidden surface removal process, and a shooting / effect applying process.
  • the image data processing circuit 20 includes a pixel access unit 50 and a depth access unit 60.
  • the pixel access unit 50 performs data processing on the pixel values and coverage of pixels constituting the three-dimensional graphics image after the drawing processing by the drawing circuit 10, and selects the flag generated by the data processing and the data processing. This is a circuit for storing the pixel value of the selected pixel in the external memory 30.
  • the pixel access unit 50 is a circuit that develops a pixel value and coverage before drawing processing from a flag received from the external memory 30 and a selected pixel value.
  • the depth access unit 60 performs data processing on the depth value and coverage of the pixels constituting the three-dimensional graphics image after the rendering processing by the rendering circuit 10, and generates a flag generated by the data processing and the data processing.
  • This is a circuit for storing in the external memory 30 the X and Y increment values and the selected depth value generated by the data processing.
  • the depth access unit 60 is a circuit that expands the flag received from the external memory 30, the X and Y increment values, and the selected depth value into the depth value before the drawing process and the coverage.
  • FIG. 2 shows 8 ⁇ 8 pixels divided into 2 ⁇ 2 pixel blocks.
  • the pixel block coverage will be described with reference to FIG.
  • a coverage indicating a color fill state is assigned, and when there is a color fill, a logic “1” is assigned to the coverage, and when there is no color fill, a logic “0” is assigned to the coverage. Therefore, coverage refers to a logical value assigned to each pixel block expressed as a binary number arranged in the order of upper left, upper right, lower left, and lower right.
  • vertical 8 ⁇ horizontal 8 pixels are shown.
  • the present invention is not limited to this, and generally the coverage of vertical M ⁇ horizontal N pixels (M and N are arbitrary positive integers) is also included. It is expressed similarly.
  • the pixel block is composed of 2 ⁇ vertical pixels in the above, but may be composed of pixels of vertical L ⁇ horizontal K (K and L are arbitrary positive integers).
  • FIG. 3 is a diagram showing the relationship between the flag and the pixel value stored in the external memory 30 for 8 ⁇ 8 pixels divided into 2 ⁇ 2 pixel blocks.
  • pixels whose coverage logic is “1” are represented by vertical stripes.
  • pixel blocks that are to be color-filled are extracted from all the pixels constituting the 2 ⁇ 2 pixel block, and are represented by horizontal stripes.
  • the flag is a logical value.
  • the logic is “1”. Otherwise, the logic is “0”. Become. Therefore, the lower left of FIG. 3 shows the logical value of the flag in each pixel block.
  • the lower right of FIG. 3 shows the logical value of the flag in each pixel block.
  • FIG. 4 is a diagram for explaining the depth value, the flag related to the depth value, and the X and Y increment values related to the depth value.
  • the upper part of FIG. 4 is a diagram illustrating the state of the flag of the image block included in the three-dimensional graphics image to be handled. If all pixels in the image block are filled, the flag logic is “1”; otherwise, the flag logic is “0”. Therefore, the logic of the flags of the second and third pixel blocks in the first column is “1”. The logic of all flags of the pixel blocks in the second column is “1”. The logic of the flags of the second, third, and fourth pixel blocks of the pixel blocks in the third column is “1”.
  • the logic of the flag of the third pixel block of the pixel blocks in the fourth column is “1”.
  • the logic of other pixel block flags is “0”.
  • the lower diagram in FIG. 4 shows that when the logic of the pixel block flag is “1”, the depth value of the upper right pixel, the depth value of the lower left pixel, and the depth of the lower right pixel are based on the depth value of the upper left pixel. It indicates that a numerical value represented by an X, Y increment value from the reference value is set in the pixel block. Further, when the logic of the flag of the pixel block is “0”, it indicates that each depth value belonging to the pixel is set in the pixel block. Therefore, the external memory 30 stores the depth value or depth value and X and Y increment values set for each pixel block.
  • FIG. 5 is a diagram for explaining the operation of the pixel access unit 50 and the pixel access unit 50.
  • the pixel access unit 50 includes a flag generation unit 51, a pixel writing unit 52, and a pixel reading unit 53.
  • the pixel access unit 50 creates a flag from the coverage of each pixel for each pixel block composed of 2 ⁇ 2 pixels when the 3D graphics image includes M ⁇ N pixels. It has a function of storing in the external memory 30. In addition, it has a function of changing the pixel value of the external memory 30 for the pixel block in which the logical value of the flag is “0” when the drawing process is performed on the vertical M ⁇ N horizontal pixels.
  • the flag generation unit 51 is a circuit that generates a flag from the coverage received from the drawing circuit 10.
  • the pixel writing unit 52 receives the pixel value from the writing request from the drawing circuit 30 and outputs the pixel value to the external memory 30 together with the writing request.
  • the pixel writing unit 52 receives the flag and the coverage from the flag generation unit 51.
  • the pixel writing unit 52 receives a writing request from the drawing circuit, it issues a reading request to the pixel reading unit 53 and receives a flag and a pixel value.
  • the pixel reading unit 53 receives a pixel value from the drawing circuit 10 together with a read request.
  • the pixel reading unit 53 sends a read request to the external memory 30 and receives a flag and a pixel value.
  • the pixel reading unit 53 outputs a flag and a pixel value when receiving a reading request from the pixel writing unit 52.
  • the flag generation unit 51 is a 4-input AND, and when a 4-bit coverage is input, a 1-bit flag is generated.
  • the coverage is a flag attached to each pixel and indicating whether the pixel is drawn (filled) or not drawn (not filled) after the rendering process. That is, it is 0 when not painted, and 1 when painted.
  • MSAA is executed using four times the number of pixels, a 4-bit coverage consisting of 2 columns ⁇ 2 rows is handled. In that case, the flag generation unit 51 becomes a 4-input AND as shown in FIG. 6A.
  • the pixel writing unit 52 in the first embodiment includes a comparison circuit 52a, a 2-bit counter 52b, an AND 52c, and a selector 52d.
  • the pixel writing unit 52 indicates that the logic of the read request to the pixel reading unit 53 and the write request to the external memory 30 is “0”. Accordingly, reading from the pixel reading unit 53 to the pixel writing unit 52 and writing to the external memory 30 from the pixel writing unit 52 are not performed.
  • the read request logic to the pixel reading unit 53 is “1”, so that the read request from the pixel writing unit 52 to the pixel reading unit 53 is performed. Is done.
  • the flag of logic “1” is input to the 2-bit counter 52b, and the 2-bit counter 52b is counted up.
  • the comparison circuit 52a displays the count value from the 2-bit counter 52b as a fixed count value set in the comparison circuit 52a itself (in the embodiment, the count value is expressed as "00" in binary number and expressed in decimal number) 4).
  • the comparison circuit 52a ends the count-up of the 2-bit counter 52b, resets the count value, that is, fixes the count value to “00”.
  • the comparison circuit 52a continues to output an enable signal to the AND 52c while the 2-bit counter 52b outputs a binary number from the binary number "00" to a fixed count value.
  • the AND 52c since the AND 52c receives the enable signal from the comparison circuit 52a and the write request from the drawing circuit 10 as input signals, the write signal is sent to the external memory 30 when the logic of the enable signal is “0”. Output.
  • the selector 52d selects the pixel value from the drawing circuit when the coverage logic is “1”, and selects the pixel value from the pixel reading unit when the coverage logic is “0”. Then, the selector 52d outputs the selected pixel value to the external memory 30 as the pixel value.
  • the pixel reading unit 53 in the first embodiment includes a pixel holding buffer 53a, a selector 53b, and an AND 53c.
  • the pixel holding buffer 53a is a circuit that receives pixel values from the external memory 30 and temporarily holds them.
  • the pixel value temporarily stored is the pixel value at the upper left of the four pixel values of 2 ⁇ 2 in the vertical direction. This is because when all the four vertical 2 ⁇ horizontal pixel values of interest have the same color, only the upper left pixel value is output to the drawing circuit 10 and the other pixel values are not output.
  • the selector 53b selects the pixel value held in the pixel holding buffer 53a when the logic of the flag is “1”, and selects the pixel value from the external memory 30 when the logic of the flag is “0”. .
  • the AND 53 c outputs a read request to the external memory 30 when both the read request from the pixel writing unit 52 and the read request from the drawing circuit 10 are logic “1”.
  • FIG. 7 is a diagram for explaining the operation of the pixel access unit 50.
  • the operation of the pixel access unit 50 described in FIG. 7 relates to one pixel block.
  • the operation of the pixel access unit 50 when the logical value of the flag of the pixel block is changed from “1” to “0” by the drawing process will be described.
  • the pixel block C composed of the pixel values output from the external memory 30 to the pixel reading unit 53 is a set of pixel values each having the same color and having the upper left pixel and a flag. That is, the pixel block C includes a pixel value and a corresponding flag on the upper left, and the others have no pixel value.
  • the pixel value of the pixel block B is selected by the selector 52d, and in the coverage, the pixel value on the left half corresponding to the logical “1” bit and the pixel on the right half corresponding to the logical “0” bit This is because the value is selected.
  • FIG. 8 is a flowchart for explaining the entire writing operation of the pixel access unit 50.
  • the writing operation described in FIG. 8 is an operation in which the pixel access unit 50 receives the pixel data after performing the drawing process on the pixel value of the vertical M ⁇ horizontal N pixel and writes it to the external memory 30.
  • the writing operation shown in FIG. 8 is for a vertical 2 ⁇ horizontal 2 pixel block, and by performing these operations a plurality of times, vertical M ⁇ horizontal N pixels are processed. Therefore, before starting this flowchart, a step of dividing the vertical M ⁇ horizontal N pixels into vertical 2 ⁇ horizontal 2 pixel blocks and recognizing them is performed.
  • the flowchart will be described below in the order of steps.
  • Step OP10 The coverage of the pixels A1, A2, A3, A4 belonging to the pixel block A shown in FIG.
  • Step OP20 Whether all the pixels A1, A2, A3, and A4 belonging to the pixel block A after the drawing process are drawn is determined based on the logical value of the coverage of each pixel. For example, when all the logical values of the coverage of each pixel display a fill, it is determined that all are drawn, and when even one of the logical values of the coverage is not a solid display, it is not determined that all are drawn. When it is determined that all drawing is performed, the process proceeds to step OP40. If it is determined that all are not drawn, the process proceeds to step OP30.
  • Step OP30 The flag before the drawing process of the pixel block A is read from the external memory 30. Thereafter, the process proceeds to Step OP50.
  • Step OP50 The logical value of the flag before the drawing process read in step OP30 is rewritten to the logical value “0” and written again to the external memory 30. Thereafter, the process proceeds to Step OP60.
  • Step OP60 A branch in the flowchart is determined using the flag of the pixel block A read in step OP30. That is, when the logical value of the flav before drawing processing is “0”, among the pixels included in the pixel block C, there are pixels that are not painted and others that are painted, so the process proceeds to step OP100 corresponding to the situation. . On the other hand, when the logical value of the flag before the rendering process is “1”, all the pixels included in the pixel block C are filled pixels of the same color, so the process proceeds to step OP70 corresponding to the situation.
  • Step OP100 A pixel block B is created by overwriting the pixel block C with respect to the pixel having the logical value “1” of coverage among the pixels belonging to the pixel block A after the drawing process read out in step OP10. Then, the pixel value in the state of the pixel block B is written into the external memory 30. Thereafter, the pixel writing operation is terminated.
  • Step OP70 In step OP60, all the pixels included in the pixel block C are determined to be filled pixels of the same color before the drawing process. However, in the determination in step OP20, it is determined that all the pixels of the pixel block A are not filled after the drawing process. Therefore, in step OP70, the pixel value of the upper left pixel C1 stored in the external memory 30 among the pixels of the pixel block C before the drawing process is read. Step OP80: The pixels C2, C3, and C4 are restored from the pixel C1 at the upper left of the pixel block C before drawing processing read from the external memory 30 in Step 70.
  • Step OP90 The pixels C1, C2, C3, and C4 of the pixel block C before the drawing process are sent to the pixel writing unit 52 and stored as the pixels B1, B2, B3, and B4 of the pixel block B on the register for writing. To do. After that, of the pixels of the pixel block A after the drawing process, pixels whose coverage logical value is “1” (for example, A1 and A3 when the coverage is (1010)) are overwritten on the upper right and lower right. Then, it progresses to step OP110.
  • A1 and A3 when the coverage is (1010) are overwritten on the upper right and lower right.
  • Step OP110 Pixels B1, B2, B2, B2, and B3 formed by combining the pixels C1, C2, C3, and C4 of the pixel block C before the drawing process and the pixels A1, A2, A3, and A4 of the pixel block A after the drawing process B3 and B4 are written in the external memory 30 as pixel values of the pixel block B.
  • Step OP40 Since the pixels A1, A2, A3, and A4 belonging to the pixel block A after the drawing process are pixels that are filled with the same color, the logical value of the flag of the pixel block A is “1”. Therefore, the logical value of the flag and the pixel value of the upper left pixel of the pixel block A are set as the pixel value of the upper left pixel of the pixel block B. Thereafter, the process proceeds to step OP120.
  • Step OP120 Only the pixel value of the pixel A1 (upper left) belonging to the pixel block A after the drawing process is written in the external memory 30 as the upper left pixel value of the pixel block B.
  • the pixel access unit 50 treats the pixel blocks by dividing them into vertical 2 ⁇ horizontal 2 pixel blocks.
  • the pixel access unit 50 treats the pixel blocks by dividing them into vertical 2 ⁇ horizontal 2 pixel blocks.
  • the pixel access unit 50 treats the pixel blocks by dividing them into vertical 2 ⁇ horizontal 2 pixel blocks.
  • the storage area for storing the upper left pixel value and 1 bit of the flag stores the pixel value of each pixel related to one pixel block and the coverage of each pixel. It becomes smaller than the storage area.
  • the vertical M ⁇ horizontal N pixels before the drawing processing are converted into vertical M ⁇ horizontal N pixels after the drawing processing.
  • the number of accesses to the external memory 30 is compared with the number of accesses in the case of handling vertical M ⁇ horizontal N pixels using the method shown in this embodiment.
  • variable length compressed data method the type and frequency of pixel values of vertical M ⁇ N horizontal pixels are analyzed, and “0” is set for the pixel value having the highest frequency, and “1” is set for the pixel value having the next highest frequency. Then, variable length data is assigned such that “10” is assigned to the pixel value having the next highest frequency.
  • the pixel value is a fixed length, for example, 4 bits, the storage area for storing the pixel value can be reduced by the amount replaced with the variable length data.
  • the pixel value of the vertical M ⁇ horizontal N pixel that is compressed by the variable length compression data method and stored in the external memory 30 is replaced with the pixel value after the drawing process. Then, in order to perform the above replacement, the following operation will be performed.
  • the compressed data is expanded to the original pixel values of M ⁇ N pixels.
  • a drawing process is performed in the second step.
  • variable length compression processing is performed on the pixel values of the vertical M ⁇ horizontal N pixels after the drawing processing in the third step, and the pixel values after the variable length compression processing are output to the external memory 30.
  • the compressed data is expanded into pixel values of vertical M ⁇ horizontal N pixels.
  • M ⁇ N ⁇ (1 + S1) + M ⁇ N ⁇ 4 (... Equation (1)) accesses are performed.
  • coverage is 1 bit
  • S1 is the average number of bits of variable-length pixel values of M ⁇ N pixels
  • the number of bits of fixed-length pixel values corresponding to variable-length pixel values is 4 bits. That is, the first term is accessed to read out the pixel values subjected to coverage and variable length compression processing. Furthermore, the second term is accessed to read out a fixed-length pixel value corresponding to the pixel value represented by the assigned variable-length bits.
  • M ⁇ N ⁇ (1 + S2) (... Expression (2)) times of access is performed.
  • the coverage is 1 bit
  • S2 is the average number of bits of variable length pixel values of M ⁇ N pixels. Note that the variable length compression process is performed by the pixel writing unit 52.
  • the first step is vertical M ⁇ horizontal N.
  • the pixel value of each pixel is read from the external memory.
  • drawing processing is performed.
  • pixel values of vertical M ⁇ horizontal N pixels are output to the external memory 30 by the method shown in the present embodiment.
  • the first step when the logical value of the flag of the pixel block of M ⁇ N ⁇ T1 (0 or more and less than 1) is “1”, (M ⁇ N ⁇ (1 ⁇ T1) ⁇ 5) + (M ⁇ N ⁇ T1 ⁇ 5/4) (...
  • the number of accesses to the pixel access unit 50 and the external memory 30 is the sum of Expression (3) and Expression (4), and is M ⁇ N ⁇ (10 ⁇ (T1 + T2) ⁇ 3 ⁇ 5/4).
  • the sum of Expression (3) and Expression (4) is obtained, which is M ⁇ N ⁇ (6 + S1 + S2).
  • S1 and S2 are average bit numbers of variable-length pixel values of M ⁇ N pixels.
  • the number of accesses from the pixel writing unit 52 to the external memory 30 in the present embodiment decreases compared to the variable length compressed data system. That is, in most cases, the number of accesses between the pixel access unit 50 and the external memory 30 in this embodiment decreases.
  • FIG. 9 is a flowchart for explaining the entire reading operation of the pixel access unit 50.
  • the read operation described with reference to FIG. 9 is an operation of reading from the external memory 30 in order to perform drawing for pixel values of vertical M ⁇ horizontal N pixels.
  • the readout operation shown in FIG. 9 is for a vertical 2 ⁇ horizontal 2 pixel block, and by performing these operations a plurality of times, vertical M ⁇ horizontal N pixels are processed. Therefore, before starting this flowchart, a step of dividing the vertical M ⁇ horizontal N pixels into vertical 2 ⁇ horizontal 2 pixel blocks and recognizing them is performed.
  • Step OP210 The flag for the pixel block is read from the external memory 30.
  • Step OP220 If the logic of the read flag is “1”, the process proceeds to step OP230. On the other hand, if the logic of the read flag is “0”, the process proceeds to step 220.
  • Step OP230 Read pixel values for four pixels belonging to the pixel block from the external memory 30. Thereafter, the reading of the pixel value is finished.
  • Step OP240 Read out only the pixel value of the upper left pixel of the pixel block. Next, the process proceeds to step OP240.
  • Step OP250 The read pixel value of the upper left pixel is output to the drawing circuit 10 continuously four times. Instead of performing this step, pixel values for four pixels may be created in the drawing circuit 10 from the read pixel value of the upper left pixel.
  • FIG. 10 is a diagram for explaining the operation of the depth access unit 60 and the depth access unit 60.
  • the depth access unit 60 includes a flag generation unit 61, a depth writing unit 62, and a depth reading unit 63.
  • the depth access unit 60 creates a flag from the coverage of each pixel and stores it in the external memory 30 for a pixel block composed of 2 ⁇ 2 pixels when there are M ⁇ N pixels. Have In addition, it has a function of changing the pixel value of the external memory 30 for the pixel block in which the logical value of the flag is “0” when the drawing process is performed on the vertical M ⁇ N horizontal pixels.
  • functions of each circuit unit included in the depth access unit 60 in order to provide the above-described functions will be described.
  • the flag generation unit 61 is a circuit that generates a flag from the coverage received from the drawing circuit 10.
  • the depth writing unit 62 receives the writing request from the drawing circuit 30 and outputs the depth value and the X, Y increment value to the external memory 30 together with the writing request.
  • the depth writing unit 62 receives a flag from the flag generation unit 61.
  • the depth writing unit 62 issues a read request to the depth reading unit 63 and receives a flag and a depth value.
  • the depth reading unit 63 receives the depth value from the drawing circuit 10 together with the read request.
  • the depth reading unit 63 sends a read request to the external memory 30 and receives a flag, a depth value, and X and Y increment values.
  • the depth reading unit 63 outputs a flag and a depth value when receiving a read request from the depth writing unit 62.
  • the flag generation unit 61 in the embodiment is a 4-input AND, and when a 4-bit coverage is input, a 1-bit flag is generated. Using the coverage indicating whether or not the pixel is painted, it is determined whether or not the depth is attached to each pixel. This is because the depth exists if the pixel is painted. Therefore, the coverage logic is 0 when there is no data in the depth direction, and is 1 when there is data in the depth direction.
  • MSAA is executed using four times the number of pixels, a 4-bit coverage consisting of 2 columns ⁇ 2 rows is handled. In that case, the flag generation unit 61 becomes a 4-input AND as shown in FIG. 11A.
  • the flag is set to 0 when no data in the depth direction is attached to all four pixels, in other words, when the four pixels to be drawn have no depth. On the other hand, if there is data in the depth direction in all, the flag is 1.
  • the depth writing unit 62 in the embodiment includes a comparison circuit 62a, a 2-bit counter 62b, an AND 62c, and a selector 62d.
  • the depth writing unit 62 indicates that the logic of the read request to the depth reading unit 63 and the write request to the external memory 30 is “0”. Therefore, reading from the depth reading unit 63 to the depth writing unit 62 and writing to the external memory 30 from the depth writing unit 62 are not performed.
  • the logic of the read request to the depth reading unit 63 is “1”, so that the reading request from the depth writing unit 62 to the depth reading unit 63 is made. Done.
  • the flag of logic “1” is input to the 2-bit counter 62b, and the 2-bit counter 62b is counted up.
  • the comparison circuit 62a displays the count value from the 2-bit counter 62b as a fixed count value set in the comparison circuit 62a itself (in the embodiment, the count value is expressed as "00" in binary number and expressed in decimal number) 4).
  • the comparison circuit 62a reaches the fixed count value, it finishes counting up the 2-bit counter 62b, resets the count value, that is, fixes the count value to “00”.
  • the comparison circuit 62a continues to output an enable signal to the AND 62c while the 2-bit counter 62b outputs a binary number from the binary number "00" to a fixed count value.
  • the AND 62c since the AND 62c receives the enable signal from the comparison circuit 62a and the write request from the drawing circuit 10 as input signals, the write signal is sent to the external memory 30 when the logic of the enable signal is “0”. Output.
  • the selector 62d selects the depth value from the drawing circuit when the coverage logic is “1”, and selects the depth value from the depth reading unit when the coverage logic is “0”. Then, the director 62d outputs the selected depth value to the external memory 30 as the depth value or the X, Y increment value.
  • the depth reading unit 63 in the embodiment includes a depth holding buffer 63a, a selector 63b, an AND 63c, and a depth interpolation 63d.
  • the depth holding buffer 63a is a circuit that receives the depth value from the depth interpolation 63d and temporarily holds it.
  • the selector 63b selects the depth value held in the depth holding buffer 63a when the logic of the flag is "1", and selects the depth value output from the depth interpolation 63d when the logic of the flag is "0".
  • An interpolated value with X, Y increment values is selected.
  • the AND 63 c outputs a read request to the external memory 30 when both the read request from the depth writing unit 62 and the read request from the drawing circuit 10 are logic “1”.
  • FIG. 12 is a diagram for explaining the operation of the depth access unit 60.
  • the operation of the depth access unit 60 described in FIG. 12 relates to one pixel block.
  • the operation of the pixel access unit 60 when the logical value of the flag of the pixel block is changed from “1” to “0” by the drawing process will be described.
  • the pixel block F has depth values for all the pixels, and the depth value of each pixel is represented by an X, Y increment value with the depth value at the upper left as a reference value. Further, the pixel block F has a flag related to the depth corresponding to the pixel value at the upper left.
  • the pixel block E written to the external memory 30 after the drawing process is composed of the upper left and lower left depth values inherited from the left half of the pixel block D and the depth value inherited from the right half of the pixel block F. Yes.
  • the depth value from the pixel block F is obtained by adding the X and Y increments to the depth value for the upper left pixel as a reference.
  • the pixel value of the pixel block E is selected by the selector 62d.
  • the left half pixel value corresponding to the logical “1” bit corresponds to the logical “0” bit
  • the right half pixel corresponding to the logical “0” bit This is because the value is selected.
  • FIG. 13 is a flowchart for explaining the entire writing operation of the depth access unit 60. The flowchart will be described below in the order of steps.
  • the writing operation shown in FIG. 13 is for a vertical 2 ⁇ horizontal 2 pixel block, and by performing these operations a plurality of times, vertical M ⁇ horizontal N pixels are processed.
  • the writing operation described in FIG. 13 is an operation in which the depth access unit 50 receives the depth value after the drawing process is performed on the depth value of the vertical M ⁇ N horizontal pixel, and writes it to the external memory 30.
  • Step OP310 The coverage of the pixels D1, D2, D3, D4 belonging to the pixel block D shown in FIG.
  • Step OP320 It is determined by the logical value of the coverage of each pixel whether there is a depth value for all of the pixels D1, D2, D3, D4 belonging to the pixel block D after the rendering process. When all the pixels are drawn and it is determined that a depth value exists, the process proceeds to step OP340. When it is determined that there is a pixel that is not drawn and there is a pixel that has no depth value, the process proceeds to step OP330. Step OP330: The flag before the drawing process of the pixel block D is read from the external memory 30. Thereafter, the process proceeds to Step OP350. Step OP350: The logical value of the flag before the drawing process read out in step OP330 is rewritten to the logical value “0” and written again in the external memory 30. Thereafter, the process proceeds to Step OP360.
  • Step OP360 The branch in the flowchart is determined using the flag of the pixel block D read in step OP330. That is, when the logical value of the flav before drawing processing is “0”, among the pixels included in the pixel block D, there are pixels that have no depth value and pixels that have a depth value. Proceed to On the other hand, when the logical value of the flag before the drawing process is “1”, all the pixels included in the pixel block D are pixels having depth values, and thus the process proceeds to step OP370 corresponding to the situation.
  • Step OP400 A pixel block E is created by overwriting the pixel block F with respect to the pixel having the logical value “1” of coverage among the pixels belonging to the pixel block D after the drawing process read out in the step OP310. Then, the depth value of the state of the pixel block E is written into the external memory 30. Thereafter, the depth writing operation is terminated.
  • Step OP370 In step OP360, the pixels included in the pixel block D are all determined to be filled pixels of the same color before the drawing process. However, in the determination in step OP320, after the rendering process, it is determined that not all of the pixels in the pixel block D are filled and there are pixels for which there is no depth value. Therefore, in step OP370, the depth value and the X and Y increment values of the upper left pixel F1 stored in the external memory 30 among the pixels of the pixel block F before the drawing process are read.
  • Step OP380 The depth value of the pixel F2, the depth value of F3, the depth value of F4 are read from the depth value of the upper left pixel F1 and the X and Y increment values of the pixel block F before drawing processing read from the external memory 30 in Step 370. Restore the value.
  • Step OP390 Sends the depth value of the pixel F1, the depth value of F2, the depth value of F3, and the depth value of F4 of the pixel block F before drawing processing to the depth writing unit 62, and the pixel block on the register for writing This is stored as the depth value of the pixel E1 of E, the depth value of E2, the depth value of E3, and the depth value of E4.
  • the process proceeds to step OP410.
  • Step OP410 The depth value of the pixel F1, the depth value of F2, the depth value of F3, the depth value of F4 of the pixel block F before the drawing process, the depth value of the pixel D1 of the pixel block D after the drawing process, and the depth of D2 Value, the depth value of D3, and the depth value of D4, the depth value of the pixel E1, the depth value of E2, the depth value of E3, the depth value of E3, and the depth value of E4 are stored in the external memory 30 in the pixel block E. Write as a pixel.
  • Step OP340 Since the pixels D1, D2, D3, and D4 belonging to the pixel block D after the drawing process are pixels having a depth value, the logical value of the flag of the pixel block D is “1”. Therefore, the logical value of the flag is written in the external memory 30. Thereafter, the process proceeds to step OP420.
  • Step OP420 Write the depth value of the pixel D1 (upper left) belonging to the pixel block D after the rendering process and the X and Y increment values of the pixels D2, D3, and D4 to the external memory 30.
  • the depth access unit 60 treats the pixel blocks by dividing them into vertical 2 ⁇ horizontal 2 pixel blocks.
  • the depth values of all the pixel blocks are stored in the external memory. Instead of writing back to 30, only the depth value at the upper left, the X and Y increment values, and the logical value of the flag are written back. As a result, the number of accesses to the external memory 30 can be reduced as compared with the case where all depth values and coverages belonging to the pixel block are written back.
  • the flag consists of only a 1-bit logical value
  • the storage area for storing the upper left flag value, the X and Y increment values, and the 1 bit of the flag includes the depth value of each pixel related to one pixel block, This is smaller than the storage area for storing pixel coverage.
  • the vertical M ⁇ horizontal N pixels before the drawing processing are converted into vertical M ⁇ horizontal N pixels after the drawing processing.
  • the number of accesses to the external memory 30 is compared with the number of accesses in the case of handling vertical M ⁇ horizontal N pixels using the method shown in this embodiment.
  • variable length compressed data method the type and frequency of depth values of vertical M ⁇ N horizontal pixels are analyzed, and “0” is assigned to the pixel value having the highest frequency, and “1” is assigned to the pixel value having the next highest frequency. Then, variable length data is assigned such that “10” is assigned to the pixel value having the next highest frequency.
  • the pixel value is a fixed length, for example, 4 bits, the storage area for storing the pixel value can be reduced by the amount replaced with the variable length data.
  • the compressed data is expanded to the original depth M ⁇ N depth value.
  • a drawing process is performed in the second step.
  • variable length compression processing is performed on the depth value of the vertical M ⁇ width N pixels after the drawing processing in the third step, and the depth value after the variable length compression processing is output to the external memory 30.
  • the compressed data is expanded into pixel values of vertical M ⁇ horizontal N pixels.
  • the first step is vertical M ⁇ horizontal N.
  • the depth value of the pixel is read from the external memory.
  • drawing processing is performed.
  • the depth value of the vertical M ⁇ N horizontal pixels is output to the external memory 30 by the method shown in the present embodiment.
  • the first step when the logical value of the flag of the pixel block of M ⁇ N ⁇ T1 (0 or more and less than 1) is “1”, (M ⁇ N ⁇ (1 ⁇ T1) ⁇ 5) + (M ⁇ N ⁇ T1 ⁇ 11/4) (...
  • the number of accesses between the pixel access unit 50 and the external memory 30 is the sum of Expression (3) and Expression (4), and is M ⁇ N ⁇ (10 ⁇ (T1 + T2) ⁇ 9/4).
  • the sum of Expression (1) and Expression (2) is obtained, which is M ⁇ N ⁇ (6 + S1 + S2).
  • S1 and S2 are average bit numbers of variable-length pixel values of M ⁇ N pixels.
  • the number of accesses from the depth writing unit 62 in this embodiment to the external memory 30 is It can be seen that this is reduced compared to the variable length compressed data system. That is, in most cases, the number of accesses between the depth access unit 60 and the external memory 30 in this embodiment decreases.
  • FIG. 14 is a flowchart for explaining the entire reading operation of the depth access unit 60. The flowchart will be described below in the order of steps. However, the readout operation shown in FIG. 14 is for a vertical 2 ⁇ horizontal 2 pixel block, and by performing these operations a plurality of times, vertical M ⁇ horizontal N pixels are processed. Further, the read operation described with reference to FIG. 14 refers to an operation of reading from the external memory 30 in order to perform drawing for pixel values of vertical M ⁇ horizontal N pixels.
  • Step OP510 The flag for the pixel block is read from the external memory 30.
  • Step OP520 If the logic of the read flag is “1”, the process proceeds to Step OP530.
  • Step OP540 Depth values for four pixels belonging to the pixel block are read from the external memory 30. Thereafter, reading of the depth value is terminated.
  • Step OP530 Only the depth value of the upper left pixel of the pixel block and the X and Y increment values for four pixels are read out.
  • step OP550 A depth value for 4 pixels is generated from the read depth value of the upper left pixel and the X and Y increment values for 4 pixels. Instead of performing this step, a depth value for four pixels may be created in the drawing circuit 10 from the depth value of the upper left pixel and the X and Y increment values for four pixels.

Abstract

Provided is a method of writing image data whereby the number of times an external memory is written to is reduced for the image data and for a method of forming image data that reduces the amount of image data used for anti-aliasing. The method of forming image data comprising: a step wherein a three dimensional graphics image is segmented into pixel blocks; a step wherein with respect to all pixels for each pixel block, using a coverage mask, if there is a solid fill of the same color, a flag with a first logic is generated, and if one portion of the pixel has a solid fill of a different color, or, if there is no fill, a flag with a second logic is generated; a step wherein within a pixel block having the flag with the first logic a single pixel value is selected from among the pixel values and is defined as a first pixel value; a step wherein within a pixel block having the flag with the second logic all pixel values are defined as a second pixel value; a step wherein image data is generated on the bases of the first pixel value, the second pixel value, and the flags with first and second logic.

Description

画像データ形成方法、画像データの書込方法、及び、画像データ処理回路Image data forming method, image data writing method, and image data processing circuit
 3次元グラフィックスのレンダリング処理において行う、アンチエイリアス処理に伴う画像データの形成方法、形成された画像データの書込方法、及び、画像データ処理回路に関する。 The present invention relates to a method for forming image data associated with anti-aliasing, a method for writing the formed image data, and an image data processing circuit, which are performed in the rendering processing of three-dimensional graphics.
 深さ(デプス)方向の画像データを有する3次元グラフィックス画像の描画時に発生するジャギー(輪郭のがたつき)を軽減するため、アンチエイリアス処理が施される。
 一般的なアンチエイリアス処理として、スーパーサンプリングアンチエイリアス(SSAA)処理、及び、マルチサンプルアンチエイリアス(MSAA)処理が主に用いられている(特許文献1)。
 ここで、SSAAとは、描画対象に対して表示解像度より高い解像度でレンダリング処理を行い、その結果得られた画像の解像度を縮小して表示画像を得る手法である。また、MSAAとは、描画対象に対して表示解像度より高い解像度でレンダリング処理を行い、得られた画像の解像度を縮小して表示画素を得る点ではSSAAと同様であるが、画素色を全て同一とする等、レンダリング処理の単純化を図る点で異なる手法である。ただし、MSAAにおいても、深さ(デプス)方向の画像データはSSAAと同様に扱われる。
Anti-aliasing is performed to reduce jaggy (shaking of the outline) that occurs when drawing a three-dimensional graphics image having image data in the depth (depth) direction.
As general anti-aliasing processing, super sampling anti-aliasing (SSAA) processing and multi-sample anti-aliasing (MSAA) processing are mainly used (Patent Document 1).
Here, SSAA is a technique for rendering a rendering target at a resolution higher than the display resolution, and reducing the resolution of the resulting image to obtain a display image. MSAA is similar to SSAA in that it renders a rendering target at a resolution higher than the display resolution and reduces the resolution of the obtained image to obtain display pixels, but the pixel colors are all the same. This is a different technique in that the rendering process is simplified. However, also in MSAA, image data in the depth direction is handled in the same manner as SSAA.
 しかしながら、MSAAにおいては、アンチエイリアス処理を軽減することはできるが、アンチエイリアス処理において扱う画像データ量を減少させることはできない。従って、画像データを処理する手法又は装置が同じであるなら、SSAA処理とMSAA処理において、画像データを蓄積するメモリへのアクセス量は同等となる。
 そうすると、画像データを蓄積する外部メモリに対する性能要請も、SSAA処理とMSAA処理とでは、同様なものとなる。
However, in MSAA, although anti-aliasing can be reduced, the amount of image data handled in anti-aliasing cannot be reduced. Therefore, if the method or apparatus for processing the image data is the same, the access amount to the memory for storing the image data is the same in the SSAA process and the MSAA process.
Then, the performance requirements for the external memory for storing image data are the same in the SSAA process and the MSAA process.
 そこで、画像に対する画像データは増大する傾向にあるため、アンチエイリアス処理に関連する外部メモリとのアクセスに使用するクロック周波数の増大又はバスのバス幅の増大はさけられない傾向にある。 Therefore, since image data for an image tends to increase, there is a tendency that an increase in clock frequency used for accessing an external memory related to anti-aliasing or an increase in bus width of the bus cannot be avoided.
特開2002-63597号公報JP 2002-63597 A
 アンチエイリアス処理に用いる画像データ量を減少させる画像データの形成方法、及び、形成された画像データについて、外部メモリへの書込回数を減少させる書込方法を提供する。 An image data forming method for reducing the amount of image data used for anti-aliasing processing and a writing method for reducing the number of times of writing the formed image data to an external memory are provided.
 本発明の第1の側面によれば、下記の画像データ形成方法を提供する。その画像データ形成方法は、3次元グラフィックス画像に含まれるマトリックス状に並べられた画素を、K行L列の前記画素からなる画素ブロックに分割する工程と、各画素ブロック毎に、前記画素の色の塗りつぶし状態を示すカバレッジを用いて、含まれる画素すべてについて、同色の塗りつぶしが行われる場合は第1論理を備えるフラグを発生し、含まれる画素の一部が異なる色の塗りつぶし又は塗りつぶしなしの場合は第2論理を備えるフラグを発生する工程と、前記第1論理を備えるフラグを有する画素ブロックにおいて、含まれる画素の画素値の内からひとつの画素値を選択し、第1画素値とする工程と、前記第2論理を備えるフラグを有する画素ブロックにおいて、含まれる画素の画素値のすべてを、第2画素値とする工程と、前記第1画素値、前記第2画素値、及び、前記第1及び第2論理を備えるフラグに基づいて、前記3次元グラフィックス画像の画像データを発生させる工程と、を備えることを特徴とする画像データ形成方法である。
 本発明の第2の側面によれば、下記の画像データ書込方法を提供する。その画像データ形成方法は、描画処理後の3次元グラフィックス画像に含まれる第1画素の第1画素値又は第1デプス値からなる画像データを書き込む方法であって、描画処理後の3次元グラフィックス画像に含まれるマトリックス状に並べられた第1画素を、K行L列の前記第1画素からなる第1画素ブロックに分割する工程と、各第1画素ブロック毎に、前記第1画素の色の塗りつぶし状態を示すカバレッジを用いて、含まれる第1画素すべてについて、同色の塗りつぶしが行われる場合は第1論理の第1フラグを発生し、含まれる第1画素の一部が異なる色の塗りつぶし又は塗りつぶしなしである場合は、第2論理の第1フラグ発生する工程と、前記第1論理の第1フラグを有する第1画素ブロックに対して、含まれる第1画素の第1画素値の内からひとつの第1画素値を選択し、第3画素値とする工程と、前記第2論理の第1フラグを有する第1画素ブロックに対して、外部メモリに記憶されている描画処理前の3次元グラフィックス画像に含まれる対応する第2画素ブロック及び第2フラグを読み出す工程と、前記第2フラグの論理が含まれる第2画素の一部が異なる色の塗りつぶし又は塗りつぶしなしであることを示す場合は、前記第2論理の第1フラグを有する第1画素ブロック含まれるすべての第1画素の第1画素値を第3画素値とする工程と、前記第2フラグの論理が同色の塗りつぶしであることを示す場合は、前記第1画素ブロックの第1画素の内、色の塗りつぶし状態を示すカバレッジを有する第1画素の第1画素値と、色の塗りつぶしなし状態を示すカバレッジを有する第1画素の第1画素値に代えて、第2画素ブロックの第2画素値を、第3画素値とする工程と、前記第3画素値、前記第1論理及び第2論理の第1フラグからなる画素データを外部メモリに書き込む工程と、を備えることを特徴とする画像データ書込方法である。
According to the first aspect of the present invention, the following image data forming method is provided. The image data forming method includes a step of dividing pixels arranged in a matrix included in a three-dimensional graphics image into pixel blocks including the pixels of K rows and L columns, and for each pixel block, Using the coverage indicating the color fill state, if the same color fill is performed for all the included pixels, a flag having the first logic is generated, and some of the included pixels are filled with different colors or not filled. In this case, in the step of generating a flag having the second logic and the pixel block having the flag having the first logic, one pixel value is selected from the pixel values of the included pixels, and is set as the first pixel value. And a step of setting all of the pixel values of the pixels included in the pixel block having a flag having the second logic to a second pixel value; Generating the image data of the three-dimensional graphics image based on a flag including the first pixel value, the second pixel value, and the first and second logics. This is an image data forming method.
According to the second aspect of the present invention, the following image data writing method is provided. The image data forming method is a method of writing image data including the first pixel value or the first depth value of the first pixel included in the three-dimensional graphics image after the drawing process, and the three-dimensional graphic after the drawing process. Dividing the first pixels arranged in a matrix form included in the scan image into first pixel blocks composed of the first pixels of K rows and L columns, and for each first pixel block, When the same color is applied to all the first pixels included using the coverage indicating the color fill state, a first flag of the first logic is generated, and some of the included first pixels have different colors. If there is no fill or no fill, the step of generating the first flag of the second logic and the first image of the first pixel included for the first pixel block having the first flag of the first logic. A step of selecting one first pixel value from among the prime values to obtain a third pixel value, and a drawing stored in the external memory for the first pixel block having the first flag of the second logic A step of reading the corresponding second pixel block and second flag included in the three-dimensional graphics image before processing, and a part of the second pixel including the logic of the second flag are filled with different colors or without filling. When indicating that there is a third pixel value, the step of setting the first pixel value of all the first pixels included in the first pixel block having the first flag of the second logic to the third pixel value; In the case of indicating the same color fill, the first pixel value of the first pixel having coverage indicating the color fill state among the first pixels of the first pixel block and the cover indicating the color unfilled state. Instead of the first pixel value of the first pixel having the first pixel value, the second pixel value of the second pixel block is set to the third pixel value, and the third pixel value, the first logic, and the second logic And a step of writing pixel data comprising a first flag to an external memory.
 本発明によれば、アンチエイリアス処理に用いる画像データ量を減少させる画像データの形成方法、及び、形成された画像データについて、外部メモリへの書込回数を減少させる書込方法を提供することができる。 According to the present invention, it is possible to provide a method for forming image data for reducing the amount of image data used for anti-aliasing processing, and a writing method for reducing the number of times the formed image data is written to an external memory. .
図1は、描画回路10、画像データ処理回路20、及び、外部メモリ30からなる半導体装置を示す。FIG. 1 shows a semiconductor device including a drawing circuit 10, an image data processing circuit 20, and an external memory 30. 図2は、縦2×横2からなる画素ブロックに区切られた縦8×横8の画素を表す。FIG. 2 shows 8 × 8 pixels divided into 2 × 2 pixel blocks. 図3は、縦2×横2からなる画素ブロックに区切られた縦8×横8の画素について、フラグと外部メモリ30に記憶される画素値との関係を示す図である。FIG. 3 is a diagram showing the relationship between the flag and the pixel value stored in the external memory 30 for 8 × 8 pixels divided into 2 × 2 pixel blocks. 図4はデプス値、デプス値に関連するフラグ、及び、デプス値に関するX,Y増分値について説明する図である。FIG. 4 is a diagram for explaining the depth value, the flag related to the depth value, and the X and Y increment values related to the depth value. 図5は、画素アクセス部50の動作及び画素アクセス部50について説明する図である。FIG. 5 is a diagram for explaining the operation of the pixel access unit 50 and the pixel access unit 50. 図6A、図6Bは、フラグ生成部51、及び、画素書込部52の具体的な回路例を示す。6A and 6B show specific circuit examples of the flag generation unit 51 and the pixel writing unit 52. FIG. 、図6Cは、画素読出部53の具体的な回路例を示す。FIG. 6C shows a specific circuit example of the pixel readout unit 53. 図7は、画素アクセス部50の動作を説明する図である。FIG. 7 is a diagram for explaining the operation of the pixel access unit 50. 図8は、画素アクセス部50の書込動作の全体を説明するフローチャートである。FIG. 8 is a flowchart for explaining the entire writing operation of the pixel access unit 50. 図9は、画素アクセス部50の読出動作の全体を説明するフローチャートである。FIG. 9 is a flowchart for explaining the entire reading operation of the pixel access unit 50. 図10は、デプスアクセス部60の動作及びデプスアクセス部60について説明する図である。FIG. 10 is a diagram for explaining the operation of the depth access unit 60 and the depth access unit 60. 図11A、図11Bは、フラグ生成部61及びデプス書込部62の具体的な回路例を示す。11A and 11B show specific circuit examples of the flag generation unit 61 and the depth writing unit 62. FIG. 図11Cは、デプス読出部63の具体的な回路例を示す。FIG. 11C shows a specific circuit example of the depth reading unit 63. 図12は、デプスアクセス部60の動作を説明する図である。FIG. 12 is a diagram for explaining the operation of the depth access unit 60. 図13は、デプスアクセス部60の書込動作の全体を説明するフローチャートである。FIG. 13 is a flowchart for explaining the entire writing operation of the depth access unit 60. 図14は、デプスアクセス部60の読出動作の全体を説明するフローチャートである。FIG. 14 is a flowchart for explaining the entire reading operation of the depth access unit 60.
 本発明は、以下に説明する実施例に対し、当業者が想到可能な、設計上の変更が加えられたもの、及び、実施例に現れた構成要素の組み換えが行われたものも含む。また、本発明は、その構成要素が同一の作用効果を及ぼす他の構成要素へ置き換えられたもの等も含み、以下の実施例に限定されない。 The present invention includes the embodiments described below that have been modified by the design that can be conceived by those skilled in the art, and those in which the components shown in the embodiments have been recombined. Further, the present invention includes those in which the constituent elements are replaced with other constituent elements having the same operational effects, and are not limited to the following embodiments.
 図1は、描画回路10、画像データ処理回路20、及び、外部メモリ30からなる半導体装置を示す。
 描画回路10は、描画する3次元グラフィックス画像を、3次元モデルと原画像とからレンダリング処理を行って形成する回路である。ここで、レンダリング処理は、例えば、投影処理、ラスタ化処理、隠面消去処理、及び、シューティング・効果付与処理などにより構成される。
FIG. 1 shows a semiconductor device including a drawing circuit 10, an image data processing circuit 20, and an external memory 30.
The drawing circuit 10 is a circuit that forms a three-dimensional graphics image to be drawn by rendering processing from a three-dimensional model and an original image. Here, the rendering process includes, for example, a projection process, a rasterization process, a hidden surface removal process, and a shooting / effect applying process.
 画像データ処理回路20は画素アクセス部50及びデプスアクセス部60を含む。
 画素アクセス部50は描画回路10による描画処理後の3次元グラフィックス画像を構成する画素の画素値、及び、カバレッジについてデータ処理を行い、そのデータ処理によって発生させたフラグと、そのデータ処理によって選択された画素の画素値と、を外部メモリ30に記憶させる回路である。
 画素アクセス部50は外部メモリ30から受け取ったフラグと選択された画素値から描画処理前の画素値とカバレッジとに展開する回路である。
 デプスアクセス部60は、描画回路10による描画処理後の3次元グラフィックス画像を構成する画素のデプス値、カバレッジについてデータ処理を行い、そのデータ処理によって発生させたフラグと、そのデータ処理によって発生させたX,Y増分値と、そのデータ処理によって発生させた選択されたデプス値とを外部メモリ30に記憶させる回路である。
 デプスアクセス部60は、外部メモリ30から受け取ったフラグ、X,Y増分値、及び、選択されたデプス値から描画処理前のデプス値、及び、カバレッジとに展開する回路である。
The image data processing circuit 20 includes a pixel access unit 50 and a depth access unit 60.
The pixel access unit 50 performs data processing on the pixel values and coverage of pixels constituting the three-dimensional graphics image after the drawing processing by the drawing circuit 10, and selects the flag generated by the data processing and the data processing. This is a circuit for storing the pixel value of the selected pixel in the external memory 30.
The pixel access unit 50 is a circuit that develops a pixel value and coverage before drawing processing from a flag received from the external memory 30 and a selected pixel value.
The depth access unit 60 performs data processing on the depth value and coverage of the pixels constituting the three-dimensional graphics image after the rendering processing by the rendering circuit 10, and generates a flag generated by the data processing and the data processing. This is a circuit for storing in the external memory 30 the X and Y increment values and the selected depth value generated by the data processing.
The depth access unit 60 is a circuit that expands the flag received from the external memory 30, the X and Y increment values, and the selected depth value into the depth value before the drawing process and the coverage.
 図2は、縦2×横2からなる画素ブロックに区切られた縦8×横8の画素を表す。図2を用いて、画素ブロックのカバレッジについて説明する。
 各画素について、色の塗りつぶし状態を示すカバレッジを割り当て、色の塗りつぶしがある時にはカバレッジに論理”1”が、色の塗りつぶしがないときにはカバレッジに論理”0”が割り当てられる。そこで、カバレッジは各画素ブロック毎に割り当てられた論理値を、左上、右上、左下、右下の順に並べて2進数として表したものをいう。
 なお、図2では、縦8×横8の画素が示されているが、それにとらわれることはなく、一般的に縦M×横N(M、Nは任意の正の整数)の画素におけるカバレッジも同様に表される。また、画素ブロックは上記では縦2×横2の画素からなっているが、縦L×横K(K、Lは任意の正の整数)の画素から構成されていてもよい。
FIG. 2 shows 8 × 8 pixels divided into 2 × 2 pixel blocks. The pixel block coverage will be described with reference to FIG.
For each pixel, a coverage indicating a color fill state is assigned, and when there is a color fill, a logic “1” is assigned to the coverage, and when there is no color fill, a logic “0” is assigned to the coverage. Therefore, coverage refers to a logical value assigned to each pixel block expressed as a binary number arranged in the order of upper left, upper right, lower left, and lower right.
In FIG. 2, vertical 8 × horizontal 8 pixels are shown. However, the present invention is not limited to this, and generally the coverage of vertical M × horizontal N pixels (M and N are arbitrary positive integers) is also included. It is expressed similarly. In addition, the pixel block is composed of 2 × vertical pixels in the above, but may be composed of pixels of vertical L × horizontal K (K and L are arbitrary positive integers).
 図3は、縦2×横2からなる画素ブロックに区切られた縦8×横8の画素について、フラグと外部メモリ30に記憶される画素値との関係を示す図である。
 図3左上はカバレッジの論理が”1”の画素を縦縞で表した図である。
 次いで、図3右上は縦2×横2の画素ブロックを構成する画素のすべてにおいて、色の塗りつぶしが行われることとなる画素ブロックを抽出し、横縞で表したものである。
 ここで、フラグとは、論理値であり、各画素ブロックにおいて、その画素ブロックに属する画素のすべてについて色の塗りつぶしが行われている場合に論理”1”、そうでない場合に論理”0”となる。
 そこで、図3左下はフラグの論理値をそれぞれの画素ブロックに記載したものである。次いで、図3右下は、それぞれの画素ブロックの内、外部メモリ30に画素値を格納したものを縦縞で表し、格納しなかったものは斜め縞である。フラグの論理が”1”のときには、画素ブロックの左上の画素値のみが外部メモリ30に記憶される。一方、フラグの論理が”0”の場合は、色の塗りつぶしが行われる画素の画素値のみが外部メモリ30に格納される。
FIG. 3 is a diagram showing the relationship between the flag and the pixel value stored in the external memory 30 for 8 × 8 pixels divided into 2 × 2 pixel blocks.
In the upper left of FIG. 3, pixels whose coverage logic is “1” are represented by vertical stripes.
Next, in the upper right of FIG. 3, pixel blocks that are to be color-filled are extracted from all the pixels constituting the 2 × 2 pixel block, and are represented by horizontal stripes.
Here, the flag is a logical value. In each pixel block, when all the pixels belonging to the pixel block are color-filled, the logic is “1”. Otherwise, the logic is “0”. Become.
Therefore, the lower left of FIG. 3 shows the logical value of the flag in each pixel block. Next, in the lower right of FIG. 3, among the respective pixel blocks, those in which the pixel values are stored in the external memory 30 are represented by vertical stripes, and those not stored are diagonal stripes. When the flag logic is “1”, only the upper left pixel value of the pixel block is stored in the external memory 30. On the other hand, when the flag logic is “0”, only the pixel value of the pixel to be color-filled is stored in the external memory 30.
 図4はデプス値、デプス値に関連するフラグ、及び、デプス値に関するX,Y増分値について説明する図である。
 図4上段の図は、取り扱う3次元グラフィックス画像に含まれる画像ブロックのフラグの状態を示す図である。画像ブロック中の画素すべてが塗りつぶしの場合、フラグの論理は”1”であり、そうでないときは、フラグの論理は”0”である。そこで、第1列の第2、第3の画素ブロックのフラグの論理は”1”である。第2列の画素ブロックのすべてのフラグの論理は”1”である。第3列の画素ブロックの第2、第3、第4の画素ブロックのフラグの論理は”1”である。第4列の画素ブロックの第3の画素ブロックのフラグの論理は”1”である。その他の画素ブロックのフラグの論理は”0”である。
 図4下段の図は、画素ブロックのフラグの論理が”1”のときには、左上の画素のデプス値を基準に、右上の画素のデプス値、左下の画素のデプス値、右下の画素のデプス値を、基準値からのX,Y増分値で表した数値が画素ブロックに設定されることを示す。さらに、画素ブロックのフラグの論理が”0”のときには、画素に属するデプス値それぞれを画素ブロックに設定することを示す。そこで、外部メモリ30には、それぞれの画素ブロックに設定されたデプス値又はデプス値及びX,Y増分値を格納する。
FIG. 4 is a diagram for explaining the depth value, the flag related to the depth value, and the X and Y increment values related to the depth value.
The upper part of FIG. 4 is a diagram illustrating the state of the flag of the image block included in the three-dimensional graphics image to be handled. If all pixels in the image block are filled, the flag logic is “1”; otherwise, the flag logic is “0”. Therefore, the logic of the flags of the second and third pixel blocks in the first column is “1”. The logic of all flags of the pixel blocks in the second column is “1”. The logic of the flags of the second, third, and fourth pixel blocks of the pixel blocks in the third column is “1”. The logic of the flag of the third pixel block of the pixel blocks in the fourth column is “1”. The logic of other pixel block flags is “0”.
The lower diagram in FIG. 4 shows that when the logic of the pixel block flag is “1”, the depth value of the upper right pixel, the depth value of the lower left pixel, and the depth of the lower right pixel are based on the depth value of the upper left pixel. It indicates that a numerical value represented by an X, Y increment value from the reference value is set in the pixel block. Further, when the logic of the flag of the pixel block is “0”, it indicates that each depth value belonging to the pixel is set in the pixel block. Therefore, the external memory 30 stores the depth value or depth value and X and Y increment values set for each pixel block.
 図5は、画素アクセス部50の動作及び画素アクセス部50について説明する図である。
 画素アクセス部50は、フラグ生成部51、画素書込部52、画素読出部53を含む。
 なお、画素アクセス部50は3次元グラフィックスの画像が縦M×横Nの画素を含むときに、縦2×横2の画素からなる画素ブロック毎に、各画素のカバレッジからフラグを作成し、外部メモリ30に記憶させる機能を有する。また、縦M×横Nの画素について描画処理を行ったときに、フラグの論理値が”0”となった画素ブロックについて、外部メモリ30の画素値を変更する機能を有する。以下、画素アクセス部50に上記の機能を持たせるために、それに含まれる各回路部が有する機能を説明する。
 フラグ生成部51は描画回路10から受け取ったカバレッジからフラグを生成する回路である。
 画素書込部52は描画回路30からの書込要求を、画素値を受けて、外部メモリ30に画素値を書込要求とともに出力する。画素書込部52はフラグ生成部51からフラグとカバレッジを受け取る。画素書込部52は描画回路からの書込要求を受け取ると、画素読出部53に対して読出要求を出し、フラグ及び画素値を受け取る。
 画素読出部53は、描画回路10から画素値を、読出要求とともに受け取る。画素読出部53は、外部メモリ30に読出要求を送り、フラグ及び画素値を受け取る。画素読出部53は、画素書込部52から読出要求を受けたときに、フラグ及び画素値を出力する。
FIG. 5 is a diagram for explaining the operation of the pixel access unit 50 and the pixel access unit 50.
The pixel access unit 50 includes a flag generation unit 51, a pixel writing unit 52, and a pixel reading unit 53.
The pixel access unit 50 creates a flag from the coverage of each pixel for each pixel block composed of 2 × 2 pixels when the 3D graphics image includes M × N pixels. It has a function of storing in the external memory 30. In addition, it has a function of changing the pixel value of the external memory 30 for the pixel block in which the logical value of the flag is “0” when the drawing process is performed on the vertical M × N horizontal pixels. Hereinafter, functions of each circuit unit included in the pixel access unit 50 in order to provide the above functions will be described.
The flag generation unit 51 is a circuit that generates a flag from the coverage received from the drawing circuit 10.
The pixel writing unit 52 receives the pixel value from the writing request from the drawing circuit 30 and outputs the pixel value to the external memory 30 together with the writing request. The pixel writing unit 52 receives the flag and the coverage from the flag generation unit 51. When the pixel writing unit 52 receives a writing request from the drawing circuit, it issues a reading request to the pixel reading unit 53 and receives a flag and a pixel value.
The pixel reading unit 53 receives a pixel value from the drawing circuit 10 together with a read request. The pixel reading unit 53 sends a read request to the external memory 30 and receives a flag and a pixel value. The pixel reading unit 53 outputs a flag and a pixel value when receiving a reading request from the pixel writing unit 52.
 図6A、図6B、図6Cは、フラグ生成部51、画素書込部52、画素読出部53の具体的な回路例を示す。
 図6Aを参照して説明を行うと、実施例1におけるフラグ生成部51は、4入力ANDであり、4ビットのカバレッジを入力すると、1ビットのフラグを発生する。カバレッジとは、各画素に付属して付加され、レンダリング処理の後、描画される画素(塗りつぶされる)か、描画されない画素(塗りつぶされない)かを示すフラッグである。すなわち、塗りつぶされない場合に0、塗りつぶされる場合に1となる。ここで、4倍の画素数を用いてMSAAを実行する場合、縦2列×横2行からなる4ビットのカバレッジを扱うことになる。その場合、フラグ生成部51は図6Aのように4入力ANDとなる。
6A, 6B, and 6C show specific circuit examples of the flag generation unit 51, the pixel writing unit 52, and the pixel reading unit 53. FIG.
Referring to FIG. 6A, the flag generation unit 51 according to the first embodiment is a 4-input AND, and when a 4-bit coverage is input, a 1-bit flag is generated. The coverage is a flag attached to each pixel and indicating whether the pixel is drawn (filled) or not drawn (not filled) after the rendering process. That is, it is 0 when not painted, and 1 when painted. Here, when MSAA is executed using four times the number of pixels, a 4-bit coverage consisting of 2 columns × 2 rows is handled. In that case, the flag generation unit 51 becomes a 4-input AND as shown in FIG. 6A.
 そうすると、4つの画素が全て同一色とならない場合、言い換えると、描画しようとしている4つの画素を塗りつぶさない場合、フラグは0となる。一方、全て同一色となる場合、フラグは1となる。 Then, if all four pixels do not have the same color, in other words, if the four pixels to be drawn are not filled, the flag is 0. On the other hand, if all the colors are the same, the flag is 1.
 図6Bを参照して説明を続けると、実施例1における画素書込部52は、比較回路52a、2ビットカウンタ52b、AND52c、セレクタ52dを含む。
 フラグ生成部51から論理”0”を表すフラグを受け取った場合、画素書込部52は、画素読出部53への読出要求、及び、外部メモリ30への書込要求の論理は”0”のままなので、画素書込部52への画素読出部53からの読出、及び、画素書込部52からの外部メモリ30への書込は行われない。
Continuing the description with reference to FIG. 6B, the pixel writing unit 52 in the first embodiment includes a comparison circuit 52a, a 2-bit counter 52b, an AND 52c, and a selector 52d.
When the flag indicating the logic “0” is received from the flag generation unit 51, the pixel writing unit 52 indicates that the logic of the read request to the pixel reading unit 53 and the write request to the external memory 30 is “0”. Accordingly, reading from the pixel reading unit 53 to the pixel writing unit 52 and writing to the external memory 30 from the pixel writing unit 52 are not performed.
 フラグ生成部51から論理7”1”を表すフラグを受け取った場合、画素読出部53への読出要求の論理が”1”となるため、画素書込部52から画素読出部53への読出要求が行われる。また、論理”1”のフラグは、2ビットカウンタ52bに入力され、2ビットカウンタ52bのカウントアップが行われる。比較回路52aは2ビットカウンタ52bからのカウント値を、比較回路52a自身に設定された固定のカウント値(実施例において、カウント値は2進数で表すと”00”であり、10進数で表すと4である。)と比較する。比較回路52aは固定のカウント値に達すると、2ビットカウンタ52bのカウントアップを終了させ、カウント値をリセット、すなわち、カウント値を”00”に固定する。 When a flag representing logic 7 “1” is received from the flag generation unit 51, the read request logic to the pixel reading unit 53 is “1”, so that the read request from the pixel writing unit 52 to the pixel reading unit 53 is performed. Is done. The flag of logic “1” is input to the 2-bit counter 52b, and the 2-bit counter 52b is counted up. The comparison circuit 52a displays the count value from the 2-bit counter 52b as a fixed count value set in the comparison circuit 52a itself (in the embodiment, the count value is expressed as "00" in binary number and expressed in decimal number) 4). When the comparison circuit 52a reaches a fixed count value, the comparison circuit 52a ends the count-up of the 2-bit counter 52b, resets the count value, that is, fixes the count value to “00”.
 比較回路52aは、2ビットカウンタ52bが2進数”00”から固定のカウント値までの2進数を出力している間、イネーブル信号をAND52cに出し続ける。
 その結果、AND52cは比較回路52aからのイネーブル信号と描画回路10からの書込要求を入力信号に受けているので、イネーブル信号の論理が”0”のときに、書込信号を外部メモリ30へ出力する。
The comparison circuit 52a continues to output an enable signal to the AND 52c while the 2-bit counter 52b outputs a binary number from the binary number "00" to a fixed count value.
As a result, since the AND 52c receives the enable signal from the comparison circuit 52a and the write request from the drawing circuit 10 as input signals, the write signal is sent to the external memory 30 when the logic of the enable signal is “0”. Output.
 セレクタ52dはカバレッジの論理が”1”のときに、描画回路からの画素値を選択し、カバレッジの論理が”0”のときに、画素読出部からの画素値を選択する。そして、セレクタ52dは選択した方の画素値を、画素値として外部メモリ30へ出力する。 The selector 52d selects the pixel value from the drawing circuit when the coverage logic is “1”, and selects the pixel value from the pixel reading unit when the coverage logic is “0”. Then, the selector 52d outputs the selected pixel value to the external memory 30 as the pixel value.
 図6Cを参照して説明を続けると、実施例1における画素読出部53は、画素保持バッファ53a、セレクタ53b、AND53cを含む。 6C, the pixel reading unit 53 in the first embodiment includes a pixel holding buffer 53a, a selector 53b, and an AND 53c.
 画素保持バッファ53aは外部メモリ30からの画素値を受け取り一時的に保持する回路である。一時的に保持する画素値は、縦2×横2の4つの画素値の内の左上の画素値である。注目する縦2×横2の4つの画素値が全て同一色となる場合、左上の画素値のみが描画回路10に出力され、その他の画素値は出力されないためである。
 セレクタ53bは、フラグの論理が”1”のときに、画素保持バッファ53aに保持された画素値を選択し、フラグの論理が”0”のときに、外部メモリ30からの画素値を選択する。
 AND53cは、画素書込部52からの読出要求と、描画回路10からの読出要求とが、双方とも論理”1”のときに、読出要求を外部メモリ30へ出力する。
The pixel holding buffer 53a is a circuit that receives pixel values from the external memory 30 and temporarily holds them. The pixel value temporarily stored is the pixel value at the upper left of the four pixel values of 2 × 2 in the vertical direction. This is because when all the four vertical 2 × horizontal pixel values of interest have the same color, only the upper left pixel value is output to the drawing circuit 10 and the other pixel values are not output.
The selector 53b selects the pixel value held in the pixel holding buffer 53a when the logic of the flag is “1”, and selects the pixel value from the external memory 30 when the logic of the flag is “0”. .
The AND 53 c outputs a read request to the external memory 30 when both the read request from the pixel writing unit 52 and the read request from the drawing circuit 10 are logic “1”.
 図7は、画素アクセス部50の動作を説明する図である。ただし、図7で説明する画素アクセス部50の動作は一つの画素ブロックに関するものである。また、画素ブロックのフラグの論理値が、描画処理によって、”1”から”0”に変更になった場合の画素アクセス部50の動作を説明するものである。
 外部メモリ30から画素読出部53に出力された画素値からなる画素ブロックCは、画素値がすべて同色であり、左上の画素とフラグからなる画素値の組である。すなわち、画素ブロックCは左上に画素値とそれに対応するフラグを含み、その他は画素値がないものである。
 また、描画回路10から画素書込部52に出力された画素値からなる画素ブロックAは、カバレッジ=1010の縦2×横2の画素値の組である。すなわち、カバレッジにおいて、論理”1”のビットに対応して、画素ブロックAは、左上と左下に異なる色の塗りつぶし画素値を有するが、右上と右下には画素値が存在しない。
 そこで、描画処理後に、外部メモリ30に書き込まれる画素ブロックBは、画素ブロックAの左半分から引き継いだ、左上と左下に異なる色の塗りつぶし画素値と、画素ブロックCの右半分から引き継いだ、同色の塗りつぶし画素値からなっている。
 画素ブロックBが有する画素値は、セレクタ52dで選択されており、カバレッジにおいて論理”1”のビットに対応して左半分の画素値が、論理”0”のビットに対応して右半分の画素値が選択されているからである。
FIG. 7 is a diagram for explaining the operation of the pixel access unit 50. However, the operation of the pixel access unit 50 described in FIG. 7 relates to one pixel block. The operation of the pixel access unit 50 when the logical value of the flag of the pixel block is changed from “1” to “0” by the drawing process will be described.
The pixel block C composed of the pixel values output from the external memory 30 to the pixel reading unit 53 is a set of pixel values each having the same color and having the upper left pixel and a flag. That is, the pixel block C includes a pixel value and a corresponding flag on the upper left, and the others have no pixel value.
A pixel block A including pixel values output from the drawing circuit 10 to the pixel writing unit 52 is a set of 2 × vertical × 2 horizontal pixel values with coverage = 1010. That is, in the coverage, the pixel block A has different pixel fill pixel values in the upper left and lower left corresponding to the logic “1” bit, but there is no pixel value in the upper right and lower right.
Therefore, the pixel block B written in the external memory 30 after the drawing process is inherited from the left half of the pixel block A, the filled pixel values of different colors in the upper left and lower left, and the same color inherited from the right half of the pixel block C. It consists of the filled pixel values.
The pixel value of the pixel block B is selected by the selector 52d, and in the coverage, the pixel value on the left half corresponding to the logical “1” bit and the pixel on the right half corresponding to the logical “0” bit This is because the value is selected.
 図8は、画素アクセス部50の書込動作の全体を説明するフローチャートである。また、図8で説明する書込動作は、縦M×横Nの画素の画素値について、描画処理を行った後の画素データを、画素アクセス部50が受け取り、外部メモリ30へ書込む動作をいう。ただし、図8に示す書込動作は縦2×横2の画素ブロックに対するものであり、これらの動作を複数回行うことで、縦M×横Nの画素を処理することになる。従って、このフローチャートを開始する以前に、縦M×横Nの画素を、縦2×横2の画素ブロックに分割してそれらを認識するステップを行う。以下に、そのフローチャートについて、ステップ順に説明する。
 ステップOP10:描画回路10から図7に示す画素ブロックAに属する画素A1、A2、A3、A4と、画素ブロックAのカバレッジを取得する。
 ステップOP20:描画処理後の画素ブロックAに属する画素A1、A2、A3、A4全てが描画されるかについて、各画素のカバレッジの論理値によって判断する。例えば、各画素のカバレッジの論理値すべてが塗りつぶしを表示するときは、全て描画すると判断し、カバレッジの論理値の内一つでも塗りつぶし表示でない場合は、全て描画すると判断しない。すべて描画されると判断する場合、ステップOP40へ進む。すべて描画されないと判断する場合、ステップOP30に進む。
 ステップOP30:画素ブロックAの描画処理前のフラグを外部メモリ30から読み出す。その後、ステップOP50に進む。
 ステップOP50:ステップOP30において読み出した描画処理前のフラグの論理値を、論理値”0”に書き換え、再び外部メモリ30に書き込む。その後、ステップOP60に進む。
FIG. 8 is a flowchart for explaining the entire writing operation of the pixel access unit 50. In addition, the writing operation described in FIG. 8 is an operation in which the pixel access unit 50 receives the pixel data after performing the drawing process on the pixel value of the vertical M × horizontal N pixel and writes it to the external memory 30. Say. However, the writing operation shown in FIG. 8 is for a vertical 2 × horizontal 2 pixel block, and by performing these operations a plurality of times, vertical M × horizontal N pixels are processed. Therefore, before starting this flowchart, a step of dividing the vertical M × horizontal N pixels into vertical 2 × horizontal 2 pixel blocks and recognizing them is performed. The flowchart will be described below in the order of steps.
Step OP10: The coverage of the pixels A1, A2, A3, A4 belonging to the pixel block A shown in FIG.
Step OP20: Whether all the pixels A1, A2, A3, and A4 belonging to the pixel block A after the drawing process are drawn is determined based on the logical value of the coverage of each pixel. For example, when all the logical values of the coverage of each pixel display a fill, it is determined that all are drawn, and when even one of the logical values of the coverage is not a solid display, it is not determined that all are drawn. When it is determined that all drawing is performed, the process proceeds to step OP40. If it is determined that all are not drawn, the process proceeds to step OP30.
Step OP30: The flag before the drawing process of the pixel block A is read from the external memory 30. Thereafter, the process proceeds to Step OP50.
Step OP50: The logical value of the flag before the drawing process read in step OP30 is rewritten to the logical value “0” and written again to the external memory 30. Thereafter, the process proceeds to Step OP60.
 ステップOP60:ステップOP30において読み出した画素ブロックAのフラグを用いて、フローチャートにおける分岐を判断する。すなわち、描画処理前のフラブの論理値が”0”の場合は、画素ブロックCが含む画素の内、塗りつぶしされないものと、塗りつぶしされるものとがあるので、その状況に対応するステップOP100へ進む。一方、描画処理前のフラグの論理値が”1”の場合は、画素ブロックCが含む画素はすべて同色の塗りつぶし画素となるので、その状況に対応するステップOP70に進む。 Step OP60: A branch in the flowchart is determined using the flag of the pixel block A read in step OP30. That is, when the logical value of the flav before drawing processing is “0”, among the pixels included in the pixel block C, there are pixels that are not painted and others that are painted, so the process proceeds to step OP100 corresponding to the situation. . On the other hand, when the logical value of the flag before the rendering process is “1”, all the pixels included in the pixel block C are filled pixels of the same color, so the process proceeds to step OP70 corresponding to the situation.
 ステップOP100:ステップOP10で読み出した、描画処理後の画素ブロックAに属する各画素の内、カバレッジの論理値”1”となっている画素について、画素ブロックCに上書きして、画素ブロックBを作成し、画素ブロックBの状態の画素値を外部メモリ30に書き込む。その後、画素書込動作を終了する。 Step OP100: A pixel block B is created by overwriting the pixel block C with respect to the pixel having the logical value “1” of coverage among the pixels belonging to the pixel block A after the drawing process read out in step OP10. Then, the pixel value in the state of the pixel block B is written into the external memory 30. Thereafter, the pixel writing operation is terminated.
 ステップOP70:ステップOP60において、画素ブロックCが含む画素は、描画処理前にはすべて同色の塗りつぶし画素と判断されている。しかし、ステップOP20における判断では、描画処理後には、画素ブロックAの画素のすべてが塗りつぶされていないと判断されている。そこで、ステップOP70において、描画処理前の画素ブロックCの画素の内、外部メモリ30に記憶されている左上の画素C1の画素値の読出を行う。
 ステップOP80:ステップ70において外部メモリ30から読み込んだ、描画処理前の画素ブロックCの左上の画素C1から、画素C2、C3、C4を復元する。
 ステップOP90:描画処理前の画素ブロックCの画素C1、C2、C3、C4を、画素書込部52に送り、書込用のレジスタ上の画素ブロックBの画素B1、B2、B3、B4として記憶する。その後、描画処理後の画素ブロックAの画素の内、カバレッジの論理値が”1”の画素を(例えば、カバレッジが(1010)のときには、A1、A3を)、右上及び右下に上書きする。その後、ステップOP110へ進む。
 ステップOP110:描画処理前の画素ブロックCの画素C1、C2、C3、C4と、描画処理後の画素ブロックAの画素A1、A2、A3、A4とを、合成して構成した画素B1、B2、B3、B4を、外部メモリ30に、画素ブロックBの画素値として書き込む。
Step OP70: In step OP60, all the pixels included in the pixel block C are determined to be filled pixels of the same color before the drawing process. However, in the determination in step OP20, it is determined that all the pixels of the pixel block A are not filled after the drawing process. Therefore, in step OP70, the pixel value of the upper left pixel C1 stored in the external memory 30 among the pixels of the pixel block C before the drawing process is read.
Step OP80: The pixels C2, C3, and C4 are restored from the pixel C1 at the upper left of the pixel block C before drawing processing read from the external memory 30 in Step 70.
Step OP90: The pixels C1, C2, C3, and C4 of the pixel block C before the drawing process are sent to the pixel writing unit 52 and stored as the pixels B1, B2, B3, and B4 of the pixel block B on the register for writing. To do. After that, of the pixels of the pixel block A after the drawing process, pixels whose coverage logical value is “1” (for example, A1 and A3 when the coverage is (1010)) are overwritten on the upper right and lower right. Then, it progresses to step OP110.
Step OP110: Pixels B1, B2, B2, B2, and B3 formed by combining the pixels C1, C2, C3, and C4 of the pixel block C before the drawing process and the pixels A1, A2, A3, and A4 of the pixel block A after the drawing process B3 and B4 are written in the external memory 30 as pixel values of the pixel block B.
 ステップOP40:描画処理後の画素ブロックAに属する画素A1、A2、A3、A4は同色で塗りつぶしが行われる画素であるから、画素ブロックAのフラグの論理値は”1”となる。そこで、そのフラグの論理値及び画素ブロックAの左上の画素の画素値を画素ブロックBの左上の画素の画素値とする。その後、ステップOP120へ進む。
 ステップOP120:描画処理後の画素ブロックAに属する画素A1(左上)の画素値のみを、画素ブロックBの左上の画素値として外部メモリ30に書き込む。
Step OP40: Since the pixels A1, A2, A3, and A4 belonging to the pixel block A after the drawing process are pixels that are filled with the same color, the logical value of the flag of the pixel block A is “1”. Therefore, the logical value of the flag and the pixel value of the upper left pixel of the pixel block A are set as the pixel value of the upper left pixel of the pixel block B. Thereafter, the process proceeds to step OP120.
Step OP120: Only the pixel value of the pixel A1 (upper left) belonging to the pixel block A after the drawing process is written in the external memory 30 as the upper left pixel value of the pixel block B.
 上記より、描画処理後の縦M×横Nの画素を扱うときに、画素アクセス部50は縦2×横2の画素ブロックに分けて扱う。そして、描画処理後の縦M×横Nの画素を外部メモリ30に書き込む場合に、描画処理の前後において、フラグの論理値が”1”であったときには、画素ブロックすべての画素値とカバレッジを外部メモリ30に書き戻すのではなく、左上の画素値とフラグの論理値のみを書き戻す動作をする。そうすると、画素ブロックに属するすべての画素値とカバレッジを書き戻す場合に比較して、外部メモリ30へのアクセス回数を減少させることができる。さらに、フラグは1ビットの論理値のみからなるので、左上の画素値及びフラグの1ビットを記憶する記憶領域は、一つの画素ブロックに係わる各画素の画素値と、各画素のカバレッジを記憶する記憶領域よりも小さくなる。 From the above, when handling vertical M × horizontal N pixels after the rendering process, the pixel access unit 50 treats the pixel blocks by dividing them into vertical 2 × horizontal 2 pixel blocks. When writing the vertical M × horizontal N pixels after the drawing process to the external memory 30, if the logical value of the flag is “1” before and after the drawing process, the pixel values and coverages of all the pixel blocks are displayed. Instead of writing back to the external memory 30, only the upper left pixel value and the logical value of the flag are written back. Then, the number of accesses to the external memory 30 can be reduced as compared with the case where all pixel values and coverage belonging to the pixel block are written back. Furthermore, since the flag consists of only a 1-bit logical value, the storage area for storing the upper left pixel value and 1 bit of the flag stores the pixel value of each pixel related to one pixel block and the coverage of each pixel. It becomes smaller than the storage area.
 ここで、可変長圧縮データ方式を用いて、縦M×横Nの画素を扱う場合に、描画処理前の縦M×横Nの画素を、描画処理後の縦M×横Nの画素に変換するときの外部メモリ30へのアクセス数と、本実施例に示した方式を用いて、縦M×横Nの画素を扱う場合のアクセス数を比較する。 Here, when dealing with vertical M × horizontal N pixels using the variable-length compressed data method, the vertical M × horizontal N pixels before the drawing processing are converted into vertical M × horizontal N pixels after the drawing processing. The number of accesses to the external memory 30 is compared with the number of accesses in the case of handling vertical M × horizontal N pixels using the method shown in this embodiment.
 可変長圧縮データ方式においては、縦M×横Nの画素の画素値の種類と頻度を分析し、頻度が高い種類の画素値に”0”を、次に頻度が高い画素値に”1”を、次の頻度が高い画素値に”10”をというように、可変長のデータを割り当てる。画素値が固定長、例えば、4ビットであった場合には、可変長のデータに置き換えた分だけ、画素値を記憶する記憶領域を減少させることができることになる。 In the variable length compressed data method, the type and frequency of pixel values of vertical M × N horizontal pixels are analyzed, and “0” is set for the pixel value having the highest frequency, and “1” is set for the pixel value having the next highest frequency. Then, variable length data is assigned such that “10” is assigned to the pixel value having the next highest frequency. When the pixel value is a fixed length, for example, 4 bits, the storage area for storing the pixel value can be reduced by the amount replaced with the variable length data.
 そこで、可変長圧縮データ方式により圧縮されており、かつ、外部メモリ30に記憶している縦M×横Nの画素の画素値について、描画処理後の画素値に置き換えることを考える。そうすると、上記の置き換えを行うため、次の操作をすることになると考える。まず、第1ステップで、圧縮データを元の縦M×横Nの画素の画素値に展開する。次いで、第2ステップで描画処理を行う。次いで、第3ステップで描画処理後の縦M×横Nの画素の画素値に対して可変長圧縮処理を行って、外部メモリ30へ可変長圧縮処理後の画素値を出力する。
 そうすると、第1ステップで圧縮データを縦M×横Nの画素の画素値に展開するのに、
 M×N×(1+S1)+M×N×4(・・・式(1))回のアクセスを行うことになる。ここで、カバレッジは1ビット、S1はM×N個の画素の可変長画素値の平均ビット数、可変長画素値に対応する固定長画素値のビット数は4ビットとする。
 すなわち、カバレッジと可変長圧縮処理を行った画素値を読み出すのに第1項のアクセスをすることになる。さらに、割り当てられた可変長ビットで表された画素値に対応する固定長の画素値を読み出すのに第2項のアクセスをすることになる。
 ついで、第3ステップにおいて圧縮データで表した縦M×横Nの画素の画素値を書込をする場合に、
 M×N×(1+S2)(・・・式(2))回のアクセスを行うことになる。ここで、カバレッジは1ビット、S2はM×N個の画素の可変長画素値の平均ビット数である。なお、可変長圧縮処理は、画素書込部52が行うものとしている。
Therefore, it is considered that the pixel value of the vertical M × horizontal N pixel that is compressed by the variable length compression data method and stored in the external memory 30 is replaced with the pixel value after the drawing process. Then, in order to perform the above replacement, the following operation will be performed. First, in the first step, the compressed data is expanded to the original pixel values of M × N pixels. Next, a drawing process is performed in the second step. Next, variable length compression processing is performed on the pixel values of the vertical M × horizontal N pixels after the drawing processing in the third step, and the pixel values after the variable length compression processing are output to the external memory 30.
Then, in the first step, the compressed data is expanded into pixel values of vertical M × horizontal N pixels.
M × N × (1 + S1) + M × N × 4 (... Equation (1)) accesses are performed. Here, coverage is 1 bit, S1 is the average number of bits of variable-length pixel values of M × N pixels, and the number of bits of fixed-length pixel values corresponding to variable-length pixel values is 4 bits.
That is, the first term is accessed to read out the pixel values subjected to coverage and variable length compression processing. Furthermore, the second term is accessed to read out a fixed-length pixel value corresponding to the pixel value represented by the assigned variable-length bits.
Next, when writing pixel values of vertical M × horizontal N pixels represented by compressed data in the third step,
M × N × (1 + S2) (... Expression (2)) times of access is performed. Here, the coverage is 1 bit, and S2 is the average number of bits of variable length pixel values of M × N pixels. Note that the variable length compression process is performed by the pixel writing unit 52.
 一方、本実施例に示す方法により、縦M×横Nの画素の画素値を、描画処理後の縦M×横Nの画素の画素値に置き換える場合、第1ステップとして、縦M×横Nの画素の画素値を外部メモリから読み出す。第2ステップで、描画処理を行う。次いで、第3ステップで本実施例に示す方法で外部メモリ30へ縦M×横Nの画素の画素値を出力することになる。
 まず、第1ステップでは、M×N×T1(0以上1未満の数字)の画素ブロックのフラグの論理値が”1”であった場合、
 (M×N×(1-T1)×5)+(M×N×T1×5/4)(・・・式(3))回のアクセス数となる。ここで、カバレッジ、フラグは1ビット、画素値は固定長で4ビットとした。
 さらに、第3ステップにおいて、T2(0以上1未満の数字)の画素ブロックのフラグの論理値が”1”であった場合、
 (M×N×(1-T2)×5)+(M×N×T2×5/4)(・・・式(4))回のアクセス数となる。ここで、カバレッジ、フラグは1ビット、画素値は固定長で4ビットとした。
On the other hand, when the pixel value of the vertical M × horizontal N pixel is replaced with the pixel value of the vertical M × horizontal N pixel after the drawing processing by the method shown in the present embodiment, the first step is vertical M × horizontal N. The pixel value of each pixel is read from the external memory. In the second step, drawing processing is performed. Next, in the third step, pixel values of vertical M × horizontal N pixels are output to the external memory 30 by the method shown in the present embodiment.
First, in the first step, when the logical value of the flag of the pixel block of M × N × T1 (0 or more and less than 1) is “1”,
(M × N × (1−T1) × 5) + (M × N × T1 × 5/4) (... Expression (3)) times. Here, the coverage and flag are 1 bit, and the pixel value is 4 bits with a fixed length.
Further, in the third step, when the logical value of the flag of the pixel block of T2 (0 or more and less than 1) is “1”,
(M × N × (1−T2) × 5) + (M × N × T2 × 5/4) (... Expression (4)) times. Here, the coverage and flag are 1 bit, and the pixel value is 4 bits with a fixed length.
 本実施例における、画素アクセス部50と外部メモリ30とのアクセス数は式(3)と式(4)の合計となり、M×N×(10-(T1+T2)×3×5/4)である。
 一方、可変圧縮データを画素の画素値とする場合、式(3)と式(4)との合計となり、M×N×(6+S1+S2)である。
 ここで、S1、S2はM×N個の画素の可変長画素値の平均ビット数である。そうすると、可変長画素値の平均ビット数がほぼ1ビットであっても、T1+T2が、0.5以上2以下であるときは、本実施例における画素書込部52から外部メモリ30へのアクセス数が、可変長圧縮データ方式に比較して減少することがわかる。すなわち、ほとんどの場合において、本実施例における画素アクセス部50と外部メモリ30とのアクセス数が減少する。
In this embodiment, the number of accesses to the pixel access unit 50 and the external memory 30 is the sum of Expression (3) and Expression (4), and is M × N × (10− (T1 + T2) × 3 × 5/4). .
On the other hand, when the variable compressed data is used as the pixel value of the pixel, the sum of Expression (3) and Expression (4) is obtained, which is M × N × (6 + S1 + S2).
Here, S1 and S2 are average bit numbers of variable-length pixel values of M × N pixels. Then, even if the average number of bits of the variable-length pixel value is approximately 1 bit, if T1 + T2 is 0.5 or more and 2 or less, the number of accesses from the pixel writing unit 52 to the external memory 30 in the present embodiment However, it can be seen that it decreases compared to the variable length compressed data system. That is, in most cases, the number of accesses between the pixel access unit 50 and the external memory 30 in this embodiment decreases.
 図9は、画素アクセス部50の読出動作の全体を説明するフローチャートである。図9で説明する読出動作は、縦M×横Nの画素の画素値について、描画を行うために、外部メモリ30から読み出す動作をいう。ただし、図9に示す読出動作は縦2×横2の画素ブロックに対するものであり、これらの動作を複数回行うことで、縦M×横Nの画素を処理することになる。従って、このフローチャートを開始する以前に、縦M×横Nの画素を、縦2×横2の画素ブロックに分割してそれらを認識するステップを行う。以下に、そのフローチャートについて、ステップ順に説明する。
 ステップOP210:外部メモリ30より、画素ブロックに対するフラグを読み出す。
 ステップOP220:読み出したフラグの論理が”1”である場合、ステップOP230へ進む。一方、読み出したフラグの論理が”0”である場合、ステップ220へ進む。
 ステップOP230:画素ブロックに属する4画素分の画素値を外部メモリ30から読み出す。その後、画素値の読出を終了する。
 ステップOP240:画素ブロックの左上の画素の画素値のみを読み出す。次いで、ステップOP240へ進む。
 ステップOP250:読み出した左上の画素の画素値を4回連続して描画回路10に出力する。なお、このステップを行うかわりに、描画回路10内において、読み出した左上の画素の画素値から4画素分の画素値を作成してもよい。
FIG. 9 is a flowchart for explaining the entire reading operation of the pixel access unit 50. The read operation described with reference to FIG. 9 is an operation of reading from the external memory 30 in order to perform drawing for pixel values of vertical M × horizontal N pixels. However, the readout operation shown in FIG. 9 is for a vertical 2 × horizontal 2 pixel block, and by performing these operations a plurality of times, vertical M × horizontal N pixels are processed. Therefore, before starting this flowchart, a step of dividing the vertical M × horizontal N pixels into vertical 2 × horizontal 2 pixel blocks and recognizing them is performed. The flowchart will be described below in the order of steps.
Step OP210: The flag for the pixel block is read from the external memory 30.
Step OP220: If the logic of the read flag is “1”, the process proceeds to step OP230. On the other hand, if the logic of the read flag is “0”, the process proceeds to step 220.
Step OP230: Read pixel values for four pixels belonging to the pixel block from the external memory 30. Thereafter, the reading of the pixel value is finished.
Step OP240: Read out only the pixel value of the upper left pixel of the pixel block. Next, the process proceeds to step OP240.
Step OP250: The read pixel value of the upper left pixel is output to the drawing circuit 10 continuously four times. Instead of performing this step, pixel values for four pixels may be created in the drawing circuit 10 from the read pixel value of the upper left pixel.
 図10は、デプスアクセス部60の動作及びデプスアクセス部60について説明する図である。
 デプスアクセス部60は、フラグ生成部61、デプス書込部62、デプス読出部63を含む。
 なお、デプスアクセス部60は縦M×横Nの画素があったときに、縦2×横2の画素からなる画素ブロックについて、各画素のカバレッジからフラグを作成し、外部メモリ30に記憶させる機能を有する。
 また、縦M×横Nの画素について描画処理を行ったときに、フラグの論理値が”0”となった画素ブロックについて、外部メモリ30の画素値を変更する機能を有する。以下、デプスアクセス部60に上記の機能を持たせるために、それに含まれる各回路部が有する機能を説明する。
 フラグ生成部61は描画回路10から受け取ったカバレッジからフラグを生成する回路である。
 デプス書込部62は描画回路30からの書込要求を、デプス値及びX,Y増分値を受けて、外部メモリ30にデプス値及びX,Y増分値を書込要求とともに出力する。デプス書込部62はフラグ生成部61からフラグを受け取る。デプス書込部62は描画回路からの書込要求を受け取ると、デプス読出部63に対して読出要求を出し、フラグ及びデプス値を受け取る。
 デプス読出部63は、描画回路10からデプス値を、読出要求とともに受け取る。デプス読出部63は、外部メモリ30に読出要求を送り、フラグ、デプス値及びX、Y増分値を受け取る。デプス読出部63は、デプス書込部62から読出要求を受けたときに、フラグ及びデプス値を出力する。
FIG. 10 is a diagram for explaining the operation of the depth access unit 60 and the depth access unit 60.
The depth access unit 60 includes a flag generation unit 61, a depth writing unit 62, and a depth reading unit 63.
The depth access unit 60 creates a flag from the coverage of each pixel and stores it in the external memory 30 for a pixel block composed of 2 × 2 pixels when there are M × N pixels. Have
In addition, it has a function of changing the pixel value of the external memory 30 for the pixel block in which the logical value of the flag is “0” when the drawing process is performed on the vertical M × N horizontal pixels. Hereinafter, functions of each circuit unit included in the depth access unit 60 in order to provide the above-described functions will be described.
The flag generation unit 61 is a circuit that generates a flag from the coverage received from the drawing circuit 10.
The depth writing unit 62 receives the writing request from the drawing circuit 30 and outputs the depth value and the X, Y increment value to the external memory 30 together with the writing request. The depth writing unit 62 receives a flag from the flag generation unit 61. When receiving a write request from the drawing circuit, the depth writing unit 62 issues a read request to the depth reading unit 63 and receives a flag and a depth value.
The depth reading unit 63 receives the depth value from the drawing circuit 10 together with the read request. The depth reading unit 63 sends a read request to the external memory 30 and receives a flag, a depth value, and X and Y increment values. The depth reading unit 63 outputs a flag and a depth value when receiving a read request from the depth writing unit 62.
 図11A、図11B、図11Cは、フラグ生成部61、デプス書込部62、デプス読出部63の具体的な回路例を示す。
 図11Aを参照して説明を行うと、実施例におけるフラグ生成部61は、4入力ANDであり、4ビットのカバレッジを入力すると、1ビットのフラグを発生する。画素が塗られているか否かを示すカバレッジを使用して、各画素にデプスが付属しているか否かを判断する。画素が塗られていれば、デプスが存在するからである。そこで、カバレッジの論理は、深さ方向のデータがない場合に0、深さ方向のデータがある場合に1となる。ここで、4倍の画素数を用いてMSAAを実行する場合、縦2列×横2行からなる4ビットのカバレッジを扱うことになる。その場合、フラグ生成部61は図11Aのように4入力ANDとなる。
11A, 11B, and 11C show specific circuit examples of the flag generation unit 61, the depth writing unit 62, and the depth reading unit 63. FIG.
Referring to FIG. 11A, the flag generation unit 61 in the embodiment is a 4-input AND, and when a 4-bit coverage is input, a 1-bit flag is generated. Using the coverage indicating whether or not the pixel is painted, it is determined whether or not the depth is attached to each pixel. This is because the depth exists if the pixel is painted. Therefore, the coverage logic is 0 when there is no data in the depth direction, and is 1 when there is data in the depth direction. Here, when MSAA is executed using four times the number of pixels, a 4-bit coverage consisting of 2 columns × 2 rows is handled. In that case, the flag generation unit 61 becomes a 4-input AND as shown in FIG. 11A.
 そうすると、4つの画素のすべてに深さ方向のデータが付属していない場合、言い換えると、描画しようとしている4つの画素に深さがない場合、フラグは0となる。一方、全てに深さ方向のデータがある場合、フラグは1となる。 If so, the flag is set to 0 when no data in the depth direction is attached to all four pixels, in other words, when the four pixels to be drawn have no depth. On the other hand, if there is data in the depth direction in all, the flag is 1.
 図11Bを参照して説明を続けると、実施例におけるデプス書込部62は、比較回路62a、2ビットカウンタ62b、AND62c、セレクタ62dを含む。
 フラグ生成部61から論理”0”を表すフラグを受け取った場合、デプス書込部62は、デプス読出部63への読出要求、及び、外部メモリ30への書込要求の論理は”0”のままなので、デプス書込部62へのデプス読出部63からの読出、及び、デプス書込部62からの外部メモリ30への書込は行われない。
Continuing with reference to FIG. 11B, the depth writing unit 62 in the embodiment includes a comparison circuit 62a, a 2-bit counter 62b, an AND 62c, and a selector 62d.
When the flag representing the logic “0” is received from the flag generation unit 61, the depth writing unit 62 indicates that the logic of the read request to the depth reading unit 63 and the write request to the external memory 30 is “0”. Therefore, reading from the depth reading unit 63 to the depth writing unit 62 and writing to the external memory 30 from the depth writing unit 62 are not performed.
 フラグ生成部61から論理”1”を表すフラグを受け取った場合、デプス読出部63への読出要求の論理が”1”となるため、デプス書込部62からデプス読出部63への読出要求が行われる。また、論理”1”のフラグは、2ビットカウンタ62bに入力され、2ビットカウンタ62bのカウントアップが行われる。比較回路62aは2ビットカウンタ62bからのカウント値を、比較回路62a自身に設定された固定のカウント値(実施例において、カウント値は2進数で表すと”00”であり、10進数で表すと4である。)と比較する。比較回路62aは固定のカウント値に達すると、2ビットカウンタ62bのカウントアップを終了させ、カウント値をリセット、すなわち、カウント値を”00”に固定する。 When the flag representing the logic “1” is received from the flag generation unit 61, the logic of the read request to the depth reading unit 63 is “1”, so that the reading request from the depth writing unit 62 to the depth reading unit 63 is made. Done. The flag of logic “1” is input to the 2-bit counter 62b, and the 2-bit counter 62b is counted up. The comparison circuit 62a displays the count value from the 2-bit counter 62b as a fixed count value set in the comparison circuit 62a itself (in the embodiment, the count value is expressed as "00" in binary number and expressed in decimal number) 4). When the comparison circuit 62a reaches the fixed count value, it finishes counting up the 2-bit counter 62b, resets the count value, that is, fixes the count value to “00”.
 比較回路62aは、2ビットカウンタ62bが2進数”00”から固定のカウント値までの2進数を出力している間、イネーブル信号をAND62cに出し続ける。
 その結果、AND62cは比較回路62aからのイネーブル信号と描画回路10からの書込要求を入力信号に受けているので、イネーブル信号の論理が”0”のときに、書込信号を外部メモリ30へ出力する。
The comparison circuit 62a continues to output an enable signal to the AND 62c while the 2-bit counter 62b outputs a binary number from the binary number "00" to a fixed count value.
As a result, since the AND 62c receives the enable signal from the comparison circuit 62a and the write request from the drawing circuit 10 as input signals, the write signal is sent to the external memory 30 when the logic of the enable signal is “0”. Output.
 セレクタ62dはカバレッジの論理が”1”のときに、描画回路からのデプス値を選択し、カバレッジの論理が”0”のときに、デプス読出部からのデプス値を選択する。そして、センレクタ62dは選択した方のデプス値を、デプス値又はX,Y増分値として外部メモリ30へ出力する。 The selector 62d selects the depth value from the drawing circuit when the coverage logic is “1”, and selects the depth value from the depth reading unit when the coverage logic is “0”. Then, the director 62d outputs the selected depth value to the external memory 30 as the depth value or the X, Y increment value.
 図11Cを参照して説明を続けると、実施例におけるデプス読出部63は、デプス保持バッファ63a、セレクタ63b、AND63c、デプス補間63dを含む。 11C, the depth reading unit 63 in the embodiment includes a depth holding buffer 63a, a selector 63b, an AND 63c, and a depth interpolation 63d.
 デプス保持バッファ63aはデプス補間63dからデプス値を受け取り一時的に保持する回路である。
 セレクタ63bは、フラグの論理が”1”のときに、デプス保持バッファ63aに保持されたデプス値を選択し、フラグの論理が”0”のときに、デプス補間63dから出力されるデプス値にX,Y増分値がたされた補間値を選択する。
 AND63cは、デプス書込部62からの読出要求と、描画回路10からの読出要求とが、双方とも論理”1”のときに、読出要求を外部メモリ30へ出力する。
The depth holding buffer 63a is a circuit that receives the depth value from the depth interpolation 63d and temporarily holds it.
The selector 63b selects the depth value held in the depth holding buffer 63a when the logic of the flag is "1", and selects the depth value output from the depth interpolation 63d when the logic of the flag is "0". An interpolated value with X, Y increment values is selected.
The AND 63 c outputs a read request to the external memory 30 when both the read request from the depth writing unit 62 and the read request from the drawing circuit 10 are logic “1”.
 図12は、デプスアクセス部60の動作を説明する図である。ただし、図12で説明するデプスアクセス部60の動作は一つの画素ブロックに関するものである。また、画素ブロックのフラグの論理値が、描画処理によって、”1”から”0”に変更になった場合の画素アクセス部60の動作を説明するものである。
 ここで、画素ブロックFは、すべての画素に対してデプス値があり、各画素のデプス値は、左上のデプス値を基準値とした、X,Y増分値で表されている。また、画素ブロックFは左上の画素値に対応するデプスに関連するフラグを有する。
 また、画素ブロックDは、カバレッジ=1010の縦2×横2の画素値の組である。すなわち、カバレッジにおいて、論理”1”のビットに対応して、画素ブロックDは、左上と左下に異なるデプス値を有する画素が存在するが、右上と右下の画素にはデプス値が存在しない。
 そこで、描画処理後に、外部メモリ30に書き込まれる画素ブロックEは、画素ブロックDの左半分から引き継いだ、左上と左下のデプス値と、画素ブロックFの右半分から引き継いだ、デプス値からなっている。ここで、画素ブロックFからのデプス値は、基準とする左上の画素に対するデプス値にX,Y増分値を加算したものである。
 画素ブロックEが有する画素値は、セレクタ62dで選択されており、カバレッジにおいて論理”1”のビットに対応して左半分の画素値が、論理”0”のビットに対応して右半分の画素値が選択されているからである。
FIG. 12 is a diagram for explaining the operation of the depth access unit 60. However, the operation of the depth access unit 60 described in FIG. 12 relates to one pixel block. Also, the operation of the pixel access unit 60 when the logical value of the flag of the pixel block is changed from “1” to “0” by the drawing process will be described.
Here, the pixel block F has depth values for all the pixels, and the depth value of each pixel is represented by an X, Y increment value with the depth value at the upper left as a reference value. Further, the pixel block F has a flag related to the depth corresponding to the pixel value at the upper left.
The pixel block D is a set of 2 × vertical × 2 pixel values with coverage = 1010. That is, in the coverage, in the pixel block D, pixels having different depth values exist in the upper left and lower left, but there are no depth values in the upper right and lower right pixels, corresponding to the logic “1” bit.
Therefore, the pixel block E written to the external memory 30 after the drawing process is composed of the upper left and lower left depth values inherited from the left half of the pixel block D and the depth value inherited from the right half of the pixel block F. Yes. Here, the depth value from the pixel block F is obtained by adding the X and Y increments to the depth value for the upper left pixel as a reference.
The pixel value of the pixel block E is selected by the selector 62d. In the coverage, the left half pixel value corresponding to the logical “1” bit corresponds to the logical “0” bit, and the right half pixel corresponding to the logical “0” bit. This is because the value is selected.
 図13は、デプスアクセス部60の書込動作の全体を説明するフローチャートである。以下に、そのフローチャートについて、ステップ順に説明する。ただし、図13に示す書込動作は縦2×横2の画素ブロックに対するものであり、これらの動作を複数回行うことで、縦M×横Nの画素を処理することになる。また、図13で説明する書込動作は、縦M×横Nの画素のデプス値について、描画処理を行った後のデプス値を、デプスアクセス部50が受け取り、外部メモリ30へ書込む動作をいう。
 ステップOP310:描画回路10から図12に示す画素ブロックDに属する画素D1、D2、D3、D4と、画素ブロックDのカバレッジを取得する。
 ステップOP320:描画処理後の画素ブロックDに属する画素D1、D2、D3、D4全てについてデプス値が存在すかについて、各画素のカバレッジの論理値によって判断する。すべての画素が描画されるとともに、デプス値が存在すると判断する場合、ステップOP340へ進む。描画されない画素があり、デプス値がない画素があると判断する場合、ステップOP330に進む。
 ステップOP330:画素ブロックDの描画処理前のフラグを外部メモリ30から読み出す。その後、ステップOP350に進む。
 ステップOP350:ステップOP330において読み出した描画処理前のフラグの論理値を、論理値”0”に書き換え、再び外部メモリ30に書き込む。その後、ステップOP360に進む。
FIG. 13 is a flowchart for explaining the entire writing operation of the depth access unit 60. The flowchart will be described below in the order of steps. However, the writing operation shown in FIG. 13 is for a vertical 2 × horizontal 2 pixel block, and by performing these operations a plurality of times, vertical M × horizontal N pixels are processed. Further, the writing operation described in FIG. 13 is an operation in which the depth access unit 50 receives the depth value after the drawing process is performed on the depth value of the vertical M × N horizontal pixel, and writes it to the external memory 30. Say.
Step OP310: The coverage of the pixels D1, D2, D3, D4 belonging to the pixel block D shown in FIG.
Step OP320: It is determined by the logical value of the coverage of each pixel whether there is a depth value for all of the pixels D1, D2, D3, D4 belonging to the pixel block D after the rendering process. When all the pixels are drawn and it is determined that a depth value exists, the process proceeds to step OP340. When it is determined that there is a pixel that is not drawn and there is a pixel that has no depth value, the process proceeds to step OP330.
Step OP330: The flag before the drawing process of the pixel block D is read from the external memory 30. Thereafter, the process proceeds to Step OP350.
Step OP350: The logical value of the flag before the drawing process read out in step OP330 is rewritten to the logical value “0” and written again in the external memory 30. Thereafter, the process proceeds to Step OP360.
 ステップOP360:ステップOP330において読み出した画素ブロックDのフラグを用いて、フローチャートにおける分岐を判断する。すなわち、描画処理前のフラブの論理値が”0”の場合は、画素ブロックDが含む画素の内、デプス値がない画素と、デプス値がある画素があるので、その状況に対応するステップOP400へ進む。一方、描画処理前のフラグの論理値が”1”の場合は、画素ブロックDが含む画素はすべてデプス値を有する画素となるので、その状況に対応するステップOP370に進む。 Step OP360: The branch in the flowchart is determined using the flag of the pixel block D read in step OP330. That is, when the logical value of the flav before drawing processing is “0”, among the pixels included in the pixel block D, there are pixels that have no depth value and pixels that have a depth value. Proceed to On the other hand, when the logical value of the flag before the drawing process is “1”, all the pixels included in the pixel block D are pixels having depth values, and thus the process proceeds to step OP370 corresponding to the situation.
 ステップOP400:ステップOP310で読み出した、描画処理後の画素ブロックDに属する各画素の内、カバレッジの論理値”1”となっている画素について、画素ブロックFに上書きして、画素ブロックEを作成し、画素ブロックEの状態のデプス値を外部メモリ30に書き込む。その後、デプス書込動作を終了する。 Step OP400: A pixel block E is created by overwriting the pixel block F with respect to the pixel having the logical value “1” of coverage among the pixels belonging to the pixel block D after the drawing process read out in the step OP310. Then, the depth value of the state of the pixel block E is written into the external memory 30. Thereafter, the depth writing operation is terminated.
 ステップOP370:ステップOP360において、画素ブロックDが含む画素は、描画処理前にはすべて同色の塗りつぶし画素と判断されている。
 しかし、ステップOP320における判断では、描画処理後には、画素ブロックDの画素のすべてが塗りつぶされておらず、デプス値が存在しない画素があると判断されている。
 そこで、ステップOP370において、描画処理前の画素ブロックFの画素の内、外部メモリ30に記憶されている左上の画素F1のデプス値及びX,Y増分値の読出を行う。
 ステップOP380:ステップ370において外部メモリ30から読み込んだ、描画処理前の画素ブロックFの左上の画素F1のデプス値及びX,Y増分値から、画素F2のデプス値、F3のデプス値、F4のデプス値を復元する。
 ステップOP390:描画処理前の画素ブロックFの画素F1のデプス値、F2のデプス値、F3のデプス値、F4のデプス値を、デプス書込部62に送り、書込用のレジスタ上の画素ブロックEの画素E1のデプス値、E2のデプス値、E3のデプス値、E4のデプス値として記憶する。その後、描画処理後の画素ブロックDの画素の内、カバレッジの論理値が”1”の画素を(例えば、カバレッジが(1010)のときには、D1のデプス値、D3のデプス値を)、右上及び右下に上書きする。その後、ステップOP410へ進む。
 ステップOP410:描画処理前の画素ブロックFの画素F1のデプス値、F2のデプス値、F3のデプス値、F4のデプス値と、描画処理後の画素ブロックDの画素D1のデプス値、D2のデプス値、D3のデプス値、D4のデプス値とを、合成して構成した画素E1のデプス値、E2のデプス値、E3のデプス値、E4のデプス値を、外部メモリ30に、画素ブロックEの画素として書き込む。
Step OP370: In step OP360, the pixels included in the pixel block D are all determined to be filled pixels of the same color before the drawing process.
However, in the determination in step OP320, after the rendering process, it is determined that not all of the pixels in the pixel block D are filled and there are pixels for which there is no depth value.
Therefore, in step OP370, the depth value and the X and Y increment values of the upper left pixel F1 stored in the external memory 30 among the pixels of the pixel block F before the drawing process are read.
Step OP380: The depth value of the pixel F2, the depth value of F3, the depth value of F4 are read from the depth value of the upper left pixel F1 and the X and Y increment values of the pixel block F before drawing processing read from the external memory 30 in Step 370. Restore the value.
Step OP390: Sends the depth value of the pixel F1, the depth value of F2, the depth value of F3, and the depth value of F4 of the pixel block F before drawing processing to the depth writing unit 62, and the pixel block on the register for writing This is stored as the depth value of the pixel E1 of E, the depth value of E2, the depth value of E3, and the depth value of E4. After that, among the pixels of the pixel block D after the drawing process, the pixels whose coverage logical value is “1” (for example, when the coverage is (1010), the depth value of D1 and the depth value of D3), Overwrite in the lower right. Thereafter, the process proceeds to step OP410.
Step OP410: The depth value of the pixel F1, the depth value of F2, the depth value of F3, the depth value of F4 of the pixel block F before the drawing process, the depth value of the pixel D1 of the pixel block D after the drawing process, and the depth of D2 Value, the depth value of D3, and the depth value of D4, the depth value of the pixel E1, the depth value of E2, the depth value of E3, the depth value of E3, and the depth value of E4 are stored in the external memory 30 in the pixel block E. Write as a pixel.
 ステップOP340:描画処理後の画素ブロックDに属する画素D1、D2、D3、D4はデプス値が存在する画素であるから、画素ブロックDのフラグの論理値は”1”となる。そこで、そのフラグの論理値を外部メモリ30に書き込む。その後、ステップOP420へ進む。
 ステップOP420:描画処理後の画素ブロックDに属する画素D1(左上)のデプス値及び画素D2、D3、D4のX,Y増分値を外部メモリ30に書き込む。
Step OP340: Since the pixels D1, D2, D3, and D4 belonging to the pixel block D after the drawing process are pixels having a depth value, the logical value of the flag of the pixel block D is “1”. Therefore, the logical value of the flag is written in the external memory 30. Thereafter, the process proceeds to step OP420.
Step OP420: Write the depth value of the pixel D1 (upper left) belonging to the pixel block D after the rendering process and the X and Y increment values of the pixels D2, D3, and D4 to the external memory 30.
 上記より、描画処理後の縦M×横Nの画素を扱うときに、デプスアクセス部60は縦2×横2の画素ブロックに分けて扱う。そして、描画処理後の縦M×横Nの画素を外部メモリ30に書き込む場合に、描画処理の前後において、フラグの論理値が”1”であったときには、画素ブロックすべてのデプス値を外部メモリ30に書き戻すのではなく、左上のデプス値、X,Y増分値とフラグの論理値のみを書き戻す動作をする。そうすると、画素ブロックに属するすべてのデプス値とカバレッジを書き戻す場合に比較して、外部メモリ30へのアクセス回数を減少させることができる。さらに、フラグは1ビットの論理値のみからなるので、左上のフラグ値、X,Y増分値及びフラグの1ビットを記憶する記憶領域は、一つの画素ブロックに係わる各画素のデプス値と、各画素のカバレッジを記憶する記憶領域よりも小さくなる。 From the above, when handling vertical M × horizontal N pixels after the drawing process, the depth access unit 60 treats the pixel blocks by dividing them into vertical 2 × horizontal 2 pixel blocks. When writing the vertical M × horizontal N pixels after the drawing process to the external memory 30, if the logical value of the flag is “1” before and after the drawing process, the depth values of all the pixel blocks are stored in the external memory. Instead of writing back to 30, only the depth value at the upper left, the X and Y increment values, and the logical value of the flag are written back. As a result, the number of accesses to the external memory 30 can be reduced as compared with the case where all depth values and coverages belonging to the pixel block are written back. Further, since the flag consists of only a 1-bit logical value, the storage area for storing the upper left flag value, the X and Y increment values, and the 1 bit of the flag includes the depth value of each pixel related to one pixel block, This is smaller than the storage area for storing pixel coverage.
 ここで、可変長圧縮データ方式を用いて、縦M×横Nの画素を扱う場合に、描画処理前の縦M×横Nの画素を、描画処理後の縦M×横Nの画素に変換するときの外部メモリ30へのアクセス数と、本実施例に示した方式を用いて、縦M×横Nの画素を扱う場合のアクセス数を比較する。 Here, when dealing with vertical M × horizontal N pixels using the variable-length compressed data method, the vertical M × horizontal N pixels before the drawing processing are converted into vertical M × horizontal N pixels after the drawing processing. The number of accesses to the external memory 30 is compared with the number of accesses in the case of handling vertical M × horizontal N pixels using the method shown in this embodiment.
 可変長圧縮データ方式においては、縦M×横Nの画素のデプス値の種類と頻度を分析し、頻度が高い種類の画素値に”0”を、次に頻度が高い画素値に”1”を、次の頻度が高い画素値に”10”をというように、可変長のデータを割り当てる。画素値が固定長、例えば、4ビットであった場合には、可変長のデータに置き換えた分だけ、画素値を記憶する記憶領域を減少させることができることになる。 In the variable length compressed data method, the type and frequency of depth values of vertical M × N horizontal pixels are analyzed, and “0” is assigned to the pixel value having the highest frequency, and “1” is assigned to the pixel value having the next highest frequency. Then, variable length data is assigned such that “10” is assigned to the pixel value having the next highest frequency. When the pixel value is a fixed length, for example, 4 bits, the storage area for storing the pixel value can be reduced by the amount replaced with the variable length data.
 そこで、可変長圧縮データ方式により圧縮されており、かつ、外部メモリ30に記憶している縦M×横Nの画素のデプス値について、描画処理後のデプス値に置き換えることを考える。そうすると、上記の置き換えを行うため、次の操作をすることになると考える。まず、第1ステップで、圧縮データを元の縦M×横Nの画素のデプス値に展開する。次いで、第2ステップで描画処理を行う。次いで、第3ステップで描画処理後の縦M×横Nの画素のデプス値に対して可変長圧縮処理を行って、外部メモリ30へ可変長圧縮処理後のデプス値を出力する。
 そうすると、第1ステップで圧縮データを縦M×横Nの画素の画素値に展開するのに、
 M×N×1+M×N×S1+M×N×4(・・・式(1))回のアクセスを行うことになる。ここで、カバレッジは1ビット、S1はM×N個の画素の可変長画素値の平均ビット数、可変長画素値に対応する固定長画素値のビット数は4ビットとする。
 すなわち、カバレッジを読み出すのに式(1)の第1項のアクセスをすることになる。また、可変長圧縮処理を行ったデプス値を読み出すのに第2項のアクセスをすることになる。さらに、割り当てられた可変長ビットで表されたデプス値に対応する固定長のデプス値を読み出すのに第3項のアクセスをすることになる。
 ついで、第3ステップにおいて圧縮データで表した縦M×横Nの画素のデプス値を書込をする場合に、
 M×N×1+M×N×S2(・・・式(2))回のアクセスを行うことになる。ここで、カバレッジは1ビット、S2はM×N個の画素の可変長デプス値の平均ビット数である。
Therefore, it is considered to replace the depth value of the vertical M × horizontal N pixel that is compressed by the variable length compression data method and stored in the external memory 30 with the depth value after the drawing process. Then, in order to perform the above replacement, the following operation will be performed. First, in the first step, the compressed data is expanded to the original depth M × N depth value. Next, a drawing process is performed in the second step. Next, variable length compression processing is performed on the depth value of the vertical M × width N pixels after the drawing processing in the third step, and the depth value after the variable length compression processing is output to the external memory 30.
Then, in the first step, the compressed data is expanded into pixel values of vertical M × horizontal N pixels.
M × N × 1 + M × N × S1 + M × N × 4 (... Expression (1)) accesses are performed. Here, coverage is 1 bit, S1 is the average number of bits of variable-length pixel values of M × N pixels, and the number of bits of fixed-length pixel values corresponding to variable-length pixel values is 4 bits.
That is, the first term of the equation (1) is accessed to read the coverage. Further, the second term is accessed to read the depth value that has been subjected to the variable length compression processing. Furthermore, the third term is accessed to read out a fixed length depth value corresponding to the depth value represented by the assigned variable length bits.
Then, when writing the depth value of the vertical M × horizontal N pixel represented by the compressed data in the third step,
M × N × 1 + M × N × S2 (... Equation (2)) accesses are performed. Here, the coverage is 1 bit, and S2 is the average number of bits of the variable length depth value of M × N pixels.
 一方、本実施例に示す方法により、縦M×横Nの画素のデプス値を、描画処理後の縦M×横Nの画素のデプス値に置き換える場合、第1ステップとして、縦M×横Nの画素のデプス値を外部メモリから読み出す。第2ステップで、描画処理を行う。次いで、第3ステップで本実施例に示す方法で外部メモリ30へ縦M×横Nの画素のデプス値を出力することになる。
 まず、第1ステップでは、M×N×T1(0以上1未満の数字)の画素ブロックのフラグの論理値が”1”であった場合、
 (M×N×(1-T1)×5)+(M×N×T1×11/4)(・・・式(3))回のアクセス数となる。ここで、カバレッジは1ビット、デプス値は固定長で4ビット、X、Y増分値は2ビットとした。
 さらに、第3ステップにおいて、T2(0以上1未満の数字)の画素ブロックのフラグの論理値が”1”であった場合、
 (M×N×(1-T2)×5)+(M×N×T2×11/4)(・・・式(4))回のアクセス数となる。ここで、カバレッジは1ビット、画素値は固定長で4ビットとした。
On the other hand, when the depth value of the vertical M × horizontal N pixel is replaced with the depth value of the vertical M × horizontal N pixel after the drawing processing by the method shown in the present embodiment, the first step is vertical M × horizontal N. The depth value of the pixel is read from the external memory. In the second step, drawing processing is performed. Next, in the third step, the depth value of the vertical M × N horizontal pixels is output to the external memory 30 by the method shown in the present embodiment.
First, in the first step, when the logical value of the flag of the pixel block of M × N × T1 (0 or more and less than 1) is “1”,
(M × N × (1−T1) × 5) + (M × N × T1 × 11/4) (... Expression (3)) times of access. Here, the coverage is 1 bit, the depth value is 4 bits with a fixed length, and the X and Y increment values are 2 bits.
Further, in the third step, when the logical value of the flag of the pixel block of T2 (0 or more and less than 1) is “1”,
(M × N × (1−T2) × 5) + (M × N × T2 × 11/4) (... Expression (4)) times. Here, the coverage is 1 bit and the pixel value is a fixed length of 4 bits.
 本実施例における、画素アクセス部50と外部メモリ30とのアクセス数は式(3)と式(4)の合計となり、M×N×(10-(T1+T2)×9/4)である。
 一方、可変圧縮データを画素の画素値とする場合、式(1)と式(2)との合計となり、M×N×(6+S1+S2)である。
 ここで、S1、S2はM×N個の画素の可変長画素値の平均ビット数である。そうすると、可変長画素値の平均ビット数がほぼ1となっても、T1+T2が1以上であって2以下であるときは、本実施例におけるデプス書込部62から外部メモリ30へのアクセス数が、可変長圧縮データ方式に比較して減少することがわかる。すなわち、ほとんどの場合において、本実施例におけるデプスアクセス部60と外部メモリ30とのアクセス数が減少する。
In this embodiment, the number of accesses between the pixel access unit 50 and the external memory 30 is the sum of Expression (3) and Expression (4), and is M × N × (10− (T1 + T2) × 9/4).
On the other hand, when variable compressed data is used as the pixel value of a pixel, the sum of Expression (1) and Expression (2) is obtained, which is M × N × (6 + S1 + S2).
Here, S1 and S2 are average bit numbers of variable-length pixel values of M × N pixels. Then, even if the average number of bits of the variable-length pixel value is approximately 1, when T1 + T2 is 1 or more and 2 or less, the number of accesses from the depth writing unit 62 in this embodiment to the external memory 30 is It can be seen that this is reduced compared to the variable length compressed data system. That is, in most cases, the number of accesses between the depth access unit 60 and the external memory 30 in this embodiment decreases.
 図14は、デプスアクセス部60の読出動作の全体を説明するフローチャートである。以下に、そのフローチャートについて、ステップ順に説明する。ただし、図14に示す読出動作は縦2×横2の画素ブロックに対するものであり、これらの動作を複数回行うことで、縦M×横Nの画素を処理することになる。また、図14で説明する読出動作は、縦M×横Nの画素の画素値について、描画を行うために、外部メモリ30から読み出す動作をいう。
 ステップOP510:外部メモリ30より、画素ブロックに対するフラグを読み出す。
 ステップOP520:読み出したフラグの論理が”1”である場合、ステップOP530へ進む。一方、読み出したフラグの論理が”0”である場合、ステップ540へ進む。
 ステップOP540:画素ブロックに属する4画素分のデプス値を外部メモリ30から読み出す。その後、デプス値の読出を終了する。
 ステップOP530:画素ブロックの左上の画素のデプス値及び4画素分のX,Y増分値のみを読み出す。次いで、ステップOP550へ進む。
 ステップOP550:読み出した左上の画素のデプス値と4画素分のX,Y増分値から4画素分のデプス値を生成する。なお、このステップを行うかわりに、描画回路10内において、左上の画素のデプス値と4画素分のX,Y増分値から、4画素分のデプス値を作成してもよい。
FIG. 14 is a flowchart for explaining the entire reading operation of the depth access unit 60. The flowchart will be described below in the order of steps. However, the readout operation shown in FIG. 14 is for a vertical 2 × horizontal 2 pixel block, and by performing these operations a plurality of times, vertical M × horizontal N pixels are processed. Further, the read operation described with reference to FIG. 14 refers to an operation of reading from the external memory 30 in order to perform drawing for pixel values of vertical M × horizontal N pixels.
Step OP510: The flag for the pixel block is read from the external memory 30.
Step OP520: If the logic of the read flag is “1”, the process proceeds to Step OP530. On the other hand, if the logic of the read flag is “0”, the process proceeds to step 540.
Step OP540: Depth values for four pixels belonging to the pixel block are read from the external memory 30. Thereafter, reading of the depth value is terminated.
Step OP530: Only the depth value of the upper left pixel of the pixel block and the X and Y increment values for four pixels are read out. Next, the process proceeds to step OP550.
Step OP550: A depth value for 4 pixels is generated from the read depth value of the upper left pixel and the X and Y increment values for 4 pixels. Instead of performing this step, a depth value for four pixels may be created in the drawing circuit 10 from the depth value of the upper left pixel and the X and Y increment values for four pixels.
 アンチエイリアス処理に用いる画像データ量を減少させる画像データの形成方法、及び、形成された画像データについて、外部メモリへの書込回数を減少させる書込方法を提供することができる。 It is possible to provide a method for forming image data for reducing the amount of image data used for anti-aliasing processing, and a writing method for reducing the number of times the formed image data is written to an external memory.
10 描画回路
20 画像データ処理回路
30 外部メモリ
50 画素アクセス部
51 フラグ生成部
52 画素書込部
53 画素読出部
60 デプスアクセス部
61 フラグ生成部
62 デプス書込部
63 デプス読出部
 
 
DESCRIPTION OF SYMBOLS 10 Drawing circuit 20 Image data processing circuit 30 External memory 50 Pixel access part 51 Flag generation part 52 Pixel writing part 53 Pixel reading part 60 Depth access part 61 Flag generation part 62 Depth writing part 63 Depth reading part

Claims (6)

  1.  3次元グラフィックス画像に含まれるマトリック状に並べられた画素を、K行KL列の前記画素からなる画素ブロックに分割する工程と、
     各画素ブロック毎に、前記画素の色の塗りつぶし状態を示すカバレッジを用いて、含まれる画素すべてについて、同色の塗りつぶしが行われる場合は第1論理を備えるフラグを発生し、含まれる画素の一部が異なる色の塗りつぶし又は塗りつぶしなしの場合は第2論理を備えるフラグを発生する工程と、
     前記第1論理を備えるフラグを有する画素ブロックにおいて、含まれる画素の画素値の内からひとつの画素値を選択し、第1画素値とする工程と、
     前記第2論理を備えるフラグを有する画素ブロックにおいて、含まれる画素の画素値のすべてを、第2画素値とする工程と、
     前記第1画素値、前記第2画素値、及び、前記第1及び第2論理を備えるフラグに基づいて、前記3次元グラフィックス画像の画像データを形成する工程と、を備えることを特徴とする画像データ形成方法。
    Dividing the pixels arranged in a matrix in the three-dimensional graphics image into pixel blocks composed of the pixels in K rows and KL columns;
    For each pixel block, using the coverage indicating the color fill state of the pixel, for all the included pixels, if the same color is filled, a flag having the first logic is generated, and a part of the included pixels Generating a flag with second logic if is different color fill or no fill; and
    In the pixel block having the flag having the first logic, selecting one pixel value from among the pixel values of the included pixels and setting it as the first pixel value;
    In the pixel block having a flag having the second logic, all the pixel values of the included pixels are set as second pixel values;
    Forming image data of the three-dimensional graphics image based on the first pixel value, the second pixel value, and a flag having the first and second logics. Image data forming method.
  2.  前記第1論理を備えるフラグを有する画素ブロックにおいて、含まれる前記画素の深行きを示すデプスの内からひとつのデプスを選択し、前記選択したデプスのデプス値を第1デプス値とし、他の前記画素のデプスのデプス値それぞれに対して、前記第1デプスからのX/Y増分値を設定する工程と、
     前記第2論理を備えるフラグを有する画素ブロックにおいて、含まれる画素すべてのデプスのデプス値を第2デプス値とする工程と、を備え、
     前記3次元グラフィックス画像の画像データを形成する工程は、前記第1画素値、前記第2画素値、及び、フラグに加え、さらに、前記第1デプス値、前記第2デプス値に基づいて、行われることを特徴とする請求項1記載の画像データ形成方法。 
    In the pixel block having the flag having the first logic, one depth is selected from the depths indicating the depth of the included pixels, the depth value of the selected depth is set as the first depth value, and the other Setting an X / Y increment value from the first depth for each depth value of the pixel;
    In the pixel block having a flag having the second logic, the step of setting the depth values of all the included pixels to the second depth value, and
    The step of forming the image data of the three-dimensional graphics image is based on the first depth value and the second depth value, in addition to the first pixel value, the second pixel value, and the flag. 2. The image data forming method according to claim 1, wherein the image data forming method is performed.
  3.  描画処理後の3次元グラフィックス画像に含まれる第1画素の第1画素値又は第1デプス値からなる画像データを書き込む方法であって、
     描画処理後の3次元グラフィックス画像に含まれるマトリックス状に並べられた第1画素を、K行L列の前記第1画素からなる第1画素ブロックに分割する工程と、
     各第1画素ブロック毎に、前記第1画素の色の塗りつぶし状態を示すカバレッジを用いて、含まれる第1画素すべてについて、同色の塗りつぶしが行われる場合は第1論理の第1フラグを発生し、含まれる第1画素の一部が異なる色の塗りつぶし又は塗りつぶしなしである場合は、第2論理の第1フラグ発生する工程と、
     前記第1論理の第1フラグを有する第1画素ブロックに対して、含まれる第1画素の第1画素値の内からひとつの第1画素値を選択し、第3画素値とする工程と、
     前記第2論理の第1フラグを有する第1画素ブロックに対して、外部メモリに記憶されている描画処理前の3次元グラフィックス画像に含まれる対応する第2画素ブロック及び第2フラグを読み出す工程と、
     前記第2フラグの論理が含まれる第2画素の一部が異なる色の塗りつぶし又は塗りつぶしなしであることを示す場合は、前記第2論理の第1フラグを有する第1画素ブロック含まれるすべての第1画素の第1画素値を第3画素値とする工程と、
     前記第2フラグの論理が同色の塗りつぶしであることを示す場合は、前記第1画素ブロックの第1画素の内、色の塗りつぶし状態を示すカバレッジを有する第1画素の第1画素値と、色の塗りつぶしなし状態を示すカバレッジを有する第1画素の第1画素値に代えて、第2画素ブロックの第2画素値を、第3画素値とする工程と、
     前記第3画素値、前記第1フラグからなる画素データを外部メモリに書き込む工程と、を備えることを特徴とする画像データ書込方法。
    A method of writing image data including a first pixel value or a first depth value of a first pixel included in a three-dimensional graphics image after rendering processing,
    Dividing the first pixels arranged in a matrix included in the three-dimensional graphics image after the drawing processing into first pixel blocks including the first pixels in K rows and L columns;
    For each first pixel block, using the coverage indicating the color fill state of the first pixel, if the same color is filled for all the included first pixels, the first flag of the first logic is generated. Generating a first flag of a second logic if some of the included first pixels are filled in different colors or not filled, and
    Selecting a first pixel value from among the first pixel values of the first pixels included in the first pixel block having the first flag of the first logic and setting it as a third pixel value;
    A step of reading the corresponding second pixel block and second flag included in the three-dimensional graphics image before drawing processing stored in the external memory for the first pixel block having the first flag of the second logic. When,
    When a part of the second pixel including the logic of the second flag indicates that a different color is filled or not filled, all the first pixels included in the first pixel block having the first flag of the second logic are included. Setting a first pixel value of one pixel as a third pixel value;
    When the logic of the second flag indicates the same color fill, the first pixel value of the first pixel having a coverage indicating the color fill state among the first pixels of the first pixel block, and the color In place of the first pixel value of the first pixel having a coverage indicating the non-filled state of the second pixel value of the second pixel block,
    And a step of writing pixel data comprising the third pixel value and the first flag to an external memory.
  4.  前記第1論理の第1フラグを有する第1画素ブロックに対して、含まれる第1画素の第1デプス値の内からひとつの第1デプス値を選択し、第3デプス値とするとともに、選択されなかった他の第1デプス値に対して、選択した第1デプス値からの増分をX/Y増分値とする工程と、
     前記第2論理の第1フラグを有する第1画素ブロックに対して、外部メモリに記憶されている描画処理前の3次元グラフィックス画像に含まれる対応する第2画素ブロック及び第2フラグを読み出す工程と、
     前記第2フラグの論理が含まれる第2画素の一部が異なる色の塗りつぶし又は塗りつぶしなしであることを示す場合は、前記第2論理の第1フラグを有する第1画素ブロックに含まれるすべての第1画素の第1デプス値を第3デプス値とする工程と、
     前記第2フラグの論理が同色の塗りつぶしであることを示す場合は、前記第1画素ブロックの第1画素の内、色の塗りつぶし状態を示すカバレッジを有する第1画素の第1デプス値と、色の塗りつぶしなし状態を示すカバレッジを有する第1画素の第1デプス値に代えて、第2画素ブロックの第2デプス値を、第3デプス値とする工程と、
     前記第3画素値、前記第1フラグに加え、前記第3デプス値、及び、X/Y増分値を画素データとして外部メモリに書き込む工程と、を備えることを特徴とする請求項3の画像データ書込方法。
    For the first pixel block having the first flag of the first logic, one first depth value is selected from the first depth values of the first pixels included, and is selected as the third depth value. Setting the increment from the selected first depth value to an X / Y increment value relative to the other first depth values that have not been performed;
    A step of reading the corresponding second pixel block and second flag included in the three-dimensional graphics image before drawing processing stored in the external memory for the first pixel block having the first flag of the second logic. When,
    When a part of the second pixel including the logic of the second flag indicates that a different color is filled or not filled, all the pixels included in the first pixel block having the first flag of the second logic are included. Setting the first depth value of the first pixel to the third depth value;
    When the logic of the second flag indicates the same color fill, the first depth value of the first pixel having the coverage indicating the color fill state among the first pixels of the first pixel block, and the color Instead of the first depth value of the first pixel having the coverage indicating the non-filled state of the second pixel block, the second depth value of the second pixel block is set to the third depth value;
    4. The image data according to claim 3, further comprising: writing the third depth value and the X / Y increment value as pixel data in an external memory in addition to the third pixel value and the first flag. Writing method.
  5.  描画処理後の3次元グラフィックス画像に含まれるマトリックス状に並べられた第1画素を、分割して形成したK行L列の前記第1画素からなる第1画素ブロックの第1画素値又は第1デプス値からなる画素データを処理する画素データ処理回路であって、
     各第1画素ブロック毎に、前記第1画素の色の塗りつぶし状態を示すカバレッジを用いて、含まれる第1画素すべてについて、同色の塗りつぶしが行われる場合は第1論理の第1フラグを発生し、含まれる第1画素の一部が異なる色の塗りつぶし又は塗りつぶしなしである場合は、第2論理の第1フラグ発生するフラグ発生回路と、
     前記第2論理の第1フラグを有する第1画素ブロックに対して、外部メモリに記憶されている描画処理前の3次元グラフィックス画像に含まれる対応する第2画素ブロック及び第2フラグを読み出す画素読出回路と、
     前記第1論理の第1フラグを有する第1画素ブロックに対して、含まれる第1画素の第1画素値の内からひとつの第1画素値を選択し、第3画素値とし、
     前記第2フラグの論理が含まれる第2画素の一部が異なる色の塗りつぶし又は塗りつぶしなしであることを示す場合は、前記第2論理の第1フラグを有する第1画素ブロックに含まれるすべての第1画素の第1画素値を第3画素値とし、
     前記第2フラグの論理が同色の塗りつぶしであることを示す場合は、前記第1画素ブロックの第1画素の内、色の塗りつぶし状態を示すカバレッジを有する第1画素の第1画素値と、色の塗りつぶしなし状態を示すカバレッジを有する第1画素の第1画素値に代えて、第2画素ブロックの第2画素値を、第3画素値とし、
     前記第3画素値、前記第1及び第2論理の第1フラグからなる画素データを外部メモリに書き込む書込回路と、を備えることを特徴とする画像データ処理回路。 
    The first pixel value or the first pixel value of the first pixel block composed of the first pixels in K rows and L columns formed by dividing the first pixels arranged in a matrix shape included in the three-dimensional graphics image after the rendering process. A pixel data processing circuit for processing pixel data consisting of one depth value,
    For each first pixel block, using the coverage indicating the color fill state of the first pixel, if the same color is filled for all the included first pixels, the first flag of the first logic is generated. A flag generation circuit for generating a first flag of a second logic when a part of the included first pixel is filled in different colors or not filled, and
    A pixel that reads out the corresponding second pixel block and second flag included in the three-dimensional graphics image before drawing processing stored in the external memory for the first pixel block having the first flag of the second logic. A readout circuit;
    For the first pixel block having the first flag of the first logic, one first pixel value is selected from the first pixel values of the first pixels included, and is set as a third pixel value.
    When a part of the second pixel including the logic of the second flag indicates that a different color is filled or not filled, all the pixels included in the first pixel block having the first flag of the second logic are included. The first pixel value of the first pixel is the third pixel value,
    When the logic of the second flag indicates the same color fill, the first pixel value of the first pixel having a coverage indicating the color fill state among the first pixels of the first pixel block, and the color Instead of the first pixel value of the first pixel having coverage indicating the non-filled state of the second pixel value of the second pixel block, the third pixel value,
    An image data processing circuit comprising: a writing circuit that writes pixel data including the third pixel value and the first flags of the first and second logics to an external memory.
  6.  前記第2論理の第1フラグを有する第1画素ブロックに対して、外部メモリに記憶されている描画処理前の3次元グラフィックス画像に含まれる対応する第2画素ブロック、第2X/Y増分値、及び、第2フラグを読み出す読出回路と、
     前記第1論理の第1フラグを有する第1画素ブロックに対して、含まれる第1画素の第1デプス値の内からひとつの第1デプス値を選択し、第3デプス値とするとともに、他の第1デプス値に対する選択した前記第1デプス値からの増分を示す第1X/Y増分値を生成し、
     前記第2フラグの論理が含まれる第2画素の一部が異なる色の塗りつぶし又は塗りつぶしなしであることを示す場合は、前記第2論理の第1フラグを有する第1画素ブロックに含まれるすべての第1画素の第1デプス値を第3デプス値とし、
     前記第2フラグの論理が同色の塗りつぶしであることを示す場合は、前記第2X/Y増分値に応じて、第2画素ブロックの第2デプス値を生成し、
     前記第1画素ブロックの第1画素の内、色の塗りつぶし状態を示すカバレッジを有する第1画素の第1デプス値と、色の塗りつぶしなし状態を示すカバレッジを有する第1画素の第1デプス値に代えて、前記第2画素ブロックの第2デプス値を、第3デプス値とし、
     前記書込回路は、前記第3画素値、前記第1論理及び第2論理の第1フラグに加え、前記第3デプス値、及び、第1X/Y増分値を画素データとして外部メモリに書き込むことを特徴とする請求項5記載の画像データ処理回路。
     
     
     
    For the first pixel block having the first flag of the second logic, the corresponding second pixel block and second X / Y increment value included in the three-dimensional graphics image before drawing processing stored in the external memory And a readout circuit for reading out the second flag;
    For the first pixel block having the first flag of the first logic, one first depth value is selected from the first depth values of the first pixels included, and is set as a third depth value. Generating a first X / Y increment value indicative of an increment from the selected first depth value to a first depth value of
    When a part of the second pixel including the logic of the second flag indicates that a different color is filled or not filled, all the pixels included in the first pixel block having the first flag of the second logic are included. The first depth value of the first pixel is the third depth value,
    If the logic of the second flag indicates that the fill is the same color, generate a second depth value of the second pixel block according to the second X / Y increment value;
    Among the first pixels of the first pixel block, a first depth value of a first pixel having a coverage indicating a color fill state and a first depth value of a first pixel having a coverage indicating a non-color fill state. Instead, the second depth value of the second pixel block is a third depth value,
    The writing circuit writes the third depth value and the first X / Y increment value to the external memory as pixel data in addition to the third pixel value and the first flag of the first logic and the second logic. The image data processing circuit according to claim 5.


PCT/JP2010/005543 2010-09-10 2010-09-10 Method of forming image data, method of writing image data, and image data processing circuit WO2012032583A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2010/005543 WO2012032583A1 (en) 2010-09-10 2010-09-10 Method of forming image data, method of writing image data, and image data processing circuit
JP2012532739A JP5708653B2 (en) 2010-09-10 2010-09-10 Image data forming method, image data writing method, and image data processing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2010/005543 WO2012032583A1 (en) 2010-09-10 2010-09-10 Method of forming image data, method of writing image data, and image data processing circuit

Publications (1)

Publication Number Publication Date
WO2012032583A1 true WO2012032583A1 (en) 2012-03-15

Family

ID=45810209

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/005543 WO2012032583A1 (en) 2010-09-10 2010-09-10 Method of forming image data, method of writing image data, and image data processing circuit

Country Status (2)

Country Link
JP (1) JP5708653B2 (en)
WO (1) WO2012032583A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116009792A (en) * 2023-03-24 2023-04-25 摩尔线程智能科技(北京)有限责任公司 Data reading and writing device and method in image processing and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08293021A (en) * 1995-04-21 1996-11-05 Mitsubishi Electric Corp Image coordinate conversion method
JP2009181582A (en) * 2008-01-31 2009-08-13 Arm Norway As Method and apparatus for processing computer graphics
JP2010102713A (en) * 2008-10-24 2010-05-06 Arm Ltd Method of and apparatus for processing computer graphics

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7280120B2 (en) * 2003-06-26 2007-10-09 Canon Kabushiki Kaisha Compositing with a sub-pixel mask in graphic object rendering

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08293021A (en) * 1995-04-21 1996-11-05 Mitsubishi Electric Corp Image coordinate conversion method
JP2009181582A (en) * 2008-01-31 2009-08-13 Arm Norway As Method and apparatus for processing computer graphics
JP2010102713A (en) * 2008-10-24 2010-05-06 Arm Ltd Method of and apparatus for processing computer graphics

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116009792A (en) * 2023-03-24 2023-04-25 摩尔线程智能科技(北京)有限责任公司 Data reading and writing device and method in image processing and electronic equipment
CN116009792B (en) * 2023-03-24 2023-09-29 摩尔线程智能科技(北京)有限责任公司 Data reading and writing device and method in image processing and electronic equipment

Also Published As

Publication number Publication date
JP5708653B2 (en) 2015-04-30
JPWO2012032583A1 (en) 2013-12-12

Similar Documents

Publication Publication Date Title
US11625883B2 (en) Random accessible lossless parameter data compression for tile based 3D computer graphics systems
EP3129974B1 (en) Gradient adjustment for texture mapping to non-orthonormal grid
JP5595739B2 (en) Method for processing graphics and apparatus therefor
US9478002B2 (en) Vertex parameter data compression
TWI264183B (en) Method for compressing data in a bit stream or bit pattern
US7764833B2 (en) Method and apparatus for anti-aliasing using floating point subpixel color values and compression of same
JP4266939B2 (en) Drawing processing apparatus and drawing data compression method
US20110285742A1 (en) System and method for path rendering with multiple stencil samples per color sample
US11393165B2 (en) Method and system for multisample antialiasing
CN101071508A (en) Image processing apparatus, image processing method, and image processing program
KR20160051154A (en) Rendering method and apparatus, and electronic apparatus
WO2006048961A1 (en) Drawing device and drawing method
WO2010134347A1 (en) Graphics drawing device, graphics drawing method, graphics drawing program, storage medium having graphics drawing program stored, and integrated circuit for drawing graphics
JP4971442B2 (en) Image processing apparatus and method for pixel data conversion
CN111279384B (en) Compression and decompression of indices in a graphics pipeline
US20220014767A1 (en) Bit plane encoding of data arrays
KR20210088588A (en) street field color palette
US7027047B2 (en) 3D graphics rendering engine for processing an invisible fragment and a method therefor
US20230048839A1 (en) Compressing texture data on a per-channel basis
US11037357B2 (en) Pixelation optimized delta color compression
CN103650004B (en) Image processing apparatus, image processing method and integrated circuit
US8681154B1 (en) Adaptive rendering of indistinct objects
JP5708653B2 (en) Image data forming method, image data writing method, and image data processing circuit
JP3547250B2 (en) Drawing method
US10713753B2 (en) Data processing systems

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10856933

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2012532739

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10856933

Country of ref document: EP

Kind code of ref document: A1