Tone mapping method and device
By considering factors such as the size of the terminal device, viewing distance, and ambient light brightness, the tone mapping parameters of the image are adjusted to solve the problem of poor tone mapping in the existing technology and achieve better display adaptation and user experience.
Patent Information
- Application Number
- CN202310196622.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2024-08-23
AI Technical Summary
The existing tone mapping method only considers the display brightness range of the display screen, cannot achieve the best display adaptation effect, and cannot effectively handle factors such as the size of the terminal device, user viewing distance, and ambient light brightness.
A tone mapping method is proposed to obtain information such as the size, viewing distance, viewing angle and ambient light brightness of the image to be displayed and the terminal device, adjust the initial tone mapping parameters of the image, obtain the tone mapping parameters based on this information, and perform tone mapping of the image , to adapt to different devices and environments.
It improves the display adaptation effect of images, improves the consistency of visual perception and viewing experience of users, and adapts to the needs of different application scenarios.
Smart Images

Figure CN118540447A
Abstract
Description
Technical Field
[0001] The present application relates to the field of display technology, and in particular to a tone mapping method and device. Background Art
[0002] Dynamic range is used in many fields to express the ratio of the maximum value to the minimum value of a variable. In digital images, dynamic range represents the ratio between the maximum brightness value and the minimum brightness value within the displayable range of the image. In the same scene in the real world, the dynamic range is usually between 10 -3 Candela / square meter (cd / m 2 ) to 106cd / m 2 High dynamic range (HDR) video technology expands the brightness range of displayable images, so it can record a larger range of brightness information in the real world and show more bright and dark details in the image. However, the brightness of the video or image usually does not match the brightness range that can be displayed by standard dynamic range (SDR) display devices or a large number of other existing HDR display devices.
[0003] Therefore, when a video or image is displayed on an existing display device, the brightness of the video or image needs to be processed according to the display capability of the display device to adapt it to the brightness range that the display device can display. This process is called tone mapping (TM).
[0004] However, the existing solutions only consider the display brightness range of the display screen when performing tone mapping, and cannot achieve the best display adaptation effect. Summary of the invention
[0005] The present application proposes a tone mapping method and device, which takes into account other information such as the size of the terminal display device and the user's viewing distance when performing tone mapping on an image, thereby improving the display adaptation effect.
[0006] In a first aspect, an embodiment of the present application provides a tone mapping method, the method comprising: obtaining an image to be displayed; obtaining reference information; the reference information comprising at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution; obtaining terminal device information; the terminal device information comprising at least one of a terminal display device size, a user viewing distance, a user viewing angle, an ambient light brightness, or a terminal display device resolution; and performing tone mapping on the image to be displayed according to the reference information and the corresponding type of the terminal device information.
[0007] In an embodiment of the present application, in the tone mapping of the image to be displayed based on the reference information and the terminal device information of the corresponding type, the reference display device size corresponds to the terminal display device size, the reference viewing distance corresponds to the user viewing distance, the reference viewing angle corresponds to the user viewing angle, the reference ambient light brightness corresponds to the ambient light brightness, and the reference display device resolution corresponds to the terminal display device resolution.
[0008] In the embodiment of the present application, when tone mapping is performed on an image, other information such as the size of the terminal display device and the user's viewing distance is also taken into account, thereby improving the display adaptation effect.
[0009] In a possible implementation, tone mapping is performed on the image to be displayed based on the reference information and the terminal device information of the corresponding type, including: obtaining tone mapping parameters based on the reference information and the terminal device information of the corresponding type; and tone mapping is performed on the image to be displayed based on the tone mapping parameters.
[0010] In a possible implementation, obtaining tone mapping parameters according to the reference information and the terminal device information of the corresponding type includes: adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters.
[0011] In the application method, the initial tone mapping parameters of the image to be displayed are adjusted according to the reference information and the corresponding type of the terminal device information to obtain the tone mapping parameters, which change with the size of the terminal display device, the user's viewing distance, the user's viewing angle, the ambient light brightness or the resolution of the terminal display device, and can flexibly adapt to different environments and display devices, effectively improve the display adaptation effect, and enhance the tone mapping effect and display effect of the image. At the same time, the user's visual perception in different application scenarios is more consistent, thereby improving the user's viewing experience.
[0012] In a possible implementation, the adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters includes: when the relationship between the reference information and the terminal device information satisfies a first condition, adjusting the initial tone mapping parameters of the image to be displayed in a first manner to obtain the tone mapping parameters. When the relationship between the reference information and the terminal device information satisfies a second condition, adjusting the initial tone mapping parameters of the image to be displayed in a second manner to obtain the tone mapping parameters. The initial tone mapping parameters are used to characterize an initial tone mapping curve, and the tone mapping parameters are used to characterize an adjusted tone mapping curve.
[0013] In this implementation, the manner of adjusting the initial tone mapping parameters corresponds to the relationship between the reference information and the terminal device information. Different adjustment methods can be used for different application scenarios to obtain different adjusted tone mapping parameters, thereby meeting user needs in different application scenarios, and adapting to changing application scenarios to improve user experience.
[0014] In a possible implementation, the first condition includes: the terminal display screen size is smaller than the reference display device size, the user viewing distance is greater than the reference viewing distance, the user viewing angle deviates from the reference viewing angle, the ambient light brightness is greater than the reference ambient light brightness, or the terminal display device resolution is smaller than the reference display device resolution.
[0015] In this embodiment, when the size of the terminal display screen is smaller than the size of the reference display device, the image visually perceived by the user will become darker or lack contrast; similarly, when the user's viewing distance is greater than the reference viewing distance, the user's viewing angle deviates from the reference viewing angle, the ambient light brightness is greater than the reference ambient light brightness, or the terminal display device resolution is smaller than the reference display device resolution, the image visually perceived by the user will also become darker or blurred, affecting the user's viewing experience. Therefore, adjusting the tone mapping parameters in the first manner helps to improve the overall brightness and detail clarity of the image, can improve the image tone mapping effect in different application scenarios, meet user needs in different application scenarios, and improve the user's visual experience.
[0016] In a possible implementation, the above-mentioned adjusting the initial tone mapping parameters of the image to be displayed in the first manner includes: obtaining one or more first brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the mapping value of the adjusted tone mapping curve at the one or more first brightness characteristic values is greater than the mapping value of the initial tone mapping curve at the one or more first brightness characteristic values.
[0017] In this embodiment, the mapping value of the adjusted tone mapping curve at the one or more first brightness characteristic values becomes larger, so that the overall or partial mapping value of the adjusted tone mapping curve becomes larger, and the overall or partial brightness of the image after tone mapping based on the tone mapping parameters becomes larger to adapt to the application scenarios covered by the above-mentioned first condition, improve the display adaptation effect, enhance the user's overall brightness perception of the picture, make the user's brightness perception consistent in different application scenarios, and improve the user experience. For example, when the size of the terminal display screen is smaller than the size of the reference display device, the mapping value of the tone mapping curve is increased to increase the image brightness, so that the user's viewing brightness perception on the small-size display screen is the same as that on the large-size display screen, thereby improving the user's visual comfort.
[0018] In a possible implementation, the above-mentioned adjusting the initial tone mapping parameters of the image to be displayed in the first manner also includes: obtaining one or more second brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the slope of the adjusted tone mapping curve obtained at the one or more second brightness characteristic values is greater than the slope of the initial tone mapping curve at the one or more second brightness characteristic values.
[0019] In this embodiment, the slope of the adjusted tone mapping curve at the one or more second brightness characteristic values increases, resulting in the overall or partial slope of the adjusted tone mapping curve increasing. The overall or partial contrast and brightness of the image after tone mapping based on the adjusted tone mapping curve increases to adapt to the application scenarios covered by the first condition above, so that the user's perception of contrast and picture details in different application scenarios is consistent, improving user experience and display adaptation effect. For example, when the size of the terminal display screen is smaller than the size of the reference display device, the slope of the tone mapping curve is increased to improve the image contrast and brightness, so that the user's viewing experience on the small-size display screen is the same as that on the large-size display screen, thereby improving the user's visual comfort.
[0020] In a possible implementation, the above-mentioned adjusting the initial tone mapping parameters of the image to be displayed in the first manner also includes: acquiring the base layer and one or more enhancement layers of the image to be displayed; the first eigenvalue of any one of the one or more enhancement layers is mapped to a second eigenvalue by the initial tone mapping curve of any enhancement layer; adjusting the initial tone mapping parameters of any enhancement layer so that the absolute value of the first eigenvalue after being mapped by the adjusted tone mapping curve is greater than the absolute value of the second eigenvalue.
[0021] In this embodiment, the first eigenvalue and the second eigenvalue can be positive or negative. When comparing the value of the first eigenvalue mapped by the adjusted tone mapping curve with the second eigenvalue, the absolute values of the two values are compared.
[0022] In this embodiment, after the base layer is mixed with one or more adjusted enhancement layers, the absolute value of the mapping value corresponding to one or more enhancement layers in the image increases, so that the features of the enhancement layer are enhanced, more high-frequency components are retained, and the local contrast or brightness is enhanced. The enhancement layer includes an edge layer, a texture layer, etc., so the corresponding image feature enhancements include: enhanced edge sharpness, clearer texture details, etc. This adapts to the application scenarios covered by the first condition above and improves the display adaptation effect. At the same time, complex images have better tone mapping and display effects. For example, when the size of the terminal display screen is smaller than the size of the reference display device, the mapping value of the enhancement layer tone mapping curve is increased to enhance the local contrast, detail clarity or brightness of the image, so that the image clarity and detail information viewed by the user on the small-size display screen are the same as those on the large-size display screen, thereby improving the user's visual comfort.
[0023] In a possible implementation, the second condition includes: the terminal display screen size is larger than the reference display device size, the user viewing distance is smaller than the reference viewing distance, the ambient light brightness is smaller than the reference ambient light brightness, or the terminal display device resolution is larger than the reference display device resolution.
[0024] In this embodiment, when the size of the terminal display screen is larger than the size of the reference display device, the image visually perceived by the user will become brighter and dazzling, or the contrast will be too strong to cause visual discomfort; similarly, when the user's viewing distance is less than the reference viewing distance, the ambient light brightness is less than the reference ambient light brightness, or the resolution of the terminal display device is greater than the resolution of the reference display device, the image visually perceived by the user will also become brighter and even dazzling to hurt the eyes, or the contrast will be too strong to cause visual discomfort, affecting the user's viewing experience. Therefore, adjusting the tone mapping curve in the second way to darken the overall brightness and contrast of the image can improve the image tone mapping effect and display effect in different application scenarios, meet the user needs of different application scenarios, and improve the user's visual experience.
[0025] In a possible embodiment, the above-mentioned adjusting the initial tone mapping parameters of the image to be displayed in the second manner includes: obtaining one or more third brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the mapping value of the adjusted tone mapping curve at the one or more third brightness characteristic values is smaller than the mapping value of the initial tone mapping curve at the one or more third brightness characteristic values.
[0026] In this embodiment, the mapping value of the adjusted tone mapping curve at the one or more third brightness characteristic values becomes smaller, resulting in the overall or partial mapping value of the adjusted tone mapping curve becoming smaller, and the overall or partial brightness of the image after tone mapping based on the adjusted tone mapping curve becomes smaller to adapt to the application scenarios covered by the second condition above, so that users can perceive the brightness consistently in different application scenarios, and improve the display adaptation effect and user experience. For example, when the size of the terminal display screen is larger than the size of the reference display device, the mapping value of the tone mapping curve is reduced to darken the image brightness, so that the user's viewing brightness experience on the large-size display screen is the same as that on the small-size display screen, thereby improving the user's visual comfort.
[0027] In a possible implementation manner, the one or more third brightness characteristic values include one or more brightness characteristic values of a dark portion of the image to be displayed.
[0028] In this implementation, since the human eye is more sensitive to the brightness of the dark part, the brightness of the dark part of the image after tone mapping based on the adjusted tone mapping parameters is further reduced, avoiding the situation where there is more noise in the application scenario covered by the second condition above, so that the user can perceive the brightness of the dark part consistently in different application scenarios, thereby improving the display adaptation effect and user experience. For example, when the size of the terminal display screen is larger than the size of the reference display device, the dark part mapping value of the tone mapping curve is adjusted down to further darken the dark part of the image, so that the user's viewing brightness experience on the large-size display screen is the same as that on the small-size display screen, thereby improving the user's visual comfort.
[0029] In a possible embodiment, the above-mentioned adjusting the initial tone mapping parameters of the image to be displayed in the second manner also includes: obtaining one or more fourth brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the slope of the adjusted tone mapping curve obtained at the one or more fourth brightness characteristic values is smaller than the slope of the initial tone mapping curve at the one or more fourth brightness characteristic values.
[0030] In this embodiment, the slope of the adjusted tone mapping curve at the one or more fourth brightness characteristic values becomes smaller, resulting in the overall or partial slope of the adjusted tone mapping curve becoming smaller, and the overall or partial contrast and brightness of the image after tone mapping based on the adjusted tone mapping curve become smaller, so as to prevent the user from being uncomfortable due to excessive contrast, so as to adapt to the application scenarios covered by the second condition above, and improve the display adaptation effect and user experience. For example, when the size of the terminal display screen is larger than the size of the reference display device, the slope of the tone mapping curve is adjusted to reduce the image contrast and brightness, so that the image contrast viewed by the user on the large-size display screen is consistent with the viewing contrast and brightness on the small-size display screen, so as to prevent the user from being uncomfortable due to excessive contrast caused by the large display screen, and improve the user's visual comfort.
[0031] In a possible implementation, the above-mentioned adjusting the initial tone mapping parameters of the image to be displayed in the second manner also includes: obtaining the base layer and one or more enhancement layers of the image to be displayed; the third eigenvalue of any one of the one or more enhancement layers is mapped by the initial tone mapping curve of any enhancement layer to a fourth eigenvalue; adjusting the initial tone mapping parameters of any enhancement layer so that the absolute value of the third eigenvalue after being mapped by the adjusted tone mapping curve is less than the absolute value of the fourth eigenvalue.
[0032] In this embodiment, the third eigenvalue and the fourth eigenvalue can be positive or negative. When comparing the value of the third eigenvalue mapped by the adjusted tone mapping curve with the size of the fourth eigenvalue, the absolute values of the above two values are compared.
[0033] In this embodiment, after the base layer is mixed with one or more adjusted enhancement layers, the mapping values corresponding to one or more enhancement layers in the image are reduced, so that the features of the enhancement layer are weakened, the high-frequency components are retained less, and the local contrast and brightness are weakened, that is, the pixel gradient is reduced. The enhancement layer includes an edge layer, a texture layer, etc., so the image feature weakening includes: the edge sharpness is weakened, the texture details are weakened, etc. Thereby adapting to the application scenarios covered by the second condition above, avoiding poor display effects caused by excessive contrast, affecting the user's viewing effect, and improving the display adaptation effect. At the same time, complex images have better tone mapping effects and display effects. For example, when the size of the terminal display screen is larger than the size of the reference display device, the mapping value of the enhancement layer tone mapping curve is adjusted to reduce the local contrast, detail clarity and brightness of the image, so that the image clarity viewed by the user on the large-size display screen is consistent with the viewing clarity and detail information perception on the small-size display screen, preventing the display screen from becoming too large and causing user discomfort due to excessive contrast, and improving the user's visual comfort.
[0034] In one possible implementation, reference tone mapping parameters of the image to be displayed are obtained; display capabilities of the terminal display device in the terminal device information are obtained; and according to the reference tone mapping parameters and the display capabilities of the terminal display device, the reference tone mapping parameters of the image to be displayed are adjusted to obtain the initial tone mapping parameters.
[0035] In this embodiment, the reference tone mapping parameters of the image to be displayed are adjusted according to the reference tone mapping parameters and the display capability information of the display screen, so that the initial tone mapping parameters are adapted to the terminal display device in terms of display capability, which serves as the basis for adjusting the tone mapping parameters again in combination with other information of the terminal display device.
[0036] In a possible implementation, obtaining the reference information includes: obtaining the reference information from the metadata of the image to be displayed; or obtaining an index of the reference information from the metadata, and selecting the reference information from a plurality of preset reference information according to the index; or using the preset reference information as the reference information.
[0037] In a possible implementation, the acquiring of the terminal device information includes: acquiring the terminal device information through measurement; or selecting the terminal device information from a plurality of preset terminal device information according to a preset index; or using the preset terminal device information as the terminal device information.
[0038] In a second aspect, an embodiment of the present application provides an image encoding method, the method comprising: writing an image to be displayed into a code stream; writing reference information of the image to be displayed into the code stream; the reference information comprises at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution; the reference information is used to perform tone mapping on the image to be displayed.
[0039] In the embodiment of the present application, according to the reference information combined with the terminal device information of the corresponding type of the decoding end, the tone mapping of the image to be displayed can flexibly adapt to different environments and display devices, effectively improve the display adaptation effect, and enhance the tone mapping effect and display effect of the image. At the same time, the user's visual perception in different application scenarios is more consistent, thereby improving the user's viewing experience.
[0040] In a possible implementation, the method further includes: writing reference tone mapping parameters of the image to be displayed into the bitstream; wherein the reference tone mapping parameters are used to obtain initial tone mapping parameters; the reference information is used by the decoding end to adjust the initial tone mapping parameters to obtain tone mapping parameters, and the tone mapping parameters are used to tone map the image to be displayed.
[0041] In this embodiment, the reference tone mapping parameters of the image to be displayed are adjusted according to the reference tone mapping parameters combined with the display capability information of the decoding end display screen, so that the initial tone mapping parameters obtained are adapted to the terminal display device in terms of display capability, which serves as the basis for the decoding end to adjust the tone mapping parameters again in combination with other information of the terminal display device.
[0042] In a possible implementation manner, writing the reference information of the to-be-displayed image into the bitstream includes: writing the reference information into the bitstream; or writing an index of the reference information into the bitstream.
[0043] In a possible implementation, the method further includes: writing one or more brightness characteristic values of the image to be displayed into the bitstream; wherein the one or more brightness characteristic values are used by the decoding end to adjust the initial tone mapping parameters to obtain the tone mapping parameters.
[0044] In this implementation, the tone mapping parameters adjusted at the decoding end using the one or more brightness characteristic values can flexibly adapt to different environments and display devices, effectively improve the display adaptation effect, and enhance the tone mapping effect and display effect of the image. At the same time, the user's visual perception in different application scenarios is more consistent, thereby improving the user's viewing experience.
[0045] In a third aspect, an embodiment of the present application provides a tone mapping device, comprising a module for executing the method described in the first aspect or any possible implementation manner of the first aspect.
[0046] Exemplarily, the device may include:
[0047] A receiving module, used for acquiring an image to be displayed;
[0048] Also used to obtain reference information; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution;
[0049] Also used to obtain terminal device information; the terminal device information includes at least one of the terminal display device size, user viewing distance, user viewing angle, ambient light brightness, or terminal display device resolution;
[0050] The tone mapping module is used to perform tone mapping on the image to be displayed according to the reference information and the terminal device information of the corresponding type.
[0051] In an embodiment of the present application, in the tone mapping of the image to be displayed based on the reference information and the terminal device information of the corresponding type, the reference display device size corresponds to the terminal display device size, the reference viewing distance corresponds to the user viewing distance, the reference viewing angle corresponds to the user viewing angle, the reference ambient light brightness corresponds to the ambient light brightness, and the reference display device resolution corresponds to the terminal display device resolution.
[0052] In a possible implementation, tone mapping is performed on the image to be displayed based on the reference information and the terminal device information of the corresponding type, including: obtaining tone mapping parameters based on the reference information and the terminal device information of the corresponding type; and tone mapping is performed on the image to be displayed based on the tone mapping parameters.
[0053] In a possible implementation, obtaining tone mapping parameters according to the reference information and the terminal device information of the corresponding type includes: adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters.
[0054] In a possible implementation, adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters includes: when the relationship between the reference information and the terminal device information satisfies a first condition, adjusting the initial tone mapping parameters of the image to be displayed in a first manner to obtain the adjusted tone mapping parameters. When the relationship between the reference information and the terminal device information satisfies a second condition, adjusting the initial tone mapping parameters of the image to be displayed in a second manner to obtain the tone mapping parameters. The initial tone mapping parameters are used to characterize an initial tone mapping curve, and the tone mapping parameters are used to characterize an adjusted tone mapping curve.
[0055] In a possible implementation, the first condition includes: the terminal display screen size is smaller than the reference display device size, the user viewing distance is greater than the reference viewing distance, the user viewing angle deviates from the reference viewing angle, the ambient light brightness is greater than the reference ambient light brightness, or the terminal display device resolution is smaller than the reference display device resolution.
[0056] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a first manner includes: obtaining one or more first brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the mapping value of the adjusted tone mapping curve at the one or more first brightness characteristic values is greater than the mapping value of the initial tone mapping curve at the one or more first brightness characteristic values.
[0057] In a possible embodiment, adjusting the initial tone mapping curve of the image to be displayed in a first manner also includes: obtaining one or more second brightness characteristic values of the image to be displayed; adjusting the initial tone mapping curve so that the slope of the adjusted tone mapping curve obtained at the one or more second brightness characteristic values is greater than the slope of the initial tone mapping curve at the one or more second brightness characteristic values.
[0058] In a possible implementation, adjusting the initial tone mapping parameters of the image to be displayed in a first manner also includes: acquiring a base layer and one or more enhancement layers of the image to be displayed; a first eigenvalue of any one of the one or more enhancement layers is mapped to a second eigenvalue by the initial tone mapping curve of the any enhancement layer; and adjusting the initial tone mapping parameters of any enhancement layer so that the absolute value of the first eigenvalue after being mapped by the adjusted tone mapping curve is greater than the absolute value of the second eigenvalue.
[0059] In this embodiment, the first eigenvalue and the second eigenvalue can be positive or negative. When comparing the value of the first eigenvalue mapped by the adjusted tone mapping curve with the second eigenvalue, the absolute values of the two values are compared.
[0060] In a possible implementation, the second condition includes: the terminal display screen size is larger than the reference display device size, the user viewing distance is smaller than the reference viewing distance, the ambient light brightness is smaller than the reference ambient light brightness, or the terminal display device resolution is larger than the reference display device resolution.
[0061] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a second manner includes: obtaining one or more third brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the mapping value of the adjusted tone mapping curve at the one or more third brightness characteristic values is smaller than the mapping value of the initial tone mapping curve at the one or more third brightness characteristic values.
[0062] In a possible implementation manner, the one or more third brightness characteristic values include: one or more brightness characteristic values of a dark portion of the image to be displayed.
[0063] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a second manner also includes: obtaining one or more fourth brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the slope of the adjusted tone mapping curve obtained at the one or more fourth brightness characteristic values is smaller than the slope of the initial tone mapping curve at the one or more fourth brightness characteristic values.
[0064] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a second manner also includes: obtaining a base layer and one or more enhancement layers of the image to be displayed; the third eigenvalue of any one of the one or more enhancement layers is mapped to a fourth eigenvalue by the initial tone mapping curve of any enhancement layer; adjusting the initial tone mapping parameters of any enhancement layer so that the absolute value of the third eigenvalue after being mapped by the adjusted tone mapping curve is less than the absolute value of the fourth eigenvalue.
[0065] In this embodiment, the third eigenvalue and the fourth eigenvalue can be positive or negative. When comparing the value of the third eigenvalue mapped by the adjusted tone mapping curve with the size of the fourth eigenvalue, the absolute values of the above two values are compared.
[0066] In a possible implementation, the tone mapping module is also used to: obtain a reference tone mapping of the image to be displayed; obtain the display capability of the terminal display device in the terminal device information; adjust the reference tone mapping parameters of the image to be displayed according to the reference tone mapping parameters and the display capability of the terminal display device to obtain the initial tone mapping parameters.
[0067] In a possible implementation, obtaining the reference information includes: obtaining the reference information from the metadata of the image to be displayed; or obtaining an index of the reference information from the metadata, and selecting the reference information from a plurality of preset reference information according to the index; or using the preset reference information as the reference information.
[0068] In a possible implementation, the acquiring of the terminal device information includes: acquiring the terminal device information through measurement; or selecting the terminal device information from a plurality of preset terminal device information according to a preset index; or using the preset terminal device information as the terminal device information.
[0069] It should be understood that the third aspect corresponds to the technical solution of the first aspect, so the beneficial effects achieved by each possible implementation method are similar and will not be repeated here.
[0070] In a fourth aspect, an embodiment of the present application provides an image encoding device, which includes a module for executing the method described in the second aspect or any possible implementation manner of the second aspect.
[0071] Exemplarily, the device may include:
[0072] The encoding module is used to write the image to be displayed into a code stream; it is also used to write reference information of the image to be displayed into the code stream; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution; the reference information is used to perform tone mapping on the image to be displayed.
[0073] The sending module is used to send the code stream.
[0074] In a possible implementation, the encoding module is also used to: write reference tone mapping parameters of the image to be displayed into the bitstream; wherein the reference tone mapping parameters are used to obtain initial tone mapping parameters; the reference information is used by the decoding end to adjust the initial tone mapping parameters to obtain tone mapping parameters, and the tone mapping parameters are used to perform tone mapping on the image to be displayed.
[0075] In a possible implementation manner, writing the reference information of the image to be displayed into the code stream includes: writing the reference information into the code stream; or writing the index of the reference information into the code stream.
[0076] In a possible implementation, the encoding module is further used to: write one or more brightness characteristic values of the image to be displayed into the bitstream; wherein the one or more brightness characteristic values are used by the decoding end to adjust the initial tone mapping parameters to obtain the tone mapping parameters.
[0077] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to execute a method as described in the first aspect or any possible implementation manner of the first aspect.
[0078] It should be understood that the technical effects that can be achieved in the fifth aspect can be specifically described by referring to the technical effects brought about by the above-mentioned first aspect or any possible implementation method of the first aspect, and will not be repeated here.
[0079] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to execute a method as described in the second aspect or any possible implementation manner of the second aspect.
[0080] It should be understood that the technical effects that can be achieved in the sixth aspect can be specifically described by referring to the technical effects brought about by the above-mentioned second aspect or any possible implementation scheme of the second aspect, and will not be repeated here.
[0081] In the seventh aspect, an embodiment of the present application provides a tone mapping system, including the tone mapping device described in the third aspect and any possible implementation of the third aspect and the image encoding device described in the fourth aspect and any possible implementation of the fourth aspect, or including the electronic device described in the fifth aspect and the electronic device described in the sixth aspect.
[0082] It should be understood that the technical effects that can be achieved in the seventh aspect can be specifically referred to the description of the technical effects brought about by the above-mentioned first aspect or any possible implementation method of the first aspect, and the description of the technical effects brought about by the above-mentioned second aspect or any possible implementation method of the second aspect, and will not be repeated here.
[0083] In an eighth aspect, an embodiment of the present application provides a code stream structure, which includes encoded image data and parameters required for image processing, and the parameters required for image processing include the reference information described in the first aspect, any possible implementation of the first aspect, the second aspect, and any possible implementation of the second aspect, and the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution.
[0084] In a possible implementation, the code stream also includes reference tone mapping parameters, and the reference tone mapping curve parameters are used to obtain initial tone mapping parameters; the reference information is used by the decoding end to adjust the initial tone mapping parameters to obtain tone mapping parameters, and the tone mapping parameters are used to perform tone mapping on the image to be displayed.
[0085] In a possible implementation manner, the code stream includes an index of the reference information.
[0086] In a possible implementation manner, the code stream includes one or more brightness characteristic values.
[0087] In the ninth aspect, an embodiment of the present application provides a computer-readable storage medium, including a program or instruction, which, when executed on a computer, enables the method in the first aspect or any possible implementation of the first aspect to be executed, or enables the method in the second aspect or any possible implementation of the second aspect to be executed.
[0088] It should be understood that the technical effects that can be achieved in the seventh aspect can be specifically described by referring to the technical effects brought about by the first aspect or any possible implementation of the first aspect or the second aspect or any possible implementation of the second aspect, and will not be repeated here.
[0089] In the tenth aspect, an embodiment of the present application provides a computer program product, including a program or instructions, which, when run on a computer, enables the method in the first aspect or any possible implementation of the first aspect to be executed, or enables the method in the second aspect or any possible implementation of the second aspect to be executed.
[0090] It should be understood that the technical effects that can be achieved in the eighth aspect can be specifically described by referring to the technical effects brought about by the first aspect or any possible implementation of the first aspect or the second aspect or any possible implementation of the second aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Figure 1 A schematic block diagram of a coding and decoding system used in an embodiment of the present application;
[0092] Figure 2A A block diagram of a content providing system for implementing a content distribution service used in an embodiment of the present application;
[0093] Figure 2B for Figure 2A A schematic diagram of an example structure of a terminal device 2106;
[0094] Figure 3A A schematic diagram of a streaming media system workflow used in an embodiment of the present application;
[0095] Figure 3B A schematic diagram of a streaming media system architecture used in an embodiment of the present application; Figure 4A A schematic diagram of a possible system architecture applicable to an embodiment of the present application;
[0096] Figure 4B A schematic diagram of the structure of an image processing system provided in an embodiment of the present application;
[0097] Figure 5 A flowchart of a tone mapping method provided in an embodiment of the present application;
[0098] Figure 6 An example diagram of an initial tone mapping parameter adjustment method provided in an embodiment of the present application;
[0099] Figure 7 An example diagram of an initial tone mapping parameter adjustment method provided in an embodiment of the present application;
[0100] Figure 8 An example diagram of an enhancement layer initial tone mapping parameter adjustment method provided in an embodiment of the present application;
[0101] Fig. 9An example diagram of an initial tone mapping parameter adjustment method provided in an embodiment of the present application;
[0102] Fig.10 An example diagram of an initial tone mapping parameter adjustment method provided in an embodiment of the present application;
[0103] Fig.11 A flowchart of an image encoding method provided in an embodiment of the present application;
[0104] Fig.12 An example diagram of a tone mapping device provided in an embodiment of the present application;
[0105] Fig.13 An example diagram of an image encoding device provided in an embodiment of the present application;
[0106] Fig.14 An example diagram of an electronic device provided in an embodiment of the present application;
[0107] Fig.15 An example diagram of an electronic device provided in an embodiment of the present application; DETAILED DESCRIPTION
[0108] The term "at least one" in the embodiments of the present application refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where any of a, b, c, ab, ac, bc, or abc can include a single a, a single b, a single c, and can also include multiple a, multiple b, and multiple c.
[0109] Furthermore, unless otherwise specified, the ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects. For example, the first priority criterion and the second priority criterion are only used to distinguish different criteria, and do not indicate the difference in the content, priority or importance of the two criteria.
[0110] In addition, the terms "including" and "having" in the embodiments, claims and drawings of the present application are not exclusive. For example, a process, method, system, product or device including a series of steps or modules / units is not limited to the listed steps or modules, and may also include steps or modules / units that are not listed.
[0111] To facilitate understanding, the technical terms involved in the embodiments of the present application are first explained accordingly.
[0112] (1) Dynamic range: The ratio of the maximum brightness to the minimum brightness in a video or image signal.
[0113] (2) High dynamic range (HDR) images: images with a dynamic range between 0.001 and 10,000 nit, where nit is the unit of illumination.
[0114] (3) Standard dynamic range (SDR) images, also known as low dynamic range, are images with a dynamic range generally between 1 nit and 100 nit.
[0115] (4) Metadata, which is used to record key information of the image in the scene or frame. In the embodiment of the present application, the metadata may also include reference tone mapping parameters, which are used to characterize the reference tone mapping curve, and reference information, including at least one of the reference display device size, reference viewing distance, reference viewing angle, reference ambient light brightness, or reference display device resolution, which is used to perform tone mapping on the image. Metadata may also include dynamic metadata and static metadata; dynamic metadata may be understood as data associated with each frame of the image (hereinafter also referred to as attribute information), which may change with different pictures; static metadata may be understood as data associated with an image sequence, which remains unchanged within the image sequence.
[0116] (5) Tone mapping: mapping the brightness of an image to the brightness range that the target display device can display. Specifically, it can be divided into high dynamic to low dynamic mapping and low dynamic to high dynamic mapping. For example, an HDR image includes a 4000nit light signal, but the HDR display capability of the target display device (TV, IPAD) is only 500nit. In this case, the 4000nit signal needs to be mapped to a 500nit device, which is a high-to-low tone mapping process. For another example, an SDR image includes a 100nit SDR signal, but the target display device has a 2000nit display capability. In this case, the 100nit signal needs to be mapped to a 2000nit device, which is a low-to-high tone mapping process.
[0117] (6) Image contrast: The measurement of the different brightness levels between the brightest and darkest eigenvalues in the light and dark areas of an image, that is, the magnitude of the grayscale contrast of an image. The larger the difference range, the greater the contrast, and the smaller the difference range, the smaller the contrast. A good contrast ratio of 120:1 can easily display vivid and rich colors. When the contrast ratio is as high as 300:1, it can support colors of all levels.
[0118] (7) A mapping curve, which is a function curve used to map the brightness of an image. The mapping curve in the embodiment of the present application may include a Sigmoid function curve, a cubic spline function curve, or a Gamma function curve.
[0119] (8) Display adaptation: Tone processing of video or image signals to adapt the display characteristics of the target display device.
[0120] When a video or image is displayed on an existing display device, it is necessary to process the brightness of the video or image according to the display capability of the display device so that it can adapt to the brightness range that the display device can display. This process is called tone mapping (TM). However, current display devices are diverse, not only with differences in the brightness range that the display can display, but also in other aspects, such as the size of the display. Therefore, the existing scheme simply aligns the maximum and minimum values of the image with the maximum and minimum brightness values of the display, and cannot achieve the best display adaptation effect. Therefore, the present application proposes a tone mapping method and device, which takes into account other information such as the size of the terminal display device and the user's viewing distance when tone mapping the image, thereby improving the display adaptation effect.
[0121] The following combination Figure 1 Describe the coding and decoding system used in this application. Figure 1A schematic block diagram of a coding and decoding system used in an embodiment of the present application is shown, for example, a video coding and decoding system 10 (or simply referred to as coding and decoding system 10) that can utilize the technology of the present application. The video encoder 20 (or simply referred to as encoder 20) and the video decoder 30 (or simply referred to as decoder 30) in the video coding and decoding system 10 represent devices that can be used to perform various technologies according to various examples described in the present application.
[0122] like Figure 1 As shown, the encoding and decoding system 10 includes a source device 12, and the source device 12 is used to provide encoded data 21 such as encoded images to a destination device 14 for decoding the encoded data.
[0123] The source device 12 includes an encoder 20 , and optionally may further include an image source 16 , an image preprocessor 18 (or a preprocessing unit), and a communication interface or a communication unit 22 .
[0124] The image source 16 may include or may be any type of image capture device for capturing real-world images, etc., and / or any type of image generation device, such as a computer graphics processor for generating computer-animated images or any type of device for acquiring and / or providing real-world images, computer-generated images (e.g., screen content, virtual reality (VR) images, and / or any combination thereof (e.g., augmented reality (AR) images). The image source may be any type of memory or storage that stores any of the above images.
[0125] In order to distinguish the processing performed by the pre-processor 18 or the pre-processing unit 18 , the image or the image data 17 may also be referred to as a raw image or raw image data 17 .
[0126] The preprocessor 18 is used to receive (raw) image data 17 and preprocess the image data 17 to obtain a preprocessed image 19 or preprocessed image data 19. For example, the preprocessing performed by the preprocessor 18 may include trimming, color format conversion (e.g., from RGB to YCbCr), color adjustment, or denoising. It is understood that the preprocessing unit 18 may be an optional component.
[0127] The video encoder 20 is configured to receive the pre-processed image data 19 and provide encoded image data 21 .
[0128] The communication interface 22 in the source device 12 may be used to receive the encoded image data 21 and transmit the encoded image data 21 (or any other processed version thereof) to another device such as the destination device 14 or any other device via the communication channel 13 for storage or direct reconstruction.
[0129] Destination device 14 includes a decoder 30 (eg, video decoder 30 ) and, in addition or alternatively, may include a communication interface or communication unit 28 , a post-processor 32 (or post-processing unit 32 ), and a display device 34 .
[0130] The communication interface 28 in the destination device 14 is used to receive the encoded image data 21 (or any other processed version) directly from the source device 12 or from any other source device such as a storage device, for example, the storage device is a coded image data storage device, and provide the encoded image data 21 to the decoder 30.
[0131] The communication interface 22 and the communication interface 28 can be used to send or receive the encoded image data 21 or the encoded data through a direct communication link between the source device 12 and the destination device 14, such as a direct wired or wireless connection, or through any type of network, such as a wired network, a wireless network or any combination thereof, any type of private network and public network or any type of combination thereof.
[0132] For example, the communication interface 22 may be used to encapsulate the encoded image data 21 into a suitable format such as a message, and / or process the encoded image data using any type of transmission coding or processing for transmission over a communication link or network.
[0133] The communication interface 28 corresponds to the communication interface 22 , for example, and can be used to receive transmission data and process the transmission data using any type of corresponding transmission decoding or processing and / or decapsulation to obtain encoded image data 21 .
[0134] Both the communication interface 22 and the communication interface 28 can be configured as follows Figure 1 A unidirectional communication interface, or a bidirectional communication interface, is indicated by an arrow pointing from the source device 12 to the corresponding communication channel 13 of the destination device 14, and can be used to send and receive messages, etc. to establish a connection, confirm and exchange any other information related to the communication link and / or data transmission such as encoded image data transmission, etc.
[0135] The decoder 30 is configured to receive the encoded image data 21 and provide decoded image data 31 or a decoded image 31 .
[0136] The post-processor 32 in the destination device 14 is used to post-process the decoded image data 31 (also called reconstructed image data) such as the decoded image 31 to obtain the post-processed image data 33 such as the post-processed image 33. The post-processing performed by the post-processing unit 32 may include, for example, color format conversion (e.g., conversion from YCbCr to RGB), color adjustment, cropping or resampling, or any other processing for generating the decoded image data 31 for display by the display device 34 or the like.
[0137] The display device 34 in the destination device 14 is used to receive the post-processed image data 33 to display the image to a user or viewer, etc. The display device 34 can be or include any type of display for displaying the reconstructed image, such as an integrated or external display screen or display. For example, the display screen can include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS), a digital light processor (DLP), or any other type of display screen.
[0138] although Figure 1 The source device 12 and the destination device 14 are shown as independent devices, but the device embodiment may also include both the source device 12 and the destination device 14 or the functions of both the source device 12 and the destination device 14, that is, both the source device 12 or the corresponding functions and the destination device 14 or the corresponding functions. In these embodiments, the source device 12 or the corresponding functions and the destination device 14 or the corresponding functions may be implemented using the same hardware and / or software or by separate hardware and / or software or any combination thereof.
[0139] According to the description, Figure 1 The presence and (exact) division of different units or functions in the source device 12 and / or destination device 14 shown may vary depending on the actual device and application, as will be apparent to the skilled person.
[0140] Combine the following Figure 2A Describe the content providing system of the content distribution service applied by this application, Figure 2A A block diagram of a content providing system for implementing a content distribution service used in an embodiment of the present application. The content providing system 2100 includes a capture device 2102, a terminal device 2106, and an (optional) display 2126. The capture device 2102 communicates with the terminal device 2106 via a communication link 2104. The communication link may include the above-mentioned communication channel 13. The communication link 2104 includes, but is not limited to, WiFi, Ethernet, wired, wireless (3G / 4G / 5G), USB, or any combination thereof.
[0141] Capture device 2102 generates data, and can use the coding method shown in the above embodiment to encode the data. Alternatively, capture device 2102 can distribute data to a streaming media server (not shown in the figure), and the server encodes the data and transmits the encoded data to terminal device 2106. Capture device 2102 includes but is not limited to a camera, a smart phone or a tablet computer, a computer or a laptop computer, a video conferencing system, a PDA, a vehicle-mounted device or any combination thereof. For example, capture device 2102 may include the above-mentioned source device 12. When data includes video, the video encoder 20 in capture device 2102 can actually perform video encoding processing. When data includes audio (i.e., sound), the audio encoder 20 in capture device 2102 can actually perform audio encoding processing. In some actual scenes, capture device 2102 distributes encoded video data and encoded audio data by multiplexing the encoded video data and the encoded audio data together. In other actual scenes, for example, in a video conferencing system, the encoded audio data and the encoded video data are not multiplexed. Capture device 2102 distributes the encoded audio data and the encoded video data to terminal device 2106 respectively.
[0142] The terminal device 2106 in the content providing system 2100 receives and regenerates the encoded data. The terminal device 2106 can be a device with data receiving and recovery capabilities, such as a smart phone or tablet computer 2108, a computer or laptop computer 2110, a network video recorder (NVR) / digital video recorder (DVR) 2112, a television 2114, a set top box (STB) 2116, a video conferencing system 2118, a video surveillance system 2120, a personal digital assistant (PDA) 2122, a vehicle device 2124 or any combination thereof, or such a device capable of decoding the above-mentioned encoded data. For example, the terminal device 2106 can include the above-mentioned destination device 14. When the encoded data includes video, the video decoder 30 in the terminal device prioritizes video decoding. When the encoded data includes audio, the audio decoder in the terminal device prioritizes audio decoding processing. The terminal device 2106 may be a video playback application, a streaming media playback application, a streaming media playback platform, a live broadcast platform, etc. running on the terminal device.
[0143] For terminal devices with a display, such as a smartphone or tablet 2108, computer or laptop 2110, NVR / DVR 2112, TV 2114, PDA* 2122, or vehicle-mounted device 2124, the terminal device can send the decoded data to its display. For terminal devices without a display, such as STB 2116, video conferencing system 3118, or video surveillance system 2120, connect the device to an external display 2126 to receive and display the decoded data.
[0144] When each device in the system performs encoding or decoding, the image encoding device or image decoding device shown in the above embodiments may be used.
[0145] Figure 2B for Figure 2A Schematic diagram of the example structure of the terminal device 2106 in FIG. After the terminal device 2106 receives the bit stream from the capture device 2102, the protocol processing unit 2202 analyzes the transmission protocol of the bit stream. The protocol includes but is not limited to Real Time Streaming Protocol (RTSP), Hyper Text Transfer Protocol (HTTP), HTTP Live streaming protocol (HLS), MPEG HTTP Dynamic Adaptive Streaming over HTTP (MPEG-DASH), Real-time Transport Protocol (RTP), Real Time Messaging Protocol (RTMP) or any combination thereof.
[0146] After the protocol processing unit 2202 processes the stream, a stream file is generated. The file is output to the demultiplexing unit 2204. The demultiplexing unit 2204 can separate the multiplexed data into coded audio data and coded video data. As mentioned above, in other actual scenarios, such as in a video conferencing system, the coded audio data and the coded video data are not multiplexed. In this case, the coded data is not transmitted to the video decoder 3206 and the audio decoder 2208 through the demultiplexing unit 2204.
[0147] Through the demultiplexing process, a video elementary stream (ES), an audio ES, and optional subtitles are generated. The video decoder 2206, including the video decoder 30 described in the above embodiment, decodes the video ES to generate a video frame by the decoding method shown in the above embodiment, and sends the data to the synchronization unit 2212. The audio decoder 2208 decodes the audio ES to generate an audio frame, and sends the data to the synchronization unit 2212. Alternatively, the video frame can be stored in a buffer (not shown in the figure) before being sent to the synchronization unit 2212. Similarly, the audio frame can be stored in a buffer (not shown in the figure) before being sent to the synchronization unit 2212.
[0148] The synchronization unit 2212 synchronizes the video frames and the audio frames and provides the video / audio to the video / audio display 3214. For example, the synchronization unit 2212 synchronizes the presentation of the video and audio information. The information can be encoded in the syntax using the timestamps associated with the encoded audio and visual data representations and the timestamps associated with the data stream transmission.
[0149] If subtitles are included in the bitstream, the subtitle decoder 2210 decodes the subtitles, synchronizes them with the video frames and audio frames, and provides the video / audio / subtitles to the video / audio / subtitle display 2216 .
[0150] The present invention is not limited to the above-mentioned system, and the image encoding device or the image decoding device in the above-mentioned embodiments can be used in other systems such as automobiles.
[0151] Combine the following Figure 3A A streaming media system to which the embodiments of the present application are applicable is described. Figure 3A A schematic diagram of a streaming media system workflow applicable to an embodiment of the present application.
[0152] The streaming media system includes a content creation module to generate the required content data, such as video or audio. The streaming media system also includes a video encoding module to encode the generated content through an encoder. The streaming media system also includes a video stream transmission module to transmit the encoded video in the form of a code stream. Optionally, the format of the video stream can be converted into a code stream format of a commonly used transmission protocol for OTT (over-the-top) devices, for example, the protocol includes but is not limited to Real Time Streaming Protocol (RTSP), Hyper Text Transfer Protocol (HTTP), HTTP Live streaming protocol (HLS), MPEG HTTP Dynamic Adaptive Streaming over HTTP (MPEG-DASH), Real-time Transport Protocol (RTP), Real-time Messaging Protocol (RTMP) or any combination thereof. Optionally, the video stream can be stored to store the original format of the video stream and / or the converted multiple code stream formats for easy use. Furthermore, the streaming media system also includes a video stream encapsulation module for encapsulating the video stream to generate an encapsulated video stream, which can be called a video streaming media package. Exemplarily, the video streaming media package can be generated according to the transcoded video stream or the stored video stream. Furthermore, the streaming media system also includes a content distribution network (CDN), which is used to distribute the video streaming media package to multiple OTT devices, such as mobile phones, computers, tablets, home projectors, etc.
[0153] It should be noted that video encoding, video streaming transmission, video stream transcoding, video stream storage, video streaming package generation and content distribution network can all be implemented on cloud servers.
[0154] Combine the following Figure 3B An exemplary streaming media system architecture of the present application is described. The streaming media system architecture includes: a client device, a content distribution network, and a cloud server.
[0155] The user on the client device sends a play or playback request to the cloud platform. Optionally, the content of the request sent may be the title of the movie or TV program being played.
[0156] The cloud platform makes a decision, replies to the client, and sends the address of the content requested by the client on the CDN to the client. Optionally, the content sent to the client can be a URL link (uniform resource locator). Specifically, the playback application service in the cloud platform checks user authorization and permission, and then considers the characteristics of each client and the current network conditions to determine which specific files are needed to process the playback request. It should be noted that the content delivery network (CDN) regularly reports the operating status, learned routes, and available content (files) to the cache control service in the cloud platform.
[0157] The client then requests the CDN to play the content based on the address, and the CDN provides the content to the client, ultimately completing the client's request.
[0158] Combine the following Figure 4A Describe the system architecture applicable to the embodiments of the present application. Figure 4A This is a schematic diagram of a possible system architecture applicable to an embodiment of the present application. The system architecture of the embodiment of the present application includes: a front-end device, a transmission link, and a terminal display device.
[0159] Among them, the front-end device is used to capture or produce HDR / SDR content (for example, HDR / SDR video or image).
[0160] In a possible embodiment, the front-end device can also be used to extract corresponding metadata from the HDR content, and the metadata may include global mapping information, local mapping information, and dynamic metadata and static metadata corresponding to the HDR content. The front-end device can send the HDR content and metadata to the terminal display device through a transmission link. Specifically, the HDR content and metadata can be transmitted in the form of one data packet, or in two data packets respectively, which is not specifically limited in the embodiments of the present application.
[0161] Optionally, the terminal display device can be used to receive metadata and HDR content, and extract the global mapping information, local mapping information and the terminal display device information contained in the corresponding metadata according to the HDR content, obtain a mapping curve to perform global tone mapping and local tone mapping on the HDR content, convert it into display content adapted for the HDR display device or SDR device in the terminal display device, and display it. It should be understood that in different embodiments, the terminal display device may include a display device with a display capability of a lower dynamic range or a higher dynamic range than the HDR content generated by the front-end device, and this application is not limited thereto.
[0162] Optionally, the front-end device and the terminal display device in the present application may be independent and different physical devices. For example, the front-end device may be a video acquisition device or a video production device, wherein the video acquisition device may be a video camera, a camera, an image plotter, etc. The terminal display device may be a device with a video playback function, such as virtual reality (VR) glasses, a mobile phone, a tablet, a television, a projector, etc.
[0163] Optionally, the transmission link between the front-end device and the terminal display device can be a wireless connection or a wired connection, wherein the wireless connection can adopt technologies such as long term evolution (LTE), fifth generation (5G) mobile communication and future mobile communication. Wireless connection can also include wireless fidelity (WiFi), Bluetooth, near field communication (NFC) and other technologies. Wired connection can include Ethernet connection, local area network connection, etc. There is no specific limitation on this.
[0164] The present application may also integrate the functions of the front-end device and the functions of the terminal display device on the same physical device, for example, a terminal device such as a mobile phone or a tablet with a video shooting function. The present application may also integrate some functions of the front-end device and some functions of the terminal display device on the same physical device. There is no specific limitation on this.
[0165] Combine the following Figure 4B Describe the end-to-end image processing system provided by the embodiment of the present application, which can be applied to Figure 4A The system architecture shown. Figure 4B A schematic diagram of the structure of an image processing system provided in an embodiment of the present application, in Figure 3B In the example, HDR / SDR content takes HDR video as an example. The image processing system includes: an HDR preprocessing module, an HDR video encoding module, an HDR video decoding module, and a tone mapping module.
[0166] Among them, the HDR preprocessing module and the HDR video encoding module can be located in Figure 4A The front-end device shown in the figure, the HDR video decoding module and the tone mapping module can be located in Figure 4A The terminal display device shown.
[0167] HDR preprocessing module: used to extract dynamic metadata (e.g., maximum, minimum, average, and range of brightness) from HDR video, and determine mapping curve parameters based on dynamic metadata and the display capability of the target display device, write the mapping curve parameters into the dynamic metadata to obtain HDR metadata, and transmit it. HDR video can be acquired or processed by a colorist; the display capability of the target display device is the brightness range that the target display device can display.
[0168] HDR video encoding module: used to encode HDR video and HDR metadata according to the video compression standard (for example, AVS or HEVC standard) (for example, embedding HDR metadata into the user-defined part of the bitstream) and output the corresponding bitstream (AVS or HEVC bitstream).
[0169] HDR video decoding module: used to decode the generated bitstream (AVS bitstream or HEVC bitstream) according to the standard corresponding to the bitstream format, and output the decoded HDR video and HDR metadata.
[0170] Tone mapping module: used to generate a mapping curve according to the parameters of the mapping curve in the decoded HDR metadata, and perform tone mapping on the decoded HDR video (i.e. HDR adaptation processing or SDR adaptation processing), and send the HDR adapted video after tone mapping to the HDR display terminal for display, or send the SDR adapted video to the SDR display terminal for display.
[0171] Exemplarily, the HDR pre-processing module may exist in a video acquisition device or a video production device.
[0172] Exemplarily, the HDR video encoding module may exist in a video acquisition device or a video production device.
[0173] Exemplarily, the HDR video decoding module may exist in a set-top box, a television display device, a mobile terminal display device, and a video conversion device for online live broadcasting, online video applications, and the like.
[0174] Exemplarily, the tone mapping module may exist in a set-top box, a television display device, a mobile terminal display device, and a video conversion device for a live webcast, a web video application, etc. More specifically, the tone mapping module may exist in the form of a chip or a software program in a set-top box, a television display, a mobile terminal display, and may exist in the form of a software program in a video conversion device for a live webcast, a web video application, etc.
[0175] In a possible embodiment, when the tone mapping module and the HDR video decoding module are both present in a set-top box, the set-top box can complete the functions of receiving, decoding, and tone mapping the video code stream, and the set-top box sends the decoded video data to a display device through a high definition multimedia interface (HDMI) for display, so that the user can enjoy the video content.
[0176] The following describes the process of tone mapping performed by a terminal display device in conjunction with specific drawings.
[0177] See also Figure 5 , Figure 5 A flowchart of a tone mapping method provided in an embodiment of the present application; the method can be executed by a terminal display device, and specifically includes the following steps:
[0178] Step S501: Acquire an image to be displayed.
[0179] In the embodiment of the present application, the image to be displayed may be an HDR image or video, or an SDR image or video. The image to be displayed may be an optical signal (i.e., a linear signal) or an electrical signal (i.e., a nonlinear signal), which is not limited in the present application. If it is an electrical signal, the electrical signal may be converted into an optical signal according to a photoelectric signal conversion function.
[0180] In a possible embodiment, the image to be displayed is transmitted in the form of a code stream, and the terminal display device can receive the code stream from the front-end device and decode the code stream to obtain data of the image to be displayed.
[0181] Optionally, the data of the image to be displayed includes image data, such as pixel data. It should be understood that the embodiment of the present application does not limit the format of the image, and the image data can be any color space, such as RGB or YUV, and the image data can be any bit width, such as 8 bits, 10 bits or 12 bits.
[0182] Optionally, the data of the image to be displayed includes metadata. It should be understood that the embodiment of the present application does not limit the format of the metadata. The metadata includes data such as the data format of the image or video, area division information, area traversal order information, image features or mapping curve parameters, and one or more metadata information units. The metadata information unit includes data such as coordinate information, image features, and curve parameters. Exemplarily, the metadata may include reference information of the image to be displayed, such as a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution, etc. The metadata may also include tone mapping information, such as a tone mapping curve, etc.
[0183] Optionally, the decoding device (eg, a set-top box) receives a code stream from the front-end device, decodes the code stream, obtains data of the image to be displayed, and then sends the decoded data of the image to be displayed to the terminal display device.
[0184] Optionally, the process of decoding the code stream includes decoding the received code stream by a decoder, thereby obtaining data of the image to be displayed. Exemplarily, the decoder may be a HEVC decoder, a JPEG decoder, a ProRes decoder, or a VVC decoder.
[0185] In another possible embodiment, the image to be displayed is an image that can be processed by software, and the software processing includes but is not limited to tone mapping, dehaze, deblur, scaling, color gamut conversion, and neural network-based graphics processing.
[0186] In another possible embodiment, the image to be displayed may be an image that has been processed by hardware, and the hardware processing includes but is not limited to tone mapping, dehaze, deblur, scaling, color gamut conversion, and neural network-based graphics processing.
[0187] Step S502, obtaining reference information; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution.
[0188] In an embodiment of the present application, reference information of an image to be displayed is obtained, and the reference information is used to perform tone mapping on the image to be displayed to improve the viewing experience of the user, including at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution. Optionally, the reference information can be used to adjust a reference tone mapping curve in combination with terminal device information.
[0189] Optionally, the reference display device size may be the size of the display device used when making the image to be displayed. Optionally, the reference display device size includes at least one of the length, width or diagonal length of the display device, which is not limited in the present application. Optionally, the reference display device size may be obtained by converting at least one of the length, width or diagonal length of the display device, which is not limited in the present application. Among them, optionally, the reason for the conversion may be an appearance reason, such as bending, folding, etc., or a visual reason, such as a change in display size caused by vision correction by a VR device. Optionally, the reference display device size may be obtained from the metadata of the image to be displayed; an index of the reference display device size may also be obtained from the metadata, and a reference device size may be selected from a plurality of preset reference display device sizes according to the index; or a preset reference display device size may be directly used as the reference display device size. The index of the reference display device size may correspond to different standards to correspond to the display device sizes specified by different standards, wherein the standards include, for example, 1920ⅹ1080HD, 1280ⅹ720HD 720P, 3840ⅹ2160Ultra HD, etc.
[0190] Optionally, the reference viewing distance may be the viewing distance of a reference display device used when producing the image to be displayed. Optionally, the reference viewing distance may be the straight-line distance between the user and the center point of the display device, may be the vertical distance between the user and the imaging plane of the display device, or may be the straight-line distance between the user and a preset position on the imaging plane of the display device, and this application does not limit this. Optionally, the reference viewing distance may be obtained from the metadata of the image to be displayed; an index of the reference viewing distance may also be obtained from the metadata, and the reference viewing distance may be selected from a plurality of preset reference viewing distances according to the index; or a preset reference viewing distance may be directly used as the reference viewing distance.
[0191] Optionally, the reference viewing angle may be a viewing angle range of a reference display device used when producing the image to be displayed. Optionally, the reference viewing angle may be an angle range that deviates from a vertical line perpendicular to the center point of the display device. The angle range is an angle range in which a user can accurately observe the image to be displayed, and this application does not limit this. Optionally, the reference viewing angle may be obtained from the metadata of the image to be displayed; an index of the reference viewing angle may also be obtained from the metadata, and the reference viewing angle may be selected from a plurality of preset reference viewing angles according to the index; or a preset reference viewing angle may be directly used as the reference viewing angle.
[0192] Optionally, the reference ambient light brightness may be the ambient light brightness when the image to be displayed is produced. Optionally, the reference ambient light brightness may be obtained from metadata of the image to be displayed; an index of the reference ambient light brightness may be obtained from the metadata, and the reference ambient light brightness may be selected from a plurality of preset reference ambient light brightnesses according to the index; or the preset reference ambient light brightness may be directly used as the reference ambient light brightness.
[0193] Optionally, the reference display device resolution may be the resolution of the reference display device used when producing the image to be displayed. Optionally, the value of the reference display device resolution may be obtained from the metadata of the image to be displayed; the index of the reference display device resolution may also be obtained from the metadata, and the reference display device resolution may be selected from a plurality of preset reference display device resolutions according to the index; or the preset reference display device resolution may be directly used as the reference display device resolution. The index of the reference display device resolution may correspond to different standards to correspond to the display device resolutions specified by different standards, such as standard 1920ⅹ1080HD, 1280ⅹ720HD 720P, 3840ⅹ2160Ultra HD, etc.
[0194] Step S503, obtaining terminal device information; the terminal device information includes at least one of the terminal display device size, user viewing distance, user viewing angle, ambient light brightness, or terminal display device resolution.
[0195] In an embodiment of the present application, terminal device information is obtained and used to adjust the reference tone mapping curve in combination with reference information.
[0196] Optionally, the terminal display device size includes at least one of the length, width or diagonal length of the terminal display device, which is not limited in this application. Optionally, the terminal display device size can be obtained by converting at least one of the length, width or diagonal length of the display device, which is not limited in this application. Among them, optionally, the reason for the conversion can be an appearance reason, such as bending, folding, etc., or a visual reason, such as a change in display size caused by vision correction of a VR device. Optionally, the terminal device size can be obtained by actually measuring the terminal device, and the terminal device size can be selected from a preset plurality of terminal display device sizes according to a preset index; the preset terminal display device size can also be directly used as the terminal display device size. The index can correspond to different standards to correspond to the display device size specified by different standards, wherein the standards are such as 1920ⅹ1080HD, 1280ⅹ720HD 720P, 3840ⅹ2160UltraHD, etc.
[0197] Optionally, the user viewing distance may be the straight-line distance between the user and the center point of the terminal display device, may be the vertical distance between the user and the imaging plane of the terminal display device, or may be the straight-line distance between the user and a preset position on the imaging plane of the terminal display device, and this application does not limit this. Optionally, the viewing distance of a single user may be obtained through actual measurement; or multiple user viewing distances may be obtained through actual measurement, and then a representative user viewing distance may be selected by calculation. For example, the center of multiple user viewing distances may be selected as the user viewing distance. Optionally, the user viewing distance may be selected from multiple preset user viewing distances according to a preset index; or the preset user viewing distance may be directly used as the user viewing distance. Optionally, when the number of users is single, the viewing distance of a single user may be obtained through actual measurement; when the number of users is multiple, the preset user viewing distance may be directly used as the user viewing distance.
[0198] Optionally, the user viewing angle may be an angle range that deviates from a vertical line perpendicular to the center point of the display device. Optionally, the viewing distance of a single user may be obtained through actual measurement; or the viewing distances of multiple users may be obtained through actual measurement, and then a representative user viewing angle may be selected by calculation. For example, the average angle of multiple user viewing angles may be selected as the user viewing angle. Optionally, the user viewing angle may be selected from multiple preset user viewing angles according to a preset index; or the preset user viewing angle may be directly used as the user viewing angle. Optionally, when the number of users is single, the viewing angle of a single user may be obtained through actual measurement; when the number of users is multiple, the preset user viewing angle may be directly used as the user viewing angle.
[0199] Optionally, the ambient light brightness may be obtained by measuring the ambient light brightness through an actual sensor; the ambient light brightness may also be selected from a plurality of preset ambient light brightnesses according to a preset index; or the preset ambient light brightness may be directly used as the ambient light brightness.
[0200] Optionally, the terminal display device resolution may be an actual value of the terminal display device resolution; the terminal display device resolution may be selected from a plurality of preset terminal display device resolutions according to an index; or the preset terminal display device resolution may be directly used as the terminal display device resolution. The index of the terminal display device resolution may correspond to different standards to correspond to the display device resolutions specified by different standards, such as standard 1920ⅹ1080HD, 1280ⅹ720HD 720P, 3840ⅹ2160Ultra HD, etc.
[0201] In a possible embodiment, the tone mapping method further includes adjusting the reference tone mapping parameters of the image to be displayed according to the reference tone mapping parameters and the display capability of the terminal display device to obtain initial tone mapping parameters.
[0202] In the embodiment of the present application, the reference tone mapping parameters are used to characterize the reference tone mapping curve, and the initial tone mapping parameters are used to characterize the initial tone mapping curve.
[0203] First, obtain the reference tone mapping parameters of the image to be displayed. Optionally, the reference tone mapping parameters can be obtained from the metadata of the image to be displayed. For example, the metadata can include multiple reference display device display capability information, such as peak brightness, and the initial global tone mapping curve parameters for tone mapping on the peak brightness; the metadata can also include histogram information and tone mapping curve parameter information as in standard ST2094-40; it can also include tone mapping curve parameter information as in standard ST2094-10. Optionally, the index of the reference tone mapping parameter can be obtained from the metadata, and the reference tone mapping parameter can be selected from the parameters of multiple preset reference tone mapping curves according to the index; the preset reference tone mapping parameter can also be directly used as the reference tone mapping parameter. Among them, the reference tone mapping curve parameter can be obtained from the metadata information, which can be obtained from the SEI encapsulated by HEVC or VVC, the user-defined NAL unit or the reserved package unit, can be obtained from the APP extension information encapsulated by JFIF, or can be obtained from the data segment encapsulated by MP4, and this application does not limit this.
[0204] Then, the display capability of the terminal display device in the terminal device information is obtained, such as the peak brightness and the darkest brightness of the terminal display device. Optionally, the display capability of the display screen of the terminal display device can be obtained as the display capability of the terminal display device; the display capability of the terminal display device can also be selected from a plurality of preset display capabilities of the terminal display device according to a preset index; or the preset display capability of the terminal display device can be directly used as the display capability of the terminal display device.
[0205] Optionally, the display capability of the reference display device in the reference information may be obtained for adjusting the reference tone mapping parameters. The display capability of the reference display device may be the display capability of the reference display device used when producing the image to be displayed, such as the peak brightness and the darkest brightness of the reference display device. Optionally, the display capability of the reference display device may be obtained from the metadata of the image to be displayed; an index of the display capability of the reference display device may also be obtained from the metadata, and the display capability of the reference display device may be selected from a plurality of preset reference display device display capabilities according to the index; or the preset reference display device display capability may be directly used as the display capability of the reference display device.
[0206] Finally, according to the reference tone mapping parameters and the display capability of the terminal display device, the reference tone mapping parameters of the image to be displayed are adjusted to obtain the initial tone mapping parameters.
[0207] In a possible embodiment, the initial tone mapping curve parameter information may be acquired according to the parameter information of the reference tone mapping curve and the display capability information of the terminal display device.
[0208] Optionally, after obtaining the display capability information of the terminal display device, one or more appropriate preset display device information and corresponding one or more reference tone mapping curve parameters are selected according to the display capability of the terminal display device. Then, initial tone mapping curve parameters are obtained according to the one or more reference tone mapping curve parameters to adapt to the display capability information of the terminal display device of the terminal device.
[0209] Optionally, the metadata may include multiple preset display device information, such as peak brightness, etc., and initial tone mapping curve parameters for tone mapping at the peak brightness. This application does not limit the format of metadata. The metadata may include histogram information and tone mapping curve parameter information as in standard ST2094-40, or may include tone mapping curve parameter information as in standard ST2094-10.
[0210] Optionally, multiple preset display device information, such as peak brightness, etc., and reference tone mapping curve parameters for tone mapping on the peak brightness may be preset values locally.
[0211] Optionally, when a reference tone mapping curve parameter is obtained, the reference tone mapping curve parameter may be adjusted to adapt to the terminal display device information.
[0212] Optionally, when a plurality of reference tone mapping curve parameters are obtained, the initial tone mapping curve parameters may be obtained by weighted averaging according to the relationship between a plurality of preset display device information and the terminal display device information corresponding to the plurality of reference tone mapping curves.
[0213] Optionally, the tone mapping curve may be calculated based on the terminal display device information based on partial parameter information of the reference tone mapping curve, wherein the partial parameter information of the reference tone mapping curve may be carried in the metadata or may be a preset value preset locally.
[0214] In another possible embodiment, the initial tone mapping curve parameter information can be obtained according to the parameter information of the reference tone mapping curve, the characteristic information of the image itself, and the terminal device information. The characteristic information of the image itself includes content characteristic information, such as the maximum, minimum, and average brightness of the content, and characteristic information related to the preset percentage distribution of the image. The parameter information of the reference tone mapping curve can be carried in the metadata, or can be a preset value preset locally, and the characteristic information of the image itself can be carried in the metadata.
[0215] In another possible embodiment, the initial tone mapping curve parameters may be calculated according to the content feature information of the image to be displayed in the metadata. Optionally, some parameter values of the initial tone mapping curve may be preset values and do not need to be calculated.
[0216] It should be noted that the tone mapping curve includes various forms, such as Sigmoid function curve, cubic spline function curve, Gamma function, etc., which are not limited in the present invention.
[0217] Exemplarily, the following function may be used to obtain the initial tone mapping curve:
[0218]
[0219] According to the above curve, the mapping relationship between the normalized HDR / SDR source data and the normalized HDR display data can be obtained. Wherein, L can be R, G, B in the RGB color domain, or the maximum value max(R, G, B) of R, G, B, or the brightness Y in the YUV color domain, or the brightness component L in the Lab color domain. L and L' can be normalized optical signals or electrical signals, which are not limited in the present invention.
[0220] Exemplarily, m=2.4, n=1, and b=the darkest brightness of the terminal display device in the above function may be preset.
[0221] The process of obtaining the parameter p in the above function according to the image feature information and the preset relationship is as follows: first, the feature information of the image is obtained from the metadata, including the maximum value maxL, the minimum value minL, the average value avgL, etc. Then, p is obtained according to the feature information of the image and the preset relationship.
[0222] Optionally, you can get p based on avgL and a preset relationship:
[0223]
[0224] Where P valueH0 , P valueL0 , TPH0, TPL0 are all preset parameters, you can set P valueH0=3.5, P valueL0 =4.0, TPH0=0.6, TPL0=0.3.
[0225] Optionally, you can get p based on maxL and a preset relationship:
[0226]
[0227] in PdeltaH1 , P deltaL1 , TPH1, TPL1 are all preset parameters, you can set P deltaH1 =3.5, P deltaL1 =4.0, TPH1=0.6, TPL1=0.3.
[0228] Optionally, p can be adjusted based on maxL and a preset relationship:
[0229]
[0230] According to the terminal display device information, the characteristic information of the image obtained from the metadata, and other curve parameters, a can be calculated:
[0231]
[0232] The peak brightness of the terminal display device is MaxDisplay, the darkest brightness is MinDisplay, and the maximum value of the feature information of the image obtained in the metadata is maxL.
[0233] Step S504: tone mapping the image to be displayed according to the reference information and the corresponding terminal device information. In the embodiment of the present application, in tone mapping the image to be displayed according to the reference information and the corresponding type of the terminal device information, the reference display device size corresponds to the terminal display device size, the reference viewing distance corresponds to the user viewing distance, the reference viewing angle corresponds to the user viewing angle, the reference ambient light brightness corresponds to the ambient light brightness, and the reference display device resolution corresponds to the terminal display device resolution.
[0234] In the embodiment of the present application, when tone mapping is performed on an image, other information such as the size of the terminal display device and the user's viewing distance is also taken into account, thereby improving the display adaptation effect.
[0235] In a possible embodiment, tone mapping is performed on the image to be displayed according to the reference information and the terminal device information of the corresponding type, including: obtaining tone mapping parameters according to the reference information and the terminal device information of the corresponding type; and tone mapping is performed on the image to be displayed based on the tone mapping parameters.
[0236] In a possible embodiment, obtaining tone mapping parameters according to the reference information and the terminal device information of the corresponding type includes: adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters.
[0237] In an embodiment of the present application, the initial tone mapping parameters of the image to be displayed are adjusted according to the reference information and the terminal device information of the corresponding type to obtain the adjusted tone mapping parameters, including adjusting the initial tone mapping parameters of the image to be displayed in different ways when the relationship between the reference information and the terminal device information meets different conditions to obtain the adjusted tone mapping parameters.
[0238] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters includes adjusting the initial tone mapping parameters of the image to be displayed in a first manner to obtain the tone mapping parameters when the relationship between the reference information and the terminal device information meets a first condition. When the relationship between the reference information and the terminal device information of the corresponding type meets a second condition, adjusting the initial tone mapping parameters of the image to be displayed in a second manner to obtain the tone mapping parameters. The initial tone mapping parameters are used to characterize an initial tone mapping curve, and the tone mapping parameters are used to characterize an adjusted tone mapping curve.
[0239] Optionally, the first condition includes at least one of: the size of the terminal display screen is smaller than the size of the reference display device, the user viewing distance is greater than the reference viewing distance, the user viewing angle deviates from the reference viewing angle, the ambient light brightness is greater than the reference ambient light brightness, or the terminal display device resolution is smaller than the reference display device resolution. It should be understood that when the relationship between the reference information and the terminal device information satisfies the first condition, the initial tone mapping parameters need to be adjusted so that the overall brightness of the image after tone mapping based on the adjusted tone mapping parameters is improved, and the clarity of details is improved, such as local contrast enhancement, edge sharpness improvement, more high-frequency component retention, or pixel gradient improvement, so that the user perception is more consistent and the user experience is improved.
[0240] When the relationship between the reference information and the terminal device information satisfies the first condition, there are three ways to adjust the initial tone mapping parameters of the image to be displayed in the first manner: manner 1, manner 2, and manner 3. This application may select one or more of manner 1, manner 2, and manner 3 for execution, and this application does not limit it. When executing multiple manners, this application does not limit the execution order of different manners. The specific adjustment methods include:
[0241] Method 1: Adjust the initial tone mapping parameters so that the mapping value of the adjusted tone mapping curve at the one or more first brightness characteristic values is greater than the mapping value of the initial tone mapping curve at the one or more first brightness characteristic values.
[0242] In an embodiment of the present application, it is first necessary to obtain one or more first brightness characteristic values of the image to be displayed. Optionally, the one or more first brightness characteristic values may be the average value of the brightness of the entire frame of the image to be displayed, the average value of the brightness of one or more regions of interest of the image to be displayed, the weighted average value of the brightness of multiple regions of the image to be displayed, or the average value of one or more brightness ranges after the brightness histogram of the image to be displayed is divided into multiple brightness ranges, which is not limited in the present application. Among them, one or more regions of interest of the image to be displayed may select feature regions of the image to be displayed, such as faces, green plants, red flags, regions with high complexity, regions with obvious noise, and non-flat regions. The present application does not limit the method for selecting feature regions. Optionally, the method for selecting the selected region may be obtained from metadata, may be obtained based on preset rules, or may be directly obtained based on the features of the image to be displayed. Optionally, the average value may be calculated as an arithmetic mean or a geometric mean, etc., which is not limited in the present application.
[0243] Exemplarily, the average value of the brightness of the entire frame of the image to be displayed may be selected as the first brightness characteristic value, and the calculation formula is as follows:
[0244]
[0245] Where L avg is the average brightness of the entire frame of the image to be displayed, L n,m is any brightness value in the entire frame brightness of the image to be displayed, width and height are the width and height of the image to be displayed, and n and m are the pixel indexes in the width direction and height direction of the image to be displayed respectively. n,m It can be R, G, B in the RGB color domain, or the maximum value max(R,G,B) among R, G, B, or the brightness Y in the YUV color domain, or the brightness component L in the Lab color domain. L and L' can be normalized optical signals or electrical signals, which is not limited in the present invention.
[0246] Then, the initial tone mapping parameters are adjusted so that a mapping value of the adjusted tone mapping curve at the one or more first brightness characteristic values is greater than a mapping value of the initial tone mapping curve at the one or more first brightness characteristic values.
[0247] In a possible embodiment, the process of adjusting the initial tone mapping parameters is: first obtain the mapping value of the initial tone mapping curve at the one or more brightness characteristic values. Exemplarily, when the initial tone mapping curve is LY=h(L), L can be R, G, B in the RGB color domain, or the maximum value max(R,G,B) of R, G, B, or the brightness Y in the YUV color domain, or the brightness component L in the Lab color domain. L and L' can be normalized light signals or electrical signals, which is not limited by the present invention. LY is the mapping value of L after being mapped by the tone mapping curve, and the curve is the average value L of the brightness of the entire frame of the image to be displayed. avg The mapping value at is LY avg =h(L avg ). Optionally, one or more parameters may be directly adjusted to increase the mapping value of the adjusted tone mapping curve at one or more first brightness characteristic values.
[0248] Optionally, based on the reference information and the terminal display device information, a new mapping value at one or more first brightness characteristic values can be obtained according to a preset algorithm; and the adjusted tone mapping parameter can be obtained according to the obtained one or more new mapping values. Optionally, the preset algorithm can be a preset priori function, and the gain coefficient P corresponding to the reference information and the terminal display device information can be obtained according to the preset priori function, then the new mapping value LYN avg =P*LY avg Optionally, the preset a priori function may be in the form of a preset lookup table of reference information, terminal display device information, and gain coefficient P.
[0249] Optionally, an equation or a group of equations for tone mapping parameters may be established according to one or more new mapping values to obtain one or more parameters of the adjusted tone mapping curve, thereby obtaining all parameters of the adjusted tone mapping curve in combination with other preset parameters. Optionally, the equation or group of equations for establishing the tone mapping curve according to one or more new mapping values may be based on a tone mapping curve function. For example, when the initial tone mapping curve function is LY=h(L), the equation is LYN avg =h(L avg ); It can also be based on the inverse tone mapping curve function, for example, when the inverse initial tone mapping curve function is L = h -1 (LY), the equation is L avg =h -1 (LYN avg ). Optionally, one or more parameters may be directly adjusted so that the mapping value of the adjusted tone mapping curve at one or more first brightness characteristic values is the one or more new mapping values.
[0250] For example, the tone mapping curve adjusted by method 1 and the initial tone mapping curve are shown in Figure 6 , Figure 6 An example diagram of an initial tone mapping parameter adjustment method provided in an embodiment of the present application. The initial tone mapping curve represented by the initial tone mapping curve parameters is curve 601, the average brightness 6 of the entire image is selected as the first brightness characteristic value, and after updating the parameters, the adjusted tone mapping curve is 602, and the mapping value of the adjusted tone mapping curve 602 at the first brightness characteristic value 6 is greater than the mapping value of the initial tone mapping curve 601 at the first brightness characteristic value 6. And the overall mapping value of the adjusted tone mapping curve 602 is greater than the overall mapping value of the initial tone mapping curve 601. Therefore, based on the adjusted tone mapping parameters, the overall brightness of the image after tone mapping becomes larger, which can make the terminal display screen size smaller than the reference display device size, or the user viewing distance greater than the reference viewing distance, or the user viewing angle deviate from the reference viewing angle, or the ambient light brightness is greater than the reference ambient light brightness, or the resolution of the terminal display device is smaller than the resolution of the reference display device, and the user's perception is more consistent, and the display adaptation effect is better.
[0251] Mode 2 adjusts the initial tone mapping parameters so that the slope of the adjusted tone mapping curve at the one or more second brightness characteristic values is greater than the slope of the initial tone mapping curve at the one or more second brightness characteristic values.
[0252] In the embodiment of the present application, it is first necessary to obtain one or more second brightness characteristic values of the image to be displayed. The method for selecting the one or more second brightness characteristic values is similar to the one or more first brightness characteristic values in method 1, and is not described in detail here. Optionally, the one or more second brightness characteristic values may be partially or completely the same as the one or more first brightness characteristic values, or may be completely different.
[0253] Then, the parameters of the initial tone mapping curve are adjusted so that the slope of the adjusted tone mapping curve at one or more second brightness characteristic values is greater than the slope of the initial tone mapping curve at the one or more second brightness characteristic values. Optionally, one or more parameters may be directly adjusted so that the slope of the adjusted tone mapping curve at one or more second brightness characteristic values becomes larger.
[0254] Exemplarily, firstly, according to the initial tone mapping curve function LY=h(L), its first-order derivative d(LY) / dL=h'(L) is obtained, and the curve parameter is P curve , the second brightness eigenvalue L avg The corresponding slope value is LY` avg =h`(L avg), then, based on the reference information and the terminal display device information, a second brightness characteristic value L is obtained according to a preset algorithm. avg The new curve parameter is P1 curve The new curve parameter P1 curve So that h`(P1 curve , L avg )>h`(P curve , L avg ). Among them, the preset algorithm can be LY` avg =h`(L avg ) is a variable, and the change of the curve parameters and LY` avg and select the appropriate curve parameter as the adjustment parameter P curve .
[0255] Exemplarily, when the initial tone mapping curve is the following function curve:
[0256]
[0257] Wherein, L is brightness, L' is the mapping value after mapping by the tone mapping curve, a, p, m, n, b are parameters of the tone mapping curve, L can be R, G, B in the RGB color domain, or the maximum value max(R, G, B) among R, G, B, or the brightness Y in the YUV color domain, or the brightness component L in the Lab color domain. L and L' can be normalized optical signals or electrical signals, which are not limited in the present invention.
[0258] Based on the current values of the curve parameters p and a, the slope value may be increased by reducing p and increasing a to obtain the adjusted tone mapping parameters.
[0259] Optionally, based on the reference information and the terminal display device information, a new slope at one or more first brightness characteristic values can be obtained according to a preset algorithm; an equation or a set of equations for tone mapping curve parameters is established according to the one or more new slopes, and one or more parameters of the adjusted tone mapping curve are obtained by solving the equations, thereby obtaining all parameters of the adjusted tone mapping curve in combination with other preset parameters. Optionally, the preset algorithm can be a preset a priori function, and the gain coefficient Q corresponding to the reference information and the terminal display device information can be obtained according to the preset a priori function. Then the new slope LYN` avg =Q*LY` avg Optionally, the preset a priori function may be in the form of a preset lookup table of reference information and terminal display device information and gain coefficient Q. For example, when the function of the initial tone mapping curve is LY=h(L), its first-order derivative is d(LY) / dL=h`(L), and the equation is LYN` avg =h`(L avg); an equation or a set of equations may also be obtained based on an inverse function of the first-order derivative of the tone mapping curve function, which is not limited here. Optionally, one or more parameters may also be directly adjusted so that the slope of the adjusted tone mapping curve at one or more first brightness feature values is the one or more new slopes.
[0260] For example, the tone mapping curve adjusted by method 2 and the initial tone mapping curve are shown in Figure 7 , Figure 7 An example diagram of an initial tone mapping parameter adjustment method provided in an embodiment of the present application. The initial tone mapping curve is curve 701, and the average brightness 5 of the entire image is selected as the second brightness characteristic value. After updating the parameters, the adjusted tone mapping curve is 702, and the slope of the adjusted tone mapping curve 702 at the second brightness characteristic value 5 is greater than the slope of the initial tone mapping curve 701 at the second brightness characteristic value 5. And the multiple-segment slopes of the adjusted tone mapping curve 702 are greater than the overall slope of the initial tone mapping curve 701. Based on the adjusted tone mapping parameters, the overall contrast of the image after tone mapping is increased, the pixel gradient is improved, and the clarity of the details is improved, so that the terminal display screen size is smaller than the reference display device size, or the user viewing distance is greater than the reference viewing distance, or the user viewing angle deviates from the reference viewing angle, or the ambient light brightness is greater than the reference ambient light brightness, or the resolution of the terminal display device is less than the resolution of the reference display device. When the user's perception is more consistent, the display adaptation effect is better, and the display effect of complex images is especially improved.
[0261] Method 3, obtaining a base layer and one or more enhancement layers of the image to be displayed; a first eigenvalue of any one of the one or more enhancement layers is mapped to a second eigenvalue by the initial tone mapping curve of any enhancement layer; adjusting the initial tone mapping curve of any enhancement layer so that the absolute value of the first eigenvalue mapped by the adjusted tone mapping curve is greater than the absolute value of the second eigenvalue.
[0262] In this embodiment, the first eigenvalue and the second eigenvalue can be positive or negative. When comparing the value of the first eigenvalue mapped by the adjusted tone mapping curve with the second eigenvalue, the absolute values of the two values are compared.
[0263] In an embodiment of the present application, the base layer and one or more enhancement layers of the image to be displayed are first obtained. Optionally, the enhancement layer includes at least one of an edge layer or a texture layer. Optionally, it can be a base layer and one or more enhancement layers obtained by filtering with a filter, or it can be a base layer and one or more enhancement layers obtained by combining image segmentation and filtering. Optionally, the filter can be a bilateral filter, a multilateral filter, etc., which is not limited in the present application. Among them, any value of any enhancement layer in the one or more enhancement layers is a first eigenvalue; the value of the first eigenvalue after being mapped by the initial tone mapping curve of any enhancement layer is a second eigenvalue.
[0264] Then, the initial tone mapping parameter of any enhancement layer is adjusted so that the absolute value of the value of the first eigenvalue mapped by the adjusted tone mapping curve is greater than the absolute value of the second eigenvalue. Optionally, the value mapped by the adjusted tone mapping curve may be expanded to N times the second eigenvalue, where N is an integer, fraction or decimal greater than 1, which is not limited in this application.
[0265] Exemplarily, the image is filtered using filters in the spatial domain, temporal domain, or a combination of spatial and temporal filters to extract data at different layers.
[0266] Any luminance value L1[m] in the base layer L1 can be:
[0267]
[0268] Where L is the brightness value of the original image, filter[n] is the filter coefficient at any position of the filter, and filterL is the length of the filter.
[0269] Any luminance value L2[m] (first eigenvalue) in the enhancement layer L2 can be:
[0270] L2[m]=L[m]–L1[m]
[0271] Among them, L is the brightness value of the original image, and L can be R, G, B in the RGB color domain, or the maximum value max(R,G,B) among R, G, B, or the brightness Y in the YUV color domain, or the brightness component L in the Lab color domain.
[0272] Then, according to the preset information or the tone mapping parameter information transmitted by the metadata, the tone mapping curves used by the multiple layers are obtained and the tone mapping is performed on each layer.
[0273] For example, if the tone mapping curve obtained for the base layer is g(), then any mapping value in the base layer L1 after mapping is L1`[m],
[0274] L1`[m]=g(L1[m])
[0275] Before adjustment, for the tone mapping curve f() obtained for the enhancement layer, any mapping value L2`[m] (second eigenvalue) in the enhancement layer L2 after mapping:
[0276] L2`[m]=f(L2[m])
[0277] If the mapping value is expanded N times, L2`[m] is expanded N times to L2``[m], where N is an integer or fraction greater than 1:
[0278] L2``[m]=N*L2`[m] The base layer mapping value L1`[m] after tone mapping is mixed with the enhancement layer L2``[m] after tone mapping using the preset gain coefficient gain[n] or the gain coefficient sent in the metadata to obtain the final image mapping value L`[m]:
[0279] L`[m]=gain[1]*L1`[m]+gain[2]*L2``[m]=gain[1]*L1`[m]+gain[1]*N*L2`[m]
[0280] The mapping value of the enhancement layer in the final image mapping value is N times larger than that before adjustment, and the brightness of the enhancement layer in the image is increased, thereby enhancing the local contrast and detail clarity of the image, thereby improving the user viewing experience.
[0281] Optional, where L is R, G, B in the RGB color space, L1` corresponds to RP[0], GP[0], BP[0], and L2`` corresponds to RP[1], GP[1], BP[1].
[0282] Finally, the multiple layers RP[n], GP[n], BP[n] are combined using the preset gain coefficient gain[n] or the gain coefficient gain[n] sent by the metadata to obtain the final mapping values Rtm, Gtm, Btm, where n represents the index of the multiple layers.
[0283] Rtm=∑RP[n]*gain[n]
[0284] Gtm=∑GP[n]*gain[n]
[0285] Btm=∑BP[n]*gain[n]
[0286] For example, the tone mapping curve adjusted by the enhancement layer in mode 3 and the initial tone mapping curve are shown in Figure 8 , Figure 8An example diagram of an adjustment method for the initial tone mapping parameters of an enhancement layer provided in an embodiment of the present application. The tone mapping curve of the base layer is 801, the initial tone mapping curve of the enhancement layer is curve 802, and the adjustment parameters are used to double the mapping value of curve 802, and the adjusted tone mapping curve of the enhancement layer is 803, and the overall mapping value of curve 803 is doubled compared with curve 802. Therefore, based on the adjusted tone mapping parameters of the enhancement layer, tone mapping is performed, and the image after mixing with the base layer retains more high-frequency components, the features of the enhancement layer are more obvious, and the local contrast becomes larger, thereby improving the clarity of details. For example, when the enhancement layer is an edge layer, the edge sharpness is improved; when the enhancement layer is a texture layer, the texture details are clearer. Therefore, when the size of the terminal display screen is smaller than the size of the reference display device, or the user viewing distance is greater than the reference viewing distance, or the user viewing angle deviates from the reference viewing angle, or the ambient light brightness is greater than the reference ambient light brightness, or the resolution of the terminal display device is smaller than the resolution of the reference display device, the user's perception is more consistent, the display adaptation effect is better, and the display effect of complex images is especially improved.
[0287] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters includes adjusting the initial tone mapping parameters of the image to be displayed in a second manner to obtain the tone mapping parameters when the relationship between the reference information and the terminal device information satisfies a second condition. The initial tone mapping parameters are used to characterize an initial tone mapping curve, and the tone mapping parameters are used to characterize an adjusted tone mapping curve.
[0288] Optionally, the second condition includes at least one of: the size of the terminal display screen is larger than the size of the reference display device, the user viewing distance is smaller than the reference viewing distance, the ambient light brightness is smaller than the reference ambient light brightness, or the resolution of the terminal display device is larger than the resolution of the reference display device. It should be understood that when the relationship between the reference information and the terminal device information satisfies the second condition, it is necessary to adjust the initial tone mapping curve parameters so that the average brightness of the image after tone mapping based on the adjusted tone mapping curve parameters is reduced, or the dark part is further darkened, so that the user perception is more consistent and the user experience is improved.
[0289] When the relationship between the reference information and the corresponding type of the terminal device information satisfies the second condition, there are three ways to adjust the initial tone mapping parameters of the image to be displayed in the second manner: manner 4, manner 5, and manner 6. The application may select one or more of manners 4, 5, and 6 for execution, and this application does not limit this. When executing multiple manners, this application does not limit the execution order of different manners. The specific adjustment methods include:
[0290] Mode 4: Adjust the initial tone mapping parameters so that the mapping value of the adjusted tone mapping curve at the one or more third brightness characteristic values is greater than the mapping value of the initial tone mapping curve at the one or more third brightness characteristic values.
[0291] In the embodiment of the present application, it is first necessary to obtain one or more third brightness characteristic values of the image to be displayed. The method for selecting the one or more third brightness characteristic values is similar to the one or more first brightness characteristic values in method 1, and will not be described in detail here.
[0292] Then, the parameters of the initial tone mapping curve are adjusted so that the mapping value of the adjusted tone mapping curve at the one or more third brightness characteristic values is greater than the mapping value of the initial tone mapping curve at the one or more third brightness characteristic values.
[0293] In a possible embodiment, the process of adjusting the initial tone mapping parameters is: first, obtaining the mapping value of the initial tone mapping curve at the one or more brightness characteristic values. Exemplarily, when the initial tone mapping curve function is LY=h(L), the curve has an average value L of the brightness of the entire frame of the image to be displayed. avg The mapping value at is LY avg =h(L avg ). Optionally, one or more parameters may be directly adjusted to reduce the mapping value of the adjusted tone mapping curve at one or more third brightness characteristic values.
[0294] Optionally, based on the reference information and the terminal display device information, a new mapping value at one or more first brightness characteristic values can be obtained according to a preset algorithm; and the parameters of the adjusted tone mapping curve can be obtained according to the obtained one or more new mapping values. Optionally, the preset algorithm can be a preset priori function, and the attenuation coefficient U corresponding to the reference information and the terminal display device information can be obtained according to the preset priori function, then the new mapping value LYN avg =U*LY avg Optionally, the preset a priori function may be in the form of a preset lookup table of reference information, terminal display device information, and attenuation coefficient U.
[0295] Optionally, an equation or set of equations for tone mapping curve parameters may be established according to one or more new mapping values to obtain one or more parameters of the adjusted tone mapping curve, thereby obtaining all parameters of the adjusted tone mapping curve in combination with other preset parameters. Optionally, the equation or set of equations for tone mapping curve parameters established according to one or more new mapping values may be based on the tone mapping curve. For example, when the initial tone mapping curve function is LY=h(L), the equation is LYN avg =h(Lavg ); It can also be based on the inverse tone mapping curve function, for example, when the inverse initial tone mapping curve function is L = h -1 (LY), the equation is L avg =h -1 (LYN avg ). Optionally, one or more parameters may be directly adjusted so that the mapping value of the adjusted tone mapping curve at one or more first brightness characteristic values is the one or more new mapping values.
[0296] Optionally, the one or more third brightness characteristic values include: one or more brightness characteristic values of the dark part of the image to be displayed, or one or more brightness characteristic values of the entire image to be displayed. The dark part may be a brightness range of 5 nit or less below the lowest brightness that can be distinguished by the human eye, or may be a relatively dark part of an image obtained based on image segmentation or brightness histogram segmentation, which is not limited in this application.
[0297] For example, when the third brightness characteristic value is the average brightness of the dark part of the image, the tone mapping curve adjusted by method 4 and the initial tone mapping curve refer to Fig. 9 , Fig. 9 An example diagram of an initial tone mapping parameter adjustment method provided in an embodiment of the present application. The initial tone mapping curve represented by the initial tone mapping parameters is curve 901, and the average brightness of the dark part of the image is selected as the third brightness characteristic value of 4.5. After updating the parameters, the adjusted tone mapping curve is 902, and the mapping value of the adjusted tone mapping curve 902 at the third brightness characteristic value of 4.5 is less than the mapping value of the initial tone mapping curve 901 at the third brightness characteristic value of 4.5. And the overall mapping value of the dark part of the adjusted tone mapping curve 902 is less than the overall mapping value of the initial tone mapping curve 901. Therefore, the dark part of the image after tone mapping based on the adjusted tone mapping parameters is darker. Since the human eye is more sensitive to the dark part, when the size of the terminal display screen is larger than the size of the reference display device, or the user viewing distance is smaller than the reference viewing distance, or the ambient light brightness is smaller than the reference ambient light brightness, or the resolution of the terminal display device is larger than the resolution of the reference display device, the human eye may see the noise in the dark part. Therefore, further suppressing the dark part can adapt to the changing application scenarios, make the user's visual perception more consistent, and improve the display adaptation effect and display effect of the image.
[0298] For example, when the third brightness characteristic value is the average brightness value of the entire image, the tone mapping curve adjusted by method 4 and the initial tone mapping curve refer to Fig.10 , Fig.10An example diagram of an initial tone mapping parameter adjustment method provided in an embodiment of the present application. The initial tone mapping curve is curve 1001, and the average brightness 6 of the entire image is selected as the third brightness characteristic value. After updating the parameters, the adjusted tone mapping curve is 1002, and the mapping value of the adjusted tone mapping curve 1002 at the average brightness 6 is less than the mapping value of the initial tone mapping curve 1001 at the average brightness 6. And the overall mapping value of the adjusted tone mapping curve 1002 is less than the overall mapping value of the initial tone mapping curve 1001. Therefore, based on the adjusted tone mapping parameters, the overall brightness of the image after tone mapping becomes smaller, which can make the user's visual perception more consistent when the terminal display screen size is larger than the reference display device size, or the user's viewing distance is smaller than the reference viewing distance, or the ambient light brightness is smaller than the reference ambient light brightness, or the resolution of the terminal display device is larger than the resolution of the reference display device. The display adaptation effect is better, and the user's eyes can be protected to a certain extent.
[0299] Mode 5, adjusting the initial tone mapping parameters so that the slope of the adjusted tone mapping curve at the one or more fourth brightness characteristic values is smaller than the slope of the initial tone mapping curve at the one or more fourth brightness characteristic values.
[0300] In the embodiment of the present application, it is first necessary to obtain one or more fourth brightness characteristic values of the image to be displayed. The method for selecting the one or more fourth brightness characteristic values is similar to the one or more first brightness characteristic values in step 1, and is not described in detail here. Optionally, the one or more fourth brightness characteristic values may be partially or completely the same as the one or more third brightness characteristic values, or may be completely different.
[0301] Then, the parameters of the initial tone mapping curve are adjusted so that the slope of the adjusted tone mapping curve at one or more fourth brightness characteristic values is smaller than the slope of the initial tone mapping curve at the one or more fourth brightness characteristic values. Optionally, one or more parameters may be directly adjusted so that the slope of the adjusted tone mapping curve at one or more fourth brightness characteristic values becomes smaller.
[0302] Exemplarily, firstly, according to the initial tone mapping curve function LY=h(L), its first-order derivative d(LY) / dL=h'(L) is obtained, and the curve parameter is P curve , the second brightness eigenvalue L avg The corresponding slope value is LY` avg =h`(L avg ), then, based on the reference information and the terminal display device information, a second brightness characteristic value L is obtained according to a preset algorithm. avg The new curve parameter is Q1 curve The new curve parameter P1 curveSo that h`(P1 curve , L avg ) <h`(P curve , L avg ). Among them, the preset algorithm can be LY` avg =h`(L avg ) is a variable, and the change of the curve parameters and LY` avg and select the appropriate curve parameter as the adjustment parameter P curve .
[0303] Exemplarily, when the initial tone mapping curve is the following function curve:
[0304]
[0305] Where L is the brightness, L' is the mapping value after the tone mapping curve, and a, p, m, n, b are the parameters of the tone mapping curve. Where L can be R, G, B in the RGB color space, or the maximum value max(R, G, B) among R, G, B, or the brightness Y in the YUV color space, or the brightness component L in the Lab color space.
[0306] Based on the current values of the curve parameters p and a, the slope value may be reduced by reducing a and increasing p to obtain the adjusted tone mapping curve parameters.
[0307] Optionally, based on the reference information and the terminal display device information, a new slope at one or more first brightness characteristic values can be obtained according to a preset algorithm; an equation or a set of equations for tone mapping curve parameters is established according to the one or more new slopes, and one or more parameters of the adjusted tone mapping curve are obtained by solving the equations, thereby obtaining all parameters of the adjusted tone mapping curve in combination with other preset parameters. Optionally, the preset algorithm can be a preset priori function, and the attenuation coefficient V corresponding to the reference information and the terminal display device information can be obtained according to the preset priori function. Then the new slope LYN` avg =V*LY` avg Optionally, the preset a priori function may be in the form of a preset lookup table of reference information and terminal display device information and attenuation coefficient V. For example, when the initial tone mapping curve function is LY=h(L), its first-order derivative is d(LY) / dL=h`(L), and the equation is LYN`avg=h`(L avg ); an equation or a set of equations may also be obtained based on an inverse function of the first-order derivative of the tone mapping curve function, which is not limited here. Optionally, one or more parameters may also be directly adjusted so that the slope of the adjusted tone mapping curve at one or more first brightness feature values is the one or more new slopes.
[0308] In the embodiment of the present application, the overall contrast of the image after tone mapping based on the adjusted tone mapping curve parameters becomes smaller and the pixel gradient is improved, thereby reducing the clarity of details. This can prevent the terminal display screen size from being larger than the reference display device size, or the user viewing distance from being smaller than the reference viewing distance, or the ambient light brightness from being smaller than the reference ambient light brightness, or the resolution of the terminal display device from being larger than the reference display device resolution, thereby preventing the image from being displayed poorly due to excessive contrast. This improves the display adaptation effect and the display effect of complex images.
[0309] Method 6, obtaining a base layer and one or more enhancement layers of the image to be displayed; the value of a third eigenvalue of any one of the one or more enhancement layers after being mapped by the initial tone mapping curve of any enhancement layer is a fourth eigenvalue; adjusting the initial tone mapping parameters of any enhancement layer so that the absolute value of the value of the third eigenvalue after being mapped by the adjusted tone mapping curve is less than the absolute value of the fourth eigenvalue.
[0310] In this embodiment, the third eigenvalue and the fourth eigenvalue can be positive or negative. When comparing the value of the third eigenvalue mapped by the adjusted tone mapping curve with the size of the fourth eigenvalue, the absolute values of the above two values are compared.
[0311] In an embodiment of the present application, the base layer and one or more enhancement layers of the image to be displayed are first obtained. Optionally, the enhancement layer includes at least one of an edge layer or a texture layer. Optionally, it can be a base layer and one or more enhancement layers obtained by filtering with a filter, or it can be a base layer and one or more enhancement layers obtained by combining image segmentation and filtering. Optionally, the filter can be a bilateral filter, a multilateral filter, etc., which is not limited in the present application. Among them, any value of any enhancement layer in the one or more enhancement layers is a third eigenvalue; the value of the third eigenvalue after being mapped by the initial tone mapping curve of any enhancement layer is a fourth eigenvalue.
[0312] Then, the initial tone mapping parameter of any enhancement layer is adjusted so that the absolute value of the value of the third eigenvalue mapped by the adjusted tone mapping curve is greater than the absolute value of the fourth eigenvalue.
[0313] The value mapped by the adjusted tone mapping curve may be reduced to M times the fourth eigenvalue, where M is a fraction or decimal greater than 0 and less than 1, and is not limited in this application.
[0314] Exemplarily, the image is filtered using filters in the spatial domain, temporal domain, or a combination of spatial and temporal filters to extract data at different layers.
[0315] Any luminance value L1[m] in the base layer L1 can be:
[0316]
[0317] Where L is the brightness value of the original image, filter[n] is the filter coefficient at any position of the filter, and filterL is the length of the filter.
[0318] Any luminance value L2[m] (third eigenvalue) in the enhancement layer L2 can be:
[0319] L2[m]=L[m]–L1[m]
[0320] Among them, L is the brightness value of the original image, which can be R, G, B in the RGB color domain, or the maximum value max(R,G,B) among R, G, B, or the brightness Y in the YUV color domain, or the brightness component L in the Lab color domain.
[0321] Then, according to the preset information or the tone mapping parameter information transmitted by the metadata, the tone mapping curves used by the multiple layers are obtained respectively; and the tone mapping is performed on each layer respectively.
[0322] For example, if the tone mapping curve obtained for the base layer is g(), then any mapping value in the base layer L1 after mapping is L1`[m],
[0323] L1`[m]=g(L1[m])
[0324] Before adjustment, the tone mapping curve obtained for the enhancement layer is f(), and after mapping, any mapping value L2`[m] (the fourth eigenvalue) in the enhancement layer L2 is:
[0325] L2`[m]=f(L2[m])
[0326] Reduce the mapped value by M times, then L2`[m] is reduced by M times to L2``[m], where M is an integer or fraction greater than 0 and less than 1:
[0327] L2``[m]=M*L2`[m]
[0328] The tone-mapped base layer mapping value L1`[m] is mixed with the tone-mapped enhancement layer L2``[m] using the preset gain coefficient gain[n] or the gain coefficient sent in the metadata to obtain the final image mapping value L`[m]:
[0329] L`[m]=gain[1]*L1`[m]+gain[2]*L2``[m]=gain[1]*L1`[m]+gain[1]*M*L2`[m]
[0330] The mapping value of the enhancement layer in the final image mapping value is M times smaller than that before adjustment, and the brightness of the enhancement layer in the image is reduced, thereby weakening the local contrast and detail clarity of the image, which can prevent the user from feeling visually uncomfortable due to excessive contrast.
[0331] Optional, where L is R, G, B in the RGB color space, L1` corresponds to RP[0], GP[0], BP[0], and L2`` corresponds to RP[1], GP[1], BP[1].
[0332] Finally, the multiple layers RP[n], GP[n], BP[n] are combined using the preset gain coefficient gain[n] or the gain coefficient gain[n] sent by the metadata to obtain the final mapping values Rtm, Gtm, Btm, where n represents the index of the multiple layers.
[0333] Rtm=∑RP[n]*gain[n]
[0334] Gtm=∑GP[n]*gain[n]
[0335] Btm=∑BP[n]*gain[n]
[0336] In an embodiment of the present application, based on the tone mapping curve parameters adjusted by the enhancement layer, the enhancement layer is tone mapped, and the image after being mixed with the base layer, the mapping value of the enhancement layer is reduced, the characteristics of the enhancement layer are weakened, the high-frequency components are retained less, the local contrast becomes smaller, and the clarity of the details is weakened. For example, when the enhancement layer is an edge layer, the edge sharpness is weakened; when the enhancement layer is a texture layer, the texture details are weakened. Therefore, it is possible to prevent the terminal display screen size from being smaller than the reference display device size, or the user viewing distance is greater than the reference viewing distance, or the user viewing angle deviates from the reference viewing angle, or the ambient light brightness is greater than the reference ambient light brightness, or the resolution of the terminal display device is less than the resolution of the reference display device, so that the image display effect is too strong and the user is uncomfortable, so that the display adaptation effect is better, especially the display effect of complex images is improved, and the user viewing experience is improved.
[0337] In a possible embodiment, tone mapping is performed on the image to be displayed based on the parameters of the adjusted tone mapping curve, that is, the tone mapping parameters.
[0338] In an embodiment of the present application, tone mapping is performed on the image to be displayed based on the above-adjusted tone mapping parameters. The present application does not limit the method and curve used in the tone mapping process. Optionally, the method used in the tone mapping process may be global tone mapping or local tone mapping, which is not limited in the present application.
[0339] Exemplarily, a reference tone mapping is implemented as:
[0340] First, according to the adjusted tone mapping parameters, the tone mapping coefficient lookup table lut is obtained, and the lookup table lut is used to obtain the tone mapping coefficient Ratio;
[0341] Then, for each pixel (R, G, B), the luminance value lum is obtained, and the tone mapping coefficient Ratio corresponding to the luminance value lum is obtained from the lookup table lut. Ratio = lut[lum].
[0342] It should be noted that this application does not limit lum, and other brightness such as R, G, B in the RGB color domain, or the brightness component L in the Lab color domain, or I in the ICtCp format, or brightness Y in the YUV color domain can be used for calculation.
[0343] Among them, when using R, G, and B in the RGB color domain to calculate lum, this application does not limit the calculation method for obtaining the brightness value lum of each pixel (R, G, B), for example, Lum = max (R, G, B), or Lum = a*R+b*G+c*B, where a, b, c are weighting coefficients
[0344] Finally, each pixel (R, G, B) is multiplied by the tone mapping coefficient Ratio for tone mapping. The pixel after tone mapping is (R TM ,G TM ,B TM ):
[0345] R TM =R*Ratio,G TM =G*Ratio,B TM =B*Ratio.
[0346] Or [YUV]=M*[RGB], YTM=Y*Ratio, [RGB]=M-1*[YUV], where M is selected according to standard BT.2020 or standard BT709.
[0347] Optionally, when tone mapping is performed on the image to be displayed according to the reference information and the terminal device information of the corresponding type, the reference information and the terminal device information of the corresponding type can be input into an AI neural network, and the AI neural network outputs the image after tone mapping of the image to be displayed.
[0348] Optionally, the saturation of each pixel (R, G, B) in the image obtained after tone mapping can be adjusted. It should be understood that the metadata may include attribute information of the color of at least one frame of image (for example, the intensity of color saturation adjustment). The color information of at least one frame of image after mapping can be corrected according to the attribute information of the color and the brightness information of each pixel in the image to be displayed before and after tone mapping.
[0349] Exemplarily, taking pixel A in the image to be displayed as an example, the ratio between the first brightness value of pixel A after tone mapping and the second brightness value of pixel A before tone mapping can be determined, and a saturation adjustment factor is determined by combining the ratio and the maximum display capability of the terminal display device, the maximum display capability of the reference display device in the front-end device (for example, a video production device), the attribute information of the color of at least one frame of the image, and the second brightness value of pixel A before tone mapping; based on the saturation adjustment factor, the color information of pixel A is adjusted. Among them, the maximum display capability can be understood as the maximum display brightness value.
[0350] It should be understood that the color information may be a YUV signal or a color signal of other color domains, which is not specifically limited in the present embodiment. The Y in "YUV" is used to represent the brightness information of the image, and UV is used to represent the color information of the image.
[0351] In a possible implementation, the color information is a YUV signal, and the color information correction can be achieved by multiplying the saturation adjustment factor by the UV component of each pixel in at least one frame of the image after tone mapping.
[0352] Exemplarily, the saturation adjustment process may be:
[0353] According to the brightness value lum of each pixel and the tone mapping coefficient Ratio, the color adjustment ratioc is obtained. Ratioc can be ratioc=(ratio) N wait;
[0354] [YUV]=M*[RGB], UTM=U*ratioc, VTM=V*ratioc, where M is selected according to standard BT.2020 or standard BT.709.
[0355] It should be noted that the present invention does not limit the saturation adjustment algorithm, also known as the color adjustment algorithm, and can be performed in different color domains, such as RGB, IctCp, HSV and Lab.
[0356] Optionally, color gamut mapping can be added after tone mapping or saturation adjustment, and the current color gamut is converted to the target color gamut. The current color gamut and the target color gamut include but are not limited to the color gamuts specified by standard BT.2020, standard BT.709, DCI-P3, and SRGB.
[0357] The following describes the image encoding process of the front-end device in conjunction with specific drawings.
[0358] See also Fig.11 , Fig.11 A flowchart of an image encoding method provided in an embodiment of the present application is provided. The method can be executed by a front-end device and specifically includes the following steps:
[0359] Step S1101: Write the image to be displayed into the code stream.
[0360] It should be understood that the image to be displayed may be one or more frames of images. When the image to be displayed is a plurality of continuous frames of images, the image to be displayed may be understood as a video. Optionally, the image to be displayed may be an HDR image or video, or an SDR image or video.
[0361] Step S1102, writing reference information of the image to be displayed into the bitstream; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution.
[0362] In the embodiment of the present application, the reference information is the same as the reference information in step S502, and will not be described in detail herein. The reference information is used to perform tone mapping on the image to be displayed.
[0363] An embodiment of the present application provides a code stream structure, which includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution.
[0364] Optionally, the method further comprises: writing reference tone mapping parameters of the image to be displayed into the bitstream; wherein the reference tone mapping parameters are used to obtain initial tone mapping parameters. The reference information is used by the decoding end to adjust the initial tone mapping parameters to obtain tone mapping parameters, and the tone mapping parameters are used to tone map the image to be displayed.
[0365] Optionally, writing the reference information of the image to be displayed into the code stream includes: writing the reference information into the code stream; or writing the index of the reference information into the code stream. The index of the reference information is the same as the index of the reference information in step S502, and will not be repeated here.
[0366] Optionally, the method further includes: writing one or more brightness characteristic values of the image to be displayed into the bitstream; wherein the one or more brightness characteristic values are used by the decoding end to adjust the initial tone mapping parameters to obtain the adjusted tone mapping parameters. The one or more brightness characteristic values are similar to the one or more first brightness characteristic values in method 1, and are not described in detail here.
[0367] The present application also provides a tone mapping device 1200, see Fig.12 , Fig.12 An example diagram of a tone mapping device provided in an embodiment of the present application. 1200 has the function of realizing the above Figure 3A The functions of the terminal display device, the functions or units or means can be implemented by software, or by hardware, or by hardware executing the corresponding software.
[0368] The receiving module 1201 is used to obtain an image to be displayed;
[0369] Also used to obtain reference information; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution;
[0370] Also used to obtain terminal device information; the terminal device information includes at least one of the terminal display device size, user viewing distance, user viewing angle, ambient light brightness, or terminal display device resolution;
[0371] The tone mapping module 1202 is used to perform tone mapping on the image to be displayed according to the reference information and the terminal device information of the corresponding type.
[0372] In an embodiment of the present application, in the tone mapping of the image to be displayed based on the reference information and the terminal device information of the corresponding type, the reference display device size corresponds to the terminal display device size, the reference viewing distance corresponds to the user viewing distance, the reference viewing angle corresponds to the user viewing angle, the reference ambient light brightness corresponds to the ambient light brightness, and the reference display device resolution corresponds to the terminal display device resolution.
[0373] In a possible embodiment, tone mapping is performed on the image to be displayed according to the reference information and the terminal device information of the corresponding type, including: obtaining tone mapping parameters according to the reference information and the terminal device information of the corresponding type; and tone mapping is performed on the image to be displayed based on the tone mapping parameters.
[0374] In a possible embodiment, obtaining tone mapping parameters according to the reference information and the terminal device information of the corresponding type includes: adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters.
[0375] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters includes: when the relationship between the reference information and the terminal device information satisfies a first condition, adjusting the initial tone mapping parameters of the image to be displayed in a first manner to obtain the adjusted tone mapping parameters. The initial tone mapping parameters are used to characterize an initial tone mapping curve, and the tone mapping parameters are used to characterize an adjusted tone mapping curve.
[0376] In a possible embodiment, the first condition includes: the terminal display screen size is smaller than the reference display device size, the user viewing distance is greater than the reference viewing distance, the user viewing angle deviates from the reference viewing angle, the ambient light brightness is greater than the reference ambient light brightness, or the terminal display device resolution is smaller than the reference display device resolution.
[0377] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a first manner includes: obtaining one or more first brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the mapping value of the adjusted tone mapping curve at the one or more first brightness characteristic values is greater than the mapping value of the initial tone mapping curve at the one or more first brightness characteristic values.
[0378] In a possible embodiment, adjusting the initial tone mapping curve of the image to be displayed in a first manner also includes: obtaining one or more second brightness characteristic values of the image to be displayed; adjusting the initial tone mapping curve so that the slope of the adjusted tone mapping curve obtained at the one or more second brightness characteristic values is greater than the slope of the initial tone mapping curve at the one or more second brightness characteristic values.
[0379] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a first manner also includes: acquiring a base layer and one or more enhancement layers of the image to be displayed; a first eigenvalue of any one of the one or more enhancement layers is mapped to a second eigenvalue by the initial tone mapping curve of the any enhancement layer; and adjusting the initial tone mapping parameters of any enhancement layer so that the absolute value of the first eigenvalue after being mapped by the adjusted tone mapping curve is greater than the absolute value of the second eigenvalue.
[0380] In this embodiment, the first eigenvalue and the second eigenvalue can be positive or negative. When comparing the value of the first eigenvalue mapped by the adjusted tone mapping curve with the second eigenvalue, the absolute values of the two values are compared.
[0381] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters includes: when the relationship between the reference information and the terminal device information satisfies the second condition, adjusting the initial tone mapping parameters of the image to be displayed in a second manner to obtain the tone mapping parameters. The initial tone mapping parameters are used to characterize an initial tone mapping curve, and the tone mapping parameters are used to characterize an adjusted tone mapping curve.
[0382] In a possible embodiment, the second condition includes: the terminal display screen size is larger than the reference display device size, the user viewing distance is smaller than the reference viewing distance, the ambient light brightness is smaller than the reference ambient light brightness, or the terminal display device resolution is larger than the reference display device resolution.
[0383] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a second manner includes: obtaining one or more third brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the mapping value of the adjusted tone mapping curve at the one or more third brightness characteristic values is smaller than the mapping value of the initial tone mapping curve at the one or more third brightness characteristic values.
[0384] In a possible embodiment, the one or more third brightness characteristic values include: one or more brightness characteristic values of a dark portion of the image to be displayed.
[0385] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a second manner also includes: obtaining one or more fourth brightness characteristic values of the image to be displayed; adjusting the initial tone mapping parameters so that the slope of the adjusted tone mapping curve obtained at the one or more fourth brightness characteristic values is smaller than the slope of the initial tone mapping curve at the one or more fourth brightness characteristic values.
[0386] In a possible embodiment, adjusting the initial tone mapping parameters of the image to be displayed in a second manner also includes: acquiring a base layer and one or more enhancement layers of the image to be displayed; the third eigenvalue of any one of the one or more enhancement layers is mapped to a fourth eigenvalue by the initial tone mapping curve of any enhancement layer; adjusting the initial tone mapping parameters of any enhancement layer so that the absolute value of the third eigenvalue after being mapped by the adjusted tone mapping curve is less than the absolute value of the fourth eigenvalue.
[0387] In this embodiment, the third eigenvalue and the fourth eigenvalue can be positive or negative. When comparing the value of the third eigenvalue mapped by the adjusted tone mapping curve with the size of the fourth eigenvalue, the absolute values of the above two values are compared.
[0388] In a possible embodiment, the tone mapping module is also used to: obtain a reference tone mapping of the image to be displayed; obtain the display capability of the terminal display device in the terminal device information; adjust the reference tone mapping parameters of the image to be displayed according to the reference tone mapping parameters and the display capability of the terminal display device to obtain the initial tone mapping parameters.
[0389] In a possible embodiment, obtaining the reference information includes: obtaining the reference information from the metadata of the image to be displayed; or obtaining an index of the reference information from the metadata, and selecting the reference information from a plurality of preset reference information according to the index; or using the preset reference information as the reference information.
[0390] In a possible embodiment, the acquiring of the terminal device information includes: acquiring the terminal device information through measurement; or selecting the terminal device information from a plurality of preset terminal device information according to a preset index; or using the preset terminal device information as the terminal device information.
[0391] It should be understood that the third aspect corresponds to the technical solution of the first aspect, so the beneficial effects achieved by each possible implementation method are similar and will not be repeated here.
[0392] It should be understood that all relevant contents of each step involved in the above tone mapping method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0393] The present application also provides an image encoding apparatus 1300, see Fig.13 , Fig.13 This is an example diagram of an image encoding device provided in an embodiment of the present application. The device 1300 has the Figure 3A The functions of the front-end device, for example, the functions or units or means can be implemented by software, or by hardware, or by hardware executing the corresponding software.
[0394] For example, see Fig.13 , the apparatus 1300 may include:
[0395] The encoding module 1301 is used to write the image to be displayed into the code stream; it is also used to write the reference information of the image to be displayed into the code stream; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution; the reference information is used to perform tone mapping on the image to be displayed.
[0396] The sending module 1302 is used to send the code stream.
[0397] In a possible embodiment, the encoding module is also used to: write reference tone mapping parameters of the image to be displayed into the bitstream; wherein the reference tone mapping parameters are used to obtain initial tone mapping parameters; the reference information is used by the decoding end to adjust the initial tone mapping parameters to obtain tone mapping parameters, and the tone mapping parameters are used to perform tone mapping on the image to be displayed.
[0398] In a possible embodiment, writing the reference information of the image to be displayed into the code stream includes: writing the reference information into the code stream; or writing the index of the reference information into the code stream.
[0399] In a possible embodiment, the encoding module is further used to: write one or more brightness characteristic values of the image to be displayed into the bit stream; wherein the one or more brightness characteristic values are used by the decoding end to adjust the initial tone mapping parameters to obtain the tone mapping parameters.
[0400] It should be understood that all relevant contents of each step involved in the above-mentioned embodiment of the image encoding method can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0401] The present application embodiment also provides an electronic device 1400, see Fig.14 , Fig.14 This is an example diagram of an electronic device provided in an embodiment of the present application, which is used to implement the tone mapping method in the embodiment shown in FIG4 .
[0402] like Fig.14 As shown, the electronic device 1400 may include a processor 1401 for executing a program or instruction stored in a memory 1402. When the program or instruction stored in the memory 1402 is executed, the processor is used to execute Figure 5 Tone mapping method in the illustrated embodiment.
[0403] Optionally, the electronic device 1400 may further include a communication interface 1403. Fig.14 The dashed lines indicate that the communication interface 1403 is optional for the electronic device 1400 .
[0404] Among them, the number of processors 1401, memories 1402 and communication interfaces 1403 does not constitute a limitation on the embodiments of the present application, and during specific implementation, they can be arbitrarily configured according to business requirements.
[0405] Optionally, the memory 1402 is located outside the electronic device 1400 .
[0406] Optionally, the electronic device 1400 includes the memory 1402, the memory 1402 is connected to the at least one processor 1401, and the memory 1402 stores instructions that can be executed by the at least one processor 1401. Fig.14 The dashed lines indicate that the memory 142 is optional for the electronic device 1400 .
[0407] The processor 1401 and the memory 1402 may be coupled via an interface circuit or may be integrated together, which is not limited here.
[0408] The specific connection medium between the processor 1401, the memory 1402 and the communication interface 1403 is not limited in the embodiment of the present application. Fig.14 The processor 1401, the memory 1402 and the communication interface 1403 are connected via a bus 1404. Fig.14 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0409] The present application also provides an electronic device 1500, see Fig.15 , Fig.15 An example diagram of an electronic device provided in an embodiment of the present application is used to implement Fig.11 The image encoding method in the illustrated embodiment.
[0410] like Fig.15 As shown, the electronic device 1500 may include a processor 1501 for executing a program or instruction stored in a memory 1502. When the program or instruction stored in the memory 1502 is executed, the processor 1501 is used to execute Fig.11 The image encoding method in the illustrated embodiment.
[0411] Optionally, the electronic device 1500 may further include a communication interface 1503. Fig.15 The dashed lines indicate that the communication interface 1503 is optional for the electronic device 1500 .
[0412] Among them, the number of processors 1501, memories 1502 and communication interfaces 1603 does not constitute a limitation on the embodiments of the present application, and during specific implementation, they can be arbitrarily configured according to business requirements.
[0413] Optionally, the memory 1502 is located outside the electronic device 1500 .
[0414] Optionally, the electronic device 1500 includes the memory 1502, the memory 1502 is connected to the at least one processor 1501, and the memory 1502 stores instructions that can be executed by the at least one processor 1501. Fig.15 The dashed lines indicate that the memory 1502 is optional for the electronic device 1600 .
[0415] The processor 1501 and the memory 1502 may be coupled via an interface circuit or may be integrated together, which is not limited here.
[0416] The specific connection medium between the processor 1501, the memory 1502 and the communication interface 1503 is not limited in the embodiment of the present application. Fig.15 In the embodiment, the processor 1501, the memory 1502 and the communication interface 1503 are connected via a bus 1504. Fig.15 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.15 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0417] It should be understood that the processor mentioned in the embodiments of the present application can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor implemented by reading software code stored in a memory.
[0418] Exemplarily, the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0419] It should be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct memory bus random access memory (DR RAM).
[0420] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.
[0421] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0422] The present application also provides a computer-readable storage medium, including a program or an instruction. When the program or the instruction is executed on a computer, the tone mapping method or the tone mapping method in the embodiment shown in FIG. Fig.12 In the illustrated embodiment, the image encoding method is performed.
[0423] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0424] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0425] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0426] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0427] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A tone mapping method, characterized in that: The method comprises: Get the image to be displayed; Acquire reference information; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution; Acquire terminal device information; the terminal device information includes at least one of the terminal display device size, user viewing distance, user viewing angle, ambient light brightness, or terminal display device resolution; According to the reference information and the terminal device information of the corresponding type, tone mapping is performed on the image to be displayed.
2. The method according to claim 1, characterized in that The performing tone mapping on the image to be displayed according to the reference information and the terminal device information of a corresponding type includes: Acquire tone mapping parameters according to the reference information and the terminal device information of the corresponding type; Based on the tone mapping parameters, tone mapping is performed on the image to be displayed.
3. The method according to claim 2, characterized in that Acquiring tone mapping parameters according to the reference information and the terminal device information of a corresponding type includes: According to the reference information and the terminal device information of the corresponding type, the initial tone mapping parameters of the image to be displayed are adjusted to obtain the tone mapping parameters.
4. The method according to claim 3, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters includes: When the relationship between the reference information and the terminal device information of the corresponding type satisfies a first condition, adjusting the initial tone mapping parameters of the image to be displayed in a first manner to obtain the tone mapping parameters; When the relationship between the reference information and the terminal device information of the corresponding type satisfies a second condition, adjusting the initial tone mapping parameters of the image to be displayed in a second manner to obtain the tone mapping parameters; The initial tone mapping parameters are used to characterize an initial tone mapping curve, and the tone mapping parameters are used to characterize an adjusted tone mapping curve.
5. The method according to claim 4, characterized in that The first condition includes: At least one of the following is true: the terminal display screen size is smaller than the reference display device size, the user viewing distance is greater than the reference viewing distance, the user viewing angle deviates from the reference viewing angle, the ambient light brightness is greater than the reference ambient light brightness, or the terminal display device resolution is smaller than the reference display device resolution.
6. The method according to claim 4 or 5, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a first manner comprises: Acquire one or more first brightness characteristic values of the image to be displayed; The initial tone mapping parameters are adjusted so that a mapping value of the obtained adjusted tone mapping curve at the one or more first brightness characteristic values is greater than a mapping value of the initial tone mapping curve at the one or more first brightness characteristic values.
7. The method according to any one of claims 4 to 6, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a first manner further includes: Acquire one or more second brightness characteristic values of the image to be displayed; The initial tone mapping parameters are adjusted so that the slope of the adjusted tone mapping curve obtained at the one or more second brightness characteristic values is greater than the slope of the initial tone mapping curve at the one or more second brightness characteristic values.
8. The method according to any one of claims 4 to 7, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a first manner further includes: Acquire a base layer and one or more enhancement layers of the image to be displayed; a value after a first characteristic value of any one of the one or more enhancement layers is mapped by the initial tone mapping curve of any one of the enhancement layers is a second characteristic value; The initial tone mapping parameter of any one of the enhancement layers is adjusted so that an absolute value of a value of the first eigenvalue mapped by the adjusted tone mapping curve is greater than an absolute value of the second eigenvalue.
9. The method according to claim 4, characterized in that The second condition includes: At least one of the following is true: the terminal display screen size is larger than the reference display device size, the user viewing distance is smaller than the reference viewing distance, the ambient light brightness is smaller than the reference ambient light brightness, or the terminal display device resolution is larger than the reference display device resolution.
10. The method according to claim 4 or 9, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a second manner comprises: Acquire one or more third brightness characteristic values of the image to be displayed; The initial tone mapping parameters are adjusted so that a mapping value of the obtained adjusted tone mapping curve at the one or more third brightness characteristic values is smaller than a mapping value of the initial tone mapping curve at the one or more third brightness characteristic values.
11. The method according to claim 4, 9 or 10, characterized in that: The one or more third brightness characteristic values include: One or more brightness characteristic values of the dark portion of the image to be displayed.
12. The method according to any one of claims 4 or 9 to 11, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a second manner further includes: Acquire one or more fourth brightness characteristic values of the image to be displayed; The initial tone mapping parameters are adjusted so that a slope of the obtained adjusted tone mapping curve at the one or more fourth brightness characteristic values is smaller than a slope of the initial tone mapping curve at the one or more fourth brightness characteristic values.
13. The method according to any one of claims 4 or 9 to 12, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a second manner further includes: Acquire a base layer and one or more enhancement layers of the image to be displayed; a value after a third eigenvalue of any one of the one or more enhancement layers is mapped by the initial tone mapping curve of any one of the enhancement layers is a fourth eigenvalue; The initial tone mapping parameter of any one of the enhancement layers is adjusted so that an absolute value of a value of the third eigenvalue mapped by the adjusted tone mapping curve is smaller than an absolute value of the fourth eigenvalue.
14. The method according to claim 3, characterized in that The method further comprises: Acquire reference tone mapping parameters of the image to be displayed; Obtaining the display capability of the terminal display device in the terminal device information; According to the reference tone mapping parameters and the display capability of the terminal display device, the reference tone mapping parameters of the image to be displayed are adjusted to obtain the initial tone mapping parameters.
15. The method according to any one of claims 1 to 14, characterized in that The obtaining of reference information comprises: Acquiring the reference information from metadata of the image to be displayed; or obtaining an index of the reference information from the metadata, and selecting the reference information from a plurality of preset reference information according to the index; Or the preset reference information is used as the reference information.
16. The method according to any one of claims 1 to 15, characterized in that The obtaining of terminal device information includes: Acquiring the terminal device information by measuring; or selecting the terminal device information from a plurality of preset terminal information according to a preset index; Or the preset terminal device information is used as the terminal device information.
17. An image encoding method, characterized in that: The method comprises: Write the image to be displayed into the code stream; Writing reference information of the image to be displayed into the bitstream; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution; The reference information is used to perform tone mapping on the image to be displayed.
18. The method according to claim 17, characterized in that The method further comprises: The reference tone mapping parameters of the image to be displayed are written into the bitstream; wherein the reference tone mapping parameters are used to obtain initial tone mapping parameters; the reference information is used by the decoding end to adjust the initial tone mapping parameters to obtain tone mapping parameters, and the tone mapping parameters are used to tone map the image to be displayed.
19. The method according to claim 17 or 18, characterized in that Writing the reference information of the image to be displayed into the code stream includes: Writing the reference information into the bitstream; Or write the index of the reference information into the bitstream.
20. The method according to any one of claims 17 to 19, characterized in that The method further comprises: Writing one or more brightness characteristic values of the image to be displayed into the code stream; The one or more brightness characteristic values are used by the decoding end to adjust the initial tone mapping parameters to obtain the tone mapping parameters.
21. A tone mapping device, characterized in that: The device comprises: A receiving module, used for acquiring an image to be displayed; Also used to obtain reference information; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution; Also used to obtain terminal device information; the terminal device information includes at least one of the terminal display device size, user viewing distance, user viewing angle, ambient light brightness, or terminal display device resolution; A tone mapping module is used to perform tone mapping on the image to be displayed according to the reference information and the terminal device information of the corresponding type.
22. The device according to claim 21, characterized in that The performing tone mapping on the image to be displayed according to the reference information and the terminal device information of a corresponding type includes: Acquire tone mapping parameters according to the reference information and the terminal device information of the corresponding type; Based on the tone mapping parameters, tone mapping is performed on the image to be displayed.
23. The device according to claim 22, characterized in that Acquiring tone mapping parameters according to the reference information and the terminal device information of a corresponding type includes: According to the reference information and the terminal device information of the corresponding type, the initial tone mapping parameters of the image to be displayed are adjusted to obtain the tone mapping parameters.
24. The device according to claim 23, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed according to the reference information and the terminal device information of the corresponding type to obtain the tone mapping parameters includes: When the relationship between the reference information and the terminal device information of the corresponding type satisfies a first condition, adjusting the initial tone mapping parameters of the image to be displayed in a first manner to obtain the tone mapping parameters; When the relationship between the reference information and the terminal device information of the corresponding type satisfies a second condition, the initial tone mapping parameters of the image to be displayed are adjusted in a second manner to obtain the tone mapping parameters. The initial tone mapping parameters are used to characterize an initial tone mapping curve, and the tone mapping parameters are used to characterize an adjusted tone mapping curve.
25. The device according to claim 24, characterized in that The first condition includes: At least one of the following is true: the terminal display screen size is smaller than the reference display device size, the user viewing distance is greater than the reference viewing distance, the user viewing angle deviates from the reference viewing angle, the ambient light brightness is greater than the reference ambient light brightness, or the terminal display device resolution is smaller than the reference display device resolution.
26. The device according to claim 24 or 25, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a first manner comprises: Acquire one or more first brightness characteristic values of the image to be displayed; The initial tone mapping parameters are adjusted so that a mapping value of the obtained adjusted tone mapping curve at the one or more first brightness characteristic values is greater than a mapping value of the initial tone mapping curve at the one or more first brightness characteristic values.
27. The device according to any one of claims 24 to 26, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a first manner further includes: Acquire one or more second brightness characteristic values of the image to be displayed; The initial tone mapping parameters are adjusted so that the slope of the adjusted tone mapping curve obtained at the one or more second brightness characteristic values is greater than the slope of the initial tone mapping curve at the one or more second brightness characteristic values.
28. The device according to any one of claims 24 to 27, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a first manner further includes: Acquire a base layer and one or more enhancement layers of the image to be displayed; a value after a first characteristic value of any one of the one or more enhancement layers is mapped by the initial tone mapping curve of any one of the enhancement layers is a second characteristic value; The initial tone mapping parameter of any one of the enhancement layers is adjusted so that an absolute value of a value of the first eigenvalue mapped by the adjusted tone mapping curve is greater than an absolute value of the second eigenvalue.
29. The device according to claim 24, characterized in that The second condition includes: At least one of the following is true: the terminal display screen size is larger than the reference display device size, the user viewing distance is smaller than the reference viewing distance, the ambient light brightness is smaller than the reference ambient light brightness, or the terminal display device resolution is larger than the reference display device resolution.
30. The device according to claim 24 or 29, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a second manner comprises: Acquire one or more third brightness characteristic values of the image to be displayed; The initial tone mapping parameters are adjusted so that a mapping value of the obtained adjusted tone mapping curve at the one or more third brightness characteristic values is smaller than a mapping value of the initial tone mapping curve at the one or more third brightness characteristic values.
31. The device according to claim 30, characterized in that The one or more third brightness characteristic values include: One or more brightness characteristic values of the dark portion of the image to be displayed.
32. The device according to any one of claims 24 or 29 to 31, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a second manner further includes: Acquire one or more fourth brightness characteristic values of the image to be displayed; The initial tone mapping parameters are adjusted so that a slope of the obtained adjusted tone mapping curve at the one or more fourth brightness characteristic values is smaller than a slope of the initial tone mapping curve at the one or more fourth brightness characteristic values.
33. The device according to any one of claims 24 or 29 to 32, characterized in that The adjusting the initial tone mapping parameters of the image to be displayed in a second manner further includes: Acquire a base layer and one or more enhancement layers of the image to be displayed; a value after a third eigenvalue of any one of the one or more enhancement layers is mapped by the initial tone mapping curve of any one of the enhancement layers is a fourth eigenvalue; The initial tone mapping parameter of any one of the enhancement layers is adjusted so that an absolute value of a value of the third eigenvalue mapped by the adjusted tone mapping curve is smaller than an absolute value of the fourth eigenvalue.
34. The device according to claim 23, characterized in that The tone mapping module is also used to: Acquire reference tone mapping parameters of the image to be displayed; Obtaining the display capability of the terminal display device in the terminal device information; According to the reference tone mapping parameters and the display capability of the terminal display device, the reference tone mapping parameters of the image to be displayed are adjusted to obtain the initial tone mapping parameters.
35. The device according to any one of claims 21 to 34, characterized in that The obtaining of reference information comprises: Acquiring the reference information from metadata of the image to be displayed; or obtaining an index of the reference information from the metadata, and selecting the reference information from a plurality of preset reference information according to the index; Or the preset reference information is used as the reference information.
36. The device according to any one of claims 21 to 35, characterized in that The obtaining of terminal device information includes: Acquiring the terminal device information by measuring; or selecting the terminal device information from a plurality of preset terminal information according to a preset index; Or the preset terminal device information is used as the terminal device information.
37. An image encoding device, characterized in that: The device comprises: The encoding module is used to write the image to be displayed into the code stream; Also used for writing reference information of the image to be displayed into the code stream; the reference information includes at least one of a reference display device size, a reference viewing distance, a reference viewing angle, a reference ambient light brightness, or a reference display device resolution; The reference information is used to perform tone mapping on the image to be displayed; The sending module is used to send the code stream.
38. The device according to claim 37, characterized in that The encoding module is also used for: The reference tone mapping parameters of the image to be displayed are written into the bitstream; wherein the reference tone mapping parameters are used to obtain the tone mapping parameters; the reference information is used by the decoding end to adjust the initial tone mapping parameters to obtain the tone mapping parameters, and the tone mapping parameters are used to tone map the image to be displayed.
39. The device according to claim 37 or 38, characterized in that Writing the reference information of the image to be displayed into the code stream includes: Writing the reference information into the bitstream; Or write the index of the reference information into the bitstream.
40. The device according to any one of claims 37 to 39, characterized in that The encoding module is also used for: One or more brightness characteristic values of the image to be displayed are written into the bitstream; wherein the one or more brightness characteristic values are used by the decoding end to adjust the initial tone mapping parameters to obtain the tone mapping parameters.
41. An electronic device, characterized in that: include: A memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to execute the method according to any one of claims 1 to 16 or claims 17 to 20.
42. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program runs on a computer or a processor, the method of any one of claims 1 to 16 or claims 17 to 20 is implemented.
43. A computer program product, characterized in that The method comprises a program or an instruction, which, when executed on a computer or a processor, causes the computer or the processor to execute the method according to any one of claims 1 to 16 or claims 17 to 20.
Citation Information
Cited By
Intelligent blackboard synchronous memory display method and system
CN119292473A
HDR dynamic tone mapping method and system
CN121122175A
Display method for projection device and projection device
EP4815438A1
Video production method and apparatus, electronic device, and storage medium
WO2026090797A1
