Data mapping transformation method and apparatus, electronic device, and storage medium

By employing a base-2 exponential function and binary encoding/decoding method in image processing, a non-uniform interval mapping table is created, solving the problems of excessively large mapping tables and curve distortion, and achieving efficient and accurate image data mapping.

CN116091358BActive Publication Date: 2026-05-01FUZHOU ROCKCHIP SEMICON
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUZHOU ROCKCHIP SEMICON
Filing Date
2023-02-21
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies in image processing, especially in the mapping transformation of exponential curves, suffer from problems such as excessively large mapping tables leading to high table lookup costs, and non-equal interval point selection methods causing curve distortion.

Method used

A base-2 exponential function is used to take values ​​on the x-axis to create a non-uniformly spaced mapping table. The interpolation interval is determined by binary encoding and two-stage decoding, and interpolation calculation is performed to obtain the y-axis mapping value.

Benefits of technology

It reduces the use of hardware resources, improves the speed of finding interpolation intervals, and ensures the accuracy and efficiency of mapping, especially for mapping quasi-exponential function curves.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116091358B_ABST
    Figure CN116091358B_ABST
Patent Text Reader

Abstract

The application provides a data mapping transformation method and device, electronic equipment and a storage medium. The data mapping transformation method comprises: obtaining a mapping table associated with a point selected on a first axis of a real curve, the mapping table comprising a first axis value and a second axis value corresponding to the first axis value, the first axis value being a value of the point on the first axis, and the second axis value being a value of a point corresponding to the point on the real curve and mapped on a second axis intersecting the first axis; encoding input data to determine that the input data is located in a first axis value interval corresponding to the first axis value in the mapping table; and performing interpolation calculation based on the first axis value interval and the mapping table to obtain a second axis mapping value of the input data on the second axis of the real curve. The application improves the accuracy and speed of data mapping transformation, and saves hardware resources.
Need to check novelty before this filing date? Find Prior Art

Description

Data mapping and transformation methods and apparatuses, electronic devices and storage media Technical Field

[0001] This application relates to the field of data processing technology, and in particular to data mapping and transformation methods and apparatus, electronic devices and storage media. Background Technology

[0002] In image processing, it is often necessary to perform mapping transformations on image parameters (such as brightness and chroma) to obtain an ideal image. Mapping transformations are performed according to a preset curve, where the x-axis of the preset curve represents the image parameters before the mapping transformation, and the y-axis represents the image parameters after the mapping transformation. Before performing the mapping transformation, a curve mapping table needs to be created for all input data; the mapping operation is essentially a table lookup operation. If each input data point has a table entry, the mapping table will be very large, and the lookup overhead will increase, which is unacceptable from a hardware implementation perspective.

[0003] To address this issue, the current approach involves taking points at equal intervals along the curve's x-axis. For example, taking points at intervals of 1 results in a mapping table with 256 entries (0, 1, 2…255). To further reduce the size of the mapping table, points can be taken at non-equal intervals along the curve's x-axis, such as retaining only 16 entries (0, 15, 31…255), with the remaining positions calculated through real-time interpolation. This approach yields an approximate curve on smooth curves, but for exponential curves or curves with steep rises or falls, this method will cause severe distortion. Summary of the Invention

[0004] This application provides a data mapping and transformation method and apparatus, electronic equipment and storage medium, which can solve the above-mentioned deficiencies in the prior art.

[0005] In a first aspect, this application provides a data mapping transformation method. The data mapping transformation method includes: obtaining a mapping table associated with points selected on a first axis of a real curve, the mapping table including first axis values ​​and second axis values ​​corresponding to the first axis values, the first axis values ​​being the values ​​of the points on the first axis, and the second axis values ​​being the values ​​mapped by points on the real curve corresponding to the points on the first axis onto a second axis intersecting the first axis; encoding input data to determine that the input data lies within a first axis value interval in the mapping table corresponding to the first axis values, the input data corresponding to parameters to be mapped in an image; and performing interpolation calculations based on the first axis value interval and the mapping table to obtain the second axis mapping value of the input data on the second axis of the real curve.

[0006] In one implementation of the first aspect, the points selected on the first axis include points selected at non-uniform intervals.

[0007] In one implementation of the first aspect, the second axis value includes a dynamically configured second axis value.

[0008] In one implementation of the first aspect, the points selected at non-uniform intervals include: starting from the origin of the coordinate system, points are selected at intervals of 2 along the positive direction of the first axis. n The sampling interval is used to take points one by one, where n takes values ​​of 0, 1, 2...N, where N is a positive integer.

[0009] In one implementation of the first aspect, encoding the input data to determine that the input data is located in the first axis value range corresponding to the first axis in the mapping table includes: binary encoding the input data to obtain a binary encoded value; decoding the binary encoded value to mark the non-zero highest bit; and determining that the input data is located in the first axis value range in the mapping table based on the position of the non-zero highest bit.

[0010] In one implementation of the first aspect, decoding the binary encoded value to mark the non-zero highest bit includes: grouping the binary encoded value; performing a first segment of decoding to determine the group in which the non-zero highest bit is located; and performing a second segment of decoding on the group in which the non-zero highest bit is located to determine the bit in which the non-zero highest bit is located.

[0011] In one implementation of the first aspect, performing the first segment of decoding to determine the group containing the non-zero highest bit includes: determining the first group greater than zero starting from the high-order bit grouping, and determining the group as the group containing the non-zero highest bit.

[0012] In one implementation of the first aspect, performing a second decoding on the group containing the non-zero highest bit to determine the bit containing the non-zero highest bit includes: determining the first non-zero bit in the group containing the non-zero highest bit in descending order of bit position, and determining the bit as the non-zero highest bit.

[0013] In one implementation of the first aspect, performing interpolation calculation based on the first axis value range and the mapping table to obtain the second axis mapping value of the input data on the second axis of the real curve includes: obtaining a pair of first axis values ​​that are the two endpoints of the first axis value range; obtaining a pair of second axis values ​​corresponding to the pair of first axis values ​​based on the mapping table; and performing the interpolation calculation based on the pair of second axis values ​​to obtain the second axis mapping value.

[0014] In one implementation of the first aspect, the first axis includes an x-axis, and the second axis includes a y-axis. Interpolation calculation based on the value range of the first axis and the mapping table to obtain the second axis mapping value of the input data on the second axis of the true curve includes: obtaining the interval endpoints x of the x-axis value range corresponding to the input data based on the mapping table. n x n+1 The mapping value y at the location n y n+1 ; and based on the following formula, interpolation is performed to obtain the y-axis mapping value corresponding to the input data: out = (y n *wet+y n+1 *(distance-wet)) / distance, wet=x n+1 -x in distance = x n+1 -x n Where out is the y-axis mapping value corresponding to the input data, and x in For input data.

[0015] In one implementation of the first aspect, the mapping table is created by corresponding the first axis value and the second axis value one-to-one.

[0016] Secondly, this application provides a data mapping transformation apparatus. The data mapping transformation apparatus includes: a mapping table acquisition module configured to acquire a mapping table associated with a point selected on a first axis of a real curve, the mapping table including a first axis value and a second axis value corresponding to the first axis value, the first axis value being the value of the point on the first axis, and the second axis value being the value mapped by a point on the real curve corresponding to the point on a second axis intersecting the first axis; an interpolation interval lookup module configured to encode input data to determine that the input data lies within a first axis value interval in the mapping table corresponding to the first axis value; and an interpolation calculation module configured to perform interpolation calculation based on the first axis value interval and the mapping table to obtain a second axis mapping value of the input data on the second axis of the real curve.

[0017] In one implementation of the second aspect, the method further includes: a mapping table creation module, configured to select the points on the first axis at non-uniform intervals, dynamically configure the values ​​of the second axis, and create the mapping table with the values ​​of the first axis and the values ​​of the second axis corresponding one-to-one.

[0018] Thirdly, this application provides an electronic device. The electronic device includes: a memory configured to store a processor-executable program; and a processor configured to invoke the program to perform the data mapping transformation method according to the first aspect of this application.

[0019] Fourthly, this application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program that is executed to implement the data mapping and transformation method according to the first aspect of this application.

[0020] In the data mapping transformation method and apparatus, electronic device and computer-readable storage medium according to this application, the exponential function with base 2 (2 n To approximate the true curve, x-axis values ​​are used to create a mapping table. This allows for the allocation of more and denser points in areas of rapid curve growth and fewer and sparser points in flatter areas, resulting in a more accurate approximation of the curve. Furthermore, when determining the x-axis value range of the input data within the mapping table, binary encoding and decoding are used to find the position of the highest non-zero bit, thus determining the interpolation range. Interpolation calculations are then performed within this range to obtain the corresponding y-axis mapping value for the input data, accelerating the search for the interpolation range and saving hardware resources. Attached Figure Description

[0021] Figure 1 shows a schematic diagram of an image acquisition and processing system.

[0022] Figure 2 shows a simplified flowchart of a data mapping transformation method according to an embodiment of this application.

[0023] Figure 3 shows a detailed flowchart of a data mapping transformation method according to an embodiment of this application.

[0024] Figure 4 shows a schematic diagram of binary encoding of input data according to an embodiment of this application.

[0025] Figure 5 shows a flowchart of a two-stage decoding interpolation interval lookup according to an embodiment of this application.

[0026] Figure 6 shows a flowchart of a specific implementation scheme of a data mapping transformation method according to an embodiment of this application.

[0027] Figure 7 shows a structural block diagram of a data mapping transformation device according to an embodiment of this application.

[0028] Figure 8 shows a structural block diagram of a data mapping transformation device according to another embodiment of this application. Detailed Implementation

[0029] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0030] It should be noted that the illustrations provided in the following embodiments are merely schematic representations of the basic concept of this application. The illustrations only show components relevant to this application and are not drawn according to the actual number, shape, and size of components in implementation. In actual implementation, the form, quantity, and proportion of each component can be arbitrarily changed, and the component layout may also be more complex. Furthermore, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0031] The following embodiments of this application provide a data mapping transformation method and apparatus, an electronic device, and a computationally readable storage medium, including but not limited to image acquisition and processing systems. The data mapping transformation method provided in this embodiment is used to achieve image processing, which includes but is not limited to image brightness transformation, image chromaticity transformation, and other processing.

[0032] Figure 1 shows a schematic diagram of an image acquisition and processing system. As shown in Figure 1, the image acquisition and processing system includes an image acquisition device 1, a communication module 2, and an image processing device 3. The image acquisition device 1 is used to acquire raw image data, including but not limited to devices with image acquisition functions such as cameras and scanners. The image acquisition device 1 transmits the raw image data to the image processing device 3 through the communication module 2. The image processing device 3 integrates a graphics processing unit (GPU), also known as a display core, visual processor, or display chip, which is a microprocessor specifically designed for performing image and graphics-related calculations on personal computers, workstations, game consoles, and some mobile devices (such as tablets and smartphones). In the example shown in Figure 1, the image processing device includes, but is not limited to, a PC, a laptop, and a smartphone. The GPU chip integrated in the image processing device is configured to perform image data mapping and transformation using the data mapping and transformation method provided in this application.

[0033] In some other embodiments, the image acquisition device can be integrated with the image processing device. For example, some mobile devices with image acquisition capabilities (such as smartphones) are equipped with cameras that can acquire images. After the images are acquired, they are processed using a GPU chip and then applied.

[0034] In the data mapping transformation method of this application, a base-2 exponential function is used to approximate the true curve for the x-axis value, while the y-axis value is an external input that can be dynamically configured to create a mapping table. During mapping, the input data is decoded using two-stage combinational logic to determine the calculation interval in which the input data falls, and interpolation is performed to obtain the final mapped value. According to the method in this embodiment, the problem of distortion in the mapping of exponential curves can be effectively solved, realizing the function of mapping exponential function curves. Furthermore, the use of a two-stage decoding method improves the efficiency of finding the interpolation interval, reduces the use of dividers in hardware implementation, saves hardware area, and significantly improves the mapping speed of input data by using a base-2 x-axis value and a two-stage decoding operation.

[0035] The technical solutions of the embodiments of this application will be described in detail below with reference to the accompanying drawings. In some embodiments, data including but not limited to image brightness data can be mapped and transformed. In some embodiments, the first axis includes but is not limited to the x-axis, and the second axis includes but is not limited to the y-axis. In the following description, an example with the x-axis as the first axis and the y-axis as the second axis will be used, but the embodiments of this application are not limited thereto.

[0036] Figure 2 shows a flowchart of a data mapping transformation method according to an embodiment of this application. As shown in Figure 2, the data mapping transformation method in this embodiment includes the following steps S11 to S14.

[0037] In step S11, a mapping table is obtained associated with a point selected on the x-axis of the real curve. The mapping table includes x-axis values ​​and y-axis values ​​corresponding to the x-axis values. The x-axis values ​​are the values ​​of the points on the x-axis, and the y-axis values ​​are the values ​​of the points on the real curve corresponding to the points on the x-axis that intersect the x-axis.

[0038] In some embodiments, to save on table lookup overhead and hardware resources during data mapping transformation, points are selected on the x-axis of the real curve using a non-uniform interval selection method. Specifically, the origin of the coordinate system can be used as the starting point, and points can be selected at intervals of 2 along the positive x-axis. nSampling points are taken sequentially at sampling intervals, where n takes values ​​of 0, 1, 2...N, where N is a positive integer. Based on the determined x-axis points, the corresponding y-axis values ​​are obtained to create a mapping table. The y-axis values ​​can be dynamically configured; there is no fixed formula or shape. They can be monotonically increasing or decreasing, as long as the initial change is rapid and the subsequent change is slow. Many such curve formulas can be listed, such as the exponential function, f(x) = e^(-x / y). x ; sigmoid function, The softplus function, f(x) = log(1 + e^(-1 / x)), is given by f(x) = x )wait.

[0039] In some embodiments, the data mapping transformation method may further include creating a mapping table that corresponds one-to-one with the x-axis values ​​and y-axis values.

[0040] The following example of mapping transformation of a wide dynamic range image in the raw domain will be used to illustrate the specific meaning of the created mapping table.

[0041] High Dynamic Range (HDR) imaging, in computer graphics and cinematography, is a set of techniques used to achieve a greater dynamic range of exposure (i.e., a greater difference between light and dark areas) than ordinary digital imaging techniques. For example, HDR technology can merge three images of the same scene—dark, normal, and bright—into a single image. The final image can simultaneously display details in both the darkest and overexposed areas. To achieve this display standard, the processed pixel bit width can reach 20 bits, meaning its pixel range is 0–20. 20 However, the 20-bit width poses significant inconvenience for storage and transmission, and such high precision is not required in subsequent processing. Therefore, the data mapping transformation method of this application is needed to compress the pixels to a certain range. At this point, the x-axis of the true curve corresponds to the pixel size of the input image, which can take values ​​from 0 to 2. 20 The y-axis can be dynamically configured, which allows for flexible compression of image pixels to the range of 8 bits (0-255) or 10 bits (0-1023). Since the human eye is more sensitive to details in dark areas and less sensitive to details in bright areas, a non-uniform curve with denser interpolation at the beginning and coarser interpolation at the end can meet this requirement. The interpolation is denser in darker areas and coarser in brighter areas, without losing too much precision as with uniform interpolation.

[0042] In this embodiment, in the mapping table created when performing a mapping transformation on a wide dynamic range image in the raw domain, the x-axis represents the pixel value before the mapping transformation, and the y-axis represents the pixel value after the mapping transformation. Here, for the true curve, starting from the origin (i.e., 0), the coordinates are divided into two axes along the positive x-axis. n Points are sampled sequentially at sampling intervals, where n takes values ​​of 0, 1, 2...N. In this embodiment, N is set to 25, thus creating a 26-segment mapping table as shown in Table 1.

[0043] Table 1 26-segment mapping table

[0044] x02 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 y0112346811162332x2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 y456491128181256362512724102414482048x2 23 2 24 2 25 y289640965793 surface

[0045] As shown in Table 1, when creating the 26-segment mapping table in this embodiment, the x-axis is first sequentially set to 0, 20, 2... 1 , ..., 2 25 There are 27 points in total, forming 26 interpolation intervals, hence the name 26-segment mapping table. Then, the y-axis values ​​corresponding to the x-axis sampling points are configured.

[0046] In step S12, the input data is encoded to determine the x-axis value range corresponding to the x-axis value in the mapping table. In some embodiments, the input data is binary encoded, the obtained binary encoded value is decoded to mark the non-zero highest bit, and then the x-axis value range of the input data is determined based on the position of the non-zero highest bit.

[0047] In step S13, interpolation is performed based on the x-axis value range and the mapping table to obtain the y-axis mapping value of the input data on the y-axis of the real curve. In some embodiments, firstly, a pair of x-axis values, which are the two endpoints of the x-axis value range, are obtained; then, a pair of second axis values ​​corresponding to the pair of x-axis values ​​are obtained based on the mapping table; finally, the interpolation calculation is performed based on the pair of second axis values ​​to obtain the second axis mapping value. Since the input data is located within the x-axis value range of the mapping table, the y-axis values ​​at the two endpoints of this range can be obtained through the mapping table, and thus the y-axis mapping value corresponding to the input data can be calculated through linear interpolation.

[0048] Steps S12 and S13 will now be described in detail with reference to FIG3. FIG3 shows a detailed flowchart of a data mapping transformation method according to an embodiment of the present application. As shown in FIG3, in some embodiments, step S12 may include steps S121 to S123.

[0049] In step S121, the input data is binary encoded to obtain a binary encoded value. In some embodiments, the range of the input data is 0 to 2. 26 Therefore, a 26-segment mapping table as shown in Table 1 is created based on the method described in step S11 above. When encoding the input data, binary encoding of the input data is first performed, since the range of the input data is 0 to 2. 26 The maximum size of the binary code after binary encoding of the data is 26 bits. Therefore, in this embodiment, the size of the binary code value of the data is set to 26 bits.

[0050] Figure 4 shows a schematic diagram of the binary encoding of input data in an embodiment of this application. In Figure 4, 0 to 25 correspond to the 0th to 25th bits of the binary encoded value, totaling 26 bits.

[0051] Subsequently, in step S122, the binary encoded value is decoded to mark the non-zero highest bit. In some embodiments, decoding the binary encoded value to mark the non-zero highest bit may include steps S1221 to S1223.

[0052] In step S1221, the binary encoded values ​​are grouped. In some embodiments, the groups can be made up of 4 bits of data.

[0053] In step S1222, the first segment of decoding is performed to determine the group containing the non-zero most significant bit. In some embodiments, this step includes determining the first group greater than zero, starting from the most significant bit group, as the group containing the non-zero most significant bit.

[0054] In step S1223, a second-stage decoding is performed on the group containing the non-zero highest bit to determine the bit position of the non-zero highest bit. In some embodiments, this step includes determining the first non-zero bit in the group containing the non-zero highest bit in descending order of bit position to determine it as the non-zero highest bit.

[0055] According to the embodiments of this application, in step S1221, when grouping the binary encoded values, 4 bits of data are grouped together. Starting from the least significant bit, the 26-bit input data is divided into 7 groups, as shown in the dashed box in Figure 4, which illustrates the specific method of input data grouping. Furthermore, in step S1222, when determining the first group greater than zero from the most significant bit group to identify the group containing the non-zero highest bit, a bitwise OR operation can be performed starting from the highest group. If any bit in each group is 1, the result of the bitwise OR operation is 1, thus identifying the group greater than zero. In step S1223, the specific implementation for determining the first non-zero bit in the group containing the non-zero highest bit in descending order of bit position can be as follows: For the group containing the non-zero highest bit determined in step S1222, a logical AND operation is performed between the group data and 0x1 from high to low. If the result of the logical AND operation is 1, then the non-zero bit is found.

[0056] Next, in step S123, the position of the highest non-zero bit is used to determine the x-axis value range of the input data in the mapping table. Since the x-axis values ​​in the mapping table are 0 and 2... 0 2 1 ……2 N After decoding the binary encoded value through the above step S122 to mark the non-zero highest bit, assuming the non-zero highest bit is bit_index, the size of the input data is in [2]. bit_index ,2 bit_index+1 Therefore, the input data is located in the x-axis value range of the mapping table within the interval [2]. bit _index ,2 bit_index+1 ].

[0057] Furthermore, as shown in FIG3, in some embodiments, step S13 may include steps S131 and S132.

[0058] In step S131, a pair of x-axis values, which are the two endpoints of the x-axis value range, are obtained.

[0059] In step S132, a pair of y-axis values ​​corresponding to the pair of x-axis values ​​are obtained based on the mapping table.

[0060] In step S133, the interpolation calculation is performed based on the pair of second axis values ​​to obtain the second axis mapping value. In one embodiment, first, a pair of x-axis values, denoted as x, which are the two endpoints of the x-axis value interval, are obtained. n x n+1 Then, by looking up the mapping table, a pair of x-axis values ​​x are obtained. n x n+1 The corresponding pair of y-axis values ​​are denoted as y n y n+1 ,

[0061] Finally, interpolation is performed based on the following formula to obtain the y-axis mapping value corresponding to the input data:

[0062] out = (y n *wet+y n+1 *(distance-wet)) / distance

[0063] wet = x n+1 -x in

[0064] distance = x n+1 -x n

[0065] Where out is the y-axis mapping value corresponding to the input data, and x in For input data.

[0066] In summary, the data mapping transformation method disclosed in this application includes two main parts: first, the creation of the mapping table in step S11 of the above embodiment; and second, the two-stage decoding to find the interpolation interval in step S12 of the above embodiment. In step S11, an exponential function with base 2 is used to approximate the true curve for x-axis values, while the y-axis value is an external input that can be dynamically configured. This creates a mapping table, allowing for the allocation of more and denser points in areas of rapid curve growth and fewer and sparser points in flat areas for the exponential function-like curve, resulting in a more approximate curve and thus more accurate mapping. Furthermore, in step S12, when determining that the input data lies within the x-axis value interval of the mapping table, binary encoding and decoding are used to find the position of the highest non-zero bit, thereby determining the interpolation interval. Interpolation calculations are then performed within the interpolation interval to obtain the y-axis mapping value corresponding to the input data, accelerating the search speed for the interpolation interval and saving hardware resources.

[0067] To more clearly illustrate the specific details of the two-stage decoding lookup interpolation interval of this application, the following detailed description of the specific implementation of the two-stage decoding lookup interpolation interval is provided in conjunction with Figures 5 and 6.

[0068] Figure 5 shows a flowchart of the two-stage decoding lookup interpolation interval in one embodiment of this application. As shown in Figure 5, the two-stage decoding lookup interpolation interval may include the following steps.

[0069] Step S31: Input the data to be mapped.

[0070] Step S32: Encode the input data to be mapped into binary and divide it into groups of 4 bits, starting from the least significant bit and moving to the most significant bit.

[0071] Step S33: Extract a set of data from the high-order bits to the low-order bits of the input data to be mapped.

[0072] Step S34: Determine whether the retrieved data is greater than zero. If so, proceed to step S35; otherwise, proceed to step S36.

[0073] Step S35: Obtain the group containing the highest non-zero bit to continue with step S37.

[0074] Step S36: Move to the next set of data and return to step S33.

[0075] Step S37: Determine if the current bit is non-zero. If it is, proceed to step S38; otherwise, proceed to step S39.

[0076] Step S38: Find the highest non-zero bit and execute step S310.

[0077] Step S39: Move to the next position and return to step S37.

[0078] Step S310: Output the interpolation interval.

[0079] In the embodiment shown in Figure 5, steps S33 to S36 are the first segment of decoding, the purpose of which is to find the group containing the non-zero highest bit, and steps S37 to S39 are the second segment of decoding, the purpose of which is to find the non-zero highest bit and then obtain the interpolation interval.

[0080] Taking the input data in Figure 4 as an example, Figure 6 is a flowchart of the specific implementation scheme of the data mapping and transformation method in one embodiment of this application.

[0081] As shown in Figure 6, the input data is denoted as in_data[25:0], which is a 26-bit binary number. The binary encoded value is divided into 7 groups: [3:0], [7:4], [11:8], [15:12], [19:16], [23:20], and [25:24]. These 7 groups are labeled as 0, 1, 2, 3, 4, 5, and 6, respectively. Starting from the most significant bit, each of the 7 groups is sequentially checked to determine if it contains the highest non-zero bit. In this embodiment, a bitwise OR operation is performed starting from group 6, and the result of the bitwise OR operation is checked to see if it equals 1. For example, when performing the logical operation [25:24], check if [25:24] is 1. If it is, record high_bit = 6, identify the group of data [25:24] as containing the non-zero highest bit, and truncate the data in this group, setting cut_data = in_data[25:24]. If [25:24] is not 1, check if [23:20] is 1. If it is, record high_bit = 5, identify the group of data [23:20] as containing the non-zero highest bit, and truncate the data in this group, setting cut_data = in_data[23:20]. This process continues until the group containing the non-zero highest bit is found, at which point the logical operation on subsequent groups stops. The data high_bit and cut_data are then stored.

[0082] Then, the second stage of decoding proceeds: Starting from the most significant bit, the data in the found `cut_data` is checked for a value of 1. This can be achieved using a logical AND operation to obtain the `low_bit` value. The `low_bit` value ranges from 0 to 3. If the most significant bit (the 4th bit) of the group containing the non-zero most significant bit is 1, then `low_bit` is 3; if the 3rd bit is 1, then `low_bit` is 2; if the 2nd bit is 1, then `low_bit` is 1; and if the 1st bit is 1, then `low_bit` is 0. Based on the obtained `high_bit` and `low_bit`, the flag value of the non-zero most significant bit can be obtained: `bit_index = high_bit * 4 + low_bit`. This completes the two-stage decoding process of finding the interpolation interval.

[0083] Finally, the mapped output value can be obtained through interpolation: out = (y n *wet+y n+1 *(distance-wet)) / distance, in this formula, distance=2 bit _ index+1 -2 bit _ index =2 bit _ indexIn this formula, the step of dividing by distance is eliminated by shifting, saving a divider.

[0084] Based on the above, this application's two-stage decoding method improves the search efficiency of the interpolation interval, and in terms of hardware implementation, reduces the use of a divider, thus saving hardware area. The reduction in the divider is achieved through 2... bit _ index The spacing is achieved by shifting. In addition, if we use the if-else method to compare level by level, the search for 25 segments would need to be divided into 3 if-else statements to find the specific segment, which would take 3 clock cycles. If we need 3 clock cycles, we would need to buffer the input data three levels, which would require 3 register resources. This application can save 3 registers, and the output latency is also reduced by 3 clock cycles.

[0085] The application also provides a data mapping transformation device, which can implement the data mapping transformation method described in this application. However, the implementation device of the data mapping transformation method described in this application includes, but is not limited to, the structure of the data mapping transformation device listed in this embodiment. All structural modifications and substitutions of the prior art made based on the principles of this application are included within the protection scope of this application.

[0086] Figure 7 shows a structural block diagram of a data mapping transformation device according to an embodiment of this application. As shown in Figure 7, the data mapping transformation device 7 in this embodiment includes a mapping table acquisition module 71, an interpolation interval lookup module 72, and an interpolation calculation module 73. The mapping table acquisition module 71 is configured to acquire a mapping table associated with a point selected on the x-axis of a real curve. The mapping table includes x-axis values ​​and y-axis values ​​corresponding to the x-axis values. The x-axis values ​​are the values ​​of the points on the x-axis, and the y-axis values ​​are the values ​​mapped by the points on the real curve corresponding to the points on the y-axis intersecting the x-axis. The interpolation interval lookup module 72 is configured to encode the input data to determine the x-axis value interval in the mapping table corresponding to the x-axis values. Furthermore, the interpolation calculation module 73 is configured to perform interpolation calculations based on the x-axis value interval and the mapping table to obtain the y-axis mapping value of the input data on the y-axis of the real curve.

[0087] Figure 8 shows a structural block diagram of a data mapping transformation device according to another embodiment of this application. As shown in Figure 8, the data mapping transformation device 8 in this embodiment includes a mapping table creation module 80, a mapping table acquisition module 81, an interpolation interval lookup module 82, and an interpolation calculation module 83. The mapping table creation module 81 is configured to select points on the x-axis at non-uniform intervals, dynamically configure y-axis values, and create a mapping table with a one-to-one correspondence between the x-axis values ​​and the y-axis values. The mapping table acquisition module 81 is configured to acquire a mapping table associated with points selected on the x-axis for the true curve, the mapping table including x-axis values ​​and y-axis values ​​corresponding to the x-axis values, the x-axis values ​​being the values ​​of the points on the x-axis, and the y-axis values ​​being the values ​​mapped by the points on the true curve corresponding to the points on the y-axis intersecting the x-axis. The interpolation interval lookup module 82 is configured to encode the input data to determine that the input data is located in the x-axis value interval in the mapping table corresponding to the x-axis values. In addition, the interpolation calculation module 83 is configured to perform interpolation calculations based on the x-axis value range and the mapping table to obtain the y-axis mapping value of the input data on the y-axis of the real curve.

[0088] It is understood that the modules in the data mapping transformation apparatus described with reference to Figures 7 and 8 can also be configured to perform the respective steps or actions in the data mapping transformation method described above. In some embodiments, the data mapping transformation apparatus may include a chip.

[0089] The application also provides an electronic device. The electronic device includes a memory and a processor. The memory is configured to store a processor-executable program. The processor is communicatively connected to the memory and is configured to invoke the computer program to perform the data mapping transformation method according to this application.

[0090] In some embodiments, the memory includes various media capable of storing program code, such as ROM, RAM, magnetic disk, USB flash drive, memory card, or optical disk.

[0091] In some embodiments, the processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. In other embodiments, the processor may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0092] The electronic devices described in this application embodiment may include mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and other terminal devices. They can also be used in databases, servers, and service response systems based on terminal artificial intelligence. This application embodiment does not impose any restrictions on the specific type of electronic device.

[0093] For example, the electronic device may be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, a computer, a laptop computer, a handheld communication device, a handheld computing device, and / or other devices for communicating over a wireless system, as well as next-generation communication systems, such as mobile terminals in 5G networks, mobile terminals in future evolved Public Land Mobile Networks (PLMNs), or mobile terminals in future evolved Non-terrestrial Networks (NTNs).

[0094] This application also provides a computer-readable storage medium storing a computer program thereon, the computer program being executed by a processor to implement the data mapping transformation according to this application. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof. The above storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0095] This application embodiment may also provide a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this application embodiment are generated. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0096] When the computer program product is executed by a computer, the computer performs the method described in the foregoing method embodiments. The computer program product can be a software installation package; when the foregoing method is required, the computer program product can be downloaded and executed on the computer.

[0097] In the data mapping transformation method and apparatus, electronic equipment, and computer-readable storage medium of this application, a base-2 exponential function (2... nTo approximate the true curve, x-axis values ​​are used to create a mapping table. This allows for the allocation of more and denser points in areas of rapid curve growth and fewer and sparser points in flatter areas, resulting in a more accurate approximation of the curve. Furthermore, when determining the x-axis value range of the input data within the mapping table, binary encoding and decoding are used to find the position of the highest non-zero bit, thus determining the interpolation range. Interpolation calculations are then performed within this range to obtain the corresponding y-axis mapping value for the input data, accelerating the search for the interpolation range and saving hardware resources.

[0098] In the embodiments provided in this application, it should be understood that the disclosed systems or methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or modules or units, and may be electrical, mechanical, or other forms.

[0099] Those skilled in the art will further recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0100] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.

[0101] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A data mapping and transformation method, characterized in that, include: Obtain a mapping table associated with a point selected on a first axis of a real curve, the mapping table including a first axis value and a second axis value corresponding to the first axis value, the first axis value being the value of the point on the first axis, and the second axis value being the value of the point on the real curve corresponding to the point on the second axis intersecting the first axis; The input data is encoded to determine that it lies within a first axis value range in the mapping table corresponding to the first axis value, wherein the input data corresponds to the parameters to be mapped in the image; and interpolation is performed based on the first axis value range and the mapping table to obtain the second axis mapping value of the input data on the second axis of the true curve, wherein the points selected on the first axis include points selected at non-uniform intervals, and the points selected at non-uniform intervals include points selected along the positive direction of the first axis starting from the origin at intervals of 2. n The sampling interval is used to take points one by one, and n takes values ​​of 0, 1, 2...N, where N is a positive integer. Encoding the input data to determine the first axis value interval in the mapping table corresponding to the first axis value includes: performing binary encoding on the input data to obtain a binary encoded value; decoding the binary encoded value to mark the non-zero highest bit; and determining the first axis value interval in the mapping table based on the position of the non-zero highest bit.

2. The data mapping and transformation method according to claim 1, characterized in that, The second axis value includes dynamically configured second axis values.

3. The data mapping and transformation method according to claim 1, characterized in that, Decoding the binary encoded value to mark the non-zero highest bit includes: grouping the binary encoded value; performing a first segment of decoding to determine the group in which the non-zero highest bit is located; and performing a second segment of decoding on the group in which the non-zero highest bit is located to determine the bit in which the non-zero highest bit is located.

4. The data mapping and transformation method according to claim 3, characterized in that, Performing the first segment of decoding to determine the group containing the non-zero highest bit includes: starting from the high-order bit group, determining the first group greater than zero, and identifying that group as the group containing the non-zero highest bit.

5. The data mapping and transformation method according to claim 3, characterized in that, Performing a second decoding operation on the group containing the non-zero highest bit to determine the bit position of the non-zero highest bit includes: determining the first non-zero bit in the group containing the non-zero highest bit in descending order of bit position, and determining the bit position as the non-zero highest bit.

6. The data mapping and transformation method according to claim 1, characterized in that, The interpolation calculation based on the first axis value range and the mapping table to obtain the second axis mapping value of the input data on the second axis of the real curve includes: obtaining a pair of first axis values ​​that are the two endpoints of the first axis value range; obtaining a pair of second axis values ​​corresponding to the pair of first axis values ​​based on the mapping table; and performing the interpolation calculation based on the pair of second axis values ​​to obtain the second axis mapping value.

7. The data mapping and transformation method according to claim 1, characterized in that, The first axis includes an x-axis, and the second axis includes a y-axis. Interpolation calculations are performed based on the value range of the first axis and the mapping table to obtain the second axis mapping value of the input data on the true curve. This includes: obtaining the endpoints of the x-axis value range corresponding to the input data based on the mapping table. 、 Mapping value at 、 And the y-axis mapping value corresponding to the input data is obtained by interpolation calculation based on the following formula: in, The y-axis mapping value corresponding to the input data. For input data.

8. The data mapping and transformation method according to claim 1, characterized in that, Also includes: Create the mapping table by matching the first axis value with the second axis value one-to-one.

9. A data mapping and transformation device, characterized in that, include: A mapping table acquisition module is configured to acquire a mapping table associated with a point selected on a first axis of a real curve. The mapping table includes a first axis value and a second axis value corresponding to the first axis value. The first axis value is the value of the point on the first axis, and the second axis value is the value mapped by the point on the real curve corresponding to the point on the second axis intersecting the first axis. An interpolation interval lookup module is configured to encode input data to determine that the input data is located in the first axis value interval in the mapping table corresponding to the first axis value. And an interpolation calculation module, configured to perform interpolation calculations based on the first axis value range and the mapping table, to obtain the second axis mapping value of the input data on the second axis of the true curve, wherein the points selected on the first axis include points selected at non-uniform intervals, and the points selected at non-uniform intervals include points selected along the positive direction of the first axis starting from the origin at intervals of 2. n The sampling interval is the number of points taken one by one, and n takes values ​​of 0, 1, 2...N, where N is a positive integer. The interpolation interval lookup module is configured to: encode the input data into binary to obtain a binary encoded value. The binary encoded value is decoded to mark the non-zero highest bit; and the position of the non-zero highest bit is used to determine the range of the first axis value in the mapping table where the input data is located.

10. The data mapping and transformation apparatus according to claim 9, characterized in that, Also includes: The mapping table creation module is configured to select points on the first axis at non-uniform intervals, dynamically configure the values ​​of the second axis, and create the mapping table with the values ​​of the first axis and the values ​​of the second axis corresponding one-to-one.

11. An electronic device, characterized in that, include: The memory is configured to store processor-executable programs. And a processor, configured to invoke the program to perform the data mapping transformation method according to any one of claims 1 to 8.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed to implement the data mapping transformation method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and device for Gamma correction

    CN106846273A