In general, digital images require significant memory for storage and require significant time and bandwidth for transmission. Digital images are often compressed to reduce storage requirements and to reduce transmission time and bandwidth. There are lossless compression techniques and lossy techniques. Typically, when a guaranteed compression ratio is needed then lossy techniques are used. There are many lossy compression algorithms. Many of those algorithms require a substantial amount of time and processor power, both to compress and to decompress. For example, some lossy compression algorithms are based on computation extensive transforms such as Fast Fourier Transform, Discrete Cosine Transform, or Wavelet Transforms.
In an example, a system includes a controller configured to: obtain palette keys for an image; and, for each of a plurality of sub-blocks of the image, obtain a compressed set of palette keys responsive to gradient analysis and entropy analysis. The system also includes a spatial light modulator coupled to the controller and configured to project an image based on the palette keys and the compressed set of palette keys.
In another example, a controller includes: a processor; and memory coupled to or included with the processor. The memory stores compression instructions that, when executed, cause the processor to: obtain an image; perform parent-child cluster compression on initial pixel colors of the image to obtain palette keys; for each of a plurality of sub-blocks of the image, obtain a compressed set of palette keys responsive to gradient analysis and entropy analysis; and output a compressed image based on the palette keys and the compressed set of palette keys.
In yet another example, a method includes: obtaining, by a controller, the image; performing, by the controller, parent-child cluster compression on initial colors of the image to obtain palette keys; for each of a plurality of sub-blocks of the image, obtain a compressed set of palette keys responsive to gradient analysis and entropy analysis; and outputting, by the controller, a compressed image based on the palette keys and the compressed set of palette keys.
The same reference numbers or other reference designators are used in the drawings to designate the same or similar features. Such features may be the same or similar either by function and/or structure.
Parent-child cluster (PCC) compression, as described herein, utilizes a clustering technique to reduce the dimensionality of the data. Because most red-green-blue (RGB) data in a localized region of an image or video is naturally clustered, the PCC compression technique produces little to no observable loss of information. PCC compression stays entirely in the spatial domain, so the compute load requirements are much lower than algorithms that use transform encoding techniques, which translates to lower power consumption. Also, decompression of PCC compression encoded images uses a look-up table (LUT). The LUT may store pixel key assignments, where the key determines the appropriate palette or cluster centroid to which a pixel is assigned.
In some examples, the PCC compression reduces quantization error among clustered pixels. Pixels are grouped into clusters based on their location in RGB space. The initial clusters are known as parents. Some or all of these parent clusters are then split into smaller clusters known as child clusters. Also, PCC compression incorporates a key encoding scheme that is tailored to the human visual system, providing high fidelity in low entropy regions and high dynamic range in high entropy regions.
In some examples, PCC compression takes pixels that make up an original image or part of an original image and maps those pixels in RGB space. Then, PCC compression groups those pixels into various clusters, based on the pixels' locations in RGB space. After the pixels have been grouped into clusters, the pixels in a given cluster are each represented by a single RGB value, which is located at the centroid of the given cluster. Additional steps are performed during compression and decompression to further improve the results of PCC compression. In some examples, PCC compression produces a compressed version of an original image.
In some examples, PCC compression is part of a recursive compression process. In some examples, the recursive compression process may include PCC compression, palette key compression for sub-blocks of an image based on gradient analysis and entropy analysis, extension of palette key compression for one sub-block of an image to other sub-blocks, and/or other compression options. The compression techniques described herein compress data in RGB space to produce a compressed image. However, other suitable types of data can be compressed using the techniques herein. In some examples, the recursive compression process described herein compresses a collection of N objects to a number less than N by analyzing an error metrics. In such examples, the objects are RGB pixels and the error metric may be maximum absolute distance (described below), but other objects and other error metrics are useful in other examples.
In the example of
Interleaving all blocks in a single pipeline can present some limitations, as the single pipeline becomes a bandwidth bottleneck. Duplicating the pipeline increases bandwidth, but at the cost of logic area. In an example, the processing, buffering, and control logic are bundled into a PCC engine. A processing system can include multiple processing engines. The number of processing engines and interleaving factor can be varied to ensure that an available recursive compression bandwidth is in line with the recursive compression bandwidth used by the recursive compression tasks being performed. In one example, eight processing engines could be used, with each processing engine interleaving 32 blocks.
The memory 112 can include read-only-memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), flash memory, and/or other non-transitory computer readable memory types. In some examples, the memory 112 store recursive compression instructions 114, analysis data 116, and frame buffer data 118. The memory 112 may also store image data, pixel data, and any other data used by processor 110 to perform recurve compression operations or results. In some examples, the memory 112 may store a key for each pixel of an image, where the key denotes the palette to which each pixel is assigned. In some examples, the memory 112 is configured to store a control bit for a sub-block of pixels, where the control bit indicates a type of encoding for the sub-block.
As shown, the first input 104 of the controller 102 receives video input. The second input 106 of controller 102 receives configuration data. The first output 108 of controller 102 is coupled to the input 122 of the light source 120. The second output 109 of controller 102 is coupled to the input 130 of the spatial light modulator 128. The optical output 124 of the light source 120 is coupled to optical input 132 of the spatial light modulator 128. The optical output 134 of the spatial light modulator 128 provides a projected video 136.
In some examples, controller 102 is configured to: receive video at its first input 104; receive configuration at its second input 106; provide a first control signal (CS1) at its first output 108 responsive to the video and the configuration data; and provide a second control signal (CS2) at its second output 109 responsive to the video and the configuration data. In some examples, the configuration data includes a video resolution configuration, a high-frequency sampling order, and/or other configuration options. In some examples, CS1 is a light intensity control signal for the light source 120. The light source 120 is configured to provide light 126 at its optical output 124 responsive to CS1. In some examples, CS2 includes a compressed image for the spatial light modulator 128. In some examples, the spatial light modulator 128 is configured to provide a projected video 136 responsive to the light 126 and CS2.
In some examples, the processor 110 determines CS2 based on recursive compression of images of the video. Such recursive compression of images of the video is based on instructions and data stored in the memory 112. Example instructions and data of the memory 112 include the recursive compression instructions 114, the analysis data 116, and the frame buffer data 118.
In some examples, execution of the recursive compression instructions 114 results in the analysis data 116 (e.g., PCC analysis data, gradient analysis data, entropy analysis data). The analysis data 116 is stored and analyzed during each iteration of the processor 110 executing the recursive compression instructions 114. In some examples, the final results of the recursive compression instructions 114 may include compressed palette keys and/or other data used to encode the frame buffer data 118. In some examples CS2 includes or is based on the frame buffer data 118. In some examples, recursive compression operations are performed by another integrated circuit (IC) (e.g., an upstream IC such as the IC 152 in
In some examples, a system includes a controller (e.g., the controller 102 or its related processor 110); and a spatial light modulator (e.g., the spatial light modulator 128) coupled to the controller. The controller is configured to (e.g., by execution of the recursive compression instructions 114): obtain palette keys for an image; and, for each of a plurality of sub-blocks of the image, obtain a compressed set of palette keys responsive to gradient analysis and entropy analysis. The spatial light modulator is configured to project an image based on the palette keys and the compressed set of palette keys.
In some examples, the controller is further configured to perform gradient analysis for each sub-block by: sampling the palette keys along each of a plurality of gradients; obtaining an interpolation result for each of the sampled palette keys and respective gradients; and determining a gradient direction of interpolation results that minimizes an error metric. In some examples, the controller is further configured to determine the error metric based on a sum of absolute difference of interpolation results along a gradient relative to the palette keys. In some examples, the controller is further configured to determine the error metric based on a maximum absolute difference of interpolation results along a gradient relative to the palette keys.
In some examples, the controller is further configured to perform entropy analysis for each sub-block by: identifying areas along the gradient direction having an entropy below a threshold as low-entropy areas; and identifying areas along the gradient direction having an entropy above the threshold as high-entropy areas. In some examples, the controller is further configured to: apply the palette keys to the high-entropy areas; and apply the compressed set of palette keys to the low-entropy areas, the compressed set of palette keys based on a first set of bits that identify colors of the compressed set of palette keys, a second set of bits that identify a number of colors per sub-block, and a third set of bits that identify the gradient direction.
In some examples, the controller is further configured to obtain the palette keys by: performing parent-child cluster compression on initial pixel colors of the image; and reducing the initial pixel colors to the palette keys responsive to the parent-child cluster compression. In some examples, the controller is configured to selectively apply at least some of the compressed set of palette keys for one of the plurality of sub-blocks to another portion of the image.
In some examples, a controller includes: a processor (e.g., the processor 110); and memory (e.g., the memory 112) coupled to or included with the processor. The memory stores compression instructions (e.g., the recursive compression instructions 114) that, when executed, cause the processor to: obtain an image; perform parent-child cluster compression on initial pixel colors of the image to obtain palette keys; for each of a plurality of sub-blocks of the image, obtain a compressed set of palette keys responsive to gradient analysis and entropy analysis; and output a compressed image based on the palette keys and the compressed set of palette keys.
In some examples, compression instructions, when executed, further cause the processor to perform gradient analysis for each sub-block by: sampling the palette keys along each of a plurality of gradients; obtaining an interpolation result for each of the sampled palette keys and respective gradients; and determining a gradient direction of interpolation results that minimizes an error metric. In some examples, the compression instructions, when executed, further cause the processor to determine the error metric based on a summed absolute difference of interpolation results along a gradient relative to palette keys. In some examples, the compression instructions, when executed, further cause the processor to determine the error metric based on a maximum absolute difference of interpolation results along a gradient relative to the palette keys.
In some examples, compression instructions, when executed, further cause the processor to perform entropy analysis for each sub-block by: identifying areas along the gradient direction having an entropy below a threshold as low-entropy areas; and identifying areas along the gradient direction having an entropy above the threshold as high-entropy areas. In some examples, the compression instructions, when executed, further cause the processor to: apply the palette keys to the high-entropy areas; and apply the compressed set of palette keys to the low-entropy areas, the compressed set of palette keys based on a first set of bits that identify colors of the compressed set of palette keys, a second set of bits that identify a number of colors per sub-block, and a third set of bits that identify the gradient direction.
In some examples, compression instructions, when executed, further cause the processor to obtain the palette keys for the image by determining a nearest cluster for each pixel of the image based on a weighted absolute difference sum. In some examples, the compression instructions, when executed, further cause the processor to obtain the palette keys for the image by: determining a weighted variance for each of a plurality of clusters, the plurality of clusters including parent clusters and child clusters; and selectively splitting clusters based on a weighted variance improvement score that compares the weighted variance of each parent cluster with the average weighted variance of respective child clusters.
In some examples, compression instructions, when executed, further cause the processor to selectively apply at least some of the compressed set of palette keys for one of the plurality of sub-blocks to another portion of the image based on a recursive algorithm that includes: performing parent-child cluster compression based on a target sub-block size to compression ratio; performing palette key re-assignment responsive to the parent-child cluster compression; and applying a key compression that substitutes an initial palette list for the image with pixel data.
include a processor and memory
To find the dimmest pixel, luminance information is calculated for each of the 256 pixels of pixels 308. Luminance is determined for each pixel based on the RGB values of the pixel. Any appropriate formula is useful to determine luminance. After the luminance is determined for each pixel, a suitable minimum calculation is performed to select the pixel with the minimum luminance. Likewise, to find the brightest pixel, a suitable maximum calculation is performed to select the pixel with the maximum luminance.
To find the mean of the data set, a recursive mean calculation is used in one example. The RGB values of each of the pixels 308 can be summed, and then the sum is divided by the number of pixels (e.g., 256) to find the mean RGB value of the entire set of pixels 308. In graph 400, the dimmest pixel is the pixel at location 402 in this example. The brightest pixel is the pixel at location 404. Finally, the “X” near the center of graph 400 is the mean of the data set, and is labeled as location 406. In some examples, location 406 may not be located exactly at the location of one of the 256 pixels of pixels 308, because location 406 represents a mean value for the data set. These three locations (402, 404, 406) are called cluster centroids, or palette centroids. These three locations in RGB space are used as the three initial centroids, respectively, for three initial parent clusters of pixels that are used in PCC compression. In
In some examples, a modified recursive mean calculation for centroids is used minimize compute load. For the modified recursive mean calculation, n=number of pixels assigned to a centroid, nquant=n quantized to a power of 2 value (1, 2, 4, 8, 16, . . . , 1024), and Sn=Sn-1+xn. If (nquant==n), μn=Sn/n (perform divide with a simple binary shift since n is a power of 2). Otherwise, μn=μn-1+(xn−μn-1)/nquant (divide is also just a simple binary shift).
In some examples, PCC compression determines the nearest cluster for each pixel. The nearest cluster may be based on a weighted absolute difference (WAD). In some examples, the WAD sum accounts for human sensitivity to given wavelengths. For example, PCC compression may include determining a nearest cluster for each pixel of the image based on a weighted absolute difference sum calculation that applies different weights to red, green, and blue absolute difference sums. In one example, if Rdiff=abs(Rcentroid−Rpixel), Gdiff=abs(Gcentroid−Gpixel), Bdiff=abs(Bcentroid−Bpixel), then WAD=2*Rdiff+4*Gdiff+1*Bdiff. In this example, abs(Rcentroid−Rpixel) is the red absolute difference sum, abs(Gcentroid−Gpixel) is a green absolute difference sum, abs(Bcentroid−Bpixel) is a blue absolute difference sum, 2 is a weight applied to the red absolute difference sum, 4 is a weight applied to the green absolute difference sum, and 1 is a weight applied to the blue absolute difference sum. In different examples, the weightings for red, green, and blue may vary. As pixels are added, PCC compression recursively adjusts the cluster centroid. PCC compression also traverse pixels in a spatially high frequency manner. In other examples, a nearest cluster may be based on a weighted squared difference. An example weighted squared difference calculation is: WR*Rdiff2+WG*Gdiff2+WG*Bdiff2, where WR is the red weighting, WG is the green weighting, and WB is the blue weighting. In still other examples, a nearest cluster may be based on a maximum weighted difference. An example maximum weighted difference calculation is: max([(WR*Rdiff), (WG*Gdiff), (WB*Bdiff).
R
diff=abs(Rcentroid−Rpixel) (1)
G
diff=abs(Gcentroid−Gpixel) (2)
B
diff=abs(Bcentroid−Bpixel) (3)
DIFF=max(Rdiff,Gdiff,Bdiff) (4)
In the example of graph 600, there are three sample pixels 602, 604, and 606. In other examples, any pixel of the pixels 308 can be selected as the starting pixel. Pixel 602 has an RGB value that denotes its location in RGB space. Centroid 502 also has an RGB value that denotes its location in RGB space. The absolute value of the three differences in the red, green, and blue values between pixel 602 and centroid 502 are computed. For instance, using hypothetical numbers in one example, the difference in the red components is 20 (Rdiff=20), the difference in the green components is 26 (Gdiff=26), and the difference in the blue components is 18 (Bdiff=18). These three difference values are used in the DIFF equation, where the maximum value of the set of (20, 26, 18) is selected. That maximum value is 26. That means the maximum absolute difference between pixel 602 and centroid 502 has a value of 26. That value of 26 is stored and will be used again later in the PCC compression process.
Next, the above calculations are performed twice more to determine the DIFF value for pixel 602 and centroid 506, and to determine the DIFF value for pixel 602 and centroid 504. As seen in graph 600, pixel 602 is farther away from centroids 506 and 504 than from centroid 502. Therefore, these two DIFF values are likely to be higher than 26, which is the DIFF value for pixel 602 and centroid 502. As a hypothetical example, the DIFF value for pixel 602 and centroid 506 is 42, and the DIFF value for pixel 602 and the centroid 504 is 55, as determined by the above equations. Three DIFF values have therefore been determined for pixel 602. The minimum of these three DIFF values (26, 42, 55) is 26, which is the DIFF value for pixel 602 and centroid 502. This means that pixel 602 is closest to centroid 502 of the three centroids, and pixel 602 is then assigned to the cluster that corresponds to centroid 502. The cluster that pixel 602 is assigned to is labeled cluster 610. At the beginning of the process, pixel 602 will be the only pixel assigned to cluster 610. As all 256 pixels in the sub-block 202 are processed, more pixels will be assigned to cluster 610, and also to the other clusters.
In this example, pixel 602 is the first pixel of the 256 pixels in the sub-block 202 that is assigned to a cluster. Before the second pixel is assigned to a cluster (e.g., pixel 604 or pixel 606), the cluster centroid that pixel 602 was assigned to is updated. That is, because pixel 602 has been assigned to cluster 610, the location of centroid 502, which is the centroid of cluster 610, is recalculated. The centroid of cluster 610 is the mathematical center, in RGB space, of all the pixels that have been assigned to cluster 610. As each new pixel is assigned to cluster 610, the location of centroid 502 is updated and will therefore move in RGB space to an updated location. The movement and final location of centroid 502 depends on how many pixels are assigned to cluster 610 and how spread out the pixels are in RGB space. In
After the first pixel, pixel 602, has been assigned to cluster 610 and centroid 502 has been updated, a second pixel from the sub-block 202 is selected and assigned to a cluster using the process described above. For example, pixel 604 has been assigned to cluster 630, as it is determined to be closest to centroid 504 after using the above process. Then a third pixel is selected and processed. As another example, pixel 606 has been assigned to cluster 620, as it is found to be closest to centroid 506 after using the above process. Each of the remaining pixels in the sub-block 202 is then selected and processed using the above-described techniques and assigned to an appropriate cluster, with the centroids (502, 504, 506) of the clusters being updated after each pixel is assigned. The result of assigning the 256 pixels to clusters 610, 620, and 630 is shown in
As each pixel is assigned to a cluster 610, 620, or 630, a running DIFF value is tracked for each cluster. For example, pixel 602 had a minimum DIFF value of 26 as described above, which was used to assign pixel 602 to cluster 610. For each pixel assigned to cluster 610, the sum of the DIFF values for that cluster is computed. The DIFF value of 26 for pixel 602 is added to the DIFF values for all other pixels assigned to cluster 610 and a running total is tracked. Similar running total DIFF values are tracked for clusters 620 and 630. A lower sum of the DIFF values for a cluster indicates a tighter grouping of the pixels that make up that cluster. As a hypothetical example, the DIFF for each cluster are: cluster 610 has DIFF sum=1992; cluster 620 has DIFF sum=2814; and cluster 630 has a DIFF sum=3786.
The next step in PCC compression is to split the clusters into parent and child clusters. In one example herein, clusters are split according to the processes described below until eight clusters result. In other examples, clusters may be split until a different number of clusters is created. “Parent clusters” refers to the original clusters 610, 620, and 630. The second level of clusters that are created as a result of the parent cluster being split are called “child clusters”. In an example herein, a parent cluster produces two child clusters, but in other examples the parent cluster can produce any number of child clusters.
In graph 700, cluster 610 from
If a second pixel is chosen and its closest parent cluster is cluster 610, the second pixel is processed as follows. First, if the second pixel is in the same location as location 702, the second pixel is assigned to child cluster 720. If the second pixel is in a different location than location 702, a second child cluster is created that has a centroid at the location of the second pixel. For example, a pixel at location 708 is the second pixel chosen for processing. Location 708 is at a different location than location 702, so a second child cluster 710 is created with a centroid at location 708. As new pixels are processed that are closest to cluster 610, those new pixels are assigned to either the first child cluster 720 or the second child cluster 710. As those new pixels are assigned to the child clusters, the locations of the centroids of the child clusters are updated as described above. The final locations of the centroids for each of the clusters may not be at a location where a pixel is present. Instead, the centroid is the mathematical center of the pixels that have been assigned to a given cluster.
The other pixels are then processed similarly. The assignment of the pixels to a specific cluster is determined using Equations 1-4 above and the DIFF values, as described with respect to
The process of assigning pixels to clusters and dividing clusters as described above may continue for each pixel of a sub-block, such as the sub-block 202. The first time that a pixel is found to be closest to cluster 620 in
In the example in
In some examples, the next step in the PCC compression process is to determine how much a DIFF score can be improved if a parent cluster is split into its respective child clusters. The DIFF score of the parent clusters is an indication of how dispersed the parent cluster is. A goal of PCC compression is to represent the pixels in a given cluster with a single value, in order to provide compression of the pixel data. Representing pixels with a single value that are close to one another provides a better compression result than representing pixels with a single value that are far apart. Therefore, the DIFF scores are used to break up the clusters that are spread out, in order to create smaller clusters that are more compact, which provides better compression results.
The improvement in DIFF scores that can be attained from breaking up a parent cluster is determined by the DIFF scores of the child clusters of that parent. If the child clusters can reduce the DIFF scores compared to the parent cluster, the results of the compression algorithm can be improved by breaking the parent cluster into its respective child clusters. This improvement is indicated by calculating a DIFF improvement score, which is the parent DIFF value minus the summation of its two (or more) child DIFF values. The DIFF improvement score is an indicator of how the overall compactness of the clusters is affected by splitting a cluster. A higher DIFF improvement score is used to determine which cluster to split to most improve the overall compactness of the clusters. This process of assigning pixels to child clusters and then determining if the child clusters should replace the parent clusters can be performed multiple times in some examples, until a target number of clusters is reached.
For example, cluster 630 has a DIFF value of 3786. Subtracting cluster 630's two child cluster DIFF values from 3786 provides a DIFF improvement score of 1000 (3786−1999−787=1000). Cluster 620 has a DIFF value of 2814. Subtracting cluster 620's two child cluster DIFF values from 2814 provides a DIFF improvement score of 1366 (2814−673−775=1366). Cluster 610 has a DIFF value of 1992. Subtracting cluster 610's two child cluster DIFF values from 1992 provides a DIFF improvement score of 922 (1992−525−545=922). The DIFF improvement scores are then sorted from largest to smallest (e.g., 1366, 1000, 922). The parent clusters are split according to the ordered list of DIFF improvement scores. In this example, splitting cluster 620 yields a DIFF improvement score of 1366, so cluster 620 is split into its two respective child clusters first (child clusters 730 and 740).
Clusters will continue to be split in this manner until one of two conditions is met. The first condition is that the number of clusters reaches a target number. In the example of
For example, cluster 620 is split into its two respective child clusters (730 and 740), as noted above. Cluster 620 had a DIFF value of 2814, and it is replaced with child clusters that have DIFF values of 673 and 775. The next cluster in the sorted list of parent DIFF improvement scores is cluster 630, which has a DIFF of 3786 and can be improved by 1000. Cluster 630 is split into child clusters 750 and 760, which have DIFF scores of 1999 and 787, respectively. At this point, two clusters from
Because there are five clusters at this point, additional splitting iterations will continue until eight clusters is reached. The additional splitting iterations involve repeating the process of assigning pixels to parent cluster and child clusters, and then determining DIFF improvement scores to decide if a cluster should be split, as described above. Some splitting iterations may produce more child clusters than other iterations. In this example, the next cluster in the sorted list of parent DIFF improvement scores is cluster 610, which has a DIFF score of 1992 and a cluster improvement score of 922. However, at this point the second condition described above is met. The DIFF score of 1992 for cluster 610 is less than the DIFF score for one of the child clusters, child cluster 750, which has a DIFF score of 1999. This indicates that the child cluster 750 should be split before the cluster 610 is split.
The splitting process continues as described above until eight clusters are created. For example, child cluster 750 may be split, and the pixels of child cluster 750 may be assigned to the child clusters of the child cluster 750 using the process described above. Pixels are also assigned to the other existing clusters as described above. The process of splitting clusters, assigning pixels to the clusters, and computing DIFF values continues as set forth above until eight clusters are created. The details of the process to go from five clusters to eight clusters is omitted for simplicity.
In some examples, for every cluster, the squared summation of assigned RGB values is tracked and used in cluster variance derivation. In some examples, the cluster variance is calculated as: a σ2=Σ(xn2)/n−(Σxn/n)2=Σ(xn2)/n−μ2, where n is the number of pixels assigned to a cluster, xn are the pixels of the cluster, and μ is the 3-D mean of the pixel when assigned. By using a variance equation, such as the a σ2 equation above, the μ for each pixel is updated each time a new pixel is added to a cluster. In other words, the centroid and μ relative to the centroid is adjusted in responsive to a new pixel being added to a cluster. At the end of an iterative loop, after all pixels have been assigned to a cluster, a weighted variance, WV, is derived for each cluster. In some examples, PCC compression includes: applying a weighted cluster variance calculation that applies different weights to red, green, and blue variances; and reducing the initial pixel colors to the palette keys responsive to the parent-child cluster compression. In some examples, WV is calculated as: WV=2*σred2+4*σgreen2+1*σblue2, where bred is the standard deviation of red in a cluster, σred2 is the variance of red in the cluster, σgreen is the standard deviation of green in the cluster, σgreen2 is the variance of green in the cluster, σblue is the standard deviation of blue in the cluster, σblue2 is the variance of blue in the cluster, 2 is the weight applied to the red variance, 4 is the weight applied to the green variance, and 1 is the weight applied to the blue variance.
In some examples, if the palette list is less than 8 (the maximum length): a WV improvement score is calculated which is the parent WV minus the average of its child clusters' WVs; the improvement scores are sorted from largest to smallest; the palette is split based on the largest improvement score; and the parent cluster is replaced with the 2 child clusters in the palette list. In some examples, repetition of the above steps are performed if the number of palette entries is still less than 8 and: 1) the maximum WV among all the child clusters added to the list is less than the next largest parent WV sum; or 2) this is the 2nd-to-last pass/iteration of the clustering algorithm (4 iterations expected).
As seen in
With diagram 1000, a count of the transitions between pixels from one key to another key can be conducted. A transition from one pixel to another means that the pixels are touching one another along an edge or at a corner. For example, for the pixels assigned to key 5, many transitions occur to either another pixel with key 5, or to pixels with keys 3 and 6. Conversely, diagram 1000 shows that there are not a lot of transitions between pixels with keys 5 and 2. In some examples, a histogram is created that shows the frequency of occurrence of a given transition from one key to another key. That transition information is then used to determine how to smooth out the clustering from one cluster to another.
For example, a process is performed that counts every transition from one pixel to another in the block of 256 pixels shown in diagram 1000. For example, the process begins at the top left corner of diagram 1000 with pixel 1002. Pixel 1002 has a palette key of 5, and touches three other pixels (1004, 1006, and 1008). Pixel 1002 has two transitions to one pixel with a palette key of 5 (pixel 1004) and 2 transitions to pixels with a palette key of 6 (pixels 1006 and 1008). The transitions to pixels with the same palette key do not have to be counted in this process. Therefore, the transitions from palette key 5 to palette key 5 can be ignored, and the transition from palette key 5 to palette key 6 is incremented by 1.
Next, pixel 1004 is analyzed. Pixel 1004 has one transition to palette key 5 (pixel 1010), and two transitions to palette key 6 (pixels 1008 and 1012). The transition to key 5 is ignored, and the transitions from palette key 5 to palette key 6 are incremented by 2 (for a total of 3 transitions between palette keys 5 and 6). In this example, this process continues in order from left to right along the top row of pixels, and the moves to the second row of pixels, and proceeds from left to right along that row. The process continues along each row, from top to bottom, moving through the rows one pixel at a time from left to right.
As another example of the continuing process, pixel 1020 is analyzed. Pixel 1020 has been assigned the palette key of 4. Pixel 1020 has three transitions to palette key 8 (pixels 1022, 1024, and 1026). The transition count from palette key 4 to palette key 8 is incremented by 3. Note that the transitions from pixel 1020 to the pixels in the row above pixel 1020 are not counted, because these two transitions would have already been counted as the process counted the transitions for the two pixels above pixel 1020. The process should not double count any of the transitions between pixels with different keys.
The process for counting transitions can proceed in any order. As one example, the process starts with pixel 1002 and then counts the transitions for every pixel in the first row. Then, the process moves to the second row and counts the transitions for every pixel in the second row. The process proceeds systematically in this manner until all transitions have been counted. As noted above, if a transition between two pixels has been counted, it is not counted again as the process moves pixel by pixel through the diagram.
In some examples, a histogram of palette key transitions is recorded. The palette key transition analysis may be used to determine how to smooth out the clustering from one cluster to another. At this point, a list of eight palette key entries have been created (see
In some examples, the brightness of each palette is calculated and stored. Brightness, or luminance, can be determined using any suitable manner. One example for determining brightness of a palette is shown in equation (5).
Brightness=5*R+9*G+2*B, (5)
where R, G, and B are the RGB values of the location of the palette as shown in
The areas where subtle gradation occur in an image are referred to as low entropy areas. Creating four times as many palettes allows for more subtle gradations in the image. In graph 1100, there are 24 “x” labels, whose locations are based on interpolating between keys 1 through 8 in the sorted list. Three new palettes are placed between each of keys 1 through 8 in the sorted list. However, there are only 7 spaces between keys 1 through 8. Therefore, additional palettes may be added by beyond key 2 and beyond key 8 as shown.
In some examples, new keys are placed in RGB space using bilinear interpolation between existing keys. The next step is to assign pixels to the new keys. Each original pixel in the sub-block 202 is analyzed to determine which of the 32 keys that pixel should be assigned to. For each pixel, the closest palette of the 24 new interpolated palettes is found. The closest palette can be found using the DIFF equations as described above (e.g., equations (1) to (4)). Any other suitable method for determining distance is useful in other examples. After the closest of the 24 new interpolated palettes is found, that distance is compared to the distance between the pixel and the palette it is currently assigned to. If the distance to the interpolated palette is less, the pixel is reassigned to the interpolated palette. If the distance to the interpolated palette is greater than the distance to the currently assigned palette, the pixel remains assigned to its current palette. Each pixel is analyzed in this manner and is either assigned to a new interpolated palette or remains assigned to the original palette the pixel was assigned to.
In one example, mean square error calculations for an image compressed and decompressed are used to determine the reduction in error that can be attained by using 32 palettes rather than eight palettes. One issue created by increasing the number of palettes from eight to 32 is that for every pixel that has been compressed or reduced to a single palette, a key indicates which palette that pixel is assigned to. With eight palettes, that key has one of eight values (0 to 7), and the key is encoded with three bits. If the list of palettes is increased to 32 palettes, the keys have to increase from 3 bits to 5 bits (to encode the values 0 through 31). Therefore, the keys should be compressed as well, or else the storage used for the compressed data set would increase to store the larger keys. In some examples, key compression reduces the amount of storage used with little visible impact on the end result of the PCC compression technique.
In some examples, the amount of data used for storage is three bits per pixel. For each sub-block, a bit is used that indicates whether a high bit encoding or a low bit encoding produces the least error. On the encode side (the compression side), the minimum is calculated, along with the delta and the corresponding key value. Also, the error (if any) is calculated for each key value. For high entropy encoding, the closest palette in the original eight palette list is used and then the error associated with that palette list is determined. Whichever encoding produces the smallest error is used, and a 1-bit control value is set.
Storage requirements can vary based on the type of PCC compression implemented. In some examples, a light compression mode may use a block size for the PCC compression algorithm of 8×8. For the palettes, the storage requirement is eight palettes per color, times ten bits per color, times 3 colors per palette, which equals 240 bits. A 3-bit control is added for 243 bits. For the keys, 3 bits per pixel are used, with 64 pixels per block (192 bits). Sixteen 2×2 sub-blocks are used, with 1 control bit per sub-block (16 bits). Therefore 208 bits are used for keys. The bits per pixel are (243+208)/64 pixels, or 7.046875 bits per pixel.
In some examples, a heavy compression mode may use a block side for the PCC algorithm of 16×16. The palettes again use 243 bits. For the keys, the sub-block increases from 2×2 to 4×4. With that increase, 3 bits per pixel times 256 pixels per block is 768 bits. Added to that is 16 4×4 sub-blocks with 1 control bit per sub-block, for a total of 784 bits. The bits per pixel are (243+784)/256 pixels, or 4.0117 bits per pixel.
In one example, the maximum total storage for heavy compression used to store an Ultra High Definition (UHD) 4K image is (3840×2160 pixels per frame)*(4.0117 bits/pixel)*(1.0625 frames for a rolling buffer)=35.35 Mbits.
In one example, light compression mode produced a resulting peak signal to noise ratio (PSNR) between an original image and a compressed image of 41.9556 dB (decibels), using approximately 7 bits per pixel. A higher PSNR means a better quality for the compressed image. In another example, a heavy compression mode produced a PSNR of 38.4067 dB between the same original image and the compressed image, using approximately 4 bits per pixel. A PSNR in the high 30s to low 40s generally provides high quality results.
In some examples, recursive compression accounts for the Mach Band Effect by performing key compression based on gradient analysis and entropy analysis. The results of gradient analysis and entropy analysis are used to sub-sample keys for low entropy areas along local gradients. In some examples, each sub-block of 4×4 pixels is analyzed to determine the dominant gradient direction. In other examples, the sub-block size may vary. In some examples, 5-bit key (i.e., 32 colors) assignments are analyzed. In other examples, the number of bits for the keys and the related color options. Regardless of the sub-block size and key size, gradient analysis may include: sub-sample keys along each gradient (see e.g.,
In some examples, entropy analysis involves: determining low-entropy and high-entropy areas along the gradient used; and using the encoding that produces the least error. In some examples, 1-bit control is used per 4×4 sub-block for low/high entropy control. For high-entropy areas along the dominant gradient, the original 8-entry palette list is used. For a 4×4 sub-block size, high-entropy encoding includes (3-bits/key)*(16 keys/sub-block)=48 bits/sub-block. For low-entropy areas along the dominant gradient, a 32-entry palette list is used. For a 4×4 sub-block size, low-entropy encoding includes (5-bits/key)(9 keys/sub-block)+(3-bit direction)=48 bits/sub-block.
For low-entropy, the original 8 keys are interpolated to 32 keys, resulting in storage of sixteen 5-bit keys (80 bits total) being stored for each sub-block. For high-entropy, the original 8 keys are used directly, resulting in sixteen 3-bits keys (48 bits total) being stored for each sub-block. Gradient encoding reduces the keys from sixteen to nine (e.g., K2-K10), where seven keys (e.g., K1) are re-created during decompression. With gradient encoding, nine 5-bit keys plus a 3-bit gradient direction (48 bits total) are stored for each sub-block. In the diagram 1300, each position marked as K1 will decode to a unique value defined by its “endpoints” and the gradient direction.
In some examples, recursive compression results in a fixed number of colors of a sub-block being shared over an increased area to reduce the amount of memory needed. In some examples, recursive compression involves: performing PCC analysis based on a target block size/lowest compression ratio; gathering multiple compressed blocks; performing PCC compression on gathered palettes to reduce the palette set for the gathered blocks; performing palette key re-assignment; and applying key compression.
In some examples, the PCC analysis does not perform key compression, but does perform interpolated palette key assignment. The PCC analysis results may include storage of variances, RGB sums, and pixel counts for each cluster. In some examples, PCC compression includes initializing a target number of parent palettes (e.g., 2 parent palettes). For example, a first parent palette closest to an origin (e.g., the dimmest) may be initialized as well as a second parent palette furthest away from the first parent palette. PCC compression may also include: traversing through a gathered palette list in a high frequency random order (not repeating from a block until all have been exhausted); and performing K-means clustering assignments. When adding to a cluster, pixel counts and sums from the original, gathered palettes may be used. PCC compression may also include iterating on the palette data to achieve steady state, randomizing traversal order; summing together variances of combined clusters; and using splitting parent clusters to break up clusters larger than a threshold. In some examples, PCC compression includes repeating cluster assignments and splitting operations until a target number of palettes is derived. The result of applying key compression is that the original palette list for pixel data is substituted with a reduced palette list.
In table 2000 of
In table 2100 of
In table 2200 of
In table 2300 of
In the example of
After obtain the compression results of the first compression of block 2504 and the second compression of claim 2506, the method 2500 may include encoding the compressed set of palette keys such that each pixel of the image can be replaced by an assigned palette key at block 2512. The assigned palette keys may be based on the first compression, the second compression, or both (e.g., if the second compression is applied to the results of the first compression). At block 2514, a compressed image is output based on the palette keys and the compressed set of palette keys. In some examples, the compressed image is stored as frame buffer data (e.g., frame buffer data 118) at block 2516. For example, the compressed image may be based on the palette keys (e.g., for high-entropy areas) and the compressed set of palette keys (e.g., for low-entropy areas). During display operations at block 2518, the compressed image is retrieved from storage and provided to a spatial light modulator (e.g., the spatial light modulator 128 in
With the method 2500, the pixels of an image are replaced with cluster centroids as described herein. Replacing the pixels of an image with cluster centroids is a first compression option to produce a compressed image. A second compression option that can be applied, in addition to or instead of the first compression option, is palette key compression as described herein. Any suitable type of display can be used to display the compressed image, such as a digital micromirror device (DMD), a liquid crystal display (LCD), light emitting diode (LED) display, thin-film transistor (TFT), liquid crystal on silicon (LCoS), or any other display.
In this description, the term “couple” may cover connections, communications, or signal paths that enable a functional relationship consistent with this description. For example, if device A generates a signal to control device B to perform an action: (a) in a first example, device A is coupled to device B by direct connection; or (b) in a second example, device A is coupled to device B through intervening component C if intervening component C does not alter the functional relationship between device A and device B, such that device B is controlled by device A via the control signal generated by device A.
Also, in this description, the recitation “based on” means “based at least in part on.” Therefore, if X is based on Y, then X may be a function of Y and any number of other factors.
A device that is “configured to” perform a task or function may be configured (e.g., programmed and/or hardwired) at a time of manufacturing by a manufacturer to perform the function and/or may be configurable (or reconfigurable) by a user after manufacturing to perform the function and/or other additional or alternative functions. The configuring may be through firmware and/or software programming of the device, through a construction and/or layout of hardware components and interconnections of the device, or a combination thereof.
As used herein, the terms “terminal”, “node”, “interconnection”, “pin” and “lead” are used interchangeably. Unless specifically stated to the contrary, these terms are generally used to mean an interconnection between or a terminus of a device element, a circuit element, an integrated circuit, a device or other electronics or semiconductor component.
A circuit or device that is described herein as including certain components may instead be adapted to be coupled to those components to form the described circuitry or device. For example, a structure described as including one or more semiconductor elements (such as transistors), one or more passive elements (such as resistors, capacitors, and/or inductors), and/or one or more sources (such as voltage and/or current sources) may instead include only the semiconductor elements within a single physical device (e.g., a semiconductor die and/or integrated circuit (IC) package) and may be adapted to be coupled to at least some of the passive elements and/or the sources to form the described structure either at a time of manufacture or after a time of manufacture, for example, by an end-user and/or a third-party.
Circuits described herein are reconfigurable to include additional or different components to provide functionality at least partially similar to functionality available prior to the component replacement. Components shown as resistors, unless otherwise stated, are generally representative of any one or more elements coupled in series and/or parallel to provide an amount of impedance represented by the resistor shown. For example, a resistor or capacitor shown and described herein as a single component may instead be multiple resistors or capacitors, respectively, coupled in parallel between the same nodes. For example, a resistor or capacitor shown and described herein as a single component may instead be multiple resistors or capacitors, respectively, coupled in series between the same two nodes as the single resistor or capacitor.
While certain elements of the described examples are included in an integrated circuit and other elements are external to the integrated circuit, in other examples, additional or fewer features may be incorporated into the integrated circuit. In addition, some or all of the features illustrated as being external to the integrated circuit may be included in the integrated circuit and/or some features illustrated as being internal to the integrated circuit may be incorporated outside of the integrated circuit. As used herein, the term “integrated circuit” means one or more circuits that are: (i) incorporated in/over a semiconductor substrate; (ii) incorporated in a single semiconductor package; (iii) incorporated into the same module; and/or (iv) incorporated in/on the same printed circuit board.
Uses of the phrase “ground” in the foregoing description include a chassis ground, an Earth ground, a floating ground, a virtual ground, a digital ground, a common ground, and/or any other form of ground connection applicable to, or suitable for, the teachings of this description. In this description, unless otherwise stated, “about,” “approximately” or “substantially” preceding a parameter means being within +/−10 percent of that parameter or, if the parameter is zero, a reasonable range of values around zero.
Modifications are possible in the described examples, and other examples are possible, within the scope of the claims.
The present application claims priority to U.S. Provisional Application No. 63/366,726, titled “Recursive Clustering Compression”, Attorney Docket number T102210US01, filed on Jun. 21, 2022, which is hereby incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
63366726 | Jun 2022 | US |