This application claims priority of Japanese Patent Application No. 2016-096958, filed on May 13, 2016, the disclosure of which is incorporated herein by reference.
The present invention relates to an image compression device, image decompression device, image compression and decompression system and a display driver, more particularly, to block compression in which image data are compressed in units of blocks.
Block compression, in which image data are compressed in units of blocks, is one of the most widely used techniques for compressing image data. A block referred herein is a unit of compression processing defined by dividing a frame image; a block is composed of a predetermined number of pixels arranged in a specific arrangement (for example, arrayed in n rows and m columns for n and m being integers at least one of which is two or more).
Block compression often includes a quantization process to reduce the number of bits. Most typically, a dither value determined for each pixel is used in a quantization process. In one example, a quantization process involves addition of a dither value to the grayscale value of each color or a value obtained from the grayscale value (for example, the luminance value), followed by bit truncation or rounding of the value obtained by the addition.
In general, it is preferable to suppress image deterioration in compression processing and this also applies to the block compression. As a result of inventors' study with respect to image deterioration in block compression including a quantization process, the inventors have discovered that a sort of image quality deterioration is caused by inappropriate generation of dither values used in the quantization process.
Therefore, an objective of the present disclosure is to provide a technique for suppressing image quality deterioration caused by block compression. Other objectives and new features of the present disclosure would be understood by a person skilled in the art from the following disclosure.
In one embodiment, an image compression device includes: a compression processing circuit configured to generate compressed image data by performing a block compression process on an image data and a dither value generator circuit. When the compressed image data associated with a certain compression target block is generated, the dither value generator circuit is configured to generate a dither value in response to block coordinates indicating the position of the compression target block in the image and the compression processing circuit is configured to perform a quantization process using the dither value in the block compression process.
In another embodiment, an image decompression circuit includes a first decompression processing circuit configured to generate first decompressed image data by performing a decompression process on a compressed image data generated through a block compression process and a dither value generator circuit. When the first decompressed image data associated with a decompression target block is generated, the dither value generator circuit is configured to generate at least one dither value in response to block coordinates indicating a position of the decompression target block in an image and the first decompression processing circuit is configured to perform an inverse quantization process using the at least one dither value in the first decompression process.
In still another embodiment, an image compression and decompression system includes block compression circuitry configured to generate a compressed image data by performing a block compression process on an image data and block decompression circuitry configured to generate a decompressed image data by performing a decompression process adapted to the block compression process on the compressed image data. When the compressed image data associated with a certain compression target block is generated, the block compression circuitry is configured to generate at least one first dither value in response to first block coordinates indicating the position of the compression target block in the image and perform a quantization process using the at least one first dither value in the block compression process. When the decompressed image data associated with a certain decompression target block is generated, the block decompression circuitry is configured to generate at least one second dither value in response to second block coordinates indicating the position of the decompression target block in the image and perform an inverse quantization process using the at least one second dither value in the decompression process.
The above-described image compression device, image decompression device, and image compression and decompression system are preferably used, for example, in a display driver which drives a display panel.
The above and other advantages and features of the present invention will be more apparent from the following description taken in conjunction with the accompanied drawings, in which:
Various Embodiments of the present disclosure will be now described herein with reference to attached drawings. It should be noted that same or corresponding elements may be denoted by same or corresponding reference numerals. It should be also noted that suffixes may be attached with reference numerals for distinguishing same elements from each other.
For easiness of understanding of a technical concept disclosed in the present disclosure, a description is first given of image quality deterioration in block compression processing, especially, image quality deterioration caused by inappropriate generation of dither values used in a quantization process.
In block compression processing, there may be a case in which such errors that luminance values of pixels in a specific row or column of each block are reduced (or increased) compared with other row(s) or column(s) although the absolute values of the errors are small. Discussed below is the case illustrated in
However, when blocks which suffer from such errors that the grayscale values in a specific row or column are reduced (or increased) compared with other row(s) or column(s) are arrayed in rows and columns in the image as illustrated in
According to an inventors' study, this sort of image quality deterioration can be suppressed by appropriately generating dither values used in the quantization process. As described in the following, dither values used in compression processing performed on a block are generated in response to the block coordinates (that is, the positon of the block in the image). This allows distributing the positions at which errors are generated in respective blocks over the image, effectively suppressing generation of visually perceivable unevenness (or mura) in the image.
This configuration is intended to reduce the data amount of the image data existing in the transfer route 3. When the transfer route 3 includes a memory, use of the image compression and decompression system 10 of the present embodiment allows reducing the data amount of image data stored in the memory, that is, reducing the capacity of the memory. When the block compression circuitry 1 and the block decompression circuitry 2 are integrated in two separate semiconductor integrated circuits, the transfer route 3 may include a transmission line connected between the two semiconductor integrated circuits. In this case, use of the image compression and decompression system 10 of the present embodiment can allow reducing the data amount of image data to be transferred over the transmission line.
The block compression circuitry 1 includes a dither value generator circuit 4 and a compression processing circuit 5. The dither value generator circuit 4 receives block coordinates xBLK and yBLK of a block for which a compression process is to be done by the block compression circuitry 1 and generates dither values in response to the block coordinates xBLK and yBLK.
It should be noted that the block coordinates xBLK and yBLK of a block indicates the position of the block in the image. More specifically, the block coordinate xBLK indicates the position of the block in the horizontal direction in the image, and the block coordinate yBLK indicates the position of the block in the vertical direction in the image. The compression processing circuit 5, when receiving an image data DIMG associated with a certain block, generates a compressed image data DCMP associated with the block by performing a block compression process on the image data DIMG associated with the block. In the compression process performed in the compression processing circuit 5, a quantization process is performed and dither values supplied from the dither value generator circuit 4 are used in the quantization process. In other words, in a compression process performed on an image data DIMG associated with a block, a quantization process is performed using dither values generated in response to the block coordinates xBLK and yBLK of the block.
The block decompression circuitry 2 includes a dither value generator circuit 6 and a decompression processing circuit 7. The dither value generator circuit 6 receives block coordinates xBLK′ and yBLK′ of a block for which a decompression process is to be done by the block decompression circuitry 2 and generates dither values in response to the block coordinates xBLK′ and yBLK′. It should be noted that the block coordinates xBLK′ and yBLK′ of a block indicates the position of the block in the image. More specifically, the block coordinate xBLK′ indicates the position of the block in the horizontal direction in the image, and the block coordinate yBLK′ indicates the position of the block in the vertical direction in the image. The decompression processing circuit 7, when receiving a compressed image data DCMP associated with a certain block, generates a decompressed image data DCMP′ associated with the block by performing a decompression process on the compressed image data DCMP associated with the block. In the decompression process performed in the decompression processing circuit 7, an inverse quantization process is performed and dither values supplied from the dither value generator circuit 6 are used in the inverse quantization process. In other words, in a decompression process performed on an image data DCMP associated with a block, an inverse quantization process is performed using dither values generated in response to the block coordinates xBLK′ and yBLK′ of the block.
It should be noted that block coordinates (xBLK, yBLK or xBLK′, yBLK′) are separately supplied to the block compression circuitry 1 and the block decompression circuitry 2, because timing at which the compression process is performed on a certain block may be different from timing at which the decompression process is performed on the block.
The compression processing circuit 5 illustrated in
The matrix compression circuit 11 performs RGB-YCbCr conversion on each of the image data DA, DB, DC and DD to calculate a luminance data Y, color difference data Cb and Cr for each of pixels A, B, C and D.
The quantization circuit 12 generates the compressed image data DCMP from the luminance data Y, the color difference data Cb and Cr of pixels A, B, C and D. A quantization process is performed in generating the compressed image data DCMP and dither values E0 to E3 received from the dither value generator circuit 4 are used in the quantization process. The dither values E0, E1, E2 and E3 are associated with pixels A, B, C and D of the block for which the compression process is to be done in the block compression circuitry 1 (which may be referred to as “compression target block”, hereinafter) and calculated from the block coordinates xBLK and yBLK of the compression target block. A detailed description will be given later of the generation of the compressed image data DCMP.
Dither values E0′ to E3′ received from the dither value generator circuit 6 are used in the inverse quantization process in the inverse quantization circuit 13. The dither values E0′, E1′, E2′ and E3′ are associated with pixels A, B, C and D of the block for which the decompression process is to be done in the block decompression circuitry 2 (which may be referred to as “decompression target block”, hereinafter) and calculated from the block coordinates xBLK′ and yBLK′ of the decompression target block.
The matrix decompression circuit 14 generates the decompressed image data DIMG′ by performing YCbCr-RGB conversion on the luminance data Y and the color difference data Cb and Cr of pixels A, B, C and D, which are reproduced by the inverse quantization circuit 13. In the present embodiment, the decompressed image data DIMG′ include the image data DA′, DB′, DC′ and DD′ of pixels A, B, C and D, and each of the image data DA′, DB′, DC′ and DD′ includes an R data indicating the grayscale values of the red color, a G data indicating the grayscale values of the green color, and B a data indicating the grayscale values of the blue color.
Next, a detailed description is given of the block compression process performed by the block compression circuitry 1 and the block decompression process performed by the block decompression circuitry 2.
When the block compression process is performed on an image data DIMG associated with a certain compression target block, the image data DIMG associated with the compression target block are supplied to the matrix compression circuit 11. The matrix compression circuit 11 performs RGB-YCbCr conversion on each of the image data DA, DB, DC and DD included in the image data DIMG to calculate a luminance data Y and color difference data Cb and Cr for each of pixels A, B, C and D.
In one embodiment, the matrix M1 defined by the following expression (1) is used in the RGB-YCbCr conversion in the matrix compression circuit 11:
In this case, the luminance data Y and the color difference data Cb and Cr of pixels A, B, C and D are calculated in accordance with the following expressions (2a) to (2d):
where Y0, Cb0, Cr0 are the luminance data Y and the color difference data Cb and Cr of pixel A, respectively, Y1, Cb1, Cr1 are the luminance data Y and the color difference data Cb and Cr of pixel B, respectively, Y2, Cb2, Cr2 are the luminance data Y and the color difference data Cb and Cr of pixel C, respectively, and Y3, Cb3, Cr3 are the luminance data Y and the color difference data Cb and Cr of pixel D, respectively. The calculated luminance data Y and color difference data Cb and Cr of pixels A, B, C and D are supplied to the quantization circuit 12.
In parallel, dither values E0, E1, E2 and E3 associated with pixels A, B, C and D of the compression target block are generated on the basis of the block coordinates xBLK and yBLK of the compression target block, and supplied to the quantization circuit 12. In one embodiment, the dither values E0, E1, E2 and E3 are generated from pseudo-random numbers which are generated by using the coordinates of pixels A, B, C and D of the compression target block as seed values. For example, the dither value E0 associated with pixel A is generated as the lower n bits of the pseudo-random number V0 obtained by the following expression (3a) for n being an integer of two or more which is equal to the number of bits of the dither value required in the quantization process:
V0=77×xA+139×yA, (3a)
where xA is the coordinate indicating the position of pixel A of the compression target block in the horizontal direction of the image, and yA is the coordinate indicating the position of pixel A of the compression target block in the vertical direction of the image. It should be noted that the coordinates xA and yA of pixel A can be determined from the block coordinates xBLK and yBLK of the compression target block, since the position of pixel A in the compression target block is determined by definition. The above-described expression (3a) is a simplified expression used for generating a pseudo-random number from the coordinates xA and yA .
Similarly, the dither values E1, E2 and E3 respectively associated with pixels B, C and D are generated as the lower n bits of the pseudo-random numbers V1, V2 and V3 obtained by the following expressions (3b), (3c) and (3d), respectively:
V1=77×xB+139×yB, (3b)
V2=77×xC+139×yC, and (3c)
V3=77×xD+139×yD, (3d)
where xB is the coordinate indicating the position of pixel B of the compression target block in the horizontal direction of the image, yB is the coordinate indicating the position of pixel B of the compression target block in the vertical direction of the image, xC is the coordinate indicating the position of pixel C of the compression target block in the horizontal direction of the image, yC is the coordinate indicating the position of pixel C of the compression target block in the vertical direction of the image, xD is the coordinate indicating the position of pixel D of the compression target block in the horizontal direction of the image, and yD is the coordinate indicating the position of pixel D of the compression target block in the vertical direction of the image. The coordinates xB, yB, xC, yC, xD and yD of pixels B, C and D can be also determined from the block coordinates xBLK and yBLK of the compression target block. It should be noted that the simplified expressions used for generating the pseudo-random numbers V0 to V3 may be variously modified.
The quantization circuit 12 generates compressed image data DCMP from the luminance data Y, color difference data Cb and Cr associated with pixels A, B, C and D, which are received from the matrix compression circuit 11. In one embodiment, the compression image data DCMP associated with the compression target block include a minimum value data Ymin, averaged color reference data Cb′, Cr′, three of luminance difference data Ydist0 to Ydist3 and an address data Yaddress. The above-described dither values E0 to E3 are used in the quantization process performed in calculating the luminance difference data Ydist0 to Ydist3 of the compressed imaged data DCMP.
In one embodiment, the minimum value data Ymin, the averaged color difference data Cb′, Cr′, the luminance difference data Ydist0 to Ydist3 and the address data Yaddress are generated through the procedure described below.
The minimum value data Ymin is determined as one of the luminance data Y0 to Y3 of pixels A to D, which one has the smallest value. When Y0 has the smallest value of the luminance data Y0 to Y3, for example, the luminance data Y0 is selected as the minimum value data Ymin.
The averaged color difference data Cb′ is calculated by calculating the sum of the color difference data Cb of pixels A, B, C and D and truncating the lower two bits of the calculated sum (that is, dividing the sum by four). Similarly, the averaged color difference data Cr′ is calculated by calculating the sum of the color difference data Cr of pixels A, B, C and D and truncating the lower two bits of the calculated sum (that is, dividing the sum by four).
The luminance difference data Ydist0 to Ydist3 are calculated by performing a quantization process on the differences obtained by subtracting the minimum value data Ymin from the luminance data Y0 to Y3, respectively. More specifically, the luminance difference data Ydist0 to Ydist3 are calculated as follows:
The luminance difference data Ydist0 is obtained by a quantization process which involves: calculating the difference Y0−Ymin which is obtained by subtracting the minimum value data Ymin from the luminance data Y0, calculating the sum of the difference Y0−Ymin and the dither value E0, and truncating the lower m bits of the obtained sum Y0−Ymin+E0. In other words, the luminance difference data Ydist0 is calculated in accordance with the following expression (4a):
Ydist032 (Y0−Ymin+E0)>>m, (4a)
where “>>m” is an operator indicating a bit truncation of m bits (that is, an m-bit right shift).
Similarly, the luminance difference data Ydist1 to Ydist3 are calculated in accordance with the following expressions (4b) to (4d):
Ydist1=(Y1−Ymin+E1)>>m, (4b)
Ydist2=(Y2−Ymin+E2)>>m, and (4c)
Ydist3=(Y3−Ymin+E3)>>m. (4d)
The compressed image data DCMP associated with a compression target block include three of the luminance difference data Ydist0 to Ydist3 which three are calculated from three of the luminance data Y0 to Y3 other than the one having the smallest value. When the luminance data Y0 has the smallest value of the luminance data Y0 to Y3, for example, the compressed image data DCMP include the luminance difference data Ydist1 to Ydist3 (other than the luminance difference data Ydist0).
The address data Yaddress is generated as a data indicating which of pixels A to D has the smallest luminance data (that is, which of the luminance data Y0 to Y3 has the smallest value). When the luminance data Y0 has the smallest value of the luminance data Y0 to Y3, for example, the address data Yaddress is generated to include information indicating that the luminance data Y0 of pixel A has the smallest value.
The compressed image data DCMP includes the minimum value data Ymin, the averaged color difference data Cb′, Cr′, three of the luminance difference data Ydist0 to Ydist3 and the address data Yaddress, which are generated as described above. The block compression process is completed through the procedure described above.
When a block decompression process is performed for a decompression target block, the compressed image data DCMP associated with the decompression target block is supplied to the inverse quantization circuit 13. In parallel, dither values E0′, E1′, E2′ and E3′ associated with pixels A, B, C and D of the decompression target block are generated by the dither value generator circuit 6 on the basis of the block coordinates xBLK′ and yBLK′ of the decompression target block, and supplied to the inverse quantization circuit 13.
The dither values E0′, E1′, E2′ and E3′ are generated by the dither value generator circuit 6 in a similar manner to the dither values E0, E1, E2 and E3 which are generated by the dither value generator circuit 4, except for that the block coordinates xBLK′ and yBLK′ of the decompression target block are used in place of the block coordinates xBLK and vBLK of the compression target block. In one embodiment, the dither values E0′, E1′, E2′ and E3′ are generated from pseudo-random numbers which are generated by using the coordinates of pixels A, B, C and D of the decompression target block as seed values. For example, the dither values E0′, E1′, E2′ and E3′ associated with pixels A, B, C and D are generated as the lower n bits of pseudo-random numbers V0′ to V3′ obtained by the following expressions (5a) to (5d), respectively:
V0′=77×xA′+139×yA′, (5a)
V1′=77×xB′+139×yB′, (5b)
V2′=77×xC′+139×yC′, and (5c)
V3′=77×xD′+139×yD′, (5d)
where xA′ is the coordinate indicating the position of pixel A of the decompression target block in the horizontal direction of the image, yA′ is the coordinate indicating the position of pixel A of the decompression target block in the vertical direction of the image, xB′ is the coordinate indicating the position of pixel B of the decompression target block in the horizontal direction of the image, yB′ is the coordinate indicating the position of pixel B of the decompression target block in the vertical direction of the image, xC′ is the coordinate indicating the position of pixel C of the decompression target block in the horizontal direction of the image, yC′ is the coordinate indicating the position of pixel C of the decompression target block in the vertical direction of the image, xD′ is the coordinate indicating the position of pixel D of the decompression target block in the horizontal direction of the image, and yD′ is the coordinate indicating the position of pixel D of the decompression target block in the vertical direction of the image. It should be noted that the coordinates xA′, yA′, xB′, yB′, xC′, yC′, xD′, and yD′ of pixels A, B, C and D can be determined from the block coordinates xBLK′ and yBLK′ of the decompression target block, since the positions of pixels A, B, C and D in the decompression target block are determined by definition. The above-described expressions (5a) to (5d) are simplified expressions used for generating pseudo-random numbers V0′ to V3′ from the coordinates xA′, yA′, xB′, yB′, xB′, yC′, xD′ and yD′. It should be noted that the simplified expressions used for the generation of the pseudo-random numbers V0′ to V3′ may be variously modified.
The inverse quantization circuit 13 reproduces the luminance data Y and color difference data Cb and Cr of pixels A, B, C and D from the compressed image data DCMP. The reproduction of the luminance data Y and color difference data Cb and Cr of pixels A, B, C and D are achieved as described below.
In the decompression process, the averaged color difference data Cb′ and Cr′ included in the compressed image data DCMP are used as the color difference data Cb and Cr for all of pixels A, B, C and D without change.
The luminance data Y0′, Y1′, Y2′ and Y3′ of pixels A, B, C and D are, on the other hand, reproduced from the minimum value data Ymin, the three of the luminance difference data Ydist0 to Ydist3 and the address data Yaddress which are included in the compressed image data DCMP, as described in the following.
The inverse quantization circuit 13 determines the minimum value data Ymin included in the compressed image data DCMP as the luminance data of the pixel indicated by the address data Yaddress. When the address data Yaddress indicates that the luminance data of pixel A is the smallest of those of pixels A, B, C and D, for example, the inverse quantization circuit 13 determines that the minimum value data Ymin as the luminance data Y0′ of pixel A. When the address data Yaddress indicates that the luminance data of a different pixel is the smallest, the inverse quantization circuit 13 determines the luminance data of the different pixel in a similar manner.
The luminance data of the remaining three pixels are reproduced from the minimum data Ymin and data obtained by performing an inverse quantization process on the three luminance difference data included in the compressed image data DCMP (that is, the three of the luminance difference data Ydist0 to Ydist3).
More specifically, the luminance data of the remaining three pixels are calculated from three of the following expressions (6a) to (6d) associated with the three remaining pixels:
Y0′=Ydist0<<m−E0′+Ymin, (6a)
Y1′=Ydist1<<m−E1′+Ymin, (6b)
Y2′=Ydist2<<m−E2′+Ymin, and (6c)
Y3′=Ydist3<<m−E3′+Ymin, (6d)
where expressions (6a), (6b), (6c) and (6d) are used for calculating the luminance data Y0′, Y1′, Y2′ and Y3′, respectively. The operator “<<m” recited in expressions (6a) to (6d) is an operator which indicates the left shift of m bits.
When the address data Yaddress indicates that the luminance data of pixel A is the smallest, for example, the compressed image data DCMP includes the luminance difference data Ydist1 to Ydist3 and the luminance data Y1′, Y2′ and Y3′ of pixels B, C and D (the pixels other than pixel A) are reproduced in accordance with expressions (6b) to (6d). When the address data Yaddress indicates that the luminance data of a different pixel is the smallest, the luminance data of the remaining three pixels are reproduced in a similar manner. The luminance data Y0′ to Y3′ of pixels A to D of the decompression target block are reproduced through the above-described procedure.
The luminance data Y0′ to Y3′ of pixels A to D of the decompression target block and the color difference data commonly used for pixels A to D (the averaged color difference data Cb′ and Cr′) obtained as described above are supplied to the matrix decompression circuit 14. The matrix decompression circuit 14 performs YCbCr-RGB conversion on the luminance data Y0′ to Y3′ and color difference data of pixels A, B, C and D to generate the decompressed image data DIMG′.
In one embodiment, a matrix M2 defined by the following expression (7) is used for the YCbCr-RGB conversion in the matrix decompression circuit 14:
In this case, the R, G and B data of the image data DA′, DB′, DC′ and DD′ of pixels A, B, C and D are calculated in accordance with the following expressions (8a) to (8d):
where RA′, GA′ and BA′ are the R, G, and B data included in the image data DA′ of pixel A, RB′, GB′ and BB′ are the R, G, and B data included in the image data DB′ of pixel B, RC′, GC′ and BC′ are the R, G, and B data included in the image data DC′ of pixel C, and RD′, GD′ and BD′ are the R, G, and B data included in the image data DD′ of pixel D.
The decompressed image data DIMG′ of the decompression target block is generated to include the thus-calculated image data DA′, DB′, DC′ and DD′ of pixels A, B, C and D. This completes the block decompression processing.
One advantage of the above-described block compression and decompression processes of the present embodiment is reduction in the image quality deterioration. The block compression and decompression processes of the present embodiment allows distributing the positions of pixels experiencing errors caused by the compression and decompression processes in the respective blocks over the image, since the dither values generated depending on the positions of the compression and decompression target blocks are used in the quantization process and the inverse quantization process. Discussed in the following is an example illustrated in the left part of
In the following, a description is given of variations of the image compression and decompression system of the present embodiment.
More specifically, the image compression and decompression system 10A includes a block compression circuitry 31 and a block decompression circuitry 32. The block compression circuitry 31 and the block decompression circuitry 32 are connected via a transfer route 33. When the block compression circuitry 31 and the block decompression circuitry 32 are integrated in the same semiconductor integrated circuit, the transfer route may include a memory. In this configuration, the block compression circuitry 31 is used for performing compression processing for reducing the data amount of image data stored in the memory. When the block compression circuitry 31 and the block decompression circuitry 32 are integrated in different two semiconductor integrated circuits, the transfer route may include a transmission line which connects the two semiconductor integrated circuits.
The block compression circuitry 31 is configured as an image compression device which performs block compression on the image data DIMG supplied thereto to generate compressed image data DCMP. The block compression circuitry 31 includes block compression circuits 411 to 413, a pixel correlation determination circuit 42 and a compressed data selection circuit 43.
The block compression circuits 411 to 413 perform different block compression processes on the image data DIMG to generate compressed image data DCMP1 to DCMP3, respectively. In detail, the block compression circuit 411 is configured to achieve block compression by performing a first compression process (compression process #1) on the image data DIMG to generate the compressed image data DCMP1. Similarly, the block compression circuit 412 is configured to achieve block compression by performing a second compression process (compression process #2) on the image data DIMG to generate the compressed image data DCMP2 and the block compression circuit 413 is configured to achieve block compression by performing a third compression process (compression process #3) on the image data DIMG to generate the compressed image data DCMP3. Compression processes #1 to #3 are different from one another.
The block compression circuits 411 to 413 are configured and operated similarly to the block compression circuitry 1 illustrated in
The pixel correlation determination circuit 42 determines the correlation among the image data of the pixels of the compression target blocks and supplies to the compressed data selection circuit 43 a selection data indicating which of compression processes #1 to #3 is to be selected on the basis of the determined correlation. The compressed data selection circuit 43 selects the compressed image data DCMP to be finally used from among the compressed image data DCMP1 to DCMP3 received from the block compression circuits 411 to 413.
The block decompression circuitry 32 is configured as an image decompression device which generates decompressed image data DIMG′ by decompressing the compressed image data DCMP. The block decompression circuitry 32 includes block decompression circuits 441 to 443, a compression process identification circuit 45 and a decompressed data selection circuit 46.
The block decompression circuits 441 to 443 perform different block decompression processes on the compressed image data DCMP to generate decompressed image data DIMG′ to DIMG′, respectively. In detail, the block decompression circuit 441 is configured to achieve block decompression by performing a first decompression process (decompression process #1) on the compressed image data DCMP to generate decompressed image data DIMG1′. Similarly, the block decompression circuit 442 is configured to achieve block decompression by performing a second decompression process (decompression process #2) on the compressed image data DCMP to generate decompressed image data DIMG2′ and the block decompression circuit 443 is configured to achieve block decompression by performing a third decompression process (decompression process #3) on the compressed image data DCMP to generate decompressed image data DIMG3′
The block decompression circuits 441 to 443 are configured and operated similarly to the block decompression circuitry 2 illustrated in
The compression process identification circuit 45 identifies which of compression processes #1 to #3 is used to generate the compressed image data DCMP and supplies to the decompressed data selection circuit 46 a compression process identification data indicating the compression process used to generate the compressed image data DCMP. When the compressed image data DCMP includes a compression process identification data which identifies the compression process used to generate the compressed image data DCMP, for example, the compression process identification circuit 45 identifies the the compression process used to generate the compressed image data DCMP from the compression process identification data. The decompressed data selection circuit 46 selects the decompressed image data DIMG′ to be finally output from the decompressed image data DIMG1′ to DIMG3′ received from the block decompression circuits 441 to 443 on the basis of the compression process identification data.
The common dither value generator circuit 47 generates common dither values from the block coordinates xBLK and yBLK of the compression target block.
The block compression circuits 411 to 413 each perform a quantization process using the common dither values in the block compression process performed therein. When the number of bits of the common dither values supplied is more than that of bits of dither values used in the quantization process performed in any of the block compression circuits 411 to 413, such block compression circuit performs the quantization process by using some of the bits of the common dither values (for example, upper or lower bits). When a certain block compression circuit 41 uses two-bit dither values in the quantization process performed therein, for example, the block compression circuit 41 performs the quantization process by using upper two bits (or lower two bits) of the common dither values generated by the common dither value generator circuit 47.
Similarly, the common dither value generator circuit 48 generates common dither values from the block coordinates xBLK′ and yBLK′ of the decompression target block. The block decompression circuits 441 to 443 each perform an inverse quantization process by using the common dither values in the block decompression process performed therein. When the number of bits of the common dither values supplied is more than that of bits of dither values used in the inverse quantization process performed in any of the block decompression circuits 441 to 443, such block decompression circuit performs the inverse quantization process by using some of the bits of the common dither values (for example, upper or lower bits). When a certain block decompression circuit 44 uses two-bit dither values in the inverse quantization process performed therein, for example, the block decompression circuit 44 performs the inverse quantization process by using upper two bits (or lower two bits) of the common dither values generated by the common dither value generator circuit 48.
The image compression and decompression system 10B illustrated in
The image compression and decompression systems 10, 10A and 10 of the above-described embodiments may be monolithically integrated in a single semiconductor integrated circuit and used for image data compression and decompression within the semiconductor integrated circuit, for example, image data compression and decompression in a display driver which drives a display panel.
The display driver 52 includes: a command control circuit 61, a block compression circuitry 62, an image memory 63, a block decompression circuitry 64, a source line driver circuit 65, a grayscale voltage generator circuit 66, and a timing control circuit 67.
The command control circuit 61 transfers the image data DIMG received from the processor 53 to the block compression circuitry 62. Additionally, the command control circuit 61 controls respective circuits of the display driver 52, including the grayscale voltage generator circuit 66 and the timing control circuit 67, in response to the control data received from the processor 53.
The block compression circuitry 62 operates as an image compression device which generates compressed image data DCMP by performing a block compression process on the image data DIMG received from the command control circuit 61 and supplies the compressed image data DCMP to the image memory 63. The block compression circuitry (1 or 31) of the above-described image compression and decompression system 10, 10A or 10B is used as the block compression circuitry 62 of the display driver 52 illustrated in
The image memory 63 stores therein the compressed image data DCMP received from the block compression circuitry 62. The compressed image data DCMP are read out from the image memory 63 and transferred to the block decompression circuitry 64.
The block decompression circuitry 64 operates as an image decompression device which generates decompressed image data DIMG′ by performing a block decompression compression on the compressed image data DCMP read out from the image memory 63 and supplies the decompressed image data DIMG′ to the source line driver circuit 65.
The source line driver circuit 65 drives the source lines of the display area 51a of the display panel 51 in response to the decompressed image data DIMG′. More specifically, The source line driver circuit 65 generates source voltages having voltage levels corresponding to the decompressed image data DIMG′ by using grayscale voltages received from the grayscale voltage generator circuit 66 and drives the respective source lines with the source voltages associated thereto.
The grayscale voltage generator circuit 66 generates the grayscale voltages used for the generation of the source voltages and supplies the grayscale voltages to the source line driver circuit 65.
The timing control circuit 67 controls operation timing of the respective circuits of the display driver 52 and the GIP circuit 51b of the display panel 51.
The display driver 52 illustrated in
The image compression and decompression system 10, 10A and 10B may be used for transferring image data from a processor to a display driver of a display device.
The processor 53A includes a block compression circuitry 54. The block compression circuitry 54 operates as an image compression device which receives image data DIMG corresponding to images to be displayed in the display area 51a of the display panel 51 and generates compressed image data DCMP by compressing the image data DIMG. The processor 53A transmits the compressed image data DCMP generated by the block compression circuitry 54 to the display driver 52A and further transmits control data controlling the operation of the display driver 52A to the display driver 52A.
The display driver 52A includes a command control circuit 61, a block decompression circuitry 64, a source line driver circuit 65, a grayscale voltage generator circuit 66, and a timing control circuit 67. The configuration and operation of the display driver 52A illustrated in
The block decompression circuitry 64 operates as an image decompression device which generates decompressed image data DIMG′ by performing a block decompression process on the compressed image data DCMP read out from the image memory 63 and supplies the decompressed image data DIMG′ to the source line driver circuit 65.
In the display system illustrated in
In the following, a description is given of a further specific implementation example of the image compression and decompression system configured to select a compression process used for block compression of the image data of each block in response to the feature of the image data of each block.
Also in the present implementation example, one block consists of 2×2 pixels (see
The block compression circuitry 71 is configured as an image compression device which generates the compressed image data DCMP by selecting the most suitable one of a plurality of compression processes in response to the correlation (or likelihood) among the image data of four pixels of a compression target block and performing the selected compression process on the image data DIMG of the compression target block. In the present example, the most suitable compression process is selected from a lossless compression process, a (1×4) compression process, a (2+1×2) compression process, a (2×2) compression process, and a (4×1) compression process.
The lossless compression process is designed to compress the image data DIMG so that the original image data DIMG of the four pixels can be losslessly reproduced from the compressed image data. In the present example, the lossless compression process is used when the image data of the four pixels of the compression target block have a specific pattern.
The (1×4) compression process is designed to individually perform a quantization process (in the present implementation example, a quantization process using dither values) on the image data of each of the four pixels of the compression target block. Use of the (1×4) compression process is preferable when the image data of the four pixels of the compression target block are poorly correlated with one another.
The (2+1×2) compression process is designed to determine representative values representing values of image data of two pixels selected from the four pixels of the compression target block and perform a quantization process on the representative values, while individually performing a quantization process on the image data of each of the remaining two pixels. The (2+1×2) compression process is preferable when the image data of two of the four pixels of the compression target block are highly correlated with each other and the image data of the remaining two are poorly correlated with each other.
The (2×2) compression process is designed to perform grouping the image data of the four pixels of the compression target block into two sets each consisting of image data of two pixels, determine representative values representing the image data for each of the two sets, and perform a quantization process on the representative values. The (2×2) compression process is preferable when the image data of two of the four pixels of the compression target block are highly correlated with each other and the image data of the remaining two are also highly correlated with each other.
The (4×1) compression process is designed to determine representative values representing the image data of the four pixels of the compression target block and perform a quantization process on the representative values. The (4×1) compression process is preferable when the image data of the four pixels of the compression target block are highly correlated with each other.
The selection of the above-described five compression processes is based on whether the image data of the four pixels of the compression target block has a specific pattern or the correlations among the image data of selected two of the four pixels calculated for all the allowed combinations of the two pixels. For example, when the image data of the four pixels are highly correlated with one another, the (4×1) compression process is used. When the image data of two of the four pixels are highly correlated and the image data of the remaining two are also highly correlated, the (2×2) compression process is used. Details of the above-described five compression processes will be described later.
To perform the above-described operation, the block compression circuitry 71 includes a lossless compression circuit 81, a (1×4) compression circuit 82, a (2+1×2) compression circuit 83, a (2×2) compression circuit 84, a (4×1) compression circuit 85, a pixel correlation determination circuit 86, and a compressed data selection circuit 87.
The lossless compression circuit 81 generates a losslessly compressed data DCMP1 by performing the above-described lossless compression process on the image data DIMG associated with the compression target block. The (1×4) compression circuit 82 generates a (1×4) compressed image data DCMP2 by performing the above-described (1×4) compression process on the image data DIMG associated with the compression target block, and the (2+1×2) compression circuit 83 generates a (2+1×2) compressed image data DCMP3 by performing the above-described (2+1×2) compression process on the image data DIMG associated with the compression target block. Furthermore, the (2×2) compression circuit 84 generates a (2×2) compressed image data DCMP4 by performing the above-described (2×2) compression process on the image data DIMG associated with the compression target block, and the (4×1) compression circuit 85 generates a (4×1) compressed image data DCMP5 by performing the above-described (4×1) compression process on the image data DIMG associated with the compression target block.
The pixel correlation determination circuit 86 determines the correlation among the image data of the four pixels of the compression target block and supplies to the compressed data selection circuit 87 the selection data indicating which of the lossless compression process, the (1×4) compression process, the (2+1×2) compression process, the (2×2) compression process, and the (2×2) compression process is to be selected. The compressed data selection circuit 87 selects the compressed imaged data DCMP to be finally used from among the compressed data DCMP1 to DCMP5 respectively received from the lossless compression circuit 81, the (1×4) compression circuit 82, the (2+1×2) compression circuit 83, the (2×2) compression circuit 84, and the (4×1) compression circuit 85 in response to the supplied selection data.
In the present example, quantization processes using dither values are performed in the block compressions in the (1×4) compression circuit 82, the (2+1×2) compression circuit 83, the (2×2) compression circuit 84, and the (4×1) compression circuit 85, and the dither values used in the quantization processes are generated from the block coordinates xBLK and yBLK of the compression target block. As is understood from the above-described discussion, the generation of the dither values used in the quantization processes from the block coordinates xBLK and yBLK effectively reduces image quality deterioration in block compression processing.
In the present example, the block decompression circuitry 72 includes an original data reproduction circuit 91, a (1×4) decompression circuit 92, a (2+1×2) decompression circuit 93, a (2×2) decompression circuit 94, a (4×1) decompression circuit 95, a compression process identification circuit 96, and a decompressed data selection circuit 97. The original data reproduction circuit 91 is configured to generate decompressed image data DIMG1′ by performing a decompression process adapted to the above-described lossless compression process on the compressed image data DCMP supplied to the block decompression circuitry 72. The (1×4) decompression circuit 92 is configured to generate decompressed image data DIMG2′ by performing a decompression process adapted to the above-described (1×4) compression process on the compressed image data DCMP supplied to the block decompression circuitry 72 and the (2+1×2) decompression circuit 93 is configured to generate decompressed image data DIMG3′ by performing a decompression process adapted to the above-described (2+1×2) compression process on the compressed image data DCMP supplied to the block decompression circuitry 72. Furthermore, the (2×2) decompression circuit 94 is configured to generate decompressed image data DIMG4′ by performing a decompression process adapted to the above-described (2×2) compression process on the compressed image data DCMP supplied to the block decompression circuitry 72 and the (4×1) decompression circuit 95 is configured to generate decompressed image data DIMG5′ by performing a decompression process adapted to the above-described (4×1) compression process on the compressed image data DCMP supplied to the block decompression circuitry 72. Details of the decompression processes performed in the original data reproduction circuit 91, the (1×4) decompression circuit 92, the (2+1×2) decompression circuit 93, the (2×2) decompression circuit 94, and the (4×1) decompression circuit 95 will be described later.
The compression process identification circuit 96 identifies which of the above-described five compression processes (the lossless compression process, the (1×4) compression process, the (2+1×2) compression process, the (2×2) compression process, and the (4×1) compression process) is used to generate the compressed image data DCMP and supplies to the decompressed data selection circuit 97 a compression process identification data indicating the compression process actually used to generate the compressed image data DCMP. In the present implementation example, the compressed imaged data DCMP include a compression process identification data identifying the compression process actually used to generate the compressed image data DCMP. The compression process identification circuit 96 identifies the compression process actually used to generate the compressed image data DCMP on the basis of the compression process identification data and supplies to the decompressed data selection circuit 97 a selection data selecting the decompressed image data corresponding to the identified compression process from among the decompressed image data DIMG1′ to DIMG5′ received from the original data reproduction circuit 91, the (1×4) decompression circuit 92, the (2+1×2) decompression circuit 93, the (2×2) decompression circuit 94, and the (4×1) decompression circuit 95, respectively. The decompressed data selection circuit 97 selects the decompressed image data DIMG′ to be finally output, from among the decompressed image data DIMG1′ to DIMG5′ in response to the selection data.
In the present example, inverse quantization processes using dither values are performed in the block decompression processes performed in the (1×4) decompression circuit 92, the (2+1×2) decompression circuit 93, the (2×2) decompression circuit 94, and the (4×1) decompression circuit 95 and the dither values used in the inverse quantization processes are generated from the block coordinates xBLK′ and yBLK′ of the decompression target block.
Next, a description is given of details of the block compression processing performed in the block compression circuitry 71 and the block decompression processing performed in the block decompression circuitry 72.
In the block decompression processing of the present example, the pixel correlation determination circuit 86 of the block compression circuitry 71 determines which of the cases described below the correlation among the image data of the four pixels of the compression target block falls into:
Case A: image data of any two pixels selected from the four pixels are poorly correlated for any possible combinations of the two pixels (see
Case B: image data of two pixels are highly correlated and image data of the remaining two pixels are poorly correlated with each other and also poorly correlated with those of the preceding two pixels (see
Case C: image data of two pixels are highly correlated and image data of the remaining two pixels are also highly correlated (see
Case D: image data of the four pixels are highly correlated (
It is first determined whether the image data of pixels A, B, C, and D fall into any of predetermined specific patterns (step S01), and when the image data of pixels A, B, C, and D fall into any of the specific patterns, the lossless compression process is performed. In the present implementation example, predetermined patterns in which the number of different data values of the image data of pixels A, B, C, and D is five or less are selected as the specific patterns for which the lossless compression process is to be performed.
In one example, the lossless compression process is performed when the image data of pixels A, B, C, and D fall into any of the following four patterns (1) to (4):
(1) The image data of pixels A to D are identical (see
When the image data of pixels A to D satisfy the following condition (1a), the lossless compression process is performed:
RA=RB=RC=RD,
GA=GB=GC=GD, and
BA=BB=BC=BD. Condition (1a)
In this case, the number of different data values of the image data of pixels A to D is three.
(2) The three grayscale values of the red, green and blue colors of each of pixels A, B, C, and D are identical.
The lossless compression process is performed also when the image data of pixels A to D satisfies the following condition (2a):
RA=GA=BA,
RB=GB=BB,
RC=GC=BC, and
RD=GD=BD. Condition (2a):
In this case, the number of different data values of the image data of pixels A, B, C, and D is four.
(3) Data values of two of R, G and B data are identical for all of the pixels A, B, C, and D (see
The lossless compression process is performed also when any one of the following three conditions (3a) to (3c) is satisfied:
GA=GB=GC=GD=BA=BB=BC=BD. Condition (3a)
BA=BB=BC=BD=RA=RB=RC=RD. Condition (3b)
RA=RB=RC=RD=GA=GB=GC=GD. Condition (3c)
In this case, the number of different data values of pixels A, B, C, and D is five.
(4) Data values of one of R, G and B data are identical for pixels A, B, C, and D and data values of other two data are identical for pixels A, B, C, and D (see
Furthermore, the lossless compression process is performed also when any one of the following three conditions (4a) to (4c) is satisfied:
GA=GB=GC=GD,
RA=BA,
RB=BB,
RC=BC, and
RD=BD. Condition (4a)
BA=BB=BC=BD,
RA=GA,
RB=GB,
RC=GC, and
RD=GD. Condition (4b)
RA=RB=RC=RD,
GA=BA,
GB=BB,
GC=BC, and
GD=BD. Condition (4c)
In this case, the number of different data values of the image data of pixels A, B, C, and D is five.
When the lossless compression process is not performed, the compression process is selected depending on the correlation among the image data of pixels A, B, C, and D. More specifically, the pixel correlation determination circuit 86 determines which of the above-described cases A to D the image data of pixels A, B, C, and D fall into:
In detail, when the following condition (A) is not satisfied for all the combinations of i and j which meet:
i E∈{A, B, C, D},
j E ∈{A, B, C, D}, and
i ≠j,
the pixel correlation determination circuit 86 determines that the image data of pixels A, B, C, and D fall into case A (i.e., there are poor correlations between image data of two pixels selected from pixels A to D for any possible combinations of the two pixels) (Step S02).
|Ri−Rj|≦Th1,
|Gi−Gj|≦Th1, and
|Bi−Bj|≦Th1, Condition (A)
where Th1 is a predetermined threshold value.
When the image data of pixels A, B, C, and D fall into case A, the pixel correlation determination circuit 86 determines that the (1×4) compression process is to be performed.
When not determining that the image data of pixels A, B, C, and D fall into case A, the pixel correlation determination circuit 86 defines a first pair of pixels and a second pair of pixels selected from pixels A, B, C, and D and, for all the possible combinations of the first and second pairs, determines whether or not a condition is satisfied in which the difference between data values of the image data of the two pixels belonging to the first pair is smaller than a predetermined value, and the difference between data values of the image data of the two pixels belonging to the second pair is smaller than the predetermined value. More specifically, the pixel correlation determination circuit 86 determines whether or not any of the following conditions (B1) to (B3) is satisfied (Step S03):
|RA−RB|Th2,
|GA−GB|Th2,
|BA−BB|Th2,
|RC−RD|Th2,
|GC−GD|≦Th2, and
|BC−BD|≦Th2. Condition (B1)
|RA−RC|≦Th2,
|GA−GC|≦Th2,
|BA−BC|≦Th2,
|RB−RD|≦Th2,
|GB−GD|≦Th2, and
|BB−BD|≦Th2. Condition (B2)
|RA|RD|≦Th2,
|GA−GD|≦Th2,
|BA−BD|≦Th2,
|RB−RC|≦Th2,
|GB−GC|≦Th2, and
|BB−BC|≦Th2. Condition (B3)
It should be noted that Th2 is a predetermined threshold value.
If none of the above conditions (B1) to (B3) is satisfied, the pixel correlation determination circuit 86 determines that the image data of pixels A, B, C, and D fall into case B (i.e., the image data of two pixels are highly correlated and the image data of the remaining two pixels are poorly correlated with each other and also poorly correlated with the image data of the preceding two pixel). In this case, the pixel correlation determination circuit 86 determines to perform the (2+1×2) compression process.
When the image data of pixels A, B, C, and D fall into neither case A nor case B, the pixel correlation determination circuit 86 determines whether or not the difference between the maximum and minimum values of the image data of the four pixels is smaller than a predetermined value for each of R data, G data and B data of the four pixels. More specifically, the pixel correlation determination circuit 86 determines whether the following condition (C) is satisfied (Step S04):
max (RA, RB, RC, RD)−min (RA, RB, RC, RD)<Th3,
max (GA, GB, GC, GD)−min (GA, GB, GC, GD)<Th3, and
max (BA, BB, BC, BD)−min (BA, BB, BC, BD)<Th3. Condition (C)
When condition (C) is not satisfied, the pixel correlation determination circuit 86 determines that the image data of pixels A to D fall into case C (that is, image data of two pixels are highly correlated and image data of the remaining pixels are also highly correlated). In this case, the pixel correlation determination circuit 86 determines to perform the (2×2) compression process.
When condition (C) is satisfied, on the other hand, the pixel correlation determination circuit 86 determines that the image data of pixels A to D fall into case D (the image data of pixels A to D are high correlated with one another). In this case, the pixel correlation determination circuit 86 determines to perform the (4×1) compression process.
The pixel correlation determination circuit 86 generates the selection data to indicate which of the (1×4) compression process, (2+1×2) compression process, (2×2) compression process and (4×1) compression process is to be used on the basis of the correlation determination result described above, and sends the selection data to the compressed data selection circuit 87. The compressed data selection circuit 87 is responsive to the selection data received from the pixel correlation determination circuit 86 for outputting as the compressed image data DCMP any of the losslessly-compressed data DCMP1 output from the lossless compression circuit 81, the (1×4) compressed data DCMP2 output from the (1×4) compression circuit 82, the (2+1×2) compressed data DCMP3 output from the (2+1×2) compression circuit 83, the (2×2) compressed data DCMP4 output from the (2×2) compression circuit 84 and the (4×1) compressed data DCMP5 outputted from the (4×1) compression circuit 85.
A detailed description is next given of the lossless compression process, the (1×4) compression process, the (2+1×2) compression process, the (2×2) compression process and the (4×1) compression process, which are performed in the block compression circuitry 71, and the decompression processes performed on the compressed image data DCMP generated with these compression processes in the block decompression circuitry 72.
1. Lossless Compression and Decompression Processes
In the present example, the lossless compression process is achieved by rearranging the data values of the image data of pixels A, B, C, and D.
The compression process identification data indicates the used compression process and four bits are allocated to the compression process identification data in the losslessly-compressed data DCMP1. In the present implementation example, the value of the compression process identification data of the losslessly-compressed data DCMP1 is “1111”.
The pattern type data identifies the pattern which the image data of pixels A to D fall into. In the present implementation examples, in which eight specific patterns (that is, the patterns corresponding to the above-described conditions (1a), (2a), (3a) to (3c) and (4a) to (4c), respectively) are defined, the pattern type data are 3-bit data.
Data #1 to #5 are obtained by rearranging data values of the image data of pixels A, B, C, and D. All of data #1 to #5 are 8-bit data. As described above, the number of different data values of the image data of pixels A, B, C, and D is equal to or less than five when the lossless compression process is selected. This means that all the data values of the image data of pixels A, B, C, and D can be contained as data #1 to #5.
The padding data are added to make the number of bits of the losslessly-compressed data DCMP1 equal to compressed image data generated by other compression processes. In the present embodiments, the padding data is a one-bit data.
The decompression of the losslessly-compressed data generated by the above-described lossless compression process is achieved by rearranging data #1 to #5 with reference to the pattern type data. Since the pattern type data describes the pattern which the image data of pixels A, B, C, and D fall into, the image data of pixels A, B, C, and D can be completely reproduced with no compression error by referring to the pattern type data.
2. (1×4) Compression and Decompression Processes
The compression process identification data indicates the used compression process; in the (1×4) compressed data DCMP2, one bit is allocated to the compression process identification data. In the present implementation example, the value of the compression process identification data of the (1×4) compressed data DCMP2 is “0”.
The RA*data, GA*data and BA*data are obtained by performing a quantization process on the R data RA, G data GA and B data BA of pixel A, respectively, and the RB*data, GB*data and BB*data are obtained by performing a quantization process on the R data RB, G data GB and B data BB of pixel B, respectively. Correspondingly, the RC*data, GC*data and BC*data are obtained by performing a quantization process on the R data RC, G data GC and B data BC of pixel C, respectively, and the RD*data, GD*data and BD*data are obtained by performing a quantization process on the R data RD, G data GD and B data BD of pixel D, respectively. In the present implementation example, only the BD*data associated with the B data of pixel D is a 3-bit data, and the others data (that is, the RA*, GA* and BA*data, the RB*, GB* and BB*data, the RC*, GC* and BC*data and the RD* and GD*data) are 4-bit data. As is described later in detail, dither values generated from the block coordinates xBLK and yBLK of the compression target block are used in the quantization process to generate the RA*, GA* and BA*data, the RB*, GB* and BB*data, the RC*, GC* and BC*data and the RD*, GD* and BD*data.
More specifically, when the RA*, GA*, and BA*data are generated, the four-bit dither value E0 is added to each of the R data RA, G data GA, and B data BA of pixel A. The dither value E0 may be obtained, for example, as the lower four bits of the pseudo-random number V0 calculated in accordance with the above-described expression (3a). It should be noted that the coordinates xA and xB of pixel A of the compression target block are used in the calculation of the pseudo-random number V0 in accordance with expression (3a), and the coordinates xA and xB of pixel A can be determined from the coordinates xBLK and yBLK of the compression target block.
This is followed by performing rounding or bit truncation on the R data, G data, and B data of pixel A with the dither value E0 added thereto, to generate the RA*, GA*, and BA*data. In the implementation example illustrated in
The RB*, GB*, and BB*data, the RC*, GC*, and BC*data and the RD*, GD*, and BD*data are generated in a similar manner. When the RB*, GB*, and BB*data are generated, the four-bit dither value E1 is added to each of the R data RB, G data GB, and B data BB of pixel B. The dither value E1 may be obtained, for example, as the lower four bits of the pseudo-random number V1 calculated in accordance with the above-described expression (3b). This is followed by performing rounding or bit truncation on the R data, G data, and B data of pixel A with the dither value E1 added thereto, to generate the RB*, GB*, and BB*data. In the implementation example illustrated in
When the RC*, GC*, and BC*data are generated, the four-bit dither value E2 is added to each of the R data RC, G data GC, and B data BC of pixel C. The dither value E2 may be obtained, for example, as the lower four bits of the pseudo-random number V2 calculated in accordance with the above-described expression (3c). This is followed by performing rounding or bit truncation on the R data, G data, and B data of pixel C with the dither value E2 added thereto, to generate the RC*, GC*, and BC*data. In the implementation example illustrated in
When the RD*, GD*, and BD*data are generated, the four-bit dither value E3 is added to each of the R data RD, G data GD, and B data BD of pixel D. The dither value E3 may be obtained, for example, as the lower four bits of the pseudo-random number V3 calculated in accordance with the above-described expression (3d). This is followed by performing rounding or bit truncation on the R data, G data, and B data of pixel D with the dither value E3 added thereto, to generate the RD*, GD*, and BD*data. In the implementation example illustrated in
The (1×4) compressed data DCMP2 is generated by attaching the compression process identification data of a value “0” to the RA*, GA*, BA*data, RB*, GB*, BB*data, RC*, GC*, BC*data and RD*, GD*, and BD*data thus generated.
Next, a description is given of data processing in the decompression process of the compressed image data DCMP2, which is compressed with the (1×4) compression process, with reference to
More specifically, the R, G, and B data of pixel A of the decompressed image data DIMG2′ are respectively reproduced as values obtained by performing a left shift of four bits on the RA*, GA*, and BA*data and then subtracting the dither value E0′. The dither value E0′ may be obtained, for example, as the lower four bits of the pseudo-random number V0′ calculated in accordance with the above-described expression (6a). It should be noted that the coordinates xA′ and xB′ of pixel A of the decompression target block are used in the calculation of the pseudo-random number V0′ in accordance with expression (6a), and the coordinates xA′ and xB′ of pixel A can be determined from the coordinates xBLK′ and yBLK′ of the decompression target block.
Similarly, the R, G and B data of pixel B of the decompressed image data DIMG2′ are respectively reproduced as values obtained by performing a left shift of four bits on the RB*, GB*, and BB*data and then subtracting the dither value E1′. The dither value E1′ may be obtained, for example, as the lower four bits of the pseudo-random number V1′ calculated in accordance with the above-described expression (6b).
Furthermore, the R, G, and B data of pixel C of the decompressed image data DIMG2′ are respectively reproduced as values obtained by performing a left shift of four bits on the RC*, GC*, and BC*data and then subtracting the dither value E2′. The dither value E2′ may be obtained, for example, as the lower four bits of the pseudo-random number V2′ calculated in accordance with the above-described expression (6c).
Furthermore, the R and G data of pixel D of the decompressed image data DIMG2′ are respectively reproduced as values obtained by performing a left shift of four bits on the RD* and GD*data and then subtracting the dither value E3′. The dither value E3′ may be obtained, for example, as the lower four bits of the pseudo-random number V3′ calculated in accordance with the above-described expression (6d). Finally, the B data of pixel D of the decompressed image data DIMG2′ is reproduced as a value obtained by performing a left shift of five bits on the BD*data and then subtracting the dither value E3′.
This completes the decompression process of the (1×4) compressed data.
3. (2+1×2) Compression and Decompression Processes
The compression process identification data indicates the used compression process, and two bits are allocated to the compression process identification data in the (2+1×2) compressed data DCMP3. In the present example, the value of the compression process identification data of the (2+1×2) compressed data DCMP3 is “10”.
The pattern recognition data is a three-bit data indicating which two of pixels A to D have the image data highly-correlated. When the (2+1×2) compression process is used, image data of two of pixels A to D are highly correlated, and image data of the other two pixels are poorly correlated with the image data of the preceding two pixels. Accordingly, the number of possible combinations of two pixels having the image data highly-correlated is six as follows:
Pixels A and C
Pixels B and D
Pixels A and B
Pixels C and D
Pixels B and C
Pixels A and D
The pattern recognition data indicates, with three bits, which of these six combinations the highly-correlated two pixels are.
The R, G, and B representative values are values representing the R, G, and B data of the two pixels having the image data highly-correlated, respectively. In the example of
The β comparison data indicates whether the difference between the R data of the highly-correlated two pixels, and the difference between the G data of the same two pixels are larger than a predetermined threshold value β. In this embodiment, the β comparison data is a 2-bit data. On the other hand, the magnitude relation data indicates which of the highly-correlated two pixels has an R data of a larger value, and which of the highly-correlated two pixels has a G data of a larger value. The magnitude relation data associated with the R data is generated only when the difference between the R data of the highly-correlated two pixels is larger than the threshold value β, and the magnitude relation data associated with the G data is generated only when the difference between the G data of the highly-correlated two pixels is larger than the threshold value β. Accordingly, the magnitude relation data is a 0 to 2-bit data.
The Ri*, Gi*, Bi*data, and the Rj*, Gj*, and Bj*data are obtained by performing a quantization process the R data, G data, and B data of the poorly-correlated two pixels, respectively. Note that i and j are two selected from A, B, C, and D so that i and j are different from each other. In this embodiment, all of the Ri*data, Gi*data, Bi*data, Rj*data, Gj*data, and Bj*data are 4-bit data.
In the following, a description is given of the data processing performed in the (2+1×2) compression process with reference to
A description is first given of the compression process of the image data of pixels A and B, which are highly correlated. First, the average value of the R data RA and RB, the average value of G data GA and GB and the average value of B data BA and BB are calculated. In the present implementation example, the average values Rave, Gave, and Bave of the R data, G data and B data are calculated by the following equations:
Rave=(RA+RB+1)/2,
Gave=(GA+GB+1)/2, and
Bave=(BA+BB+1)/2.
Furthermore, the difference |RA−RB| between the R data of pixels A and B and the difference |GA−GB| between the G data are compared with the predetermined threshold value β. The results of these comparisons are incorporated into the (2+1×2) compressed data DCMP3 as the β comparison data.
Furthermore, the magnitude relation data is generated by the following procedure, for the R and G data of pixels A and B. When the difference |RA−RB| between the R data of pixels A and B is larger than the threshold value β, the magnitude relation data includes a data indicating which of pixels A and B has the larger R data. When the difference |RA−RB| between the R data of pixels A and B is equal to or smaller than the threshold value β, the magnitude relation data are generated so as not to describe the magnitude relation between the R data of pixels A and B. Similarly, when the difference |GA−GB| between the G data of pixels A and B is larger than the threshold value β, the magnitude relation data includes a data indicating which of pixels A and B has the larger G data. When the difference |GA−GB| between the G data of pixels A and B is equal to or smaller than the threshold value β, the magnitude relation data are generated so as not to describe the magnitude relation between the G data of pixels A and B. The magnitude relation data thus generated is incorporated into the (2+1×2) compressed data DCMP3 .
This is followed by calculating the R representative value, G representative value and B representative value by respectively performing a quantization process using dither values on the average values Rave, Gave, and Bave of the R data, G data and B data of pixels A and B.
In the quantization process of the R representative value, G representative value and B representative value, a dither value is added to the average values Rave, Gave, and Bave of the R data, G data and B data of pixels A and B. In the present example, the dither value is calculated from the block. The dither value may be calculated by using the coordinates of one of pixels A and B (which are highly correlated) as the lower four bits of the pseudo-random number V0 or V1 calculated in accordance with expression (3a) or (3b). Illustrated in
This is followed by calculating the R representative value, G representative value, and B representative value by performing rounding or bit truncation on the average values Rave, Gave, and Bave with the dither value added thereto.
The numerical values added to the average value Rave of the R data and the average value Gave of the G data in the rounding process and the numbers of bits truncated in the bit truncation process for the average value Rave of the R data and the average value Gave of the G data depend on the magnitude relations between the differences |RA−RB|, |GA−GB| and the threshold value β. For the average value Rave of the R data, when the difference |RA−RB| of the R data is larger than the threshold value β, a value of four is added to the average value Rave of the R data and then the lower three bits of the average value Rave of the R data are truncated to calculate the R representative value. Otherwise, a value of two is added to the average value Rave of the R data and then the lower two bits of the average value Rave of the R data are truncated to calculate the R representative value. The same goes for the average value Gave of the G data. When the difference |GA−GB| of the G data is larger than the threshold value β, a value of four is added to the average value Gave of the G data and then the lower three bits of the average value Gave of the G data are truncated to calculate the G representative value. Otherwise, a value of two is added to the average value Gave of the G data and then the lower two bits of the average value Gave of the G data are truncated to calculate the G representative value.
For the B representative value, on the other hand, a value of four is added to the average value Bave of the B data and then the lower three bits of the average value Bave of the B data are truncated to calculate the B representative value. This completes the compression process for the image data of pixels A and B.
For pixels C and D (which are poorly correlated with each other), on the other hand, the same process as the (1×4) compression process is performed. A quantization process using dither values is individually performed for pixels C and D to achieve bit reduction of the R, G and B data of pixels C and D. In detail, dither values are first added to the R data RC, RD, G data GC, GD, and B data BC and BD of pixels C and D. As described above, the dither values are calculated from the block coordinates xBLK and yBLK of the compression target block. In
This is followed by performing rounding or bit truncation to generate the RC*, GC*, and BC*data and the RD*, GD*, and BD*data. More specifically, a value of 8 is added to the R data, G data, and B data of pixels C and D with the dither values E2 and E3 added thereto, and this is followed by bit truncation of the lower four bits. This completes the calculation of the RC*, GC*, BC*data and the RD*, GD*, BD*data.
The (2+1×2) compressed data DCMP3 is finally generated by attaching the compression process identification data and the pattern recognition data to the R, G, and B representative values, the β comparison data, the magnitude relation data, the RC*, GC*, BC*data, the RD*, GD*, and BD*data which are generated as described above.
Next, a description is given of data processing in the decompression process of the (2+1×2) compressed data DCMP3 with reference to
First, a description is given of the decompression process for pixels A and B (which are highly correlated). In the decompression process for pixels A and B, an inverse quantization process using a dither value is performed on the R representative value, G representative value and B representative value. More specifically, a left shift is first performed on the R representative value, G representative value and B representative value. The numbers of bits of the left shift performed on the R representative value and G representative value respectively depend on the magnitude relation between the differences |RA−RB| and the threshold value β and the magnitude relation between the differences |GA−GB| and the threshold value β, which are described in the β comparison data. When the difference |RA−RB| between the R data is larger than the threshold value β, a left shift of three bits is performed on the R representative value; otherwise a left shift of two bits is performed. Similarly, when the difference |GA−GB| between the R data is larger than the threshold value β, a left shift of three bits is performed on the G representative value; otherwise a left shift of two bits is performed. Additionally, a left shift of three bits is performed on the B representative value, independently of the β comparison data.
This is followed by subtracting a dither value from the left-shifted R representative value, G representative value and B representative value. In the present example, the dither value is calculated from the block coordinates xBLK′ and yBLK′ of the decompression target block. The dither value may be calculated, for example, as the lower four bits of the pseudo-random number V0′ or V1′ calculated in accordance with expression (6a) or (6b) on the basis of the coordinates of one of pixels A and B (which are highly correlated). Illustrated in
The value obtained by performing the above-described inverse quantization process (the left shift and subtraction of the dither value) on the R representative value may be hereinafter referred to as the inverse-quantized R representative value. Similarly, the value obtained by performing the above-described inverse quantization process on the G representative value may be hereinafter referred to as the inverse-quantized G representative value and the value obtained by performing the above-described inverse quantization process on the B representative value may be hereinafter referred to as the inverse-quantized B representative value.
The R, G, and B data of pixels A and B are reproduced from the inverse-quantized R representative value, inverse-quantized G representative value and inverse-quantized B representative value.
The β comparison data and the magnitude relation data are used in the reproduction of the R data of pixels A and B. When the β comparison data describes that the difference |RA−RB| between the R data is larger than the threshold value β, the value obtained by adding a constant value (for example, five) to the inverse-quantized R representative value is reproduced as the R data of the pixel which is described as having the larger R data in the magnitude relation data, and the value obtained by subtracting the constant value from the inverse-quantized R representative value is reproduced as the R data of the other pixel which is described as having the smaller R data in the magnitude relation data. When the difference |RA−RB| between the R data is smaller than the threshold value β, on the other hand, the R data of pixels A and B are both reproduced as a value identical to the inverse-quantized R representative value.
A similar process is performed for the reproduction of the G data of pixels A and B, using the β comparison data and the magnitude relation data. In the reproduction of the B data of pixels A and B, on the other hand, the B data of pixels A and B are both reproduced as a value identical to the inverse-quantized B representative value, independently of the β comparison data and the magnitude relation data.
This completes the reproduction of the R data, G data and B data of pixels A and B.
In the decompression process for pixels C and D (which are poorly correlated with each other), on the other hand, a similar inverse quantization process to the decompression process of the (1×4) compressed data DCMP2 is performed. In the decompression process for pixels C and D, a left shift of four bits is first performed on each of the RC*data, GC*data, BC*data, RD*data, GD*data, and BD*data. This is followed by subtracting the dither values E2′ and E3′ to reproduce the R, G, and B data of pixels C and D.
The reproduction of the image data of all of pixels A to D of the decompression target block, that is, the decompression of the (2+1×2) compressed data DCMP3 is completed through the above-described procedure.
4. (2×2) Compression and Decompression Processes
The compression process identification data indicate the used compression process and three bits are allocated to the compression process identification data in the (2×2) compressed data DCMP4. In the present example, the value of the compression process identification data of the (2×2) compressed data DCMP4 is “110”.
The pattern recognition data is a 2-bit data indicating which two of pixels A to D are highly correlated. When the (2×2) compression process is used, two of pixels A to D (referred to as the first pixel pair, hereinafter) are highly correlated, and the other two pixels (referred to as the second pixel pair, hereinafter) are highly correlated. Accordingly, the number of possible combinations of highly-correlated two pixels is three as follows:
Pixels A and B are highly correlated, and pixels C and D are highly correlated.
Pixels A and C are highly correlated, and pixels B and D are highly correlated.
Pixels A and D are highly correlated, and pixels B and C are highly correlated.
The R representative value #1, G representative value #1, and B representative value #1 are values representing the R data, G data, and B data of the two pixels of the first pixel pair, and the R representative value #2, G representative value #2, and B representative value #2 are values representing the R data, G data, and B data of the two pixels of the second pixel pair. In the example of
The β comparison data indicates whether the difference between the R data of the highly-correlated two pixels, the difference between the G data of the highly-correlated two pixels, and the difference between the B data of the highly-correlated two pixels are larger than the predetermined threshold value β. In the present example, the β comparison data is a 6-bit data in which three bits are allocated to each of the first and second pixel pairs. On the other hand, the magnitude relation data indicates which of the two highly-correlated pixels has the larger R data, which of the two highly-correlated pixels has the larger G data, and which of the two highly-correlated pixels has the larger B data for each of the first and second pixels pairs. For each of the first and second pixel pairs, the magnitude relation data associated with the R data is generated only when the difference between the R data of the two pixels of the pixel pair is larger than the threshold value β. Correspondingly, for each of the first and second pixel pairs, the magnitude relation data associated with the G data is generated only when the difference between the G data of the two pixels of the pixel pair is larger than the threshold value β. The magnitude relation data associated with the B data is generated only when the difference between the B data of the two pixels of the pixel pair is larger than the threshold value β. Accordingly, the magnitude relation data is a 0- to 6-bit data.
In the following, a description is given of data processing in the (2×2) compression process with reference to
The average values of the R data, G data and B data are first calculated for each of the first and second pixel pairs. In detail, the average values Rave1, Gave1, and Bave1 of the R data, G data, and B data of pixels A and B, and the average values Rave2, Gave2, and Bave2 of the R data, G data, and B data of pixels C and D are calculated in accordance with the following equations:
Rave1=(RA+RB+1)/2,
Gave1=(GA+GB+1)/2,
Bave1=(BA+BB+1)/2,
Rave2=(RC+RD+1)/2,
Gave2=(GC+GD+1)/2, and
Bave2=(BC+BD+1)/2.
Furthermore, the difference |RA−RB| between the R data of pixels A and B, the difference |GA−GB| between the G data and the difference |BA−BB| between the B data are then compared with the predetermined threshold value β. Similarly, the difference |RC−RB| between the R data of pixels C and D, the difference |GC−GB| between the G data and the difference |BC−BD| between the B data are compared with the predetermined threshold value β. The β comparison data is generated to describe the results of these comparisons and incorporated into the (2×2) compressed data DCMP4.
Furthermore, the magnitude relation data are generated for each of the first pixel pair (pixels A and
B) and the second pixel pair (pixels C and D). The generated magnitude relation data is incorporated into the (2×2) compressed data DCMP4.
In detail, when the difference |RA−RB| between the R data of pixels A and B is larger than the threshold value β, the magnitude relation data is generated to describe which of pixels A and B has the larger R data. When the difference |RA−RB| between the R data of pixels A and B is equal to or smaller than the threshold value β, the magnitude relation data is generated so as not to describe the magnitude relation between the R data of pixels A and B. Similarly, when the difference |GA−GB| between the G data of pixels A and B is larger than the threshold value β, the magnitude relation data is generated to describe which of pixels A and B has the larger G data. When the difference |GA−GB| between the G data of pixels A and B is equal to or smaller than the threshold value β, the magnitude relation data is generated so as not to describe the magnitude relation between the G data of pixels A and B. In addition, when the difference |BA−BB| between the B data of pixels A and B is larger than the threshold value β, the magnitude relation data is generated to describe which of pixels A and B has the larger B data. When the difference |BA−BB| between the B data of pixels A and B is equal to or smaller than the threshold value β, the magnitude relation data are generated so as not to describe the magnitude relation between the B data of pixels A and B.
Correspondingly, when the difference |RC−RD| between the R data of pixels C and D is larger than the threshold value β, the magnitude relation data is generated to describe which of pixels C and D has the larger R data. When the difference |RC−RD| between the R data of pixels C and D is equal to or smaller than the threshold value β, the magnitude relation data are generated so as not to describe the magnitude relation between the R data of pixels C and D. Similarly, when the difference |GC−GD|between the G data of pixels C and D is larger than the threshold value β, the magnitude relation data is generated to describe which of pixels C and D has the larger G data. When the difference |GC−GD| between the G data of pixels C and D is equal to or smaller than the threshold value β, the magnitude relation data are generated so as not to describe the magnitude relation between the G data of pixels C and D. Finally, when the difference |BC−BD| between the B data of pixels C and D is larger than the threshold value β, the magnitude relation data is generated to describe which of pixels C and D has the larger B data. When the difference |BC−BD| between the B data of pixels C and D is equal to or smaller than the threshold value β, the magnitude relation data is generated so as not to describe the magnitude relation between the B data of pixels C and D.
Furthermore, the R representative value #1, G representative value #1, B representative value #1, R representative value #2, G representative value #2, and B representative value #2 are calculated by performing a quantization process on the average values Rave1, Gave1, and Bave1 of the R, G, and B data of pixels A and B and the average values Rave2, Gave2, and Bave2 of the R, G, and B data of pixels C and D.
In the quantization process of the average values Rave1, Gave1, and Bave1, a dither value is added to the average values Rave1, Gave1, and Bave1 of the R, G, and B data of pixels A and B. In the present example, the dither value is calculated from the block coordinates xBLK and yBLK of the compression target block. The dither value used in the quantization process of the average values Rave1, Gave1, and Bave1 may be calculated as the lower four bits of the pseudo-random number V0 or V1 calculated from expression (3a) or (3b) by using the coordinates of one of pixels A and B. In the present example, a description is given with an assumption that the dither value E0 calculated from the coordinates of pixel A is used in the quantization process of the average values Rave1, Gave1, and Bave1 and the dither value E0 is calculated as “0”.
Similarly, a dither value is added to the average values Rave2, Gave2, and Bave2 of the R, G, and B data of pixels C and D in the quantization process of the average values Rave2, Gave2, and Bave2. This dither value is also calculated from the block coordinates xBLK and yBLK of the compression target block. The dither value used in the quantization process performed on the average values Rave2, Gave2, and Bave2 may be calculated, for example, as the lower four bits of the pseudo-random number V2 or V3 calculated in accordance with expression (3c) or (3d) by using the coordinates of one of pixels C and D. In the present example, the dither value E2 calculated from the coordinates of pixel C is used in the quantization process of the average values Rave2, Gave2, and Bave2 and the dither value E2 is calculated as “10”.
This is followed by performing rounding or bit truncation on the average values Rave1, Gave1, and Bave1, Rave2, Gave2, and Bave2 with the dither values added thereto to calculate the R representative values, G representative values, and B representative values. As for pixels A and B, the value which is added in the rounding process and the number of bits truncated in the bit truncation process is selected between two bits and three bits, depending on the magnitude relation between the difference |RA−RB| and the threshold value β, the magnitude relation between the difference |GA−GB| and the threshold value β, and the magnitude relation between the difference |BA−BB| and the threshold value β. When the difference |RA−RB| between the R data of pixels A and B is larger than the threshold value β, a value of four is added to the average value Rave1 of the R data, and then the lower three bits are truncated from the average value Rave1 to thereby calculate the R representative value #1. Otherwise, a value of two is added to the average value Rave1 and then the lower two bits are truncated from the average value Rave1 to thereby calculate the R representative value #1. As a result, the R representative value #1 is obtained as a 5-bit or 6-bit data. The same goes for the G data and B data. When the difference |GA−GB| between the G data of pixels A and B is larger than the threshold value β, a value of four is added to the average value Gave1 of the G data, and then the lower three bits are truncated from the average value Gave1 to thereby calculate the G representative value #1. Otherwise, a value of two is added to the average value Gave1 and then the lower two bits are truncated from the average value Gave1 to thereby calculate the G representative value #1. Furthermore, when the difference |BA−BB| between the B data of pixels A and B is larger than the threshold value β, a value of four is added to the average value Bave1 of the B data and then the lower three bits are truncated from the average value Bave1 to thereby calculate the B representative value #1. Otherwise, a value of two is added to the average value Bave1 and then the lower two bits are truncated from the average value Bave1 to thereby calculate the B representative value #1.
A similar process is performed for the pair of pixels C and D to calculate the R representative value #2, G representative value #2 and B representative value #2. It should be noted however that for the G data of pixels C and D, the value which is added in the rounding process and the number of bits truncated in the bit truncation process are one bit or two bits. When the difference |GC−GC| between the G data of pixels C and D is larger than the threshold value β, a value of two is added to the average value Gave2 of the G data, and then the lower two bits are truncated from the average value Gave2 to thereby calculate the G representative value #2. Otherwise, a value of one is added to the average value Gave2 and then the lower one bit is truncated from the average value Gave2 to thereby calculate the G representative value #2.
The above-described procedure completes the (2×2) compression process.
Next, a description is given of data processing in the decompression process of the (2×2) compressed data DCMP4 with reference to
In the decompression process performed on the (2×2) compressed data DCMP4, an inverse quantization process using a dither value is performed on the R representative value #1, G representative value #1 and B representative value #1.
More specifically, a left shift is first performed on the R representative value #1, G representative value #1, and B representative value #1. The number of bits of the left shift depends on the magnitude relations between the threshold value β and the differences |RA−RB|, |GA−GB|, and |BA−BB| of the R data, G data and B data of pixels A and B, which are described in the β comparison data. When the difference |RA−RB| between the R data of pixels A and B is larger than the threshold value β, a left shift of three bits is performed on the R representative value #1, and otherwise a left shift of two bits is performed on the R representative value #1. Similarly, when the difference |GA−GB| between the G data of pixels A and B is larger than the threshold value β, a left shift of three bits is performed on the G representative value #1, and otherwise a left shift of two bits is performed on the G representative value #1. Furthermore, when the difference |BA−BB| between the B data of pixels A and B is larger than the threshold value β, a left shift of three bits is performed on the B representative value #1, and otherwise a left shift of two bits is performed on the B representative value #1.
A similar left shift is performed on the R representative value #2, the G representative value #2 and the B representative value #2. It should be noted however that the number of bits of the left shift of the G representative value #2 is selected between one bit and two bits. When the difference |GC−GD| between the G data of pixels C and D is larger than the threshold value β, a left shift of two bits is performed on the G representative value #2, and otherwise a left shift of one bit is performed on the G representative value #2.
This is followed by subtracting dither values from the left-shifted R representative value #1, G representative value #1, B representative value #1, R representative value #2, G representative value #2 and B representative value #2. In the present example, the dither values are calculated from the block coordinates xBLK′ and yBLK′ of the decompression target block. The dither value used in the inverse quantization process of the R representative value #1, G representative value #1, B representative value #1 associated with pixels A and B may be calculated, for example, as the lower four bits of the pseudo-random number V0′ or V1′ calculated in accordance with expression (6a) or (6b) by using the coordinates of one of pixels A and B. Illustrated in
The values obtained by performing the above-described inverse quantization process (left shift and subtraction of the dither value) on the R representative value #1, G representative value #1, B representative value #1 may be hereinafter referred to as inverse-quantized R representative value #1, inverse-quantized G representative value #1, and inverse-quantized B representative value #1, respectively. Similarly, the values obtained by performing the above-described inverse quantization process (left shift and subtraction of the dither value) on the R representative value #2, G representative value #2, B representative value #2 may be hereinafter referred to as inverse-quantized R representative value #2, inverse-quantized G representative value #2, and inverse-quantized B representative value #2, respectively.
The R, G, B data of pixels A and B are reproduced from the inverse-quantized R representative value #1, inverse-quantized G representative value #1, and inverse-quantized B representative value #1 and the R, G, B data of pixels C and D are reproduced from the inverse-quantized R representative value #2, inverse-quantized G representative value #2, and inverse-quantized B representative value #2.
The β comparison data and the magnitude relation data are used in the reproduction of the R, G, and B data of each pixel. When the β comparison data describes that the difference |RA−RB| between the R data of pixels A and B is larger than the threshold value β, the value obtained by adding a constant value (for example, five) to the inverse-quantized R representative value #1 is reproduced as the R data of one of pixels A and B, which is described as having the larger R data in the magnitude relation data, and the value obtained by subtracting the constant value from the inverse-quantized R representative value #1 is reproduced as the R data of the other one, which is described as having the smaller R data in the magnitude relation data. When the difference |RA−RB| between the R data of pixels A and B is smaller than the threshold value β, the R data of pixels A and B are both reproduced as the value identical to the inverse-quantized R representative value #1. The G and B data of pixels A and B, and the R, G, and B data of pixels C and D are also reproduced through a similar procedure.
The reproduction of the R data, G data and B data of pixels A to D of the decompression target block, that is, the decompression of the (2×2) compressed data DCMP4 is completed through the above-described procedure.
5. (4×1) Compression and Decompression Processes
In the present example, as illustrated in
The compression process identification data indicates the used compression process and four bits are allocated to the compression process identification data in the (4×1) compressed data DCMP5. In the present example, the value of the compression process identification data of the (4×1) compressed data DCMP5 is “1110”.
The minimum value data Ymin, the luminance difference data Ydist0 to Ydist3, the address data Yaddress, and the averaged color difference data Cb′ and Cr′ are obtained through converting the R, G, and B data of pixels A to D into YUV data through YUV conversion, and performing a compression process on the YUV data. As described above, the minimum value data Ymin and the luminance difference data Ydist0 to Ydist3 are obtained from the luminance data of the YUV data of the four pixels and the averaged color difference data Cb′ and Cr′ are obtained from the color difference data of the YUV data. Ymin, three of Ydist0 to Ydist3 and Cb′ and Cr′ are representative values of pixels A to D. In the present example, 10 bits are allocated to the minimum value data Ymin, four bits are allocated to each of the luminance difference data Ydist0 to Ydist3, two bits are allocated to the address data Yaddress and 10 bits are allocated to each of the averaged color difference data Cb′ and Cr′.
Next, a description is given of data processing in the (4×1) compression process with reference to
This is followed by generating the minimum value data Ymin, the luminance difference data Ydist0 to Ydist3, the address data Yaddress, and the averaged color difference data Cb′ and Cr′ from the luminance data Y and color difference data Cr and Cb of pixels A to D.
The minimum value data Ymin is determined as the smallest one of the luminance data Y0 to Y3 of pixels A, B, C, and D. When the luminance data Y0 is the smallest of the luminance data Y0 to Y3, the minimum value Ymin is determined as being equal to the luminance data Y0.
The averaged color difference data Cb′ is calculated by calculating the sum of the color difference data Cb of pixels A, B, C, and D and truncating the lower two bits of the calculated sum (that is, dividing the sum by four). Similarly, the averaged color difference data Cr′ is calculated by calculating the sum of the color difference data Cr of pixels A, B, C, and D and truncating the lower two bits of the calculated sum (that is, dividing the sum by four).
The luminance difference data Ydist0 to Ydist3 are calculated by performing a quantization process on the differences respectively obtained by subtracting the minimum value data Ymin from the luminance data Y0 to Y3, the quantization process using the dither values E0 to E3. More specifically, the luminance difference data Ydist0 to Ydist3 are calculated as follows:
The luminance difference data Ydist0 is calculated by calculating the difference Y0−Ymin obtained by subtracting the minimum value data Ymin from the luminance data Y0 and performing a quantization process which involves calculating the sum of the difference Y0−Ymin and the dither value E0 and truncating the lower six bits of the obtained sum Y0−Ymin+E0. In other words, the luminance difference data Ydist0 is calculated in accordance with the following expression (9a):
Ydist0=(Y0−Ymin+E0)>>6. (9a)
Similarly, the luminance difference data Ydist1 to Ydist3 are calculated in accordance with the following expressions (9b) to (9d):
Ydist1=(Y1−Ymin+E1)>>6, (9b)
Ydist2=(Y2−Ymin+E2)>>6, and (9c)
Ydist3=(Y3−Ymin+E3)>>6. (9d)
The dither value E0, which is associated with pixel A, is generated as lower eight bits of a pseudo-random number V0 generated by using as seed values the coordinates xA and yA of pixel A of the compression target block (for example, the pseudo-random number V0 generated in accordance with the above-described expression (3a)). It should be noted that the coordinates xA and yA of pixel A can be determined from the block coordinates xBLK and yBLK of the compression target block. Similarly, the dither value E1, which is associated with pixel B, is generated as lower eight bits of a pseudo-random number V1 generated by using as seed values the coordinates xB and yB of pixel B of the compression target block (for example, the pseudo-random number V1 generated in accordance with the above-described expression (3b)). Furthermore, the dither value E2, which is associated with pixel C, is generated as lower eight bits of a pseudo-random number V2 generated by using as seed values the coordinates xC and yC of pixel C of the compression target block (for example, the pseudo-random number V2 generated in accordance with the above-described expression (3c)). Finally, the dither value E3, which is associated with pixel D, is generated as lower eight bits of a pseudo-random number V3 generated by using as seed values the coordinates xD and yD of pixel D of the compression target block (for example, the pseudo-random number V3 generated in accordance with the above-described expression (3d)).
The (4×1) compressed data DCMP5 includes three of the luminance difference data Ydist0 to Ydist3, which are calculated from three of the luminance data Y0 to Y3 other than the smallest one of the luminance data Y0 to Y3. When the luminance data Y0 is the smallest of the luminance data Y0 to Y3, The (4×1) compressed data DCMP5 includes the luminance difference data Ydist1 to Ydist3 (other than the luminance difference data Ydist0).
The address data Yaddress is generated as a data which indicates the pixel having the smallest luminance data of pixels A to D (that is, the data which indicates which of the luminance data Y0 to Y3 is the smallest). When the luminance data Y0 is the smallest of the luminance data Y0 to Y3, for example, the address data Yaddress is generated to include information indicating that the luminance data Y0 associated with pixel A is the smallest.
The (4×1) compressed data DCMP5 is generated to incorporate the thus-generated minimum value data Ymin, averaged color difference data Cb′, Cr′, three of the luminance difference data Ydist0 to Ydist3, and address data Yaddress. This completes the (4×1) compression process.
Next, a description is given of data processing in the decompression process of the (4×1) compressed data DCMP5. First, the luminance data Y0′, Y1′, Y2′, and Y3′ of pixels A, B, C, and D of the decompression target block are reproduced from the minimum value data Ymin, three of the luminance difference data Ydist0 to Ydist3 and address data Yaddress, which are included in the (4×1) compressed data DCMP5.
First, the minimum value data Ymin included in the (4×1) compressed data DCMP5 is determined as the luminance data of the pixel indicated by the address data Yaddress. When the address data Yaddress indicates that the luminance data of pixel A is the smallest, the minimum data Ymin is determined as the luminance data Y0′ of pixel A. When the address data Yaddress indicates that the luminance data of a different pixel is the smallest, the luminance data of the different pixel is determined in a similar manner.
The luminance data of the remaining three pixels are reproduced from the minimum value data Ymin and data obtained by performing an inverse quantization process using dither values on the three luminance difference data included in the (4×1) compressed data DCMP5 (three of the luminance difference data Ydist0 to Ydist3).
More specifically, the luminance data of the remaining three pixels are calculated in accordance with the three expressions associated with the remaining three pixels of the following expressions (10a) to (10d):
Y0′=Ydist0<<m−E0′+Ymin, (10a)
Y1′=Ydist1<<m−E1′+Ymin, (10b)
Y1′=Ydist2<<m−E2′+Ymin, and (10c)
Y3′=Ydist3<<m−E3′+Ymin, (10d)
where expressions (10a), (10b), (10c) and (10d) are used for calculating the luminance data Y0′, Y1′, Y2′ and Y3′, respectively. The operator “<<m” in expressions (10a) to (10d) is an operator indicating a left shift of m bits.
When the address data Yaddress indicates that the luminance data of pixel A is the smallest, for example, the (4×1) compressed data DCMP5 includes the luminance difference data Ydist1 to Ydist3 and the luminance data Y1′, Y2′, and Y3′ of pixels B, C and D (the pixels other than pixel A) are reproduced in accordance with expressions (10b) to (10d). When the address data Yaddress indicates that the luminance data of a different pixel is the smallest, the luminance data of the remaining three pixels are reproduced in a similar manner.
The dither value E0′ associated with pixel A is generated as the lower eight bits of a pseudo-random number V0′ generated using the coordinates xA′ and yA′ of pixel A of the decompression target block as seed values (for example, the pseudo-random number V0′ generated in accordance with the above-described expression (5a)). It should be noted that the coordinates xA′ and yA′ of pixel A of the decompression target block can be determined from the block coordinates xBLK′ and yBLK′ of the decompression target block. Similarly, the dither value E1′ associated with pixel B is generated as the lower eight bits of a pseudo-random number V1′ generated using the coordinates xB′ and yB′ of pixel B of the decompression target block as seed values (for example, the pseudo-random number V1′ generated in accordance with the above-described expression (5b)). Furthermore, the dither value E2′ associated with pixel C is generated as the lower eight bits of a pseudo-random number V2′ generated using the coordinates xC′ and yC′ of pixel C of the decompression target block as seed values (for example, the pseudo-random number V2′ generated in accordance with the above-described expression (5c)). Finally, the dither value E3′ associated with pixel D is generated as the lower eight bits of a pseudo-random number V3′ generated using the coordinates xD′ and yD′ of pixel D of the decompression target block as seed values (for example, the pseudo-random number V3′ generated in accordance with the above-described expression (5d)).
The above-described processing achieves reproduction of the luminance data Y0′ to Y3′ of pixels A to D of the decompression target block.
On the other hand, the averaged color difference data Cb′ and Cr′ included in the (4×1) compressed data DCMP5 are used as the color difference data Cb and Cr for all of pixels A to D without change.
This is followed by generating decompressed image data DIMG5′ by performing YCbCr-RGB conversion on the luminance data Y0′ to Y3′ and the color difference data (that is, the averaged color difference data Cb′ and Cr′) of pixels A to D. In the present example, The R, G, and B data of the image data DA′, DB′, DC′, and DD′ associated with pixels A, B, C, and D of the decompression target block are reproduced through the YCbCr-RGB conversion in accordance with the above-described expressions (8a) to (8d). As described above, RA′, GA′, and BA′ in expressions (8a) to (8d) are R, G, and B data included in the image data DA′ associated with pixel A, RB′, GB′, and BB′ are R, G, and B data included in the image data DB′ associated with pixel B, RC′, GC′, and BC′ are R, G, and B data included in the image data DC′ associated with pixel C and RD′, GD′, and BD′ are R, G, and B data included in the image data DD′ associated with pixel D.
The above-described procedure completes reproduction of the R, G, and B data of pixels A to D of the decompression target block, that is, decompression of the (4×1) compressed data DCMP5.
Although embodiments and examples of the present disclosure have been described in the above, the present invention must not be construed as being limited to the above-described embodiments and examples. A person skilled in the art would appreciate that the present invention may be implemented with various modifications.
Number | Date | Country | Kind |
---|---|---|---|
2016096958 | May 2016 | JP | national |