Color gamut conversion method, mapping table establishment method, device, equipment, storage medium and program product
By using a combination of the first and second fields to represent the optical signal value, the problem of high storage resource consumption in traditional color gamut conversion is solved, realizing an efficient color gamut conversion method and reducing storage space requirements.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN QINGSONG PHOTOELECTRIC TECH CO LTD
- Filing Date
- 2024-08-13
- Publication Date
- 2026-07-14
Smart Images

Figure CN121528174B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image display technology, and in particular to a color gamut conversion method, a mapping table establishment method, an apparatus, a device, a storage medium, and a program product. Background Technology
[0002] High Dynamic Range Imaging (HDRI or HDR) is a set of techniques used in computer graphics and cinematography to achieve a greater dynamic range of exposure (i.e., greater difference between light and dark areas) than ordinary digital imaging techniques. The typical characteristics of HDR compared to traditional SDR (Standard Dynamic Range) are that HDR has a higher brightness range, a wider color gamut, and a greater color bit depth.
[0003] In current practical applications, a significant issue is that many video sources, video processing devices, and display media do not fully support HDR formats. Many older devices will continue to exist and be used for a long time, and the differences between various standards and product generations are substantial. Currently, conversion between HDR and SDR is used to achieve different color gamuts or color spaces. During color gamut conversion, the electrical signal values after video encoding need to be converted into linear optical signal values.
[0004] The conversion between traditional electrical signal values and linear optical signal values generally uses a lookup table method. This involves defining a RAM (Random Access Memory) and pre-loading the values. Considering the very large data range of linear optical signal values, requiring 27 bits for representation, and electrical signal values requiring 10 bits, the data table has a depth of 2^27 and a width of 10 bits, requiring 2^27 * 10 bits = 1.3 Gbit of storage space. However, this method consumes a significant amount of storage resources. Summary of the Invention
[0005] Therefore, it is necessary to provide a color gamut conversion method, mapping table establishment method, apparatus, device, storage medium, and program product that can reduce storage resources to address the above-mentioned technical problems.
[0006] Firstly, this application provides a color gamut conversion method, the method comprising:
[0007] The first electrical signal value obtained after encoding the image is acquired; the first electrical signal value represents the color information of the image in a first color gamut.
[0008] From a pre-established first mapping table, find the target optical signal value represented in a first form that corresponds to the first electrical signal value; the first mapping table includes the mapping relationship between different electrical signal values and optical signal values under a first color gamut.
[0009] From a pre-established second mapping table, a second electrical signal value corresponding to the target optical signal value is found; the second mapping table includes the mapping relationship between different electrical signal values and optical signal values under the second color gamut; wherein, the optical signal values in the first mapping table and the second mapping table are represented by a first form, the first form includes a first field and a second field, the value of the first field multiplied by the target value equals the optical signal value, the target value is obtained by exponentiation with a preset value as the base and the value of the second field as the exponent;
[0010] The image is displayed in the second color gamut based on the second electrical signal value.
[0011] In one embodiment, the method further includes:
[0012] Determine the electro-optical transfer function corresponding to the first color gamut;
[0013] For any electrical signal value in the first color gamut, based on the electro-optical transfer function, determine the optical signal value corresponding to the electrical signal value, expressed in a second form; the second form is an integer form.
[0014] Based on the optical signal value represented in the second form, the values of the first field and the second field are determined, and the optical signal value represented in the first form is obtained through the values of the first field and the second field.
[0015] Establish a mapping relationship between the electrical signal value in the first color gamut and the optical signal value represented in the first form;
[0016] A first mapping table is generated based on the mapping relationship between each electrical signal value in the first color gamut and the optical signal value represented in the first form.
[0017] In one embodiment, determining the values of the first field and the second field based on the optical signal value represented in a second form includes:
[0018] Based on the optical signal value represented in a second form, a first initial value for the first field and a second initial value for the second field are set;
[0019] Determine the relationship between the first initial value and the preset range;
[0020] If the first initial value is greater than the upper limit of the preset range, then the first initial value is shifted to the left once and the second initial value is incremented by 1; if the first initial value is less than the lower limit of the preset range, then the first initial value is shifted to the right once and the second initial value is decremented by 1.
[0021] The updated first initial value is used as the new first initial value, and the step of determining the relationship between the first initial value and the preset range is returned based on the new first initial value, and the process continues until the first initial value is within the preset range, or the number of moves reaches the moving threshold. The last determined first initial value is used as the value of the first field, and the last determined second initial value is used as the value of the second field.
[0022] In one embodiment, the step of searching for the second electrical signal value corresponding to the target optical signal value from a pre-established second mapping table includes:
[0023] Obtain the pre-established second mapping table;
[0024] If the target optical signal value is in the second mapping table, then the electrical signal value corresponding to the target optical signal value in the second mapping table is used as the second electrical signal value corresponding to the target optical signal value.
[0025] In one embodiment, the method further includes:
[0026] If the target optical signal value is not in the second mapping table, then a reference optical signal value that meets the approximation condition is determined in the second mapping table, and the electrical signal value corresponding to the reference optical signal value is used as the second electrical signal value corresponding to the target optical signal value.
[0027] In one embodiment, the method further includes:
[0028] After finding the target optical signal value represented in the first form from the first mapping table, if an update operation for the target optical signal value is detected, the target optical signal value is converted from the first form to the second form.
[0029] Based on the update operation, the target optical signal value expressed in the second form is updated to obtain the updated target optical signal value expressed in the second form.
[0030] Based on the updated target optical signal value represented in the second form, determine the values of the new first field and the new second field, represent the updated target optical signal value represented in the first form using the values of the new first field and the new second field, and perform the step of searching for the second electrical signal value corresponding to the target optical signal value from the pre-established second mapping table based on the updated target optical signal value represented in the first form.
[0031] Secondly, this application also provides a method for establishing a mapping table, the method comprising:
[0032] Determine the electro-optic transfer function corresponding to the target color gamut; the target color gamut refers to either the first color gamut or the second color gamut.
[0033] For any electrical signal value under the target color gamut, based on the electro-optical transfer function, determine the optical signal value corresponding to the electrical signal value in a second form; the second form is an integer form.
[0034] Based on the optical signal value represented in the second form, the values of the first field and the second field are determined, and the optical signal value represented in the first form is obtained through the values of the first field and the second field.
[0035] Establish a mapping relationship between the electrical signal value and the optical signal value represented in the first form under the target color gamut;
[0036] A target mapping table is generated based on the mapping relationship between each electrical signal value in the target color gamut and the optical signal value represented in the first form.
[0037] In one embodiment, determining the values of the first field and the second field based on the optical signal value represented in a second form includes:
[0038] Based on the optical signal value represented in a second form, a third initial value for the first field and a fourth initial value for the second field are set;
[0039] Determine the relationship between the third initial value and the preset range;
[0040] If the third initial value is greater than the upper limit of the preset range, then the third initial value is shifted to the left by one, and the fourth initial value is incremented by 1; if the third initial value is less than the lower limit of the preset range, then the third initial value is shifted to the right by one, and the fourth initial value is decremented by 1.
[0041] The updated third initial value is used as the new third initial value, and the step of determining the relationship between the third initial value and the preset range is returned based on the new third initial value, until the third initial value is within the preset range, or the number of moves reaches the moving threshold. The finally determined third initial value is used as the value of the first field, and the finally determined fourth initial value is used as the value of the second field.
[0042] Thirdly, this application also provides a color gamut conversion device, the device comprising:
[0043] The first electrical signal acquisition module is used to acquire the first electrical signal value obtained after the image is encoded; the first electrical signal value represents the color information of the image in a first color gamut.
[0044] An electro-optic conversion module is used to look up a target optical signal value, represented in a first form, that corresponds to the first electrical signal value from a pre-established first mapping table; the first mapping table includes the mapping relationship between different electrical signal values and optical signal values under a first color gamut.
[0045] The photoelectric conversion module is used to look up a second electrical signal value corresponding to the target optical signal value from a pre-established second mapping table; the second mapping table includes the mapping relationship between different electrical signal values and optical signal values under a second color gamut; wherein, the optical signal values in the first mapping table and the second mapping table are represented by a first form, the first form including a first field and a second field, the value of the first field multiplied by the target value equals the optical signal value, the target value is obtained by exponentiation with a preset value as the base and the value of the second field as the exponent;
[0046] The display module is used to display the image in the second color gamut based on the second electrical signal value.
[0047] Fourthly, this application also provides a mapping table creation apparatus, the apparatus comprising:
[0048] The transfer function determination module is used to determine the electro-optic transfer function corresponding to the target color gamut; the target color gamut refers to the first color gamut or the second color gamut.
[0049] The optical signal calculation module is used to determine, based on the electro-optical transfer function, the optical signal value corresponding to any electrical signal value under the target color gamut, in a second form; the second form is an integer form.
[0050] The optical signal format conversion module is used to determine the values of the first field and the second field based on the optical signal value represented in the second format, and to obtain the optical signal value represented in the first format through the values of the first field and the second field;
[0051] The mapping relationship establishment module is used to establish a mapping relationship between the electrical signal value and the optical signal value represented in the first form under the target color gamut.
[0052] The mapping table generation module is used to generate a target mapping table based on the mapping relationship between each electrical signal value and the optical signal value represented in the first form under the target color gamut.
[0053] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described color gamut conversion method and mapping table establishment method.
[0054] Sixthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described color gamut conversion method and mapping table establishment method.
[0055] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described color gamut conversion method and mapping table establishment method.
[0056] The aforementioned color gamut conversion method, mapping table establishment method, apparatus, device, storage medium, and program product, from a pre-established first mapping table, look up a target optical signal value represented in a first form corresponding to a first electrical signal value. The first mapping table includes mapping relationships between different electrical signal values and optical signal values under the first color gamut, i.e., electro-optical conversion is completed through a lookup table. Further, from a pre-established second mapping table, look up a second electrical signal value corresponding to the target optical signal value. The second mapping table includes mapping relationships between different electrical signal values and optical signal values under the second color gamut, i.e., photoelectric conversion is completed through a lookup table. Even further, based on the second electrical signal value, an image is displayed in the second color gamut, thereby converting the first electrical signal value under the first color gamut into the second electrical signal value under the second color gamut, thus completing the color gamut conversion. This color gamut conversion method supports the access of various standard video source devices and can interface with display media of different standards. In the above process, when photoelectric conversion or electro-optical conversion is completed by the lookup table method, the optical signal values in the first and second mapping tables are represented by the first form. In the first form, the value of the first field multiplied by the target value equals the optical signal value. The target value and the optical signal value are obtained by exponentiation. The value of the second field is the exponent of the target value. Therefore, the values of the first and second fields are much smaller than the optical signal value. The data bit width occupied by the first form is much smaller than the data bit width occupied by the optical signal value. The combination of the first and second fields can represent an optical signal value with a very large range, realizing the compression of the optical signal values in each mapping table. This can greatly reduce the size of invalid storage space and reduce storage resource overhead. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a diagram illustrating the application environment of a color gamut conversion method in one embodiment.
[0059] Figure 2This is a flowchart illustrating a color gamut conversion method in one embodiment;
[0060] Figure 3 This is a comparative diagram of EOTF and OETF in one embodiment;
[0061] Figure 4 This is a mapping curve between electrical and optical signals in one embodiment;
[0062] Figure 5 This is a schematic diagram illustrating the relationship between the grayscale step of an electrical signal and the display brightness of a 12-bit signal in one embodiment;
[0063] Figure 6 This is a schematic diagram illustrating the relationship between the grayscale step of an electrical signal and the display brightness of a 10-bit signal in one embodiment;
[0064] Figure 7 This is a schematic diagram of the process for finding the second mapping table in one embodiment;
[0065] Figure 8 This is a flowchart illustrating a mapping table creation method in one embodiment;
[0066] Figure 9 This is a structural block diagram of a color gamut conversion device in one embodiment;
[0067] Figure 10 This is a structural block diagram of a mapping table creation device in one embodiment;
[0068] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0070] In current practical applications, a significant issue is that many video sources, video processing devices, and display media do not fully support HDR formats. Many older devices will continue to exist and be used for a long time, and the differences between various standards and product generations are substantial. Currently, conversion between HDR and SDR is used to achieve different color gamuts or color spaces. During color gamut conversion, the electrical signal values after video encoding need to be converted into linear optical signal values.
[0071] The conversion between traditional electrical signal values and linear optical signal values generally uses a lookup table method. This involves defining a RAM (Random Access Memory) and pre-loading the values. Considering the very large data range of linear optical signal values, requiring 27 bits for representation, and electrical signal values requiring 10 bits, the data table has a depth of 2^27 and a width of 10 bits, requiring 2^27 * 10 bits = 1.3 Gbit of storage space. However, this method consumes a significant amount of storage resources.
[0072] This application provides a color gamut conversion method. It involves acquiring a first electrical signal value obtained after encoding an image. This first electrical signal value represents the color information of the image in a first color gamut. A target optical signal value, represented in a first form, corresponding to the first electrical signal value is found from a pre-established first mapping table. The first mapping table includes mapping relationships between different electrical signal values and optical signal values in the first color gamut, thus completing the electro-optical conversion through a lookup table. Further, a second electrical signal value corresponding to the target optical signal value is found from a pre-established second mapping table. This second mapping table includes mapping relationships between different electrical signal values and optical signal values in the second color gamut, thus completing the photoelectric conversion through a lookup table. Even further, based on the second electrical signal value, an image is displayed in the second color gamut, thereby converting the first electrical signal value in the first color gamut to the second electrical signal value in the second color gamut, thus completing the color gamut conversion. This color gamut conversion method supports the access of various standard video source devices and can interface with display media of different standards. In the above process, when photoelectric conversion or electro-optical conversion is completed by the lookup table method, the optical signal values in the first and second mapping tables are represented by the first form. In the first form, the value of the first field multiplied by the target value equals the optical signal value. The target value and the optical signal value are obtained by exponentiation. The value of the second field is the exponent of the target value. Therefore, the values of the first and second fields are much smaller than the optical signal value. The data bit width occupied by the first form is much smaller than the data bit width occupied by the optical signal value. The combination of the first and second fields can represent an optical signal value with a very large range, realizing the compression of the optical signal values in each mapping table. This can greatly reduce the size of invalid storage space and reduce storage resource overhead.
[0073] The color gamut conversion method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, the video source device 102 in the first color gamut encodes the image to obtain a first electrical signal value, and transmits the first electrical signal value to the display device 104 in the second color gamut. The first electrical signal value represents the color information of the image in the first color gamut. The display device 104 acquires the first electrical signal value obtained after encoding the image; the display device 104 searches for a target light signal value, represented in a first form, corresponding to the first electrical signal value from a pre-established first mapping table; the first mapping table includes the mapping relationship between different electrical signal values and light signal values in the first color gamut; the display device 104 searches for a second electrical signal value, corresponding to the target light signal value, from a pre-established second mapping table; the second mapping table includes the mapping relationship between different electrical signal values and light signal values in the second color gamut; the light signal values in both the first and second mapping tables are represented in a first form, which includes a first field and a second field. The value of the first field multiplied by the target value equals the light signal value, and the target value is obtained by exponentiation with a preset base and the value of the second field as the exponent; the display device 104 displays the image in the second color gamut based on the second electrical signal value.
[0074] The video source device 102 and the display device 104 may be, but are not limited to, various personal computers, laptops, smartphones, tablets, video processing devices and display media.
[0075] In one exemplary embodiment, such as Figure 2 As shown, a color gamut conversion method is provided, which can be applied to... Figure 1 Taking a display device as an example, the explanation includes the following steps:
[0076] Step 202: Obtain the first electrical signal value after encoding the image; the first electrical signal value represents the color information of the image in the first color gamut.
[0077] An image is a static picture or frame generated by a video source device, containing all the pixels that make up the picture and their corresponding color information. Each frame of the image is encoded individually or in combination into a series of electrical signal values (denoted as E values) for transmission in the transmission medium and finally decoded and displayed on the display device.
[0078] The first electrical signal value refers to a digital representation obtained after image encoding. This representation is a series of binary codes or numerical values. The first electrical signal value represents the color information of the image in the first color gamut, where color information refers to the color value or color attribute of each pixel in the image. In digital images, color information is usually represented by values in red, green, blue (RGB) or other color spaces (such as CMYK, HSV, etc.). Furthermore, the first electrical signal value also includes visual information such as the image's color, brightness, and contrast, as well as metadata (such as timestamps, frame numbers, etc.).
[0079] The first color gamut refers to the color gamut used by the video source device. Because video source devices and display devices may be based on different technologies or standards, their ability to capture and represent colors (i.e., color gamut) may differ. Therefore, the first color gamut defines the range or color space of colors used by the video source device when generating and transmitting video signals. When the video signal is transmitted to the display device, the display device needs to convert and process the received signal according to its own supported color gamut to accurately display the colors of the original image.
[0080] Specifically, the video source device encodes each frame of the image to obtain a first electrical signal value, and transmits the first electrical signal value to the display device. The display device receives the first electrical signal value transmitted by the video source.
[0081] Step 204: From the pre-established first mapping table, find the target optical signal value represented in a first form that corresponds to the first electrical signal value; the first mapping table includes the mapping relationship between different electrical signal values and optical signal values under the first color gamut.
[0082] The first mapping table is a pre-established data structure that contains the mapping relationships between different electrical signal values (E values) and optical signal values (O values) within the first color gamut. The electrical signal values in the first mapping table are typically generated by the video source device and are encoded and compressed to represent the color information of the image. The optical signal values in the first mapping table are an important intermediate value, representing the color representation of the first electrical signal values in the physical world.
[0083] It should be noted that the process of converting an electrical signal into an optical signal is called EOTF. The optical domain (O domain) where the optical signal is located is a unified intermediate domain. Any different HDR coding standards can be uniformly expressed in the O domain. Then, the signal is converted into an electrical signal in the target color gamut, thus completing the mutual conversion between different HDR standards.
[0084] The target light signal value is obtained by looking up the entry corresponding to the first electrical signal value in the first mapping table. The target light signal value indicates which light signal value should be used to correctly reproduce the colors of the image on the display device. The target light signal value is determined based on the mapping relationship between the first color gamut used by the video source device and the second color gamut supported by the display device. Once the target light signal value is determined, the display device can use the information represented by the target light signal value to generate or control light, thereby presenting a visual effect that matches the original image.
[0085] Specifically, the display device determines the first electrical signal value sent by the video source device and accesses a pre-established first mapping table. In the first mapping table, the display device uses the first electrical signal value as a key to look up and extracts the target optical signal value corresponding to the first electrical signal value.
[0086] Step 206: Find the second electrical signal value corresponding to the target optical signal value from the pre-established second mapping table; the second mapping table includes the mapping relationship between different electrical signal values and optical signal values under the second color gamut; wherein, the optical signal values in the first mapping table and the second mapping table are represented by a first form, the first form includes a first field and a second field, the value of the first field multiplied by the target value equals the optical signal value, the target value is obtained by exponentiation with a preset value as the base and the value of the second field as the exponent.
[0087] The second mapping table is a pre-established table that contains the mapping relationships between different electrical signal values and optical signal values under the second color gamut (i.e., the color gamut in which the display device operates). It is used to convert optical signal values into second electrical signal values under the second color gamut during color gamut conversion. It should be noted that the process of converting optical signals into electrical signals is called OETF (Optical Encoding and Transformation). Figure 3 This is a comparative diagram of EOTF and OETF in one embodiment.
[0088] The second electrical signal value is the electrical signal value that corresponds to the target light signal value and is located in the second color gamut, obtained by the display device after determining the target light signal value by looking up the second mapping table.
[0089] The second color gamut refers to the range or set of colors that a display device can display.
[0090] The first form refers to the way optical signal values are stored or represented in the first and second mapping tables. The optical signal values in both tables are represented using floating-point data types, which are called the first form. The first form includes two fields: a first field and a second field. These two fields are used together to represent the optical signal value.
[0091] The first and second fields are two components of the first form, used to store different information or parameters related to the optical signal value. The value of the first field multiplied by the target value equals the optical signal value. The target value is obtained by exponentiation using a preset base and the value of the second field as the exponent.
[0092] The target value refers to the value calculated based on the second field through some operation (such as exponentiation), which is used to multiply with the first field to obtain the final optical signal value.
[0093] The preset value refers to the number system used in the storage and calculation of the display device, which determines how the light signal value is represented. The number system used by the display device includes binary, decimal, octal, etc. For example, taking the light signal value as 19971400000000, according to 19971400000000 = 1.99714 × 10^13, the first field is 1.99, the target value is 10^13, the preset value is 10, and the second field is 13. For example, taking the light signal value as 1200, according to 1200 = 150 × 2^3, the first field is 150, the target value is 2^3, the preset value is 2, and the second field is 3.
[0094] Specifically, the display device determines the target optical signal value and accesses a pre-established second mapping table. In the second mapping table, the display device uses the target optical signal value as a key to look up the value and extracts the second electrical signal value corresponding to the target optical signal value.
[0095] In some embodiments, the conversion between E and O in conventional technologies can also be achieved using a direct calculation method. This direct calculation method directly calculates the O corresponding to E, or the E corresponding to O, based on the electro-optic transfer function. However, because the direct calculation method involves exponentiation and has a large data bit width, while it works fine for display devices processing individual images, it struggles to meet real-time requirements for continuous video stream processing. It also consumes a significant amount of FPGA logic resources and multipliers in the display device, resulting in a massive computational load. Generally, sacrificing precision to reduce resource consumption is necessary for practical value, and this is the approach taken in many product applications. For example, using integer processing and discarding long decimal places can affect the low-grayscale effect of the video. The specific amount of precision sacrificed depends on the application scenario and the desired resource savings.
[0096] If, after resource assessment, it is determined that the resource overhead required to determine the second electrical signal value corresponding to the target optical signal value through direct calculation is acceptable, then the direct calculation method can be used instead of using the second mapping table for lookup.
[0097] Step 208: Display the image in the second color gamut based on the second electrical signal value.
[0098] Specifically, after the display device obtains the second electrical signal value corresponding to the target light signal value, it converts the second electrical signal value into a digital signal that the display device can recognize, maps the digital signal to specific image data, and displays the image sent by the video source device according to the image data under the second color gamut supported by the display device.
[0099] In the aforementioned color gamut conversion method, a target optical signal value, represented in a first form, corresponding to a first electrical signal value is found from a pre-established first mapping table. The first mapping table includes the mapping relationship between different electrical signal values and optical signal values under the first color gamut, thus completing the electro-optical conversion through a lookup table. Further, a second electrical signal value corresponding to the target optical signal value is found from a pre-established second mapping table. The second mapping table includes the mapping relationship between different electrical signal values and optical signal values under the second color gamut, thus completing the photoelectric conversion through a lookup table. Even further, an image is displayed in the second color gamut based on the second electrical signal value, thereby converting the first electrical signal value in the first color gamut to the second electrical signal value in the second color gamut, thus completing the color gamut conversion. This color gamut conversion method supports the access of various standard video source devices and can interface with display media of different standards. In the above process, when photoelectric conversion or electro-optical conversion is completed by the lookup table method, the optical signal values in the first and second mapping tables are represented by the first form. In the first form, the value of the first field multiplied by the target value equals the optical signal value. The target value and the optical signal value are obtained by exponentiation. The value of the second field is the exponent of the target value. Therefore, the values of the first and second fields are much smaller than the optical signal value. The data bit width occupied by the first form is much smaller than the data bit width occupied by the optical signal value. The combination of the first and second fields can represent an optical signal value with a very large range, realizing the compression of the optical signal values in each mapping table. This can greatly reduce the size of invalid storage space and reduce storage resource overhead.
[0100] In one embodiment, the method for establishing the first mapping table can be the same as the method for establishing the second mapping table. Therefore, only the method for establishing the first mapping table will be described here. Specifically, the method for establishing the first mapping table includes:
[0101] 1. Determine the electro-optic transfer function corresponding to the first color gamut.
[0102] The electro-optical transfer function (EOTF) is a function that converts the encoded electrical signal of an image into the linear optical domain, describing the conversion process from video signal to linear optical output. Using the EOTF, the corresponding linear optical output can be calculated from the input video signal, thus achieving color gamut conversion. For example, the conversion between BT.709 (a format of SDR) and BT.2020 (a format of HDR) first involves converting the encoded electrical signal of the BT.709 video into the linear optical domain; this process is called EOTF, and the function that performs the EOTF is called the electro-optical transfer function.
[0103] Specifically, the display device determines the electro-optical transfer function corresponding to the first color gamut based on the type of the first color gamut.
[0104] In some embodiments, the conversion between different color spaces corresponds to different electro-optical transfer functions. Table 1 lists the electro-optical transfer functions corresponding to several color spaces:
[0105] Table 1
[0106]
[0107] Among them, sRGB and Rec.709 mainly belong to the SDR color gamut standard. P3-D65, P3-Theatrical, and Rec.2020 mainly belong to the HDR color gamut standard. According to the SMPTE ST 2084 standard, the EOTF conversion equation corresponding to PQ in Table 1 is:
[0108]
[0109] where
[0110] N denotes a nonlinear color value
[0111] L denotes the corresponding linear color value
[0112]
[0113] m2 is the number 2523 / 4096×128=78.84375
[0114] c1 is the number 3424 / 4096=0.8359375=c3-c2+1
[0115] c2 is the number 2413 / 4096×32=18.8515625
[0116] c3 is the number 2392 / 4096×32=18.6875
[0117] Where N is a nonlinear electrical signal with a data range of 0-1023, and L is a linear optical signal with a data range of 0.00004-10000 nits, representing light intensity in nits. The above function represents the mapping relationship between electrical and optical signals. Table 2 shows the corresponding optical signals for different electrical signal pairs obtained using this function.
[0118] Table 2
[0119] N L (linear optical data) nit 0 0.000000 1 0.000040 2 0.000131 3 0.000262 ...... ...... ...... ...... 1021 9724.121312 1022 9815.190962 1023 9907.147488
[0120] Figure 4 This is a mapping curve between electrical and optical signals in one embodiment. Figure 4 Several typical electrical signal data correspondences are given, among which, Figure 4 The horizontal axis represents light intensity, and the vertical axis represents the value of the encoded electrical signal.
[0121] 2. For any electrical signal value in the first color gamut, based on the electro-optical transfer function, determine the optical signal value corresponding to the electrical signal value in the second form; the second form is an integer form.
[0122] Specifically, for any electrical signal value under the first color gamut, the display device uses the electro-optical transfer function (EOTF) corresponding to the first color gamut to convert the targeted electrical signal value into an optical signal value, and quantizes the calculated optical signal value into an integer form.
[0123] Third, based on the optical signal value represented in the second form, determine the value of the first field and the value of the second field, and obtain the optical signal value represented in the first form through the value of the first field and the value of the second field.
[0124] When using the first and second fields to represent and compress optical signal values, the bit width of these fields directly affects the storage size of the RAM. The method for determining the first field involves analyzing the data step size. By plotting a curve of grayscale step size versus display brightness, the step size of the entire grayscale range is analyzed to find the minimum grayscale step size. Taking a value with a precision of at least twice this minimum ensures data integrity. Here, integrity means that the error will not affect the result, not that it is mathematically identical. The method for determining the second field considers the maximum and minimum range of the data. For example, from 0.00001 to 1000000 (equivalent to -5 to 6 powers), the first field only needs 5 bits to represent this range.
[0125] Figure 5This is a schematic diagram illustrating the relationship between the grayscale step of the electrical signal and the display brightness of the 12-bit signal in one embodiment. Figure 6 This is a schematic diagram illustrating the relationship between the grayscale step of the electrical signal and the display brightness of the 10-bit signal in one embodiment, as shown below. Figure 5 and Figure 6 As shown, with increasing brightness, the percentage of grayscale step gradually decreases. Combined with the specific grayscale mapping relationship in Table 2 above, a deeper analysis of the table lookup process reveals that although the data table depth is extremely large, since the range of the N signal is 0-1024, this means that a large number of tables will not be looked up. This is based on the theoretical foundation of the computation process: low grayscale requires high precision, but the data range is very small. However, high brightness allows for a large data range, but the tolerance for precision errors is very high. Based on the above findings, this application uses a first field and a second field to represent and compress the optical signal value. For example, 9971400000000 = 1.99714 × 10^13, so this number can be represented by two fields: 13 and 1.99714. Depending on the usage, the decimal part that does not affect precision can be discarded for further compression. For example, using 13 and 1.99 expresses this very large number.
[0126] According to the above Figure 5 and Figure 6 The characteristics of the PQ table for color gamut conversion in HDR and its relationship with the grayscale step percentage require a power of 2 to the power of 5, which is the range from 0 to 32. Therefore, the second field uses 5 bits. The first field, from... Figure 5 and Figure 6 Looking at the data above, the smallest grayscale step is about 0.9%. Considering the extreme cases of positive and negative deviations, the required resolution of the first field needs to be more than twice that value, requiring 8-bit precision of 1 / 255, which is sufficient to achieve 0.39%. Using 8 bits to represent this, the range of the first field is 128-255, so 5 bits + 8 bits are enough to maintain full precision data processing.
[0127] Therefore, based on the above analysis, we know that the first field ranges from 128 to 255, occupying 8 bits, and the second field ranges from 0 to 32, occupying 5 bits. This means that a 27-bit optical signal value can be represented using 13 bits of data. It should be noted that the conversion between traditional electrical signal values and linear optical signal values generally uses a lookup table. In this lookup table, the optical signal values are stored in integer form. Taking PQ as an example, the original data lookup table typically requires 27 bits of data to represent the signal, while the electrical signal value requires 10 bits. Therefore, the depth of this data table is 2^27, and the width is 10 bits, requiring 2^27 * 10 bits = 1.3 Gbit of storage space. According to this embodiment, a data depth of 13 bits can be used, while the data width remains unchanged at 10 bits. This reduces the required storage space by thousands of times (8192 * 10 bits = 8 Kbit).
[0128] Since the first field is 8 bits, every time it reaches 255, a carry-over 1 needs to be added to the second field. Then the first field starts again from 128, and the corresponding second field starts from 13. 13 is actually the maximum range of the second field.
[0129] It's important to note that the first field restarts from 128 after a carry, instead of starting from 0 or other values, because: the first field is 8 bits, and its midpoint is 10000000 (i.e., 128). When the value of the first field increases from 127 to 128 (i.e., from 01111111 to 10000000), it doesn't actually "overflow" the 8-bit range, as 128 can still be represented by 8 bits. However, as it continues to increase from 128, it gets closer to 255, which is the maximum value an 8-bit field can represent. Therefore, to optimize the range of values and efficiency, a carry is not performed until the first field reaches 128, as doing so would waste bits in the second field representing numbers less than 128. Instead, the carry is considered only when the first field reaches or exceeds 128 (i.e., close to half its maximum value), allowing for a more even distribution of the value range between the first and second fields. Therefore, when the value of the first field reaches 255 and a carry is needed, the first field is reset to 128, and the carry is reflected in the second field. This ensures that both the first and second fields are used effectively, and large values can be represented without losing too much precision.
[0130] Specifically, the display device determines a preset value, and based on the light signal value expressed in a second form and the preset value, determines the value of the first field and the value of the second field; the display device determines the range of the first field, and if the value of the first field is not within the range of the first field, the first field and the second field are adjusted until the adjusted first field is within the range of the first field, and the adjusted value of the first field and the adjusted value of the second field are used as the final determined value of the first field and the second field, and the light signal value expressed in the first form is obtained through the final determined value of the first field and the second field.
[0131] IV. Establish the mapping relationship between the electrical signal value in the first color gamut and the optical signal value represented in the first form.
[0132] Specifically, the display device establishes a mapping relationship between the electrical signal value corresponding to the first color gamut and the light signal value expressed in a first form.
[0133] 5. Based on the mapping relationship between each electrical signal value in the first color gamut and the optical signal value represented in the first form, generate a first mapping table.
[0134] Specifically, after the display device establishes a mapping relationship between each electrical signal value in the first color gamut and the corresponding light signal value represented in the first form, it can obtain the first mapping table.
[0135] For example, the host computer / ARM calculates the function value (i.e., the corresponding optical signal value) corresponding to any electrical signal value in each first color gamut according to the photoelectric transfer function corresponding to the PQ curve. Specifically, the host computer / ARM uses the grayscale of each 10-bit E signal (i.e., electrical signal) as the independent variable to calculate a 27-bit function value (i.e., the optical signal value represented in the second form). The function value is then used to determine the values of the first and second fields in the manner described above, combining them into a 5-bit + 8-bit 13-bit O data (i.e., the optical signal value represented in the first form). Thus, using the 10-bit electrical signal value as the index value, the 13-bit O data can be obtained, completing the creation of the first mapping table. Similarly, the creation of the second mapping table can be completed.
[0136] In this embodiment, representing the optical signal value as an integer simplifies the storage and transmission process. Based on the integer optical signal value, a first field and a second field are used to represent the optical signal value. Since the optical signal value is equal to the value of the first field multiplied by the target value, and the value of the second field is the exponent of the target value (where the target value and the optical signal value are obtained through exponentiation), the values of the first field and the second field are both much smaller than the optical signal value. The data bit width occupied by the first form is much smaller than the data bit width occupied by the optical signal value. The first field and the second field can be combined to represent an optical signal value with a very large range, achieving compression of the optical signal values in each mapping table and greatly reducing storage space. On the other hand, establishing a mapping relationship between electrical signal values and optical signal values and generating a mapping table can accelerate the subsequent lookup and conversion process.
[0137] In one embodiment, determining the values of the first field and the second field based on the optical signal value represented in a second form includes:
[0138] 1. Based on the optical signal value expressed in a second form, set a first initial value for the first field and a second initial value for the second field.
[0139] Specifically, the display device determines a preset value, uses the determined preset value as the base, sets a second initial value for the second field, determines a target value based on the second initial value and the preset value, and determines a first initial value for the first field based on the requirement that the value of the first field multiplied by the target value equals the second optical signal value.
[0140] 2. Determine the relationship between the first initial value and the preset range.
[0141] The preset range refers to the range within which the first initial value is used for counting. When the value of the first field reaches the upper limit of its preset range, a carry operation is triggered, which increments the value of the second field by 1, while the value of the first field is reset to the lower limit of the preset range to continue counting or accumulating. When the value of the first field is less than the lower limit of its preset range, a borrow operation is triggered, which decrements the value of the second field by 1, while the value of the first field is divided by the preset value (i.e., the number system used for storage and calculation in the display device). This mechanism ensures that even when the value range of a single field is limited, a larger value range or more complex control logic can be achieved through the combination of multiple fields and specific logic processing. Taking a preset value of 2 as an example, the preset range corresponding to the first field is [128, 255].
[0142] Specifically, the display device determines a preset range corresponding to the first field. If the first initial value is within the preset range, then the first initial value is used as the value of the first field, and the second initial value is used as the value of the second field. If the first initial value is not within the preset range, then both the first and second initial values need to be adjusted.
[0143] 3. If the first initial value is greater than the upper limit of the preset range, the first initial value is shifted to the left once and the second initial value is incremented by 1; if the first initial value is less than the lower limit of the preset range, the first initial value is shifted to the right once and the second initial value is decremented by 1.
[0144] If the first initial value is not within the preset range, there are two scenarios, each with a different adjustment strategy. Scenario 1: The first initial value is greater than the upper limit of the preset range. In this case, the adjustment strategy is to shift the first initial value to the left (i.e., divide the first initial value by the preset value), and simultaneously increment the second initial value corresponding to the second field by 1. This process is repeated until the first initial value falls within the preset range. For example, if the preset range corresponding to the first field is [128, 255], and the optical signal value is 1200, the preset value is 2, the first initial value is 600, and the second initial value is 1, then obviously, the first initial value is not within [128, 255]. Therefore, the first initial value needs to be shifted to the left (i.e., divided by 2), and the updated first initial value is 300. At the same time, the second initial value is increased by 1 (i.e., the second initial value is 2). At this time, the updated first initial value is still not within the preset range, so the updated first initial value needs to be shifted to the left again, and the updated first initial value is 150. At the same time, the second initial value is increased by 1 (i.e., the second initial value is 3). At this time, the updated first initial value is within [128, 255], and the first and second initial values are no longer adjusted.
[0145] Scenario 2: The second initial value is less than the lower limit of the preset range. In this case, the corresponding adjustment strategy is to shift the first initial value to the right, which means multiplying the first initial value by the preset value, while decrementing the second initial value corresponding to the second field by 1. This process is repeated until the first initial value is within the preset range.
[0146] Specifically, the display device determines the set first initial value, second initial value, and preset value. If the first initial value is greater than the upper limit of the preset range, the first initial value is shifted to the left by one, that is, the first initial value is divided by the preset value, and at the same time, the second initial value is incremented by 1. If the first initial value is less than the lower limit of the preset range, the first initial value is shifted to the right by one, that is, the first initial value is multiplied by the preset value, and at the same time, the second initial value is decremented by 1.
[0147] Fourth, the updated first initial value is used as the new first initial value, and the step of judging the relationship between the first initial value and the preset range is returned based on the new first initial value. This process continues until the first initial value is within the preset range or the number of moves reaches the moving threshold. The final determined first initial value is used as the value of the first field, and the final determined second initial value is used as the value of the second field.
[0148] The move threshold refers to the threshold number of consecutive leftward shifts. For example, with a preset value of 2, the corresponding move threshold can be set to 13.
[0149] Specifically, the display device uses the updated first initial value as the new first initial value and determines whether the new first initial value is within the preset range of the first field. If it is not, the first initial value and the second initial value are adjusted again according to step three until the first initial value is within the preset range of the first field, or the number of consecutive movements in a certain direction reaches a preset movement threshold. Then, the adjustment of the first initial value and the second initial value is stopped, and the finally determined first initial value is used as the value of the first field, and the finally determined second initial value is used as the value of the second field.
[0150] In this embodiment, a preset range for the first field is set, and the first initial value and the second initial value are adjusted according to the relationship between the first initial value of the first field and the preset range, so that the updated first initial value is within the preset range corresponding to the first field, thereby determining the value of the first field and the value of the second field. This can avoid invalid or erroneous data input, thereby maintaining the integrity and accuracy of the data.
[0151] In a traditional method, the second electrical signal value corresponding to the target optical signal value is directly calculated using the photoelectric transfer function. However, this method involves exponential operations and has a large data bit width, resulting in significant computational resource consumption when processing continuous video streams and other data, making it difficult to meet real-time requirements. In another traditional method, a pre-established direct mapping table includes mapping relationships between different electrical signal values and optical signal values. This direct mapping table stores optical signal values directly calculated using the photoelectric transfer function. This pre-established direct mapping table allows for the lookup of the second electrical signal value corresponding to the target optical signal value. However, the large data bit width of the optical signal value calculated directly results in a large storage space requirement, affecting the lookup efficiency of the table lookup method. Therefore, this application proposes a method to look up the second electrical signal value corresponding to the target optical signal value from a pre-established second mapping table, including:
[0152] Obtain the pre-established second mapping table; if the target optical signal value is in the second mapping table, then use the electrical signal value corresponding to the target optical signal value in the second mapping table as the second electrical signal value corresponding to the target optical signal value.
[0153] In this process, the second mapping table uses electrical signal values as keys for lookup. The range of electrical signals is 0-1024, and only electrical signals in the 0-1024 range correspond to optical signal values. Therefore, some optical signal values are not found in the second mapping table. After finding the target optical signal value represented in the first form from the first mapping table, if the target optical signal value is in the second mapping table, it can be directly read from the second mapping table. If the target optical signal value is not in the second mapping table, the electrical signal value corresponding to an optical signal value that is similar to the target optical signal value is found in the second mapping table and used as the electrical signal value corresponding to the target optical signal value.
[0154] Specifically, the display device retrieves a pre-established second mapping table from the local machine, and after finding the target light signal value represented in the first form from the first mapping table, it checks whether the target light signal value exists in the second mapping table. If the target light signal value is in the second mapping table, the electrical signal value corresponding to the target light signal value in the second mapping table is used as the second electrical signal value corresponding to the target light signal value.
[0155] In this embodiment, since the second mapping table is pre-established, the target optical signal value can be quickly found and matched, and then the corresponding second electrical signal value can be quickly found and matched. This method finds the second electrical signal value faster. Compared with the traditional method of calculating the second electrical signal value corresponding to the target optical signal value in real time, the use of the second mapping table can significantly reduce the amount of calculation and query time. In addition, compared with the traditional method of using a direct mapping table, the optical signal value stored in the second mapping table is represented by a first form. The first form occupies a smaller data bit width, reducing the size of the invalid storage space and improving the efficiency of table lookup.
[0156] In some embodiments, if the target optical signal value is not in the second mapping table, a reference optical signal value that satisfies the approximation condition is determined in the second mapping table, and the electrical signal value corresponding to the reference optical signal value is used as the second electrical signal value corresponding to the target optical signal value.
[0157] The approximation condition refers to a metric or algorithm used to evaluate the similarity or proximity between the target optical signal value and existing optical signal values in the second mapping table. Once a reference optical signal value that meets the approximation condition is determined, the display device uses the electrical signal value corresponding to that reference optical signal value as the second electrical signal value corresponding to the target optical signal value. Although the determined second electrical signal value may not be perfectly accurate, it provides a reasonable approximation, allowing the display device to continue operating without a precise mapping.
[0158] Specifically, the display device retrieves a pre-established second mapping table from the local machine, and after finding the target light signal value represented in the first form from the first mapping table, it checks whether the target light signal value exists in the second mapping table. If the target light signal value is not in the second mapping table, the similarity between the target light signal value and the existing light signal value in the second mapping table is calculated, and the light signal value with the highest similarity is taken as the reference light signal value that satisfies the approximation condition. At the same time, the electrical signal value corresponding to the reference light signal value is taken as the second electrical signal value corresponding to the target light signal value.
[0159] In some embodiments, the display device may also pre-establish a third mapping table based on the second mapping table, and look up the second electrical signal value corresponding to the target optical signal value from the pre-established third mapping table. The third mapping table includes the mapping relationship between different optical signal values and electrical signal values under the second color gamut.
[0160] Specifically, the display device acquires a pre-established second mapping table, determines the optical signal value represented in the first form, traverses the second mapping table, finds the reference optical signal value closest to the optical signal value, and stores the electrical signal value corresponding to the reference optical signal value as an O-to-E mapping in a data table, until all 8192 O values have corresponding E values, completing the creation of the third mapping table (OE data table). After the display device finds the target optical signal value represented in the first form from the first mapping table, it uses the electrical signal value corresponding to the target optical signal value in the third mapping table as the second electrical signal value corresponding to the target optical signal value.
[0161] In this embodiment, when the target optical signal value is not in the second mapping table, a reference optical signal value that meets the approximation conditions is determined from the second mapping table. The electrical signal value corresponding to the reference optical signal value is then used as the second electrical signal value corresponding to the target optical signal value. In this process, since the data range of optical signal values is larger than that of electrical signal values, this method of determining the reference optical signal value by introducing approximation conditions ensures that even when the target optical signal value and the second electrical signal value cannot be precisely mapped, the corresponding second electrical signal value can still be determined, guaranteeing the smooth operation of photoelectric conversion and thus improving robustness. Furthermore, compared to real-time calculation of the electrical signal value corresponding to each optical signal value, using a pre-established second mapping table significantly reduces computational costs and improves the efficiency of determining the second electrical signal value. Compared to online searching for the electrical signal value corresponding to each optical signal value, the introduced approximation conditions avoid the need to calculate the corresponding electrical signal value for each optical signal value using the photoelectric conversion function, further reducing computational costs.
[0162] In one embodiment, the color gamut conversion method further includes:
[0163] 1. After finding the target optical signal value represented in the first form from the first mapping table, if an update operation for the target optical signal value is detected, the target optical signal value is converted from the first form to the second form.
[0164] The update operation refers to the process of modifying an existing target optical signal value. Since the target optical signal value is initially found in the first mapping table and is represented in the first form (floating-point type), but the update operation is based on the target optical signal value represented in the second form, it is necessary to convert the target optical signal value represented in the first form to the target optical signal value represented in the second form when modifying the target optical signal value.
[0165] Update operations can be triggered by the user, events, or automatically based on some algorithmic logic. For example, after finding the target light signal value represented in a first form from the first mapping table, the user views a target light signal value through the interface of the display device and decides that it needs to be modified. At this time, the user inputs a new light signal value, or adjusts the light signal value according to the adjustment tools (such as sliders, knobs, etc.) provided by the display interface. The display device detects the change in user input and triggers the update operation.
[0166] For example, after finding the target light signal value represented in the first form from the first mapping table, the display device detects that the current target light signal value does not meet the preset conditions or thresholds according to the built-in algorithm or logic, and then automatically calculates a new light signal value that is more in line with the current system status or business requirements. At this time, the display device triggers an update operation.
[0167] For example, to maintain the accuracy of the light signal value, the display device performs a calibration operation periodically. During the calibration process, after finding the target light signal value represented in a first form from a first mapping table, the display device recalculates or sets the target light signal value based on some reference data or standard values. Based on the new target light signal value, an update operation is triggered, and the old target light signal value is replaced with the new target light signal value.
[0168] Specifically, after the display device finds the target light signal value represented in the first form from the first mapping table, it detects whether there is an update operation that modifies the current target light signal value. If an update operation for the target light signal value is detected, the target light signal value is converted from the first form to the second form.
[0169] With a preset value of 2, the target light signal value is represented in a first form by combining the first field (150) and the second field (3). After the display device finds the target light signal value represented in the first form from the first mapping table, if it detects an update operation for the target light signal value, it converts the target light signal value represented in the first form into the target light signal value represented in the second form (i.e., 1200, obtained from 150×2^3=1200).
[0170] Second, based on the update operation, the target optical signal value represented in the second form is updated to obtain the updated target optical signal value represented in the second form.
[0171] Specifically, after the display device converts the target light signal value represented in the first form into the target light signal value represented in the second form, it modifies the target light signal value represented in the second form according to the update operation to obtain the updated target light signal value represented in the second form.
[0172] Third, based on the updated target optical signal value represented in the second form, determine the value of the new first field and the value of the new second field, represent the updated target optical signal value represented in the first form through the value of the new first field and the value of the new second field, and based on the updated target optical signal value represented in the first form, perform the step of searching for the second electrical signal value corresponding to the target optical signal value from the pre-established second mapping table.
[0173] After the update operation is performed, the updated optical signal needs to be displayed. Therefore, after obtaining the updated target optical signal value represented in the second form, it is also necessary to look up the corresponding second electrical signal value in the second mapping table, so as to display the corresponding image on the display interface. Since the optical signal values stored in the second mapping table are all represented in the first form, after obtaining the updated target optical signal value represented in the second form, it is necessary to convert the target optical signal value represented in the second form to the target optical signal value represented in the first form before the table lookup can be performed based on the second mapping table.
[0174] Specifically, the display device sets a first initial value for a first field and a second initial value for a second field based on the updated target light signal value represented in a second form, and determines a preset range for the first field. If the first initial value is not within the preset range, the first and second initial values are adjusted until the first initial value is within the preset range. The finally determined first initial value is used as the new value of the first field, and the finally determined second initial value is used as the new value of the second field. The display device represents the updated target light signal value represented in the first form using the new values of the first and second fields, and based on the target light signal value represented in the first form, it looks up the second electrical signal value corresponding to the target light signal value in a second mapping table. The display device displays the image in a second color gamut according to the second electrical signal value.
[0175] For example, Figure 7 This is a schematic diagram of the process of looking up the second mapping table in one embodiment, such as... Figure 7 The FPGA processor within the display device, upon obtaining a target optical signal value represented in a first form based on a first mapping table and detecting an update operation on the target optical signal value, converts the target optical signal value from the first form to a second form and modifies the target optical signal value in the second form to obtain an updated target optical signal value converted in the second form. Subsequently, the FPGA processor converts the updated target optical signal value converted in the second form into 13-bit dynamic floating-point data consisting of a first field and a second field. Specifically, if the first initial value of the first field is greater than 255, the first initial value is shifted left once, and the second initial value of the second field is incremented by 1; if the first initial value is less than 128, the first initial value is shifted right once, and the second initial value of the second field is decremented by 1. Determine if the updated first initial value is within the range of 128 to 255. If not, continue adjusting the first and second initial values until they are shifted left 13 times or the condition of 128 to 255 is met. The final determined first initial value is used as the value of the first field, which is 8 bits. The second initial value is used as the value of the second field, which is 5 bits. This completes the conversion of the target optical signal value into a 13-bit dynamic floating-point number consisting of the first and second fields.
[0176] The FPGA processor uses the calculated 13-bit dynamic floating-point data (first field + second field) to query the second mapping table issued by the host computer / ARM to obtain the corresponding second electrical signal value, thus completing the OE conversion (i.e., optical signal to electrical signal conversion). After obtaining the second electrical signal value, the FPGA processor displays the image in the second color gamut based on the second electrical signal value.
[0177] In this embodiment, since the target optical signal value retrieved from the first mapping table is represented in a first form, and the update operation is performed based on the target optical signal value represented in a second form, when an update operation on the target optical signal value is detected, converting the target optical signal value from the first form (e.g., floating-point type) to the second form (e.g., integer type) and updating based on the converted second-form value ensures data consistency across different data formats, thereby ensuring that the update is correctly reflected in the entire processing flow. Simultaneously, after updating the target optical signal value, the corresponding electrical signal value can be retrieved again based on the updated value, ensuring that the mapping relationship between the optical signal and the electrical signal remains accurate, which is beneficial for guaranteeing the accuracy and reliability of color gamut conversion.
[0178] In one embodiment, such as Figure 8 As shown, a method for creating a mapping table is also provided, including the following steps:
[0179] Step 802: Determine the electro-optic transfer function corresponding to the target color gamut; the target color gamut refers to the first color gamut or the second color gamut.
[0180] The electro-optical transfer function (EOTF) is a function that converts the encoded electrical signal of an image into the linear optical domain, describing the conversion process from video signal to linear optical output. Using the EOTF, the corresponding linear optical output can be calculated from the input video signal, thus achieving color gamut conversion. For example, the conversion between BT.709 (a format of SDR) and BT.2020 (a format of HDR) first involves converting the encoded electrical signal of the BT.709 video into the linear optical domain; this process is called EOTF, and the function that performs the EOTF is called the electro-optical transfer function.
[0181] The first color gamut refers to the color gamut used by the video source device. The second color gamut refers to the range or set of colors that a display device can display.
[0182] Specifically, the display device determines the electro-optical transfer function corresponding to the first color gamut based on the type of the first color gamut.
[0183] In some embodiments, the conversion between different color spaces corresponds to different electro-optical transfer functions. Table 1 lists the electro-optical transfer functions corresponding to several color spaces.
[0184] Step 804: For any electrical signal value under the target color gamut, determine the optical signal value corresponding to the electrical signal value in the second form based on the electro-optical transfer function; the second form is an integer form.
[0185] Specifically, for any electrical signal value under the target color gamut, the display device uses the electro-optical transfer function (EOTF) corresponding to the target color gamut to convert the targeted electrical signal value into an optical signal value, and quantizes the calculated optical signal value into an integer form.
[0186] Step 806: Based on the optical signal value represented in the second form, determine the value of the first field and the value of the second field, and obtain the optical signal value represented in the first form through the value of the first field and the value of the second field.
[0187] When using the first and second fields to represent and compress optical signal values, the bit width of these fields directly affects the storage size of the RAM. The method for determining the first field involves analyzing the data step size. By plotting a curve of grayscale step size versus display brightness, the step size of the entire grayscale range is analyzed to find the minimum grayscale step size. Taking a value with a precision of at least twice this minimum ensures data integrity. Here, integrity means that the error will not affect the result, not that it is mathematically identical. The method for determining the second field considers the maximum and minimum range of the data. For example, from 0.00001 to 1000000 (equivalent to -5 to 6 powers), the first field only needs 5 bits to represent this range.
[0188] Figure 5 This is a schematic diagram illustrating the relationship between the grayscale step of the electrical signal and the display brightness of the 12-bit signal in one embodiment. Figure 6 This is a schematic diagram illustrating the relationship between the grayscale step of the electrical signal and the display brightness of the 10-bit signal in one embodiment, as shown below. Figure 5 and Figure 6 As shown, with increasing brightness, the percentage of grayscale step gradually decreases. Combined with the specific grayscale mapping relationship in Table 2 above, a deeper analysis of the table lookup process reveals that although the data table depth is extremely large, since the range of the N signal is 0-1024, this means that a large number of tables will not be looked up. This is based on the theoretical foundation of the computation process: low grayscale requires high precision, but the data range is very small. However, high brightness allows for a large data range, but the tolerance for precision errors is very high. Based on the above findings, this application uses a first field and a second field to represent and compress the optical signal value. For example, 9971400000000 = 1.99714 × 10^13, so this number can be represented by two fields: 13 and 1.99714. Depending on the usage, the decimal part that does not affect precision can be discarded for further compression. For example, using 13 and 1.99 expresses this very large number.
[0189] According to the above Figure 5 and Figure 6The characteristics of the PQ table for color gamut conversion in HDR and its relationship with the grayscale step percentage require a power of 2 to the power of 5, which is the range from 0 to 32. Therefore, the second field uses 5 bits. The first field, from... Figure 4 and Figure 5 Looking at the data above, the smallest grayscale step is about 0.9%. Considering the extreme cases of positive and negative deviations, the required resolution of the first field needs to be more than twice that value, requiring 8-bit precision of 1 / 255, which is sufficient to achieve 0.39%. Using 8 bits to represent this, the range of the first field is 128-255, so 5 bits + 8 bits are enough to maintain full precision data processing.
[0190] Therefore, based on the above analysis, we know that the first field ranges from 128 to 255, occupying 8 bits, and the second field ranges from 0 to 32, occupying 5 bits. This means that a 27-bit optical signal value can be represented using 13 bits of data. It should be noted that the conversion between traditional electrical signal values and linear optical signal values generally uses a lookup table. In this lookup table, the optical signal values are stored in integer form. Taking PQ as an example, the original data lookup table typically requires 27 bits of data to represent the signal, while the electrical signal value requires 10 bits. Therefore, the depth of this data table is 2^27, and the width is 10 bits, requiring 2^27 * 10 bits = 1.3 Gbit of storage space. According to this embodiment, a data depth of 13 bits can be used, while the data width remains unchanged at 10 bits. This reduces the required storage space by thousands of times (8192 * 10 bits = 8 Kbit).
[0191] Since the first field is 8 bits, every time it reaches 255, a carry-over 1 needs to be added to the second field. Then the first field starts again from 128, and the corresponding second field starts from 13. 13 is actually the maximum range of the second field.
[0192] It's important to note that the first field restarts from 128 after a carry, instead of starting from 0 or other values, because: the first field is 8 bits, and its midpoint is 10000000 (i.e., 128). When the value of the first field increases from 127 to 128 (i.e., from 01111111 to 10000000), it doesn't actually "overflow" the 8-bit range, as 128 can still be represented by 8 bits. However, as it continues to increase from 128, it gets closer to 255, which is the maximum value an 8-bit field can represent. Therefore, to optimize the range of values and efficiency, a carry is not performed until the first field reaches 128, as doing so would waste bits in the second field representing numbers less than 128. Instead, the carry is considered only when the first field reaches or exceeds 128 (i.e., close to half its maximum value), allowing for a more even distribution of the value range between the first and second fields. Therefore, when the value of the first field reaches 255 and a carry is needed, the first field is reset to 128, and the carry is reflected in the second field. This ensures that both the first and second fields are used effectively, and large values can be represented without losing too much precision.
[0193] Specifically, the display device determines a preset value, and based on the light signal value expressed in a second form and the preset value, determines the value of the first field and the value of the second field; the display device determines the range of the first field, and if the value of the first field is not within the range of the first field, the first field and the second field are adjusted until the adjusted first field is within the range of the first field, and the adjusted value of the first field and the adjusted value of the second field are used as the final determined value of the first field and the second field, and the light signal value expressed in the first form is obtained through the final determined value of the first field and the second field.
[0194] Step 808: Establish the mapping relationship between the electrical signal value and the optical signal value represented in the first form under the target color gamut.
[0195] Specifically, the display device establishes a mapping relationship between the electrical signal value corresponding to the first color gamut and the light signal value expressed in a first form.
[0196] Step 810: Generate a target mapping table based on the mapping relationship between each electrical signal value in the target color gamut and the optical signal value represented in the first form.
[0197] Specifically, after the display device establishes a mapping relationship between each electrical signal value in the first color gamut and the corresponding light signal value represented in the first form, it can obtain the first mapping table.
[0198] For example, the host computer / ARM calculates the function value (i.e., the corresponding optical signal value) corresponding to any electrical signal value in each first color gamut according to the photoelectric transfer function corresponding to the PQ curve. Specifically, the host computer / ARM uses the grayscale of each 10-bit E signal (i.e., electrical signal) as the independent variable to calculate a 27-bit function value (i.e., the optical signal value represented in the second form). The function value is then used to determine the values of the first and second fields in the manner described above, combining them into a 5-bit + 8-bit 13-bit O data (i.e., the optical signal value represented in the first form). Thus, using the 10-bit electrical signal value as the index value, the 13-bit O data can be obtained, completing the creation of the first mapping table. Similarly, the creation of the second mapping table can be completed.
[0199] In this embodiment, representing the optical signal value as an integer simplifies the storage and transmission process. Based on the integer optical signal value, the optical signal value is represented by a first field and a second field. The value of the first field multiplied by the target value equals the optical signal value. Since the target value and the optical signal value are obtained through exponentiation, and the value of the second field is the exponent of the target value, the values of the first field and the second field are both much smaller than the optical signal value. The data bit width occupied by the first form is much smaller than the data bit width occupied by the optical signal value. The combination of the first field and the second field can represent an optical signal value with a very large range, realizing the compression of the optical signal values in each mapping table, greatly reducing the storage space. Furthermore, the mapping table establishment method of this application embodiment can also be used for other complex algorithms that require table lookup. By reasonably determining the values of the first field and the second field, the storage volume can be greatly reduced while ensuring accuracy.
[0200] In one embodiment, determining the values of the first field and the second field based on the optical signal value represented in a second form includes:
[0201] 1. Based on the optical signal value expressed in the second form, set the third initial value of the first field and the fourth initial value of the second field.
[0202] Specifically, the display device determines a preset value, uses the determined preset value as the base, sets the fourth initial value of the second field, determines the target value based on the fourth initial value and the preset value, and determines the third initial value of the first field based on the requirement that the value of the first field multiplied by the target value equals the second optical signal value.
[0203] 2. Determine the relationship between the third initial value and the preset range.
[0204] The preset range refers to the range within which the first initial value is used for counting. When the value of the first field reaches the upper limit of its preset range, a carry operation is triggered, which increments the value of the second field by 1, while the value of the first field is reset to the lower limit of the preset range to continue counting or accumulating. When the value of the first field is less than the lower limit of its preset range, a borrow operation is triggered, which decrements the value of the second field by 1, while the value of the first field is divided by the preset value (i.e., the number system used for storage and calculation in the display device). This mechanism ensures that even when the value range of a single field is limited, a larger value range or more complex control logic can be achieved through the combination of multiple fields and specific logic processing. Taking a preset value of 2 as an example, the preset range corresponding to the first field is [128, 255].
[0205] Specifically, the display device determines the preset range corresponding to the first field. If the third initial value is within the preset range, the third initial value is used as the value of the first field, and the fourth initial value is used as the value of the second field. If the third initial value is not within the preset range, the third and fourth initial values need to be adjusted.
[0206] 3. If the third initial value is greater than the upper limit of the preset range, then the third initial value is shifted to the left once and the fourth initial value is incremented by 1; if the third initial value is less than the lower limit of the preset range, then the third initial value is shifted to the right once and the fourth initial value is decremented by 1.
[0207] If the third initial value is not within the preset range, there are two scenarios, each with a different adjustment strategy. Scenario 1: The third initial value is greater than the upper limit of the preset range. In this case, the adjustment strategy is to shift the third initial value to the left (i.e., divide the third initial value by the preset value), and simultaneously increment the fourth initial value corresponding to the second field by 1. This process is repeated until the third initial value falls within the preset range. For example, if the preset range corresponding to the first field is [128, 255], and the optical signal value is 1200, the preset value is 2, the third initial value is 600, and the fourth initial value is 1, then obviously, the third initial value is not within the range of [128, 255]. Therefore, the third initial value needs to be shifted to the left (i.e., divided by 2), and the updated third initial value is 300. At the same time, the fourth initial value is increased by 1 (i.e., the fourth initial value is 2). At this time, the updated third initial value is still not within the preset range, so the updated third initial value needs to be shifted to the left again, and the updated third initial value is 150. At the same time, the fourth initial value is increased by 1 (i.e., the fourth initial value is 3). At this time, the updated third initial value is within the range of [128, 255], and the third and fourth initial values are no longer adjusted.
[0208] Scenario 2: The fourth initial value is less than the lower limit of the preset range. In this case, the corresponding adjustment strategy is to shift the third initial value to the right, which means multiplying the third initial value by the preset value. At the same time, the fourth initial value corresponding to the second field is reduced by 1. This process is repeated until the third initial value is within the preset range.
[0209] Specifically, the display device determines the set third initial value, fourth initial value, and preset value. If the third initial value is greater than the upper limit of the preset range, the third initial value is shifted to the left by one, that is, the third initial value is divided by the preset value, and at the same time, the fourth initial value is incremented by 1. If the third initial value is less than the lower limit of the preset range, the third initial value is shifted to the right by one, that is, the third initial value is multiplied by the preset value, and at the same time, the fourth initial value is decremented by 1.
[0210] Fourth, the updated third initial value is used as the new third initial value, and the step of judging the relationship between the third initial value and the preset range is returned based on the new third initial value. This process continues until the third initial value is within the preset range or the number of moves reaches the moving threshold. The final determined third initial value is used as the value of the first field, and the final determined fourth initial value is used as the value of the second field.
[0211] The move threshold refers to the threshold number of consecutive leftward shifts. For example, with a preset value of 2, the corresponding move threshold can be set to 13.
[0212] Specifically, the display device uses the updated third initial value as the new third initial value and determines whether the new third initial value is within the preset range of the first field. If not, it adjusts the third and fourth initial values again according to step three until the third initial value is within the preset range of the first field, or until the number of consecutive movements in a certain direction reaches a preset movement threshold. Then, it stops adjusting the third and fourth initial values, uses the finally determined third initial value as the value of the first field, and uses the finally determined fourth initial value as the value of the second field.
[0213] In this embodiment, a preset range for the first field is set, and the third and fourth initial values are adjusted according to the relationship between the third initial value of the first field and the preset range, so that the updated third initial value is within the preset range corresponding to the first field, thereby determining the value of the first field and the value of the second field. This can avoid invalid or erroneous data input, thereby maintaining the integrity and accuracy of the data.
[0214] In one detailed embodiment, a color gamut conversion method includes the following steps:
[0215] 1. Determine the electro-optic transfer function corresponding to the first color gamut.
[0216] 2. For any electrical signal value in the first color gamut, based on the electro-optical transfer function, determine the optical signal value corresponding to the electrical signal value in the second form; the second form is an integer form.
[0217] Third, based on the optical signal value expressed in the second form, set the first initial value of the first field and the second initial value of the second field.
[0218] IV. Determine the relationship between the first initial value and the preset range.
[0219] 5. If the first initial value is greater than the upper limit of the preset range, the first initial value is shifted to the left once and the second initial value is incremented by 1; if the first initial value is less than the lower limit of the preset range, the first initial value is shifted to the right once and the second initial value is decremented by 1.
[0220] 6. The updated first initial value is used as the new first initial value, and the step of judging the relationship between the first initial value and the preset range is returned based on the new first initial value. This process continues until the first initial value is within the preset range or the number of moves reaches the moving threshold. The final determined first initial value is used as the value of the first field, and the final determined second initial value is used as the value of the second field.
[0221] 7. Obtain the optical signal value in the first form by using the values of the first field and the second field.
[0222] 8. Establish the mapping relationship between the electrical signal value in the first color gamut and the optical signal value represented in the first form.
[0223] 9. Based on the mapping relationship between each electrical signal value in the first color gamut and the optical signal value represented in the first form, generate a first mapping table.
[0224] 10. Obtain the first electrical signal value after the image is encoded; the first electrical signal value represents the color information of the image in the first color gamut.
[0225] 11. From the pre-established first mapping table, find the target optical signal value represented in the first form that corresponds to the first electrical signal value; the first mapping table includes the mapping relationship between different electrical signal values and optical signal values under the first color gamut.
[0226] 12. After finding the target optical signal value represented in the first form from the first mapping table, if an update operation for the target optical signal value is detected, proceed to step 13; if no update operation for the target optical signal value is detected, proceed to step 14.
[0227] Thirteen, convert the target optical signal value from the first form to the second form; based on the update operation, update the target optical signal value represented in the second form to obtain the updated target optical signal value represented in the second form; based on the updated target optical signal value represented in the second form, determine the new values of the first field and the new values of the second field, represent the updated target optical signal value represented in the first form through the new values of the first field and the new values of the second field, and execute step fourteen based on the updated target optical signal value represented in the first form.
[0228] Fourteen, obtain the pre-established second mapping table; the second mapping table includes the mapping relationship between different electrical signal values and optical signal values under the second color gamut; wherein, the optical signal values in the first mapping table and the second mapping table are both represented by a first form, the first form includes a first field and a second field, the value of the first field multiplied by the target value equals the optical signal value, the target value is obtained by exponentiation with a preset value as the base and the value of the second field as the exponent.
[0229] 15. If the target optical signal value is in the second mapping table, proceed to step 16; if the target optical signal value is not in the second mapping table, proceed to step 17.
[0230] 16. Take the electrical signal value corresponding to the target optical signal value in the second mapping table as the second electrical signal value corresponding to the target optical signal value, and execute step 18.
[0231] 17. Determine the reference optical signal value that satisfies the approximation condition in the second mapping table, and take the electrical signal value corresponding to the reference optical signal value as the second electrical signal value corresponding to the target optical signal value, and proceed to step 18.
[0232] 18. Display the image in the second color gamut based on the second electrical signal value.
[0233] In this embodiment, representing the optical signal value as an integer simplifies the storage and transmission process. Based on the integer optical signal value, the optical signal value is represented by a first field and a second field. Since the optical signal value is equal to the value of the first field multiplied by the target value, and the value of the second field is the exponent of the target value, where the target value and the optical signal value are obtained through exponentiation, the values of the first field and the second field are both much smaller than the optical signal value. The data bit width occupied by the first form is much smaller than the data bit width occupied by the optical signal value. The first field and the second field can be combined to represent an optical signal value with a very large range, realizing the compression of the optical signal values in each mapping table, greatly reducing the storage space. Furthermore, the mapping table establishment method of this application embodiment can also be used for other complex algorithms that require table lookup. By reasonably determining the values of the first field and the second field, the storage volume can be greatly reduced while ensuring accuracy. When performing photoelectric conversion or electro-optical conversion using the lookup table method, the optical signal values in the first and second mapping tables are represented by the first form. That is, the optical signal values in the mapping tables are compressed by the first and second fields. The combination of the first and second fields represents a lookup table with a very large range but with certain accuracy requirements, which can greatly reduce the size of invalid storage space and reduce storage resource overhead.
[0234] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0235] Based on the same inventive concept, this application also provides a color gamut conversion apparatus for implementing the color gamut conversion method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more color gamut conversion apparatus embodiments provided below can be found in the limitations of the color gamut conversion method described above, and will not be repeated here.
[0236] In one exemplary embodiment, such as Figure 9 As shown, a color gamut conversion device is provided, comprising:
[0237] The first electrical signal acquisition module 901 is used to acquire the first electrical signal value obtained after the image is encoded; the first electrical signal value represents the color information of the image in a first color gamut.
[0238] The electro-optic conversion module 902 is used to look up a target optical signal value, represented in a first form, corresponding to the first electrical signal value from a pre-established first mapping table; the first mapping table includes the mapping relationship between different electrical signal values and optical signal values under a first color gamut.
[0239] The photoelectric conversion module 903 is used to look up a second electrical signal value corresponding to the target optical signal value from a pre-established second mapping table; the second mapping table includes the mapping relationship between different electrical signal values and optical signal values under a second color gamut; wherein, the optical signal values in the first mapping table and the second mapping table are represented by a first form, the first form includes a first field and a second field, the value of the first field multiplied by the target value equals the optical signal value, the target value is obtained by exponentiation with a preset value as the base and the value of the second field as the exponent;
[0240] Display module 904 is used to display the image in the second color gamut based on the second electrical signal value.
[0241] In one embodiment, the electro-optic conversion module 902 is further configured to: determine the electro-optic transfer function corresponding to the first color gamut; for any electrical signal value in the first color gamut, determine, based on the electro-optic transfer function, the optical signal value corresponding to the electrical signal value in a second form; the second form being an integer form; based on the optical signal value represented in the second form, determine the value of a first field and the value of a second field, and obtain the optical signal value represented in the first form through the values of the first field and the second field; establish a mapping relationship between the electrical signal value in the first color gamut and the optical signal value represented in the first form; and generate a first mapping table based on the mapping relationship between each electrical signal value in the first color gamut and the optical signal value represented in the first form.
[0242] In one embodiment, the electro-optic conversion module 902 is further configured to: set a first initial value for the first field and a second initial value for the second field based on the optical signal value expressed in a second form; determine the relationship between the first initial value and a preset range; if the first initial value is greater than the upper limit of the preset range, shift the first initial value to the left by one and increment the second initial value by 1; if the first initial value is less than the lower limit of the preset range, shift the first initial value to the right by one and decrement the second initial value by 1; use the updated first initial value as the new first initial value, and return to the step of determining the relationship between the first initial value and the preset range based on the new first initial value, until the first initial value is within the preset range, or the number of shifts reaches a shift threshold, and use the finally determined first initial value as the value of the first field and the finally determined second initial value as the value of the second field.
[0243] In one embodiment, the photoelectric conversion module 903 is further configured to acquire a pre-established second mapping table; if the target optical signal value is in the second mapping table, then the electrical signal value corresponding to the target optical signal value in the second mapping table is used as the second electrical signal value corresponding to the target optical signal value.
[0244] In one embodiment, the photoelectric conversion module 903 is further configured to, if the target optical signal value is not in the second mapping table, determine a reference optical signal value that satisfies the approximation condition in the second mapping table, and use the electrical signal value corresponding to the reference optical signal value as the second electrical signal value corresponding to the target optical signal value.
[0245] In one embodiment, the photoelectric conversion module 903 is further configured to, after finding the target optical signal value represented in a first form from the first mapping table, if an update operation for the target optical signal value is detected, convert the target optical signal value from the first form to a second form; based on the update operation, update the target optical signal value represented in the second form to obtain an updated target optical signal value represented in the second form; based on the updated target optical signal value represented in the second form, determine the values of a new first field and a new second field, represent the updated target optical signal value represented in the first form using the values of the new first field and the new second field, and based on the updated target optical signal value represented in the first form, execute the step of finding the second electrical signal value corresponding to the target optical signal value from the pre-established second mapping table.
[0246] Based on the same inventive concept, this application also provides a mapping table creation apparatus for implementing the mapping table creation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more mapping table creation apparatus embodiments provided below can be found in the limitations of the mapping table creation method described above, and will not be repeated here.
[0247] In one exemplary embodiment, such as Figure 10 As shown, a mapping table creation apparatus is provided, comprising:
[0248] The transfer function determination module 1001 is used to determine the electro-optical transfer function corresponding to the target color gamut; the target color gamut refers to the first color gamut or the second color gamut.
[0249] The optical signal calculation module 1002 is used to determine, based on the electro-optical transfer function, the optical signal value corresponding to any electrical signal value under the target color gamut, expressed in a second form; the second form is an integer form.
[0250] The optical signal format conversion module 1003 is used to determine the value of the first field and the value of the second field based on the optical signal value represented in the second form, and obtain the optical signal value represented in the first form through the value of the first field and the value of the second field;
[0251] The mapping relationship establishment module 1004 is used to establish a mapping relationship between the electrical signal value and the optical signal value represented in the first form under the target color gamut.
[0252] The mapping table generation module 1005 is used to generate a target mapping table based on the mapping relationship between each electrical signal value and the optical signal value represented in the first form under the target color gamut.
[0253] In one embodiment, the optical signal format conversion module 1003 is further configured to: set a third initial value for the first field and a fourth initial value for the second field based on the optical signal value represented in the second form; determine the relationship between the third initial value and a preset range; if the third initial value is greater than the upper limit of the preset range, shift the third initial value to the left by one and increment the fourth initial value by 1; if the third initial value is less than the lower limit of the preset range, shift the third initial value to the right by one and decrement the fourth initial value by 1; use the updated third initial value as the new third initial value, and return to the step of determining the relationship between the third initial value and the preset range based on the new third initial value, until the third initial value is within the preset range, or the number of shifts reaches a shift threshold, and use the finally determined third initial value as the value of the first field and the finally determined fourth initial value as the value of the second field.
[0254] The modules in the aforementioned color gamut conversion device and mapping table establishment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0255] In one exemplary embodiment, a computer device is provided, which may be a display device, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a mapping table creation method and / or a color gamut conversion method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0256] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0257] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0258] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0259] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0260] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0261] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal-to-value processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0262] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0263] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A color gamut conversion method, characterized in that, The method includes: The first electrical signal value obtained after encoding the image is acquired; the first electrical signal value represents the color information of the image in a first color gamut. From a pre-established first mapping table, find the target optical signal value represented in a first form that corresponds to the first electrical signal value; the first mapping table includes the mapping relationship between different electrical signal values and optical signal values under a first color gamut. From a pre-established second mapping table, a second electrical signal value corresponding to the target optical signal value is found; the second mapping table includes the mapping relationship between different electrical signal values and optical signal values under the second color gamut; wherein, the optical signal values in the first mapping table and the second mapping table are represented by a first form, the first form includes a first field and a second field, the value of the first field multiplied by the target value equals the optical signal value, the target value is obtained by exponentiation with a preset value as the base and the value of the second field as the exponent; The image is displayed in the second color gamut based on the second electrical signal value; The method further includes: Determine the electro-optical transfer function corresponding to the first color gamut; For any electrical signal value in the first color gamut, based on the electro-optical transfer function, determine the optical signal value corresponding to the electrical signal value, expressed in a second form; the second form is an integer form. Based on the optical signal value represented in the second form, the values of the first field and the second field are determined, and the optical signal value represented in the first form is obtained through the values of the first field and the second field. Establish a mapping relationship between the electrical signal value in the first color gamut and the optical signal value represented in the first form; A first mapping table is generated based on the mapping relationship between each electrical signal value in the first color gamut and the optical signal value represented in the first form. Determining the values of the first field and the second field based on the optical signal value represented in the second form includes: Determine the range of the first field; the range of the first field is a preset range, which includes an upper limit value and a lower limit value. If the value of the first field is not within the range of the first field, then adjust the first field and the second field until the adjusted first field is within the range of the first field. The adjusted value of the first field and the adjusted value of the second field are then used as the final determined values of the first field and the second field.
2. The method according to claim 1, characterized in that, Determining the values of the first field and the second field based on the optical signal value represented in the second form includes: Based on the optical signal value represented in a second form, a first initial value for the first field and a second initial value for the second field are set; Determine the relationship between the first initial value and the preset range; If the first initial value is greater than the upper limit of the preset range, then the first initial value is shifted to the left once and the second initial value is incremented by 1; if the first initial value is less than the lower limit of the preset range, then the first initial value is shifted to the right once and the second initial value is decremented by 1. The updated first initial value is used as the new first initial value, and the step of determining the relationship between the first initial value and the preset range is returned based on the new first initial value, and the process continues until the first initial value is within the preset range, or the number of moves reaches the moving threshold. The last determined first initial value is used as the value of the first field, and the last determined second initial value is used as the value of the second field.
3. The method according to claim 1, characterized in that, The step of searching for the second electrical signal value corresponding to the target optical signal value from a pre-established second mapping table includes: Obtain the pre-established second mapping table; If the target optical signal value is in the second mapping table, then the electrical signal value corresponding to the target optical signal value in the second mapping table is used as the second electrical signal value corresponding to the target optical signal value.
4. The method according to claim 3, characterized in that, The method further includes: If the target optical signal value is not in the second mapping table, then a reference optical signal value that meets the approximation condition is determined in the second mapping table, and the electrical signal value corresponding to the reference optical signal value is used as the second electrical signal value corresponding to the target optical signal value.
5. The method according to claim 1, characterized in that, The method further includes: After finding the target optical signal value represented in the first form from the first mapping table, if an update operation for the target optical signal value is detected, the target optical signal value is converted from the first form to the second form. Based on the update operation, the target optical signal value expressed in the second form is updated to obtain the updated target optical signal value expressed in the second form. Based on the updated target optical signal value represented in the second form, determine the values of the new first field and the new second field, represent the updated target optical signal value represented in the first form using the values of the new first field and the new second field, and perform the step of searching for the second electrical signal value corresponding to the target optical signal value from the pre-established second mapping table based on the updated target optical signal value represented in the first form.
6. A method for establishing a mapping table, characterized in that, The method includes: Determine the electro-optic transfer function corresponding to the target color gamut; the target color gamut refers to either the first color gamut or the second color gamut. For any electrical signal value under the target color gamut, based on the electro-optical transfer function, determine the optical signal value corresponding to the electrical signal value in a second form; the second form is an integer form. Based on the optical signal value represented in the second form, the values of the first field and the second field are determined, and the optical signal value represented in the first form is obtained through the values of the first field and the second field. Establish a mapping relationship between the electrical signal value and the optical signal value represented in the first form under the target color gamut; Based on the mapping relationship between each electrical signal value in the target color gamut and the optical signal value represented in the first form, a target mapping table is generated; Determining the values of the first field and the second field based on the optical signal value represented in the second form includes: Determine the range of the first field; the range of the first field is a preset range, which includes an upper limit value and a lower limit value. If the value of the first field is not within the range of the first field, then adjust the first field and the second field until the adjusted first field is within the range of the first field. The adjusted value of the first field and the adjusted value of the second field are then used as the final determined values of the first field and the second field.
7. The method according to claim 6, characterized in that, Determining the values of the first field and the second field based on the optical signal value represented in the second form includes: Based on the optical signal value represented in a second form, a third initial value for the first field and a fourth initial value for the second field are set; Determine the relationship between the third initial value and the preset range; If the third initial value is greater than the upper limit of the preset range, then the third initial value is shifted to the left by one, and the fourth initial value is incremented by 1; if the third initial value is less than the lower limit of the preset range, then the third initial value is shifted to the right by one, and the fourth initial value is decremented by 1. The updated third initial value is used as the new third initial value, and the step of determining the relationship between the third initial value and the preset range is returned based on the new third initial value, until the third initial value is within the preset range, or the number of moves reaches the moving threshold. The finally determined third initial value is used as the value of the first field, and the finally determined fourth initial value is used as the value of the second field.
8. A color gamut conversion device, characterized in that, The device includes: The first electrical signal acquisition module is used to acquire the first electrical signal value obtained after the image is encoded; the first electrical signal value represents the color information of the image in a first color gamut. An electro-optic conversion module is used to look up a target optical signal value, represented in a first form, that corresponds to the first electrical signal value from a pre-established first mapping table; the first mapping table includes the mapping relationship between different electrical signal values and optical signal values under a first color gamut. The photoelectric conversion module is used to look up a second electrical signal value corresponding to the target optical signal value from a pre-established second mapping table; the second mapping table includes the mapping relationship between different electrical signal values and optical signal values under a second color gamut; wherein, the optical signal values in the first mapping table and the second mapping table are represented by a first form, the first form including a first field and a second field, the value of the first field multiplied by the target value equals the optical signal value, the target value is obtained by exponentiation with a preset value as the base and the value of the second field as the exponent; The display module is used to display the image in the second color gamut based on the second electrical signal value; The electro-optic conversion module is further configured to: determine the electro-optic transfer function corresponding to the first color gamut; for any electrical signal value in the first color gamut, determine the optical signal value corresponding to the electrical signal value in a second form based on the electro-optic transfer function; the second form is an integer form; determine the value of a first field and the value of a second field based on the optical signal value in the second form, and obtain the optical signal value in the first form through the values of the first field and the second field; establish a mapping relationship between the electrical signal value in the first color gamut and the optical signal value in the first form; and generate a first mapping table based on the mapping relationship between each electrical signal value in the first color gamut and the optical signal value in the first form. The electro-optic conversion module is further configured to determine the range of the first field; the range of the first field is a preset range, which includes an upper limit value and a lower limit value; if the value of the first field is not within the range of the first field, the first field and the second field are adjusted until the adjusted first field is within the range of the first field, and the adjusted value of the first field and the adjusted value of the second field are used as the final determined value of the first field and the value of the second field.
9. A mapping table creation apparatus, characterized in that, The device includes: The transfer function determination module is used to determine the electro-optic transfer function corresponding to the target color gamut; the target color gamut refers to the first color gamut or the second color gamut. The optical signal calculation module is used to determine, based on the electro-optical transfer function, the optical signal value corresponding to any electrical signal value under the target color gamut, in a second form; the second form is an integer form. The optical signal format conversion module is used to determine the values of the first field and the second field based on the optical signal value represented in the second format, and to obtain the optical signal value represented in the first format through the values of the first field and the second field; The mapping relationship establishment module is used to establish a mapping relationship between the electrical signal value and the optical signal value represented in the first form under the target color gamut. The mapping table generation module is used to generate a target mapping table based on the mapping relationship between each electrical signal value and the optical signal value represented in the first form under the target color gamut; The optical signal format conversion module is further configured to determine the range of the first field; the range of the first field is a preset range, which includes an upper limit value and a lower limit value; if the value of the first field is not within the range of the first field, the first field and the second field are adjusted until the adjusted first field is within the range of the first field, and the adjusted value of the first field and the adjusted value of the second field are used as the final determined value of the first field and the value of the second field.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.