Lookup table remapping method and system for improving data smoothness
By improving the remapping lookup table method of data smoothness, data shift and local remapping technology are used to solve the problems of high hardware cost and low efficiency in the nonlinear lookup table, and efficient image processing smoothness is achieved.
Patent Information
- Application Number
- CN202510524277.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art has problems in the nonlinear lookup table with high hardware cost, low efficiency and limited smoothness improvement, especially in image processing, resulting in tomography of image brightness and color.
By constructing a remapping lookup table method that improves data smoothness, data shift, gradient detection and local remapping techniques are used to increase the index terms of steep segments, and select appropriate mapping algorithms according to the application scenario to generate smooth output data.
While keeping the size of the lookup table controllable, the smoothness of the output curve is improved, hardware resource consumption is reduced by more than 90%, and efficient data smoothing processing is achieved.
Smart Images

Figure CN120407836A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image processing, and more specifically, to a remapping look-up table method and system for improving data smoothness. Background Art
[0002] In the IC design or FPGA programming of digital image processing, a look-up table (LUT for short) is usually used to process image data. LUTs are divided into linear output (refer to Figure 1 ) and non-linear output (refer to Figure 2 ); in the application of non-linear output LUTs, the correspondence between input data (or index items) and output data is uneven. As Figure 3 shown, taking the index item 16 as the demarcation point, the input is divided into section A and section B, denoted as In_A and In_B; similarly, the output is also divided into section A and section B, denoted as Out_A and Out_B; it can be observed that the shape of Out_A is relatively steep, accounting for about 42% of the entire output range, but the corresponding input is less than 7%; while the shape of Out_B is relatively flat, accounting for about 58% of the entire output range, and the corresponding input range is about 93%; since the number of index items in section Out_A is small, microscopically, it is not smooth; this situation occurs in image processing, which will cause "fault" phenomena in the brightness and color of the image (refer to Figure 4 ).
[0003] Currently, the main method to solve the above defects is to increase the LUT so that there are enough index items in the originally non-smooth area (refer to Figure 5 ). Although this method can improve the smoothness of the output curve, its disadvantages are also obvious; firstly, the hardware cost increases. Taking Figure 5 as an example, the storage space consumed by the expanded LUT is 16 times that of the original LUT; secondly, the efficiency of reading, writing, and searching of the expanded LUT is reduced; thirdly, the improvement of the originally smooth output section by the expanded LUT is limited, and the overall solution efficiency is low; (for the resource consumption comparison table, refer to Figure 6 ); a more reasonable remapping look-up table method and system for improving data smoothness to solve the above defects are needed. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a remapping look-up table method for improving data smoothness and a remapping look-up table system for improving data smoothness in view of the above defects of the prior art.
[0005] The technical solution adopted by the present invention to solve its technical problems is:
[0006] A remapping lookup table method for improving data smoothness is constructed, which includes the following steps:
[0007] Receive input data, perform data shift operations, adapt to the LUT index range, and obtain a corresponding first index value;
[0008] Performing a table lookup function according to the first index value to obtain intermediate data;
[0009] Based on the intermediate data obtained, the gradient detection method is used to calculate the difference between adjacent index outputs to determine whether the output data belongs to a steep segment, and the corresponding maximum and minimum index values are set as thresholds;
[0010] Compare the first index value with a threshold value and output a second index value to be remapped;
[0011] Perform shift operation on the second index value to add interpolation points;
[0012] Remap the data of the steep section to obtain smoother optimized data;
[0013] The intermediate data and optimized data are integrated according to the threshold to generate the final output data.
[0014] The remapping lookup table method for improving data smoothness of the present invention, wherein the data shift operation is performed to adapt the LUT index range and obtain the corresponding first index value using:
[0015] I=X>>m;
[0016] Where X is the input data, m is the number of right shifts, and I is the first index value.
[0017] In the remapping lookup table method for improving data smoothness of the present invention, the table lookup function is performed according to the first index value to obtain the intermediate data using:
[0018] Y′=LUT(I);
[0019] Among them, Y′ is the intermediate data.
[0020] The remapping lookup table method for improving data smoothness of the present invention adopts the gradient detection method to calculate the adjacent index output difference to determine whether the output data belongs to a steep section, and the corresponding maximum and minimum index values are set as thresholds using the formula:
[0021] ΔY=Y′ I+1 -Y′ I ;
[0022] Among them, Y′ I+1 and Y′ I is the output value corresponding to two adjacent indexes;
[0023] When ΔY > n, it is determined as a steep section, where n is a set value.
[0024] In the remapping lookup table method for improving data smoothness according to the present invention, when comparing the first index value with a threshold value and outputting the second index value to be remapped, the formula is:
[0025] if(I min <I<I max )then I′=I;
[0026] Wherein, I min is the minimum threshold value, I max is the maximum threshold value, and I′ is the second index value.
[0027] In the remapping lookup table method for improving data smoothness according to the present invention, when performing a shift operation on the second index value to increase interpolation points, the formula is:
[0028] I″=I′<<k;
[0029] Wherein, the value range of k is 2 - 4, and I″ is the extended index value.
[0030] In the remapping lookup table method for improving data smoothness according to the present invention, when remapping the data in the steep section to obtain smoother optimized data, it is as follows:
[0031] According to the lookup table result Y′ and the set threshold values I min 、I max to determine the output range y min 、
[0032] y min =LUT(I min );
[0033] y max =LUT(I max );
[0034] Select a suitable mapping algorithm according to the application scenario;
[0035] Using the extended index value I″ as the input, perform a remapping operation and obtain the result Y″.
[0036] In the remapping lookup table method for improving data smoothness according to the present invention, selecting a suitable mapping algorithm according to the application scenario includes:
[0037] For the interval where the output changes smoothly, adopt a linear interpolation algorithm, and the algorithm formula is:
[0038] Y″=(ymax -y min ) / (I max -I min )*(I″ - I min ) + y min ;
[0039] For the non - linear output segment, a polynomial fitting algorithm is adopted, and the algorithm formula is:
[0040] Y″ = a*(I″)2 + b*(I″) + c;
[0041] For a specific non - linear relationship, a power function mapping algorithm is adopted, and the algorithm formula is:
[0042] Y″ = (I″) n ;
[0043] Where a, b, and c are the coefficients of each term in the polynomial, and n is the exponent of the power operation.
[0044] In the remapping lookup table method for improving data smoothness according to the present invention, the integrating intermediate data and optimized data based on a threshold to generate the final output data includes:
[0045] By the threshold interval I min ~I max to control the gated output of Y′ and Y″ and obtain the final output value Y;
[0046] if(I min <I<I max );
[0047] then Y = Y′;
[0048] else Y = Y″.
[0049] A remapping lookup table system for improving data smoothness, which is applied to the remapping lookup table method for improving data smoothness as described above. The system includes an input pre - processing module, a conventional lookup table module, a threshold setting module, a comparator, a shift processing module, a remapping module, and a gated output module;
[0050] The input pre - processing module is used to receive input data, perform data shift operations, adapt to the LUT index range, and obtain the corresponding first index value;
[0051] The conventional lookup table module is used to perform a lookup table function according to the first index value and obtain intermediate data;
[0052] The threshold setting module is used to calculate the difference between adjacent index outputs using the gradient detection method based on the obtained intermediate data, thereby determining whether the output data belongs to a steep segment, and setting the maximum and minimum values of the corresponding indexes as thresholds;
[0053] The comparator is used to compare the first index value with the threshold and output the second index value to be remapped;
[0054] The shift processing module is used to perform a shift operation on the second index value to increase the interpolation points;
[0055] The remapping module is used to perform a remapping process on the data in the steep segment to obtain smoother optimized data;
[0056] The gating output module is used to integrate the intermediate data and the optimized data according to the threshold to generate the final output data.
[0057] The beneficial effects of the present invention are as follows: Through local remapping and dynamic algorithm adaptation, while keeping the scale of the LUT controllable, the present patent designs for balanced precision and efficiency, and solves the smoothness problem of the non-linear output curve. Its core advantages are as follows:
[0058] (1) Piecewise optimization: Only expand the index for the problem area, and the resource consumption is reduced by more than 90% compared with global optimization;
[0059] (2) Flexible algorithm support: The best mapping model can be selected according to the output characteristics to balance precision and efficiency;
[0060] (3) Hardware-friendly design: Through technologies such as shifting, multiplexing, and pipelining, it adapts to the real-time requirements of FPGA / ASIC. Description of the Drawings
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will further illustrate the present invention in conjunction with the drawings and embodiments. The drawings in the following description are only partial embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts:
[0062] Figure 1 It is a schematic diagram of the application of a linear output LUT;
[0063] Figure 2 It is a schematic diagram of the application of a non-linear output LUT;
[0064] Figure 3 It is an application example of a non-linear output LUT;
[0065] Figure 4 It is a schematic diagram of the fault phenomenon;
[0066] Figure 5 It is a schematic diagram of increasing the LUT;
[0067] Figure 6 It is a schematic diagram for comparing before and after LUT expansion;
[0068] Figure 7 It is a flowchart of the remapping lookup table method for improving data smoothness in a preferred embodiment of the present invention;
[0069] Figure 8 It is a schematic diagram of LUT improvement in the remapping lookup table method for improving data smoothness in a preferred embodiment of the present invention;
[0070] Figure 9 It is an example diagram of the input bit width and shift configuration in the remapping lookup table method for improving data smoothness in a preferred embodiment of the present invention;
[0071] Figure 10 It is a schematic block diagram of the principle of the remapping lookup table system for improving data smoothness in a preferred embodiment of the present invention. Detailed implementation manners
[0072] In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are partial embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0073] Embodiment 1
[0074] The remapping lookup table method for improving data smoothness in a preferred embodiment of the present invention, as Figure 7 shown, and referring to Figure 8 and Figure 9 , includes the following steps:
[0075] S01: Receive input data, perform data shift operation, adapt to the LUT index range, and obtain the corresponding first index value;
[0076] Formula: I = X >> m (X is the input data, m is the number of right shifts, and I is the index value);
[0077] Features:
[0078] · The input data bit width is adaptive (supporting 10 / 12 / 14 bit);
[0079] · Align the LUT index through shift processing;
[0080] · Retain the low-order data in the register for subsequent precision compensation.
[0081] For example (refer to Figure 9 ): The 12-bit input data is shifted right by 4 bits, and the upper 8 bits are used as the look-up table index.
[0082] S02: Perform the look-up table function according to the first index value to obtain the intermediate data;
[0083] Formula: Y′ = LUT(I);
[0084] Features:
[0085] · The LUT is stored in the RAM, the index address is aligned with the input data, and the output bit width covers the dynamic range.
[0086] · The 16-bit fixed-point data format (Q12.4) is adopted, which is convenient for docking with the floating-point arithmetic unit.
[0087] S03: According to the obtained intermediate data, use the gradient detection method to calculate the difference between adjacent index outputs, thereby determining whether the output data belongs to the steep segment, and set the maximum and minimum values of the corresponding indexes as the thresholds;
[0088] Formula: ΔY = Y′I + 1 - Y′I (when ΔY > n, it is determined as the steep segment, and n is an empirical value).
[0089] S04: Compare the first index value with the threshold, and output the second index value to be remapped;
[0090] Formula: if (Imin < I < Imax) then I′ = I;
[0091] S05: Perform a shift operation on the second index value to increase the interpolation points;
[0092] Formula: I″ = I′ << k (the value of k can be selected from 2 to 4, representing that the index is expanded to 4 to 16 times the original).
[0093] For example: The index value range of the steep segment is 0 to 8, shifted left by 3 bits, and the index value range is expanded to 0 to 64.
[0094] S06: Remap the data in the steep segment to obtain smoother optimized data;
[0095] · Determine the output range ymin and ymax of the remapping according to the look-up table result Y′ in the second step and the threshold settings Imin and Imax in the third step.
[0096] · Select a suitable mapping algorithm (linear, polynomial fitting, exponential / logarithmic) according to the application scenario.
[0097] · Use the expanded index value I″ in the fifth step as the input to perform the remapping operation and obtain the result Y″.
[0098] Algorithm selection and calculation logic:
[0099] Linear interpolation: Y″=(ymax-ymin) / (Imax-Imin)*(I″-Imin)+ymin;
[0100] Applicable scenarios: ranges where output changes smoothly and hardware resource consumption is low.
[0101] Polynomial fitting: Y″=a*(I″)²+b*(I″)+c;
[0102] Applicable scenarios: nonlinear output segments, where a balance between accuracy and computational complexity is required.
[0103] Power function mapping: Y″=(I″) n ;
[0104] Applicable scenarios: Specific nonlinear relationships are implemented through lookup tables or fast exponentiation operations.
[0105] S07: Integrate the intermediate data and the optimized data according to the threshold value to generate the final output data;
[0106] Description: The threshold range Imin~Imax is used to control the gate output of the result Y′ in step (2) and the result Y″ in step (6) to obtain the final output value Y.
[0107] This patent uses local remapping and dynamic algorithm adaptation to balance accuracy and efficiency while maintaining controllable LUT size, solving the problem of smoothness of nonlinear input curves. Its core advantages are as follows:
[0108] (1) Segmented optimization: Expand the index only for the problem area, reducing resource consumption by more than 90% compared to global optimization;
[0109] (2) Flexible algorithm support: The optimal mapping model can be selected based on output characteristics, balancing accuracy and efficiency;
[0110] (3) Hardware-friendly design: Adapting to the real-time requirements of FPGA / ASIC through shifting, multiplexing, pipelining and other technologies;
[0111] The core idea of the remapping method used in this method is to adopt a segmented optimization strategy (see Figure 8 ), by adding index items to the local area of the original LUT to improve the smoothness of the output curve, only a small amount of hardware resources are added, and the hardware cost is low.
[0112] Maintaining a small overall LUT allows for efficient read, write, and search operations during application:
[0113] Keep the gentle section: directly reuse the original LUT output value to save resources.
[0114] Reconstruct the steep section: add local index items and remap the original LUT value to improve the smoothness of the output curve.
[0115] More specifically:
[0116] (1) Resource reuse design
[0117] BRAM partitioning: partition the BRAM of the original LUT into a steep section and a gentle section, and dynamically switch through address offset.
[0118] Computing unit sharing: includes logic computing units such as multipliers and adders applied in each algorithm module.
[0119] (2) Timing and power consumption optimization
[0120] Three-stage pipeline design:
[0121] The first stage: input shift + index comparison;
[0122] The second stage: look-up table + gradient calculation;
[0123] The third stage: remapping calculation + output integration;
[0124] (3) Power consumption optimization
[0125] Gated clock: turn off the clock signal for inactive modules (such as unselected algorithm units) to reduce dynamic power consumption.
[0126] (4) Precision and error control
[0127] Rounding error compensation: retain low-order data in the shift operation for precision calibration of the final output.
[0128] Saturation processing: limit the output value within the legal range (such as 0 - 4095) to avoid overflow.
[0129] Embodiment 2
[0130] A remapping look-up table system for improving data smoothness, applied to the remapping look-up table method for improving data smoothness as described above, as Figure 10 shown, the system includes an input preprocessing module 1, a conventional look-up table module 2, a threshold setting module 3, a comparator 4, a shift processing module 5, a remapping module 6, and a gated output module 7;
[0131] The input preprocessing module 1 is used to receive input data, perform data shift operations, adapt to the LUT index range, and obtain the corresponding first index value;
[0132] The conventional look-up table module 2 is used to perform a look-up table function according to the first index value to obtain intermediate data;
[0133] The threshold setting module 3 is used to calculate the adjacent index output difference by using the gradient detection method according to the obtained intermediate data, thereby determining whether the output data belongs to a steep section, and setting the maximum and minimum values of the corresponding indexes as thresholds;
[0134] The comparator 4 is used to compare the first index value with the threshold value and output the second index value to be remapped;
[0135] The shift processing module 5 is used to perform a shift operation on the second index value to increase the interpolation points;
[0136] The remapping module 6 is used to perform a remapping process on the data in the steep section to obtain smoother optimized data;
[0137] The gating output module 7 is used to integrate the intermediate data and the optimized data according to the threshold value to generate the final output data;
[0138] The core idea of the remapping method used in this system is to adopt a segmented optimization strategy to improve the smoothness of the output curve by adding index items to the local area of the original LUT, with only a small amount of hardware resources added and a relatively low hardware cost.
[0139] It should be understood that those of ordinary skill in the art can make improvements or transformations according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.
Claims
1. A remapping lookup table method for improving data smoothness, characterized in that, It includes the following steps: Receive input data, perform a data shift operation, adapt to the LUT index range, and obtain the corresponding first index value; Execute a look-up table function according to the first index value to obtain intermediate data; According to the obtained intermediate data, use the gradient detection method to calculate the adjacent index output difference, thereby determining whether the output data belongs to a steep section, and set the maximum and minimum values of the corresponding indexes as thresholds; Compare the first index value with the threshold and output the second index value to be remapped; Perform a shift operation on the second index value to increase the interpolation points; Remap the data in the steep section to obtain smoother optimized data; Integrate the intermediate data and the optimized data according to the threshold to generate the final output data.
2. The method of remapping lookup table for improving data smoothness according to claim 1, wherein The operation of performing a data shift, adapting to the LUT index range, and obtaining the corresponding first index value adopts: I = X >> m; Where X is the input data, m is the number of right shifts, and I is the first index value.
3. The method of remapping lookup table for improving data smoothness according to claim 2, characterized in that, The operation of executing a look-up table function according to the first index value to obtain intermediate data adopts: Y′ = LUT(I); Where Y′ is the intermediate data.
4. The remapping lookup table method for improving data smoothness according to claim 3, wherein, The operation of using the gradient detection method to calculate the adjacent index output difference, thereby determining whether the output data belongs to a steep section, and setting the maximum and minimum values of the corresponding indexes as thresholds adopts the formula: ΔY = Y' I+1 -Y' I ; Among them, Y' I+1 and Y' I are the output values corresponding to two adjacent indices; When ΔY > n, it is determined as a steep section, and n is a set value.
5. The method for remapping a lookup table to improve data smoothness according to claim 4, wherein The operation of comparing the first index value with the threshold and outputting the second index value to be remapped adopts the formula: if(I min <I<I max )then I′=I; Among them, I min is the minimum threshold, which is I max the maximum threshold, and I' is the second index value.
6. The remapping lookup table method for improving data smoothness according to claim 5, wherein The operation of performing a shift operation on the second index value to increase the interpolation points adopts the formula: I″ = I′ << k; Where the value range of k is 2 - 4, and I″ is the extended index value.
7. The remapping lookup table method for improving data smoothness according to claim 7, characterized in that The operation of remapping the data in the steep section to obtain smoother optimized data adopts: According to the lookup table result Y′ and the set threshold I min 、I max Determine the output range y of the remapping min 、y max ; y min = LUT(I min ); y max = LUT(I max ); Select a suitable mapping algorithm according to the application scenario; Use the extended index value I″ as the input to perform a remapping operation and obtain the result Y″.
8. The remapping lookup table method for improving data smoothness according to claim 7, wherein Selecting a suitable mapping algorithm according to the application scenario includes: For the interval with a gentle output change, adopt a linear interpolation algorithm, and the algorithm formula is: Y″=(y max -y min ) / (I max -I min )*(I″ - I min ) + y min ; For the non-linear output section, adopt a polynomial fitting algorithm, and the algorithm formula is: Y″ = a*(I″)2 + b*(I″) + c; For a specific non-linear relationship, adopt a power function mapping algorithm, and the algorithm formula is: Y″ = (I″) n ; Where a, b, and c are the coefficients of each term in the polynomial, and n is the exponent of the power operation.
9. The remapping lookup table method for improving data smoothness according to claim 1, wherein The operation of integrating the intermediate data and the optimized data according to the threshold to generate the final output data includes: Through threshold interval I min ~I max To control the gated outputs of Y' and Y'', and obtain the final output value Y; If(I min <I<I max ); then Y = Y′; else Y = Y″.
10. A remapping lookup table system for improving data smoothness, applied to the remapping lookup table method for improving data smoothness as described in any one of claims 1-9, characterized in that, The system includes an input preprocessing module, a conventional look-up table module, a threshold setting module, a comparator, a shift processing module, a remapping module, and a gated output module; The input preprocessing module is used to receive input data, perform a data shift operation, adapt to the LUT index range, and obtain the corresponding first index value; The conventional look-up table module is used to execute a look-up table function according to the first index value to obtain intermediate data; The threshold setting module is used to calculate the adjacent index output difference by using the gradient detection method according to the obtained intermediate data, thereby determining whether the output data belongs to a steep section, and setting the maximum and minimum values of the corresponding indexes as thresholds; The comparator is used to compare the first index value with a threshold value and output a second index value to be remapped; The shift processing module is used to perform a shift operation on the second index value to increase interpolation points; The remapping module is used to perform a remapping process on the data in the steep section to obtain smoother optimized data; The gating output module is used to integrate the intermediate data and the optimized data according to the threshold value to generate the final output data.