A method for compressing and reconstructing a 3D LUT using difference and scaling coefficients
Patent Information
- Application Number
- CN202610776185.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-01
- Publication Date
- 2026-08-18
AI Technical Summary
[0006]本发明提供一种利用差值和缩放倍数对3D 查找表进行压缩与重构的方法,该方法通过创新的数据表示和计算流程,在保证色彩校正质量的前提下,解决现有技术对硬件存储要求过高的问题,从而实现色彩校正技术在更广泛、特别是资源受限的平台上的高效、低功耗部署
[0021] 1. Significantly improved storage efficiency: This invention reduces the storage efficiency of a source 3D LUT, which theoretically requires high-precision storage, by introducing a channel-specific scaling factor (…). ,
,
This effectively compresses and quantizes the difference into a 3D LUT that requires only low-precision storage, which significantly reduces storage space requirements.
Smart Images

Figure CN122601803A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image color correction, and more specifically to a method for compressing and reconstructing 3D LUTs using interpolation and scaling factors. Background Technology
[0002] With the development of display technology, consumers have placed higher demands on the accuracy, richness, and expressiveness of image colors. Color correction, as a crucial step in the image processing pipeline, aims to ensure that the output colors of display devices conform to specific standards (such as...). (e.g., DCI-P3, etc.) or to achieve the desired artistic style. Among numerous color correction techniques, 3D lookup tables (3D LUTs) are widely used because they can accurately represent the complex, non-linear color mapping relationship from any point in the color space to the target point, and have become a core technical means for achieving color reproduction and stylization. A 3D LUT can be regarded as a cubic grid that is uniformly or non-uniformly sampled in the RGB color space. Each grid vertex stores a target RGB value. For any color in the input image, the accurately corrected output color can be obtained by performing three-dimensional interpolation within its color cube. This method can adjust the brightness, saturation, and hue of a color simultaneously, and its correction capability is far superior to that of a one-dimensional lookup table that can only adjust each channel independently.
[0003] However, applying a complete 3D LUT to real-time hardware processing presents a key challenge: the trade-off between correction accuracy and chip area overhead. Specifically, the internal precision of the 3D lookup table (3D LUT) is crucial for maintaining high-fidelity color correction. To minimize accuracy loss introduced by quantization, the industry typically configures the storage precision of the 3D LUT to match the bit depth of the input and output image signals. For example, a pipeline processing 10-bit precision images would use a 10-bit precision 3D LUT; similarly, processing a 12-bit image stream requires a 12-bit precision LUT. This matching strategy ensures that the mapped values retrieved from the LUT have sufficient precision, thereby guaranteeing the color accuracy and smooth transition of the final output image. This results in significant storage space requirements, placing considerable pressure on chip area and power consumption. Conversely, if the entire 3D LUT is stored with low precision (e.g., 8 bits) to save resources, quantization errors will lead to a significant decrease in color correction accuracy, resulting in color distortion, banding, and other problems.
[0004] The most direct and common implementation scheme for high-fidelity color mapping using 3D LUTs is "directly storing the true value of the 3D LUT that matches the input / output signal bit depth". The standard technical path is as follows: (1) LUT generation: On the software side, a 3D LUT is generated through color management algorithms or artistic color correction. To ensure mapping accuracy, the storage bit depth of the LUT is usually consistent with the input / output signal bit depth of the target hardware pipeline; (2) Direct storage of true value: The complete data of the above LUT, that is, the target RGB color value (true value) corresponding to each grid vertex, is directly loaded into the on-chip memory of the image processing hardware; (3) Hardware lookup table and interpolation: During real-time processing, the hardware uses the RGB value of the input pixel as coordinates and calculates the output color value from the stored LUT true value through lookup table and three-dimensional interpolation. This scheme is a strategy commonly adopted in the industry to balance accuracy and overhead.
[0005] There is a direct trade-off between the precision and hardware resource consumption of 3D LUTs. To achieve a smooth correction effect without obvious color banding, 3D LUTs typically require high precision and a certain size (such as 17x17x17, 33x33x33, or even 65x65x65). This is particularly important for embedded systems and mobile devices. In scenarios where hardware resources such as display driver chips (e.g., on-chip memory) are severely limited, directly storing a lookup table of this size is a heavy burden. The technical problem this invention aims to solve is: how to significantly reduce the chip area requirement of 3D LUTs while maintaining the high-precision color correction effect of 3D LUTs, thereby achieving efficient and low-cost deployment of high-precision color correction algorithms on resource-constrained hardware platforms. Summary of the Invention
[0006] This invention provides a method for compressing and reconstructing 3D lookup tables using interpolation and scaling factors. This method solves the problem of excessive hardware storage requirements in existing technologies while ensuring color correction quality through innovative data representation and calculation processes, thereby enabling efficient and low-power deployment of color correction technology on a wider range of platforms, especially those with limited resources.
[0007] A method for compressing and reconstructing 3D LUTs using interpolation and scaling factors includes:
[0008] Based on the hardware 3D LUT size and output pixel accuracy in the operating environment, a reference 3D LUT is generated. The difference between the source 3D LUT and the reference 3D LUT is calculated by subtracting pixels one by one to generate an intermediate difference 3D LUT.
[0009] Determine the maximum and minimum values of each of the three color channels of the intermediate difference 3D LUT, determine whether they fall within the value range stored in the hardware 3DLUT, and calculate the quantization coefficient of that color channel.
[0010] The values of each color channel of the intermediate difference 3D LUT are multiplied by the corresponding quantization coefficient to generate the final difference 3D LUT configured for the hardware; the scaling factor of each color channel of the final difference 3D LUT configured for the hardware is calculated.
[0011] The final difference 3D LUT and the scaling factor are loaded into the hardware storage unit;
[0012] For each input pixel's RGB value, the corresponding interpolation vector is found in the final difference 3D LUT based on its high-order bits, and the difference vector of that pixel is calculated based on its low-order bits as interpolation weights.
[0013] The difference vector is multiplied by the corresponding channel scaling factor to restore the true value of the difference vector. The true value of the difference vector is added to the input pixel value to generate the final corrected pixel value.
[0014] Furthermore, the scaling factor of each color channel of the final interpolated 3D LUT configured for the hardware is generated by calculating the reciprocal of the quantization factor of that color channel.
[0015] Furthermore, if the maximum and minimum values of the three color channels fall within the range of values stored in the hardware 3D LUT, then the quantization coefficient and scaling factor of that color channel are both 1; otherwise, the quantization coefficients in both positive and negative directions are calculated, and the minimum of the two is taken as the quantization coefficient of that color channel.
[0016] Furthermore, the calculation of the quantization coefficients in both positive and negative directions further includes:
[0017] If the maximum value of the range stored in the hardware 3D LUT is greater than 0, then the quantization coefficient in the positive direction is the ratio of the maximum value in the range of the hardware 3D LUT to the maximum value of the intermediate difference 3D LUT in that color channel; otherwise, the quantization coefficient in the positive direction is 1.
[0018] If the minimum value of the numerical range stored in the hardware 3D LUT is less than 0, then the quantization coefficient in the negative direction is the ratio of the minimum value in the numerical range of the hardware 3D LUT to the minimum value of the intermediate difference 3D LUT in that color channel; otherwise, the quantization coefficient in the negative direction is 1.
[0019] Furthermore, the calculation method for the higher-order bits is as follows: , where lut_size is the size of one side of the 3D LUT.
[0020] The present invention has the following beneficial effects:
[0021] 1. Significantly improved storage efficiency: This invention reduces the storage efficiency of a source 3D LUT, which theoretically requires high-precision storage, by introducing a channel-specific scaling factor (…). , , This effectively compresses and quantizes the difference into a 3D LUT that requires only low-precision storage, which significantly reduces storage space requirements.
[0022] 2. Effective Precision Preservation: Despite employing low-precision compressed storage, during the reconstruction stage, by multiplying the difference vector by the corresponding scaling factor, it is possible to restore the true value of the difference vector, which is close to the original high-precision value. This means that after the compression-reconstruction process, the final output corrected pixels can still achieve a color correction effect similar to that of the uncompressed high-precision LUT. Attached Figure Description
[0023] Figure 1 This is a flowchart of the processing procedure of the present invention. Detailed Implementation
[0024] The traditional "direct storage of 3D LUT truth value" scheme has an inherent drawback: its storage overhead increases cubically with the LUT precision (size N), resulting in excessive chip area, which in turn drives up manufacturing costs and limits its application. This technology adopts a "direct storage of truth value" architecture, and its storage capacity is determined by the following formula:
[0025]
[0026] Storage capacity directly determines the physical area of on-chip static RAM (SRAM). As shown in the table below, the overhead required to store a 10-bit precision (b=10) LUT increases dramatically under different sizes N:
[0027]
[0028] Because this solution must be Each of the vertices is allocated a full bit storage space, resulting in a storage capacity that is equal to the storage capacity of the vertices. The size of the LUT (Least Usage Test) is directly proportional to its bit capacity. When the LUT size increases from N=17 (commonly used for basic correction) to N=65 (used for high-quality cinematic color grading), the storage capacity increases nearly 56 times. Secondly, at the physical level, the area of on-chip memory is roughly linearly related to its bit capacity; therefore, the chip area increases cubically. For an N=65 LUT, its occupied area may exceed 1 mm², which is significant in miniaturized, low-cost mobile device system-on-a-chip (SoC) applications. The storage overhead is extremely high. Therefore, the ultimate drawback of this approach is the "inefficient storage" problem caused by the infrastructure. It forces designers to make a difficult trade-off between color quality and chip cost / area: either pay a huge price in area and cost for high quality, or sacrifice color accuracy to control costs, resulting in color gradation or distortion in the image. This structural contradiction limits the adoption of high-quality color processing technology in mainstream consumer electronics.
[0029] To address the issue of large chip area overhead in existing high-precision 3D LUT technologies, this invention proposes an efficient 3D LUT implementation method based on interpolation compression and scaling restoration. The core idea of this invention is to decompose the complete, high-precision source 3D LUT into a lower-precision interpolation 3D LUT and a set of channel scaling factors, instead of directly storing it. Through this "separate storage, on-time synthesis" strategy, high-precision color correction effects can be reconstructed on the hardware side with minimal storage overhead.
[0030] The overall flow of the technical solution of this invention is as follows: Figure 1 As shown, it mainly includes two stages: software preprocessing and hardware real-time processing, which are summarized below.
[0031] Software preprocessing stage: The source 3D LUT is compressed to generate the final interpolated 3D LUT and scaling factors configured for the hardware. Its main steps include:
[0032] (1) Difference calculation. Generate a reference 3D LUT representing the identity function, and calculate the difference between the source 3D LUT and the reference 3D LUT to obtain the intermediate difference 3D LUT, converting the absolute color mapping information into relative adjustment information.
[0033] (2) Calculate the quantization coefficients. Calculate the maximum and minimum values (min) of each RGB channel of the 3D LUT for the intermediate difference. ch ,max ch RGB values represent the relative intensity of light. A 3D LUT is essentially a mapping relationship stored in a new color space. It takes a set of RGB values as input and outputs new RGB values after color adjustment. The process involves determining whether the maximum and minimum values of each RGB channel fall within the range of values stored in the hardware 3D LUT ([V...). min V max ]).
[0034] If the maximum and minimum values of the R, G, and B color channels fall within the range of values stored in the hardware 3D LUT, that is, V min <= min ch And max ch <= V maxThis color channel does not need to be quantized; let the quantization factor Q of this color channel be... ch = 1.
[0035] Otherwise, calculate the quantization factor Q for that color channel. ch First, calculate the quantization coefficient Q in both the positive and negative directions. p and Q n
[0036] If V max > 0, Q p = V max / max ch Otherwise Q p = 1
[0037] If V min < 0, Q n = V min / min ch Otherwise Q n = 1
[0038] Take Q p Q n The smaller one is Q ch Q ch = min(Q p Q n )
[0039] V min V max Determined by hardware storage, for example, an 8-bit signed number V min =-128, V max =127
[0040] (3) Quantize the intermediate difference 3D LUT. The R, G, and B channel values of the intermediate difference 3D LUT are multiplied by the corresponding quantization coefficient Q. ch This generates the final interpolated 3D LUT configured for the hardware. The scaling factors for the R, G, and B channels of the final interpolated 3D LUT configured for the hardware are calculated.
[0041] As can be seen, the final output of the software preprocessing stage consists of two parts: a significantly reduced-size final interpolated 3D LUT configured for hardware and three channel scaling factors.
[0042] Real-time hardware processing stage (executed on the hardware): Using the final interpolated 3D LUT and scaling factors for the three channels generated in the previous stage, real-time color correction is performed on the input pixels. Its main steps include:
[0043] (1) Configuration steps. Load the final interpolated 3D LUT and channel scaling factor configured for the hardware into the hardware storage unit;
[0044] (2) Lookup and reconstruction steps. For the RGB value of each input pixel, the corresponding interpolation vector is found in the final difference 3D LUT according to the high-bit index and low-bit interpolation method. The difference vector for that pixel is calculated using the lower-order bits as interpolation weights. ;
[0045] in In this context, the range of i is determined by the interpolation algorithm. For example, trilinear interpolation requires taking the 8 nearest interpolation vectors of the interpolation point, while tetrahedral interpolation requires taking the 4 nearest interpolation vectors of the interpolation point.
[0046] (3) Scaling and combining step. The difference vector obtained in step (2) is then scaled and combined. Multiply each value by the corresponding channel scaling factor to restore the true value of the difference vector;
[0047] (4) Finally, the true value of the difference vector is added to the input pixel value to obtain the final corrected pixel value. The calculation formula is: Output = Input + Difference × Scaling factor.
[0048] To clearly illustrate the technical solution of this invention, a simplified 3x3x3 3D LUT is used as an example to demonstrate the entire process from the source 3D LUT to hardware configuration and real-time computation. The processing flow for large-size LUTs (such as 17×17×17) in practical applications is exactly the same. Assume the LUT size: N=3, and the source 3D LUT: denoted as... The specific values are shown in the table below (by...). Channel Sequence Index)
[0049]
[0050]
[0051] In this example, the color processing and output pixel precision is 10-bit. A 10-bit bit depth can divide the brightness or color level of the three RGB channels into 1024 levels. This benchmark is commonly found in professional monitors and other devices, and its maximum value is 1023, denoted as HB in this example. In this example, the source 3D LUT is unsigned 10-bit, the reference 3D LUT is unsigned 10-bit, and the difference 3D LUT (without affecting image quality) is signed 8-bit, with a maximum value of 127, denoted as Q.
[0052] Software preprocessing stage
[0053] Step 1. Generate the baseline LUT.
[0054] The baseline LUT represents an identity mapping, and the RGB value of each vertex is generated according to the following formula.
[0055]
[0056] for benchmark The values are as follows:
[0057]
[0058]
[0059] Step 2. Calculate the difference between the source 3D LUT and the reference 3D LUT. .
[0060] The source LUT is obtained by subtracting the base LUT element by element.
[0061]
[0062] Calculated :
[0063]
[0064]
[0065] At this time This is an intermediate LUT, defined as an intermediate difference 3D LUT, not the final output difference LUT.
[0066] Step 3. Generate the final interpolation 3D LUT configured for the hardware.
[0067] statistics The maximum and minimum values of each of the three channels are given in the table. We can obtain:
[0068]
[0069] In this example, the source 3D LUT table is 10 bits. Assuming the hardware 3D LUT stores signed 8-bit values, [V min V max ]=[-128, 127]. Then, calculate the quantization coefficient according to (2) above, and the steps are as follows:
[0070]
[0071] The formula for generating the final difference 3D LUT is:
[0072] The resulting final difference 3D LUT, i.e. as follows:
[0073]
[0074]
[0075] At this point, the final difference 3D LUT, i.e. It is a signed 8-bit.
[0076] Step 4. Calculate the scaling factor for the RGB channels.
[0077] Based on step (3) above, calculate the scaling factors for the R, G, and B channels of the final difference 3D LUT:
[0078]
[0079] Step 3 yields the final difference 3D LUT, i.e. The scaling factor obtained in step 4 is a parameter configured by the software for the hardware.
[0080] Hardware real-time processing stage
[0081] Step 5: Look up the table
[0082] Hardware input 10-bit pixels As 3D coordinates, the high bit of the pixel is used as the input pixel. The high-order digit of the lookup value is calculated as follows:
[0083]
[0084] This refers to the size of the 3D lookup table. In this example, each table entry is 3x3x3. The value is 3. In this example, the high 1 bit of the pixel is used for indexing. Generally, the choice depends on the required precision (the table itself quantizes the entire data space). Size, Then, the high n-bits of the R, G, and B inputs are used to find the nearest neighbor terms needed for interpolation.
[0085] Interpolation is performed using the lower bits of the pixel (the interpolation method can be trilinear interpolation, tetrahedral interpolation, or other 3D interpolation algorithms). In this example, the lower 9 bits of the input pixel are used for pixel interpolation.
[0086] Assume the input pixels in this example are ( Given (180, 512, 960), the calculated index idx and interpolation weight frac are as follows:
[0087] r_idx = >> 9) & 0x1 = (180 >> 9) & 0x1 = 0,
[0088] r_frac = & 0x1ff = 180 & 0x1ff = 180
[0089] g_idx = >> 9) & 0x1 = (512 >> 9) & 0x1 = 1,
[0090] g_frac = & 0x1ff = 512 & 0x1ff = 0
[0091] b_idx = >> 9) & 0x1 = (960 >> 9) & 0x1 = 1,
[0092] b_frac = & 0x1ff = 960 & 0x1ff = 448
[0093] This example uses trilinear interpolation, with the interpolation points enclosed in a cube composed of 3D lookup table samples. Given the calculated coordinates (r_idx, g_idx, b_idx) = (0, 1, 1), the eight vertices of the cube used for interpolation are (0, 1, 1), (0, 1, 2), (0, 2, 1), (0, 2, 2), (1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2). The interpolation points are then indexed into... The values of the eight points are obtained as follows: (111, 37, 28), (119, 2, -114), (56, -117, 55), (118, -51, -78), (20, -48, 33), (30, -21, -121), (27, -32, 34), (-46, -91, -69), with weights r_frac = 180, g_frac = 0, and b_frac = 448. The result of trilinear interpolation using these eight points and their respective weights is (trilinear interpolation is a well-known technique in graphics processing technology; the calculation process is omitted here) the difference vector. = (87, -4, -98).
[0094] Step 6: Combine output pixels
[0095] The difference vector will be obtained next. Multiply by the scaling factor to get the true value of the difference. Then, add the true value of the difference to the input pixel to obtain the output pixel. , , The steps are as follows:
[0096]
[0097]
[0098] In this example, the final output pixel is (769, 483, 190), which is 10-bit pixels.
[0099] As can be seen from this embodiment, this specific processing procedure verifies several key technical effects and significance of the method of the present invention. 1. A source 3D LUT requiring 10-bit precision storage is scaled down by introducing a channel-specific scaling factor. 1. Effectively compresses and quantizes the difference vector into a 3D LUT requiring only 8-bit precision storage, significantly reducing storage space requirements. 2. Despite using 8-bit compressed storage, the difference vector can be restored to a near-original 11-bit true value by multiplying it by the corresponding scaling factor during the reconstruction stage. This means that after the compression-reconstruction process, the final output corrected pixels can still achieve color correction effects similar to the uncompressed high-precision LUT. 3. Universality and scalability of the solution: Although this example uses specific inputs (180, 512, 960) and specific LUT sizes (3x3x3 is for illustration only; in actual applications, LUTs will be much larger, such as 17x17x17 or 33x33x33), and precision (10-bit -> 8-bit), its core principles (difference calculation, scaling factor determination, quantization storage, interpolation lookup, and scaling restoration) are applicable to 3D LUT compression scenarios of various scales and precision requirements, demonstrating the universality and good scalability of this method.
[0100] While direct quantization of entries (e.g., from 10-bit to 8-bit) can also achieve compression, quantization incurs losses and may cause drift. This solution uses interpolation quantization to reduce this drift. The technical advantage of this invention lies in balancing efficient chip area saving with reliable image quality assurance.
[0101] In typical scenarios with 10-bit input / output precision, the proposed solution achieves stable area optimization across different LUT sizes compared to the original solution that "directly stores the truth value." This significant saving in chip area (storage space) translates to a substantial reduction in the core chip area for display processing chips or mobile SoCs, where on-chip memory resources are extremely valuable, directly leading to cost reduction. The following diagram illustrates the area savings for LUT sizes of 17, 33, and 65.
[0102]
[0103] As can be seen, this invention can result in approximately 20% savings in chip storage area. This saving directly translates into reduced chip cost and optimized power consumption, which is of great significance for large-scale deployment. When configuring LUT data, the amount of data required to be loaded from external memory is also reduced by 20%, improving configuration speed and reducing system power consumption. The final hardware operations of this invention are only "table lookup" and "multiplication and addition," with a fixed and simple calculation path, making it very suitable for implementation using an efficient, low-power hardware pipeline. Compared to directly processing data, it has advantages in terms of logic resources and power consumption.
[0104] On the other hand, this invention guarantees image quality. The scaling factor accurately records the actual maximum amplitude of the difference for each channel, ensuring that the dynamic range of the adjustment amount can be fully restored during the hardware restoration stage, avoiding the truncation error of direct quantization in operations such as strong saturation enhancement. The final color output is calculated as Output = Input + (Difference × Scaling Factor). The entire calculation process introduces only controlled, minor quantization errors in the difference part, thus ensuring high fidelity of the output result overall. In summary, this invention, by combining the storage difference with the scaling factor, achieves visual performance close to that of the original precision LUT while reducing the storage bit depth, successfully resolving the contradiction between storage efficiency and image quality.
Claims
1. A method for compressing and reconstructing a 3D LUT using interpolation and scaling factors, comprising: Based on the hardware 3D LUT size and output pixel accuracy in the operating environment, a reference 3D LUT is generated. The difference between the source 3D LUT and the reference 3D LUT is calculated by subtracting pixels one by one to generate an intermediate difference 3D LUT. Determine the maximum and minimum values of each of the three color channels of the intermediate difference 3D LUT, determine whether they fall within the range of values stored in the hardware 3D LUT, and calculate the quantization coefficient of that color channel. The color channel values of the intermediate difference 3D LUT are multiplied by their corresponding quantization coefficients to generate the final difference 3D LUT configured for the hardware. Calculate the scaling factor for each color channel of the final differential 3D LUT configured for the hardware; The final difference 3D LUT and the scaling factor are loaded into the hardware storage unit; For each input pixel's RGB value, the corresponding interpolation vector is found in the final difference 3D LUT based on its high-order bits, and the difference vector of that pixel is calculated based on its low-order bits as interpolation weights. The difference vector is multiplied by the corresponding channel scaling factor to restore the true value of the difference vector. The true value of the difference vector is added to the input pixel value to generate the final corrected pixel value.
2. The method for compressing and reconstructing a 3D LUT using interpolation and scaling factors as described in claim 1, wherein the scaling factors of each color channel of the final interpolation 3D LUT configured for the hardware are generated by calculating the reciprocal of the quantization factor of the color channel.
3. The method for compressing and reconstructing a 3D LUT using interpolation and scaling factors as described in claim 1, further comprising: If the maximum and minimum values of each of the three color channels fall within the range of values stored in the hardware 3D LUT, then the quantization factor and scaling factor of that color channel are both 1. Otherwise, calculate the quantization coefficients in both positive and negative directions, and take the minimum of the two as the quantization coefficient for that color channel.
4. The method for compressing and reconstructing a 3D LUT using interpolation and scaling factors as described in claim 3, wherein calculating the quantization coefficients in both positive and negative directions further includes: If the maximum value of the range of values stored in the hardware 3D LUT is greater than 0, then the quantization coefficient in the positive direction is the ratio of the maximum value in the range of values of the hardware 3D LUT to the maximum value of the intermediate difference 3D LUT in that color channel; otherwise, the quantization coefficient in the positive direction is 1. If the minimum value of the numerical range stored in the hardware 3D LUT is less than 0, then the quantization coefficient in the negative direction is the ratio of the minimum value in the numerical range of the hardware 3D LUT to the minimum value of the intermediate difference 3D LUT in that color channel; otherwise, the quantization coefficient in the negative direction is 1.
5. The method for compressing and reconstructing a 3D LUT using interpolation and scaling factors as described in claim 1, wherein the calculation method for the higher-order bits is as follows: ,in It is the single-side dimension of the 3D LUT.