Video conversion method, electronic equipment and storage medium
By performing chrominance value conversion in a specific area of the chrominance map, the problem of video conversion accuracy loss in the prior art is solved, and the image quality improvement of SDR video and the reversible restoration of HDR video are achieved.
Patent Information
- Application Number
- CN202410038544.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-01-09
AI Technical Summary
The existing video conversion schemes have accuracy losses during chromaticity conversion, resulting in poor video conversion effect.
By obtaining the chromaticity value of pixel units in HDR video at the position of the chromaticity map, and based on the preset chromaticity conversion algorithm, the chromaticity value is converted in a specific area of the chromaticity map to ensure that the converted chromaticity value falls within or outside the SDR color gamut, and avoiding hard cropping.
The image quality effect of the converted SDR video is improved, and the conversion process is reversible, which can restore the chromaticity information of the HDR video when necessary.
Smart Images

Figure CN120343191A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to a video conversion method, an electronic device, and a storage medium. Background Art
[0002] With the popularization of intelligent terminal devices, it has become a common practice for users to shoot videos using electronic devices such as mobile phones and tablets. The videos shot by electronic devices include High Dynamic Range (HDR) videos and Standard Dynamic Range (SDR) videos.
[0003] To be compatible with electronic devices with different specifications of display screens and to present the original video content created by the original author with good visual effects, users have a need to convert the formats of these two types of videos. For example, converting an HDR video to an SDR video, or converting an SDR video to an HDR video.
[0004] In current video conversion solutions, there is a loss of precision when converting the chrominance of a video, resulting in poor video conversion effects. Summary of the Invention
[0005] Embodiments of this application provide a video conversion method, an electronic device, and a storage medium, which can improve the video conversion effect.
[0006] In a first aspect, embodiments of this application provide a video conversion method, which can be applied to any electronic device with video processing capabilities. The method includes: in response to an operation of converting a High Dynamic Range (HDR) video to a Standard Dynamic Range (SDR) video, the electronic device obtains a first chrominance value of a first pixel unit of a first image in the HDR video, where the first image is any frame image in the HDR video, and the first pixel unit is any pixel unit in the first image; the electronic device determines the regional position of the first chrominance value in the chromaticity diagram; if the electronic device determines that the first chrominance value is within a first region of the chromaticity diagram, the electronic device performs chrominance conversion on the first chrominance value to obtain a second chrominance value of the first pixel unit of the first image in the SDR video; the distance between the second chrominance value and the white point of the chromaticity diagram is less than the distance between the first chrominance value and the white point.
[0007] Exemplarily, referring to Figure 8 , the first region of the chromaticity diagram refers to the region within the HDR color gamut except for the △DEF region, that is, the region in △A’B’C’ except for △DEF. Compared with the △DEF region, the first region can be regarded as a large color gamut. The first chrominance value can correspond to Figure 8 the b point in , since the b point is outside the △ABC region within the HDR color gamut, that is, the b point is in the first region, the electronic device can map the b point to the b’ point based on a preset chrominance conversion algorithm. The second chrominance value can correspond toFigure 8 point b'. The white point is Figure 8 point O in. The distance between the second chromaticity value and the white point corresponds to the distance between point b' and point O, and the distance between the first chromaticity value and the white point corresponds to the distance between point b and point O. The distance between point b' and point O is less than the distance between point b and point O. Compared with point b, point b' is closer to the white point.
[0008] In the above embodiments, if the electronic device determines that the chromaticity value (such as the above first chromaticity value) of a certain pixel unit in a certain frame of an HDR video is located in the first region of the chromaticity diagram, the electronic device performs chromaticity conversion on the chromaticity value of the pixel unit so that the converted chromaticity value (such as the above second chromaticity value) falls at a position within the SDR color gamut of the chromaticity diagram, rather than on the boundary of the SDR color gamut, thereby converting the chromaticity information within the large color gamut of the image in the HDR video to within the small color gamut to a certain extent, and the image quality effect of the converted SDR video can be improved.
[0009] In an optional implementation manner of the first aspect, the electronic device performs chromaticity conversion on the first chromaticity value to obtain the second chromaticity value of the first pixel unit in the first image of the SDR video, including: the electronic device obtains the first connection line between the first coordinate point and the white point, determines the first intersection point of the first connection line and the boundary of the SDR color gamut in the chromaticity diagram, and the second intersection point of the first connection line and the boundary of the HDR color gamut in the chromaticity diagram; the first coordinate point is the coordinate point of the first chromaticity value on the chromaticity diagram; the electronic device respectively obtains the first distance value between the first coordinate point and the white point, the second distance value between the first intersection point and the white point, and the third distance value between the second intersection point and the white point; the electronic device determines the fourth distance value according to the first distance value, the second distance value, and the third distance value, where the fourth distance value is the distance value between the second coordinate point and the white point, and the second coordinate point is the coordinate point of the second chromaticity value on the chromaticity diagram; the electronic device determines the second chromaticity value according to the fourth distance value.
[0010] Exemplarily, referring to Figure 8 , the first coordinate point is point b, the second coordinate point is point b', the first connection line is Ob, the boundary of the SDR color gamut is the boundary of △ABC, the boundary of the HDR color gamut is the boundary of △A'B'C', the first intersection point is point a, and the second intersection point is point c. The first distance value is the distance value between point b and point O, which can be denoted as x1, the second distance value is the distance value between point a and point O, which can be denoted as dis(Oa), the third distance value is the distance value between point c and point O, which can be denoted as dis(Oc), and the fourth distance value is the distance value between point b' and point O, which can be denoted as y1. In one example, the electronic device can determine the fourth distance value y1 through the following formula.
[0011] y1 = f(x1) = βx1 / (α + β) + (α - α*β) / (α + β)
[0012] Where α = dis(Oc) / dis(Oa) – 1, β is a constant, for example, β is taken as 0.2.
[0013] The above embodiments illustrate the position of the first chromaticity value in the chromaticity diagram. By means of geometric operations, it is determined to convert the first chromaticity value to the second chromaticity value. In this way, the chromaticity values within the large color gamut can be mapped to the SDR color gamut according to a certain ratio, so as to convert the chromaticity information within the large color gamut of the images in the HDR video to the small color gamut.
[0014] In an alternative embodiment of the first aspect, the method further includes: if the electronic device determines that the first chromaticity value is within the second region of the chromaticity diagram, the electronic device uses the first chromaticity value as the chromaticity value of the first pixel unit of the first image in the SDR video.
[0015] Exemplarily, referring to Figure 8 , the second region of the chromaticity diagram refers to the △DEF region within the HDR color gamut. Compared with the aforementioned first region, the second region can be regarded as a small color gamut.
[0016] In the above embodiments, if the electronic device determines that the chromaticity value (such as the above-mentioned first chromaticity value) of a certain pixel unit in a certain frame of the HDR video is within the second region of the chromaticity diagram, the electronic device may not perform chromaticity conversion on the chromaticity value of this pixel unit, that is, keep the chromaticity value of this pixel unit unchanged.
[0017] In an alternative embodiment of the first aspect, the method further includes: in response to an operation of converting the SDR video to the HDR video, the electronic device obtains the third chromaticity value of the second pixel unit of the second image in the SDR video. The second image is any frame image in the SDR video, and the second pixel unit is any pixel unit in the second image; the electronic device determines the regional position of the third chromaticity value in the chromaticity diagram; if the electronic device determines that the third chromaticity value is within the third region of the chromaticity diagram, the electronic device performs chromaticity conversion on the third chromaticity value to obtain the fourth chromaticity value of the second pixel unit of the second image in the HDR video; the distance between the fourth chromaticity value and the white point of the chromaticity diagram is greater than the distance between the third chromaticity value and the white point.
[0018] Exemplarily, referring to Figure 8 , the third region of the chromaticity diagram refers to the region in the SDR color gamut except the △DEF region, that is, the region in △ABC except △DEF. The third chromaticity value can correspond to Figure 8 the f point in Figure 8The f' point. The distance between the fourth chromaticity value and the white point corresponds to the distance between the f' point and the O point, and the distance between the third chromaticity value and the white point corresponds to the distance between the f point and the O point. The distance between the f' point and the O point is greater than the distance between the f point and the O point. Compared with the f point, the f' point is farther from the white point.
[0019] In the above embodiments, if the electronic device determines that the chromaticity value (such as the above-mentioned third chromaticity value) of a certain pixel unit in a certain frame of the SDR video is located in the third region of the chromaticity diagram, the electronic device performs chromaticity conversion on the chromaticity value of the pixel unit so that the converted chromaticity value (such as the above-mentioned fourth chromaticity value) falls at a position outside the SDR color gamut of the chromaticity diagram, that is, converts the chromaticity value in the small color gamut to the large color gamut, which can improve the image quality effect of the converted HDR video.
[0020] In an alternative embodiment of the first aspect, when the electronic device performs chromaticity conversion on the third chromaticity value to obtain the fourth chromaticity value of the second pixel unit of the second image in the HDR video, it includes: the electronic device obtains the second connection line between the third coordinate point and the white point, determines the third intersection point of the second connection line and the SDR color gamut boundary in the chromaticity diagram, and the fourth intersection point of the second connection line and the HDR color gamut boundary in the chromaticity diagram; the third coordinate point is the coordinate point of the third chromaticity value on the chromaticity diagram; the electronic device respectively obtains the fifth distance value between the third coordinate point and the white point, the sixth distance value between the third intersection point and the white point, and the seventh distance value between the fourth intersection point and the white point; the electronic device determines the eighth distance value according to the fifth distance value, the sixth distance value and the seventh distance value, and the eighth distance value is the distance value between the fourth coordinate point and the white point, and the fourth coordinate point is the coordinate point of the fourth chromaticity value on the chromaticity diagram; the electronic device determines the fourth chromaticity value according to the eighth distance value.
[0021] Exemplarily, referring to Figure 8 , the third coordinate point can be the f point, the fourth coordinate point can be the f' point, the second connection line is Of, the SDR color gamut boundary is the boundary of △ABC, the HDR color gamut boundary is the boundary of △A'B'C', the third intersection point is the g point, and the fourth intersection point is the h point. The fifth distance value is the distance value x2 between the f point and the O point, the sixth distance value is the distance value between the g point and the O point, which can be denoted as dis(Og), the seventh distance value is the distance value between the h point and the O point, which can be denoted as dis(Oh), and the eighth distance value is the distance value y2 between the f' point and the O point. In one example, the electronic device determines the distance value y2 between the f' point and the white point O through the following formula:
[0022] x2 = f(y2) = βy2 / (α + β) + (α - α*β) / (α + β)
[0023] In the formula, α = dis(Oh) / dis(Og) - 1, and β is a constant. For example, β takes 0.2.
[0024] The above embodiments show the position of the third chromaticity value in the chromaticity diagram. Through the formula of geometric operation, it is determined to convert the third chromaticity value to the fourth chromaticity value. In this way, the chromaticity values in the small color gamut can be mapped outside the SDR color gamut according to a certain ratio, which can improve the picture quality effect of the converted HDR video.
[0025] In an alternative embodiment of the first aspect, the method further includes: the electronic device determines that the third chromaticity value is within the second region of the chromaticity diagram, and the electronic device uses the third chromaticity value as the chromaticity value of the second pixel unit of the second image in the HDR video.
[0026] In the above embodiments, if the electronic device determines that the chromaticity value of a certain pixel unit in a certain frame of the SDR video (such as the above-mentioned third chromaticity value) is within the second region of the chromaticity diagram, the electronic device may not perform chromaticity conversion on the chromaticity value of the pixel unit, that is, keep the chromaticity value of the pixel unit unchanged.
[0027] In an alternative embodiment of the first aspect, the chromaticity diagram is a CIE1976 chromaticity diagram.
[0028] In a second aspect, an embodiment of the present application provides an electronic device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, and the computer program code includes computer instructions. The one or more processors call the computer instructions to cause the electronic device to execute the method according to any one of the first aspect.
[0029] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions to cause the electronic device to execute the method according to any one of the first aspect.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions run on the electronic device, the electronic device is caused to execute the method according to any one of the first aspect.
[0031] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program code. When the computer program code runs on the electronic device, the electronic device is caused to execute the method according to any one of the first aspect.
[0032] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding alternative embodiments are similar and will not be repeated. Description of the Drawings
[0033] Figure 1 It is a schematic diagram of the CIE1931 chromaticity diagram;
[0034] Figure 2 It is a schematic diagram of the change of the mobile phone interface provided by the embodiment of the present application Figure 1 ;
[0035] Figure 3 It is a schematic diagram of the change of the mobile phone interface provided by the embodiment of the present application Figure 2 ;
[0036] Figure 4 It is a schematic diagram of the change of the mobile phone interface provided by the embodiment of the present application Figure 3 ;
[0037] Figure 5 It is a schematic diagram of the change of the mobile phone interface provided by the embodiment of the present application Figure 4 ;
[0038] Figure 6 It is a schematic diagram of chromaticity conversion based on the CIE1931 chromaticity diagram provided by the embodiment of the present application;
[0039] Figure 7 It is a flowchart of the video conversion method provided by the embodiment of the present application Figure 1 ;
[0040] Figure 8 It is a schematic diagram of chromaticity conversion based on the CIE1976 chromaticity diagram provided by the embodiment of the present application;
[0041] Figure 9 It is a schematic diagram of the functional relationship of the electronic device mapping chromaticity points based on the chromaticity diagram;
[0042] Figure 10 It is a flowchart of the video conversion method provided by the embodiment of the present application Figure 2 ;
[0043] Figure 11 It is a schematic diagram of the structure of an electronic device provided by the embodiment of the present application;
[0044] Figure 12 It is a software architecture diagram of an electronic device provided by the embodiment of the present application. Detailed implementation manners
[0045] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and effects. Those skilled in the art can understand that the terms "first" and "second" do not limit the quantity and execution order, and the terms "first" and "second" do not necessarily limit being different.
[0046] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be construed as being more preferred or having more advantages than other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner.
[0047] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (kind / individual) of the following" or its similar expression refers to any combination of these items, including any combination of single item (kind / individual) or plural items (kinds / individuals). For example, at least one (kind / individual) of a, b or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, c may be single or multiple.
[0048] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc., and the data includes videos, etc.) involved in the present application are all information and data that have been authorized by the user or fully authorized by all parties. And the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0049] For the convenience of understanding, the following first explains the professional terms involved in the embodiments of the present application.
[0050] 1. Chromaticity diagram: It is an image that describes the gamut range formulated by the International Commission on Illumination (CIE) to visually display the relationship of colors. For example, the CIE1931 chromaticity diagram and the CIE1976 chromaticity diagram, and the CIE1931 is the most widely used.
[0051] Figure 1 It is a schematic diagram of the CIE1931 chromaticity diagram. Figure 1The points on the middle curve 1 are monochromatic light, that is, the color of light (electromagnetic wave) with a single frequency. The values marked on the curve 1 are wavelength values, ranging from 380nm to 700nm, which is the wavelength range of light visible to the human eye. Connecting the left endpoint (380nm) and the right endpoint (700nm) of the curve 1 forms a closed area. The entire image is also called the "horseshoe diagram" because of its horseshoe-like shape. The area enclosed by the image covers all the colors that the human eye can distinguish, and each point on the image corresponds to a unique color.
[0052] 2. Color space refers to the set of all colors that a device (display) can display. All colors that a device can display are located in this color space. In mathematical terms, it is c∈S, where c is any color displayed by the device and S is a color space. Figure 1 For example, the largest color space is the CIE1931 color space, that is Figure 1 The horseshoe-shaped enclosed area in the chromaticity diagram shown, the CIE1931 color space can be understood as the full set of color domains, mathematically represented by U, and any color space S is a subset of U, that is,
[0053] 3. Color gamut refers to the range of the color space. Different color spaces have different color gamuts. Figure 1 The area of △ABC shown corresponds to color gamut 1, and the area of △A'B'C' corresponds to color gamut 2. The color space of color gamut 1 is smaller than the color space of color gamut 2. Relative to color gamut 2, color gamut 1 can be called a small color gamut, and relative to color gamut 1, color gamut 2 can be called a large color gamut. In an embodiment of the present application, color gamut 1 can be a BT.709 color gamut, and color gamut 2 can be a BT.2020 color gamut. Relative to the BT.2020 color gamut, the BT.709 color gamut is a small color gamut, and relative to the BT.709 color gamut, the BT.2020 color gamut is a large color gamut. When HDR video is converted to SDR video, the color gamut is converted from BT.2020 to BT.709. When SDR video is converted to HDR video, the color gamut is converted from BT.709 to BT.200.
[0054] 4. White point refers to the color when the device displays 255 white, usually expressed by color coordinates or color temperature K. The white point corresponds to the standard color temperature of white balance, usually expressed as Dxx. For example, Figure 1 In the figure, the white point is represented by the color temperature D65, which is equivalent to the color temperature of 6500K. The white point of the area △ABC corresponding to the color gamut 1 coincides with the white point of the area △A'B'C' corresponding to the color gamut 2.
[0055] 5. Standard Dynamic Range (SDR) is a technology for representing light intensity based on the brightness, contrast, and color characteristics of a Cathode Ray Tube (CRT) display. The dynamic range mentioned here generally refers to the brightness range, and a larger brightness range can support higher contrast. The brightness range supported by SDR is between 0.1 nit and 100 nit. It uses the BT.709 color gamut and uses the Gamma curve as its Electro-Optical Transfer Function (EOTF).
[0056] 6. High Dynamic Range (HDR) is an upgrade to SDR and is a technology for improving video display quality. HDR changes the way brightness and color information of videos and images are represented in the signal, thereby supporting a larger brightness range (0.0005 - 10000 nit), a wider BT.2020 color gamut, and higher-precision quantization (10-bit or 12-bit).
[0057] The picture of an HDR video can show more details in the bright and dark parts. The picture has rich colors and vivid and natural detail performance, so the picture is closer to what the human eye sees. The color saturation and picture contrast of an SDR video are not as good as those of an HDR video. Compared with an HDR video, the picture of an SDR video gives people a dull and unnatural visual experience, and there are obvious deficiencies in the details of the bright and dark parts.
[0058] 7. A pixel is the basic unit that makes up a digital image. A pixel is also called a pixel point or a pixel unit. A pixel unit can include one or more pixel points. In the embodiments of this application, the pixel unit in the image is taken as an example for the description of the solution.
[0059] For ease of understanding, the scenario of the video conversion method provided in the embodiments of this application will be introduced first below.
[0060] Scenario 1: After the user uses an electronic device to shoot an HDR video, in order to adapt to a device that supports playing SDR videos, the user has a need to convert the HDR video into an SDR video. In one example, a gallery application (or called an album application) and a video editing application are installed on the electronic device. The user can view the videos taken or downloaded in the gallery application, such as an HDR video. In response to an editing operation on the HDR video in the gallery application, the electronic device starts the video editing application. In response to an operation of video conversion in the video editing application, the electronic device converts the HDR video into an SDR video based on a preset chromaticity conversion algorithm. The electronic device starting the video editing application can be understood as the electronic device invoking the process corresponding to the video editing application.
[0061] The following combines Figures 2 to 4The user operation process of the above Scenario 1 is introduced. Unless otherwise specified, in the following embodiments, the electronic device is taken as an example of a mobile phone for introduction, and the interface display and user operations of other devices are similar to those of the mobile phone.
[0062] Figure 2 Schematic illustration of the change of the mobile phone interface provided by the embodiment of the present application Figure 1 . As Figure 2 shown in a and b, in response to an operation on the icon 1011 of the gallery application on the interface 101, the mobile phone displays the interface 102, and the interface 102 includes album categories such as camera, all photos, videos, screen recording, my favorites, etc. As Figure 2 shown in b and c, in response to an operation on the video control 1021 on the interface 102, the mobile phone displays the interface 1031, and the interface 1031 includes multiple videos, for example Figure 2 shown in c, there are 3 SDR videos and 1 HDR video. As Figure 2 shown in c and d, in response to an operation on the HDR video 1031 on the interface 103, the mobile phone displays the interface 104, and the interface 104 includes the icon 104 and the video playback progress window 1041. The icon 104 can be located in the upper right corner of the interface 104, and is used to indicate that the video type of the currently played video is an HDR video. Controls such as share, favorite, edit, delete, more, etc. are also displayed at the bottom of the interface 104, facilitating the user to perform related operations on the video. The above example shows the operation process of the user viewing videos on the mobile phone.
[0063] Figure 3 Schematic illustration of the change of the mobile phone interface provided by the embodiment of the present application Figure 2 . As Figure 3 shown in a and b, in response to an operation on the "edit" control on the interface 104, the mobile phone can display the interface 201, and the interface 201 displays a first prompt message, which is used to prompt the user whether to agree to use the video editing application to edit the video. As Figure 3 shown in b and c, in response to an operation on the "agree" control on the interface 201, the mobile phone can display the interface 202, and the interface 202 displays a second prompt message, which is used to prompt the user whether to allow the video editing application to access the music and videos on the mobile phone. As Figure 3 shown in c and d, in response to an operation on the "always allow" control on the interface 202, the mobile phone can display the interface 203, and the interface 203 displays a third prompt message, which is used to prompt the user whether to allow the video editing application to access the photos and videos on the mobile phone. As Figure 3 shown in d and e, in response to an operation on the "always allow" control on the interface 203, the mobile phone can display the interface 204, and the interface 204 is the video editing interface provided by the video editing application.
[0064] The above example shows the operation process of a user first invoking a video editing application through a gallery application for video editing. After the video editing application obtains various authorizations from the user, the user can perform video editing in the video editing application. It should be understood that after the video editing application obtains various authorizations from the user, when the user invokes the video editing application again through the gallery application for video editing, the mobile phone may not display interfaces 201 to 203 and directly enter interface 204.
[0065] Figure 4 Schematic diagram of the change of the mobile phone interface provided by the embodiment of the present application Figure 3 . As Figure 4 shown in a and b, in response to an operation on the control 2041 on interface 204, the mobile phone can display a window 2042 on interface 204. The window 2042 displays a selection control 2043 for video conversion and an export control 2044. The video type of the current video is an HDR video (gray bold). As Figure 4 shown in b and c, in response to an operation 1 to convert to "ordinary video" on the selection control 2043 and an operation 2 on the export control 2044, the mobile phone starts to perform video conversion, converting the current HDR video to an SDR video. The video conversion process takes a certain amount of time. During the video conversion process, the mobile phone can display a window 3021 on interface 302. The window 3021 displays the progress of video export (video conversion). After the video export is completed, the mobile phone can display interface 303, which is the interface of the gallery application. The interface 303 can pop up a card 3031, and the card 3031 displays a fourth prompt message, which is used to prompt the user that the converted video has been saved to the "Pictures" album and the editing draft. The card 3021 will no longer be displayed after a period of time (such as 2 s) of popping up. In this example, the ordinary video refers to the SDR video.
[0066] The above example shows the operation process of a user performing video conversion in a video editing application after invoking the video editing application through a gallery application. After the video conversion is completed, the converted SDR video is stored in the gallery application, and the mobile phone displays the SDR video in the gallery application, facilitating the user to view the converted video.
[0067] Scenario 2: The electronic device stores multiple videos including HDR videos and SDR videos, and the user has a need to splice the multiple videos. Taking the splicing of two videos as an example, the video types of the two videos are different. For example, the first video is an SDR video and the second video is an HDR video. In response to an editing operation on the first video in the gallery application, the electronic device starts the video editing application. In response to the operations of adding the second video and splicing the videos in the video editing application, the electronic device converts the SDR video into an HDR video based on a preset chrominance conversion algorithm, thereby obtaining two SDR videos, and then splices the two HDR videos to obtain the spliced video.
[0068] It should be noted that when the electronic device splices HDR videos and SDR videos, it usually takes the HDR video as the benchmark and converts the SDR video into an HDR video so that the video types of the two spliced videos are the same before performing video splicing. Of course, in some embodiments, when the electronic device splices HDR videos and SDR videos, it can also convert the HDR video into an SDR video based on the user's selection so that the video types of the two videos are the same before performing video splicing.
[0069] The following combines Figure 5 to introduce the user operation process of the above Scenario 2.
[0070] Figure 5 Schematic diagram of the change of the mobile phone interface provided by the embodiment of the present application Figure 4 As Figure 5 shown in a of, the mobile phone display interface 401, and a certain SDR video in the gallery application is displayed on the interface 401. In response to an operation on the "Edit" control on the interface 401, the mobile phone display interface 402 is shown. As Figure 5 shown in b of, controls 4021 and 4022 are displayed on the interface 402. "1080P" is displayed on the control 4021 to indicate that the video type of the current video is an SDR video, and the control 4022 is used to trigger the addition of a new video or picture. As Figure 5 shown in b and c of, in response to an operation on the control 4022, the mobile phone display interface 403 is shown. Multiple pictures and multiple videos are displayed on the interface 403, and the multiple videos include HDR videos. As Figure 5 shown in c and d of, in response to operation 1 of selecting the HDR video 4031 on the interface 403 and operation 2 of the "Add" control on the interface 403, the mobile phone display interface 404 is shown. A control 4041 is displayed on the interface 404, and "HDR|1080P" is displayed on the control 4041 to indicate that the video type of the newly added second video is an HDR video. The area 4042 of the interface 404 includes two videos, namely an SDR video and the newly added HDR video. As Figure 5As shown in Figure d, in response to an operation on area 4042, which can be an operation where the user long - presses and holds area 4042, the mobile phone displays thumbnails of the two videos in area 4042, such as Figure 5 the thumbnails 4043 and 4044 shown in Figure e. In response to the user releasing the finger (or cursor) in area 4042, the mobile phone displays interface 404.
[0071] In response to an operation on the "Export" control on interface 404, the mobile phone can first perform video conversion. For example, after converting an SDR video to an HDR video, the mobile phone performs video splicing on the converted HDR video and the newly added second HDR video, and finally obtains the spliced video. The mobile phone can store the spliced video in the gallery application. After the video splicing is completed, the mobile phone can display the spliced video (not shown) in the gallery application.
[0072] The above example shows the operation process of the user for video splicing. If the video types of the two videos are different, for example, one video is an SDR video and the other is an HDR video, before video splicing, the mobile phone can first convert the SDR video to an HDR video, and then perform splicing processing on the two HDR videos to make the color and picture quality of the spliced video consistent.
[0073] Based on the above Scenario 1, the HDR video includes a series of consecutive frames of images. The process of the electronic device converting the HDR video to an SDR video includes: the electronic device sequentially converts the chromaticity of each frame of image in the series of frames of the HDR video based on a preset chromaticity conversion algorithm to obtain an SDR video, and the SDR video includes a series of frames of images with chromaticity conversion. When converting the HDR video to an SDR video, the color gamut is converted from BT.2020 to BT.709, which can be understood as a conversion from a large color gamut to a small color gamut. For the sake of easy understanding, the following combines Figure 6 to illustrate the chromaticity conversion of a certain pixel unit in any frame of the HDR video.
[0074] Exemplarily, Figure 6 is a chromaticity conversion schematic diagram based on the CIE1931 chromaticity diagram provided by the embodiment of the present application. As Figure 6 shown, Image 1 is any frame of the HDR video. After the electronic device obtains the chromaticity value of pixel unit 1 in Image 1, it can map this chromaticity value to the chromaticity diagram.
[0075] It should be understood that a point in the chromaticity diagram corresponds to a chromaticity value. In some embodiments, the chromaticity value is also called the color value.
[0076] In a possible case, the chromaticity value of pixel unit 1 is mapped outside the area of △ABC, for example Figure 6Point E in it. The color gamut corresponding to the area of △ABC is BT.709 (small color gamut), and the color gamut corresponding to the area of △A’B’C’ is BT.2020 (large color gamut). In this case, the electronic device needs to convert the chromaticity value of pixel unit 1. Based on a preset chromaticity conversion algorithm, the electronic device can map point E to point G, and point G is on the boundary of the area of △ABC. The electronic device uses the chromaticity value corresponding to point G as the chromaticity value of pixel unit 1 after chromaticity conversion.
[0077] In another possible case, the chromaticity value of pixel unit 1 is mapped to the area of △ABC and within it, for example Figure 6 Point I in it. In this case, the electronic device may not convert the chromaticity value of pixel unit 1.
[0078] The electronic device can traverse each pixel unit in Image 1 in the above manner to complete the chromaticity conversion of Image 1.
[0079] In the above example, the chromaticity conversion algorithm directly performs hard clip processing on the coordinate points corresponding to the chromaticity values outside the small color gamut and within the large color gamut (including the boundary of the large color gamut), and maps the coordinate point to the boundary of the small color gamut. For example Figure 6 Among them, multiple points including D, E, F, and G are all mapped to point H on the boundary of the small color gamut, that is, there are multiple chromaticity values corresponding to one chromaticity value in chromaticity conversion. Since multiple chromaticity values are all mapped to a certain chromaticity value, this will affect the color presentation effect of Image 1 after chromaticity conversion, and the chromaticity conversion accuracy of the image is low, which in turn leads to a poor SDR video effect after conversion.
[0080] It should be noted that hard clip processing is a matrix operation process, and the points mapped to the boundary of the small color gamut are calculated through a preset matrix. This matrix can be a 3×3 matrix.
[0081] In addition, after the electronic device converts the HDR video to an SDR video based on the chromaticity conversion algorithm in the above example, and then converts the SDR video back to the HDR video (which can correspond to Scenario 2 above), the electronic device cannot determine which chromaticity value outside the small color gamut the chromaticity value on the boundary of the small color gamut should be mapped to. For example, if the original HDR video is to be restored, Figure 6 the chromaticity value of point H in it should be mapped to the chromaticity value of point E. However, since the chromaticity conversion algorithm is an irreversible algorithm, when the SDR video is converted back to the HDR video, the electronic device may map point H to Figure 6 other points in it, such as point G. The above process causes the electronic device to be unable to restore the chromaticity information of the image in the original HDR video.
[0082] In view of the above problems, an embodiment of the present application proposes a video conversion method. When an electronic device converts an HDR video into an SDR video, if a pixel unit in a certain frame of the HDR video needs to perform chromaticity conversion, the electronic device does not perform hard clip processing. Instead, based on a new chromaticity conversion algorithm, the chromaticity values outside the small color gamut are mapped inside the small color gamut, rather than being mapped to the boundary of the small color gamut. It can be understood that based on this new chromaticity conversion algorithm, two adjacent chromaticity values outside the small color gamut can be respectively mapped to different chromaticity values inside the small color gamut, so as to retain the chromaticity details of the images in the original HDR video.
[0083] In addition, the above new chromaticity conversion algorithm is a reversible algorithm. When the electronic device converts the HDR video into an SDR video and then converts the SDR video back to the HDR video, the electronic device can, based on the inverse process of the new chromaticity conversion algorithm, map the chromaticity values inside the small color gamut back to the chromaticity values outside the small color gamut, so as to restore the original HDR video and retain the chromaticity details of the images in the original HDR video.
[0084] The following uses specific embodiments to elaborate in detail on the technical solution of the present application and how the technical solution of the present application solves the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0085] Figure 7 is the flow of the video conversion method provided by the embodiment of the present application Figure 1 As Figure 7 shown, this video conversion method can be applied to any electronic device. For example, the electronic device is a mobile phone. This method may include:
[0086] S701. In response to an operation of converting an HDR video into an SDR video, the electronic device obtains the first chromaticity value of the first pixel unit of the first image in the HDR video.
[0087] The HDR video obtained by the electronic device includes multiple consecutive frames of images. The first image is any one of the multiple frames of images, and the first pixel unit is any pixel unit in the first image. The first chromaticity value of the first pixel unit is the original chromaticity value of the first pixel unit in the HDR video, and the first chromaticity value is any chromaticity value within the HDR color gamut.
[0088] Exemplarily, Figure 8 is the chromaticity conversion schematic diagram based on the CIE1931 chromaticity diagram provided by the embodiment of the present application. As Figure 8As shown, similar to the CIE1931 chromaticity diagram, the CIE1976 chromaticity diagram also includes two triangular regions, namely the region of △ABC and the region of △A’B’C’. The region of △ABC corresponds to the SDR color gamut, that is, the BT.709 color gamut (small color gamut), and the region of △A’B’C’ corresponds to the HDR color gamut, that is, the BT.2020 color gamut (large color gamut). △ABC and △A’B’C’ have a common center point O, and point O is the white point of the color gamut.
[0089] The first chromaticity value of the first pixel unit can correspond to a certain point within the HDR color gamut in the chromaticity diagram. For example, the first chromaticity value corresponds to Figure 8 point a, point b, point c, or point d in the shown chromaticity diagram.
[0090] It should be noted that compared with the CIE1931 chromaticity diagram, the geometric similarity between △ABC corresponding to the small color gamut and △A’B’C’ corresponding to the large color gamut in the CIE1976 chromaticity diagram is higher. Since the subsequent chromaticity conversion is carried out based on the geometric relationship of the triangular regions corresponding to the color gamuts, therefore, in this embodiment, the CIE1976 chromaticity diagram is used to represent the chromaticity value of the pixel unit in the image, which can improve the accuracy of chromaticity conversion.
[0091] S702. The electronic device determines the regional position of the first chromaticity value in the chromaticity diagram.
[0092] In some embodiments, if the electronic device determines that the first chromaticity value is within the first region of the chromaticity diagram, execute:
[0093] Exemplarily, referring to Figure 8 , the first region can be the region of △A’B’C’ in the chromaticity diagram except for △DEF.
[0094] S703. The electronic device performs chromaticity conversion on the first chromaticity value based on the chromaticity diagram to obtain a second chromaticity value.
[0095] The second chromaticity value is in the third region of the chromaticity diagram. Exemplarily, the third region can be the region of △ABC in the chromaticity diagram except for △DEF. The second chromaticity value is the chromaticity value of the first pixel unit in the SDR video. The electronic device converts the first chromaticity value within the first region of the chromaticity diagram to the third region of the chromaticity diagram, realizing the conversion of the chromaticity value within the large color gamut to the small color gamut. The following details the chromaticity conversion process with a specific example.
[0096] Exemplarily, if the first chromaticity value of the first pixel unit is Figure 8The chromaticity value corresponding to point b in the figure. Since point b is outside the △DEF region and inside the △A’B’C’ region, the electronic device determines to perform chromaticity conversion on the chromaticity value corresponding to point b, maps point b to point b' inside the △ABC region, and point b' is on the line Ob. Based on the position of point b' on the chromaticity diagram, the electronic device can obtain the chromaticity value corresponding to point b', and the chromaticity value corresponding to point b' is the second chromaticity value of the first pixel unit. The above process can map the chromaticity value within a large color gamut to within a small color gamut.
[0097] Based on the above example, the electronic device can determine the chromaticity value corresponding to point b' through the following steps.
[0098] Step 11. The electronic device obtains the line connecting point b and the white point O on the chromaticity diagram, determines the two intersection points of the line with the boundary of the SDR color gamut and the boundary of the HDR color gamut respectively, and records them as point a and point c respectively.
[0099] Step 12. The electronic device obtains the distance value x1 between point b and the white point O, the distance value dis(Oa) between point a and the white point O, and the distance value dis(Oc) between point c and the white point O on the chromaticity diagram.
[0100] Step 13. The electronic device determines the distance value y1 between point b' and the white point O according to the distance value x1 between point b and the white point O, the distance value dis(Oa) between point a and the white point O, and the distance value dis(Oc) between point c and the white point O. Exemplarily, the electronic device can determine the distance value y1 between point b' and the white point O through the following formula:
[0101] y1 = f(x1) = βx1 / (α + β) + (α - α*β) / (α + β)
[0102] In the formula, α = dis(Oc) / dis(Oa) – 1, and β is a constant. For example, β takes 0.2.
[0103] It should be noted that the electronic device can also determine the distance value y1 between point b' and the white point O through other formulas, that is, this embodiment does not limit y = f(x), as long as y = f(x) satisfies monotonicity, reversibility, and f(1 - β) = 1 - β, f(1 + α) = 1. For the specific description of y = f(x), reference can be made to the embodiments shown later. Figure 9 The embodiments shown.
[0104] Step 14. The electronic device determines the chromaticity value corresponding to point b' according to the distance value y1 between point b' and the white point O.
[0105] Point b' is on the line Ob. The electronic device can determine the position of point b' on the chromaticity diagram according to the distance value y1 between point b' and the white point O, so as to determine the chromaticity value corresponding to point b'.
[0106] It should be understood that if the first chromaticity value of the first pixel unit is Figure 8 the chromaticity value corresponding to any point on the line segment dc in
[0107] the electronic device can, based on the above steps 11 to 14, determine the corresponding mapping point of this point, and thus determine the chromaticity value corresponding to the mapping point.
[0108] In some embodiments, if the electronic device determines that the first chromaticity value is within the second region (including the boundary of the second region) of the chromaticity diagram, it performs:
[0109] S704. The electronic device uses the first chromaticity value as the chromaticity value of the first pixel unit of the first image in the SDR video.
[0110] Exemplarily, referring to Figure 8 , the second region can be the region of △DEF in the chromaticity diagram. This step can be regarded as the electronic device not performing chromaticity conversion on the first chromaticity value of the first pixel unit, and the first chromaticity value of the first pixel unit remains unchanged.
[0111] Exemplarily, if the first chromaticity value of the first pixel unit is Figure 8 the chromaticity value corresponding to point e in
[0112] Since point e is within the △DEF region, the electronic device does not perform chromaticity conversion on the chromaticity value corresponding to point e, that is, the chromaticity value of the first pixel unit in the SDR video is still the chromaticity value corresponding to point e. In this example, it can also be considered that the electronic device maps point e in the chromaticity diagram to point e', and point e' coincides with point e. If the distance value between point e and point O is denoted as x, and the distance value between point e' and point O is denoted as y, then y = x. Figure 9 Based on the examples of the above embodiments, Figure 9 shows a schematic diagram of the functional relationship of the electronic device mapping chromaticity points based on the chromaticity diagram. A chromaticity point refers to the point corresponding to a certain chromaticity value on the chromaticity diagram. Figure 9 In Figure 8 the abscissa x indicates the normalized large color gamut, represented by [0, 1 + α], and the ordinate y indicates the normalized small color gamut, represented by [0, 1]. Figure 9The line segment 2 in can be expressed as y = f(x), x ∈ (1 - β, 1 + α], indicating that within the large color gamut (the first region, i.e., the region outside △DEF and inside △A'B'C' in), the chromaticity points can be based on y = f(x) to determine the mapped points of the chromaticity points. Exemplarily, Figure 8 outside △DEF and inside △A'B'C' in), the chromaticity points within the large color gamut can be based on y = f(x) to determine the mapped points of the chromaticity points. Exemplarily, Figure 9 in, x = 1 can correspond to Figure 8 point a in; Figure 9 in, x = 1 - β can correspond to Figure 8 point d in, f(1 - β) = 1 - β indicates that point d coincides with the mapped point d', that is, the chromaticity value of point d remains unchanged; Figure 9 in, x = 1 + α can correspond to Figure 8 point c in, f(1 + α) = 1 indicates that the mapped point of point c is point d, that is, the chromaticity value of point c is converted to the chromaticity value of point d.
[0113] Based on the above S701 to S704, the electronic device can perform chromaticity conversion or not perform chromaticity conversion on the chromaticity value of each pixel unit in each frame of the HDR video, so as to obtain the chromaticity information of each frame of the converted SDR video. Since the above chromaticity conversion does not convert the chromaticity value within the large color gamut to the boundary of the small color gamut, but converts the chromaticity value within the large color gamut to within the small color gamut according to a certain proportional relationship, thus to a certain extent, the chromaticity information within the large color gamut of the images in the HDR video is converted to within the small color gamut, which can improve the picture quality effect of the converted SDR video.
[0114] Figure 10 is the flow of the video conversion method provided by the embodiment of the present application Figure 2 . As Figure 10 shown, this video conversion method can be applied to any electronic device. For example, when the electronic device is a mobile phone, this method may include:
[0115] S1001. In response to an operation of converting an SDR video to an HDR video, the electronic device obtains the third chromaticity value of the second pixel unit of the second image in the SDR video.
[0116] The SDR video obtained by the electronic device includes a plurality of consecutive frames of images. The second image is any one of the plurality of frames of images, and the second pixel unit is any pixel unit in the second image. The third chromaticity value of the second pixel unit is the original chromaticity value of the second pixel unit in the SDR video, and the third chromaticity value is any chromaticity value within the SDR color gamut.
[0117] The third chromaticity value of the second pixel unit can correspond to a certain point within the SDR color gamut in the chromaticity diagram. For example, the third chromaticity value corresponds to Figure 8 point f in the chromaticity diagram shown, and point f is within the SDR color gamut.
[0118] S1002. The electronic device determines the regional position of the third chromaticity value in the chromaticity diagram.
[0119] In some embodiments, if the electronic device determines that the third chromaticity value is within the third region of the chromaticity diagram, it performs:
[0120] S1003. The electronic device performs chromaticity conversion on the third chromaticity value based on the chromaticity diagram to obtain a fourth chromaticity value.
[0121] The fourth chromaticity value is within the first region of the chromaticity diagram. The fourth chromaticity value is the chromaticity value of the second pixel unit in the HDR video. The electronic device converts the third chromaticity value within the third region of the chromaticity diagram to the first region of the chromaticity diagram, thereby realizing the conversion of chromaticity values within a small color gamut to those within a large color gamut. The chromaticity conversion process will be described in detail below with a specific example.
[0122] Exemplarily, if the third chromaticity value of the second pixel unit is Figure 8 the chromaticity value corresponding to point f in, since point f is outside the △DEF region and inside the △ABC region, that is, point f is within the third region of the chromaticity diagram, the electronic device determines to perform chromaticity conversion on the chromaticity value corresponding to point f and maps point f to point f' outside the △ABC region and inside the △A'B'C'. Point f' is on the extension line of Of. Based on the position of point f' on the chromaticity diagram, the electronic device can obtain the chromaticity value corresponding to point f', and the chromaticity value corresponding to point f' is denoted as the fourth chromaticity value of the second pixel unit. The above process can realize the mapping of chromaticity values within a small color gamut to those within a large color gamut.
[0123] Based on the above example, the electronic device can determine the chromaticity value corresponding to point f' through the following steps.
[0124] Step 21. The electronic device obtains the connection line between point f and the white point O on the chromaticity diagram, and determines two intersection points of the connection line with the boundary of the SDR color gamut and the boundary of the HDR color gamut, denoted as point g and point h respectively.
[0125] Step 22. The electronic device obtains the distance value x2 between point f and the white point O, the distance value dis(Og) between point g and the white point O, and the distance value dis(Oh) between point h and the white point O on the chromaticity diagram.
[0126] Step 23. The electronic device determines the distance value y2 between point f' and the white point O according to the distance value x2 between point f and the white point O, the distance value dis(Og) between point g and the white point O, and the distance value dis(Oh) between point h and the white point O. Exemplarily, the electronic device determines the distance value y2 between point f' and the white point O through the following formula:
[0127] x2 = f(y2) = βy2 / (α + β) + (α - α*β) / (α + β)
[0128] Where α = dis(Oh) / dis(Og) – 1, β is a constant, for example, β is taken as 0.2.
[0129] The above formula can also be expressed as x = f -1 (y), which can be regarded as the inverse function (or called the inverse function) of the aforementioned y = f(x). Through the inverse function of y = f(x), the electronic device can determine the distance value y2 between the f’ point and the white point O.
[0130] Step 24. The electronic device determines the chromaticity value corresponding to the f’ point according to the distance value y2 between the f’ point and the white point O.
[0131] The f’ point is on the extension line of Of. The electronic device can determine the position of the f’ point on the chromaticity diagram according to the distance value y2 between the f’ point and the white point O, so as to determine the chromaticity value corresponding to the f’ point.
[0132] It should be understood that if the third chromaticity value of the second pixel unit is Figure 8 the chromaticity value corresponding to any point on the line segment ig, the electronic device can determine the corresponding mapping point of this point based on the above steps 21 to 24, so as to determine the chromaticity value corresponding to this mapping point.
[0133] Through the above steps 21 to 24, the electronic device can map the chromaticity values within the chromaticity range corresponding to the line segment ig to the chromaticity range corresponding to the line segment ih according to a certain ratio, which can be regarded as converting the chromaticity values in the small color gamut to the large color gamut, and can improve the picture quality effect of the converted HDR video.
[0134] In some embodiments, if the electronic device determines that the third chromaticity value is within the second region (including the boundary of the second region) of the chromaticity diagram, it performs:
[0135] S1004. The electronic device uses the third chromaticity value as the chromaticity value of the second pixel unit of the second image in the HDR video.
[0136] This step can be regarded as the electronic device not performing chromaticity conversion on the third chromaticity value of the second pixel unit, and the third chromaticity value of the second pixel unit remains unchanged.
[0137] Based on the above S1001 to S1004, the electronic device can perform chromaticity conversion or not on the chromaticity values of each pixel unit in each frame of the SDR video, so as to obtain the chromaticity information of each frame of the converted HDR video. The above chromaticity conversion is to convert a part of the chromaticity values in the small color gamut to the large color gamut according to a certain proportional relationship, which can improve the picture quality effect of the converted HDR video. The above processing process can be applied to video splicing as a preprocessing process for splicing multiple different types of videos.
[0138] Figure 7The chromaticity conversion of the illustrated embodiment is from a large color gamut to a small color gamut, i.e., from the BT.2020 color gamut to the BT.709 color gamut. Figure 10 The chromaticity conversion of the illustrated embodiment can be regarded as Figure 7 the reverse process of the illustrated embodiment, i.e., Figure 10 the chromaticity conversion of the illustrated embodiment is from a small color gamut to a large color gamut, i.e., from the BT.709 color gamut to the BT.2020 color gamut. Based on Figure 7 the illustrated embodiment, it is possible to convert an SDR video to an HDR video. After converting the SDR video to an HDR video, based on Figure 10 the illustrated embodiment, it is possible to restore the HDR video to the SDR video before conversion, i.e., the video conversion process is reversible.
[0139] The video conversion method proposed in the embodiments of this application can be applied to any electronic device with video processing capabilities. This electronic device can also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The electronic device can be a mobile phone with a touch screen, smart TV, wearable device, tablet computer (Pad), computer with wireless transceiver function, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, etc. The embodiments of this application do not limit the specific technologies and specific device forms adopted by the electronic device.
[0140] Exemplarily, Figure 11 is a schematic structural diagram of an electronic device provided by the embodiments of this application. As Figure 11As shown in the figure, the electronic device 100 includes: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a sensor 180, a button 190, a camera 193, and a display screen 194.
[0141] It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In some embodiments, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware.
[0142] It can be understood that the interface connection relationships between the modules illustrated in the embodiment are only illustrative descriptions and do not constitute a structural limitation on the electronic device 100. In some embodiments, the electronic device 100 may also adopt different interface connection methods or a combination of multiple interface connection methods in the above embodiments.
[0143] The processor 110 may include one or more processing units. Among them, different processing units may be independent devices or integrated in one or more processors. A memory may also be provided in the processor 110 for storing instructions and data. In the embodiments of the present application, the processor 110 can be used to call the computer program in the memory to enable the electronic device to execute the steps of the method embodiments described later, realizing the conversion between different types of videos, such as converting an HDR video to an SDR video, or converting an SDR video to an HDR video.
[0144] The USB interface 130 is an interface that conforms to the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device, can also be used for data transmission between the terminal device and peripheral devices, and can also be used to connect headphones to play audio through the headphones.
[0145] The charging management module 140 is used to receive a charging input from a charger. The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110.
[0146] The wireless communication function of the electronic device 100 can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, baseband processor, etc. The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the electronic device 100. The wireless communication module 160 can provide solutions for wireless communications such as wireless local area networks (WLAN), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), NFC, infrared technology (IR), etc. applied to the electronic device 100.
[0147] The electronic device 100 can implement the display function through the GPU, display screen 194, application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute instructions to generate or change display information.
[0148] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0149] The electronic device 100 can implement the shooting function through the image signal process (ISP) module, one or more cameras 193, video codec, GPU, one or more display screens 194, and application processor, etc. The camera 193 is used to capture static images or videos. In some embodiments, the electronic device 100 may include one or more cameras 193.
[0150] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, data files such as music, photos, videos, etc. are saved in the external memory card.
[0151] The internal memory 121 can be used to store one or more computer programs, and the one or more computer programs include instructions. The processor 110 can execute the above instructions stored in the internal memory 121, so that the electronic device 100 performs various functional applications and data processing, etc.
[0152] The sensor 180 may include one or more of the following, for example: a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, or a bone conduction sensor, etc.
[0153] In addition, on top of the above components, the electronic device also runs an operating system. For example, iOS operating system, Android operating system, or Windows operating system, etc. Application programs can be installed and run on the operating system.
[0154] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present application, taking the software system with a layered architecture as the Android system as an example, the software structure of the electronic device is illustratively described. Figure 12 This is a software architecture diagram of an electronic device provided by the embodiments of the present application. The layered architecture divides the software system of the electronic device into several layers, and each layer has a clear role and division of labor. Communication between layers is through software interfaces. Refer to Figure 12 , the electronic device includes: an applications layer (applications), an application framework layer (application framework), an Android runtime, system libraries, and a kernel layer (kernel).
[0155] The applications layer may include a gallery application and a video editing application. The gallery application stores various images or videos taken or downloaded by the user, and the videos include HDR videos and SDR videos. The video editing application provides functions including importing and exporting videos, video conversion, special effects and filters, audio editing, subtitles and titles, transition effects, and sharing videos, etc. In some embodiments, the applications layer may also include applications such as a camera, a calendar, a call, a map, a navigation, a Bluetooth, and a music application.
[0156] In the embodiments of the present application, the gallery application can call functions such as video conversion provided by the video editing application to convert the HDR video in the gallery application into an SDR video, or convert the SDR video in the gallery application into an HDR video.
[0157] The application framework layer can provide application programming interfaces (application programming interface, API) and programming frameworks for the applications in the applications layer. In the embodiments of the present application, the application framework layer may include a video processing service, and the video processing service can call the chromaticity conversion module of the system library according to the instructions issued by the video editing application to implement chromaticity conversion of video images.
[0158] The Android Runtime is responsible for the scheduling and management of the Android system. The system libraries can include multiple functional modules, for example, a chromaticity conversion module, etc. In the embodiments of the present application, a chromaticity conversion algorithm is preset in the chromaticity conversion module. The chromaticity conversion algorithm involves functions related to chromaticity conversion, such as y = f(x) and x = f -1 (y) as described in the foregoing embodiments. The chromaticity conversion module can perform chromaticity conversion on the chromaticity values of pixel units in an image based on the chromaticity conversion algorithm.
[0159] Exemplarily, in response to an operation of editing a video, for example, Figure 3 as shown in a of the figure, in response to an operation on the "Edit" control on the interface 104, the gallery application can send a message to the video editing application. The message can include the video data to be edited, such as an HDR video. After receiving the message, the video editing application imports the video data. In response to an operation of video conversion, for example, Figure 4 as shown in b of the figure, in response to an operation 1 on the selection control 2043 to convert to "ordinary video" and an operation 2 on the export control 2044, the video editing application can send a video conversion instruction to the video processing service in the application framework layer. The video conversion instruction is used to indicate converting the HDR video to an SDR video. After receiving the video conversion instruction, the video processing service can send the video conversion instruction to the chromaticity conversion module. Based on the video conversion instruction, the chromaticity conversion module executes the steps of the foregoing Figure 7 shown embodiments to implement converting the HDR video to an SDR video.
[0160] The above example shows the internal execution process of the electronic device converting the HDR video to an SDR video. This process is only an example and does not constitute a limitation on the video conversion method executed by the electronic device.
[0161] The internal execution process of the electronic device converting the SDR video to an HDR video can refer to the above example and will not be elaborated here.
[0162] The kernel layer is the layer between the hardware and the software. The kernel layer includes, for example, a display driver, a sensor driver, a camera driver, an audio driver, etc. The embodiments of the present application do not impose any limitations on this.
[0163] It can be understood that Figure 12 the modules included in each layer shown are the modules involved in the embodiments of the present application. The modules included in each layer do not constitute a limitation on the structure and module deployment hierarchy of the electronic device. In some embodiments, the electronic device can include more or fewer layers than shown, and each layer can include more or fewer components. The present application does not make any limitations.
[0164] It should be noted that in the above embodiments, the "module" may be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group of processors, etc.) for executing one or more software or firmware programs, a memory, a merged logic circuit, and / or other suitable components that support the described functions.
[0165] Therefore, the modules in the examples described in the embodiments of the present application can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software form depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0166] Based on the foregoing several embodiments, the embodiments of the present application provide a video conversion method, which can be applied to any electronic device with video processing functions. The method includes: in response to an operation of converting a high dynamic range (HDR) video into a standard dynamic range (SDR) video, the electronic device obtains a first chrominance value of a first pixel unit of a first image in the HDR video, where the first image is any frame image in the HDR video, and the first pixel unit is any pixel unit in the first image; the electronic device determines the regional position of the first chrominance value in a chromaticity diagram; if the electronic device determines that the first chrominance value is within a first region of the chromaticity diagram, the electronic device performs chrominance conversion on the first chrominance value to obtain a second chrominance value of the first pixel unit of the first image in the SDR video; the distance between the second chrominance value and the white point of the chromaticity diagram is less than the distance between the first chrominance value and the white point.
[0167] Exemplarily, with reference to Figure 8 , the first region of the chromaticity diagram refers to the region within the HDR color gamut except for the △DEF region, that is, the region within △A’B’C’ except for △DEF. Compared with the △DEF region, the first region can be regarded as a large color gamut. The first chrominance value may correspond to Figure 8 point b in, since point b is outside the △ABC region within the HDR color gamut, that is, point b is in the first region, the electronic device can map point b to point b’ based on a preset chrominance conversion algorithm. The second chrominance value may correspond to Figure 8 point b’ in. The white point is Figure 8 point O in, the distance between the second chrominance value and the white point corresponds to the distance between point b’ and point O, the distance between the first chrominance value and the white point corresponds to the distance between point b and point O, and the distance between point b’ and point O is less than the distance between point b and point O. Compared with point b, point b’ is closer to the white point.
[0168] In the above embodiments, if the electronic device determines that the chrominance value of a certain pixel unit in a certain frame of an HDR video (such as the first chrominance value mentioned above) is located within the first region of the chromaticity diagram, the electronic device performs chrominance conversion on the chrominance value of the pixel unit so that the converted chrominance value (such as the second chrominance value mentioned above) falls within the SDR color gamut in the chromaticity diagram, rather than on the boundary of the SDR color gamut. Thus, to a certain extent, the chrominance information within the large color gamut of the images in the HDR video is converted to within the small color gamut, which can improve the image quality effect of the converted SDR video.
[0169] In an alternative embodiment, the electronic device performs chrominance conversion on the first chrominance value to obtain the second chrominance value of the first pixel unit in the first image of the SDR video, including: the electronic device obtains the first connection line between the first coordinate point and the white point, determines the first intersection point of the first connection line and the SDR color gamut boundary in the chromaticity diagram, and the second intersection point of the first connection line and the HDR color gamut boundary in the chromaticity diagram; the first coordinate point is the coordinate point of the first chrominance value on the chromaticity diagram; the electronic device respectively obtains the first distance value between the first coordinate point and the white point, the second distance value between the first intersection point and the white point, and the third distance value between the second intersection point and the white point; the electronic device determines the fourth distance value according to the first distance value, the second distance value, and the third distance value, where the fourth distance value is the distance value between the second coordinate point and the white point, and the second coordinate point is the coordinate point of the second chrominance value on the chromaticity diagram; the electronic device determines the second chrominance value according to the fourth distance value.
[0170] Exemplarily, referring to Figure 8 , the first coordinate point is point b, the second coordinate point is point b', the first connection line is Ob, the SDR color gamut boundary is the boundary of △ABC, the HDR color gamut boundary is the boundary of △A'B'C', the first intersection point is point a, and the second intersection point is point c. The first distance value is the distance value between point b and point O, which can be denoted as x1, the second distance value is the distance value between point a and point O, which can be denoted as dis(Oa), the third distance value is the distance value between point c and point O, which can be denoted as dis(Oc), and the fourth distance value is the distance value between point b' and point O, which can be denoted as y1. In one example, the electronic device can determine the fourth distance value y1 through the following formula.
[0171] y1 = f(x1) = βx1 / (α + β) + (α - α*β) / (α + β)
[0172] In the formula, α = dis(Oc) / dis(Oa) - 1, and β is a constant. For example, β takes 0.2.
[0173] The above embodiments illustrate the position of the first chromaticity value in the chromaticity diagram. By means of geometric operations, it is determined to convert the first chromaticity value to the second chromaticity value. In this way, the chromaticity values in the large color gamut can be mapped to the SDR color gamut according to a certain ratio, so as to convert the chromaticity information in the large color gamut of the images in the HDR video to the small color gamut.
[0174] In an alternative embodiment, the method further includes: if the electronic device determines that the first chromaticity value is within the second region of the chromaticity diagram, the electronic device uses the first chromaticity value as the chromaticity value of the first pixel unit of the first image in the SDR video.
[0175] Exemplarily, with reference to Figure 8 , the second region of the chromaticity diagram refers to the △DEF region within the HDR color gamut. Compared with the aforementioned first region, the second region can be regarded as a small color gamut.
[0176] In the above embodiments, if the electronic device determines that the chromaticity value (such as the above-mentioned first chromaticity value) of a certain pixel unit in a certain frame of the HDR video is within the second region of the chromaticity diagram, the electronic device may not perform chromaticity conversion on the chromaticity value of this pixel unit, that is, keep the chromaticity value of this pixel unit unchanged.
[0177] In an alternative embodiment, the method further includes: in response to an operation of converting the SDR video to the HDR video, the electronic device obtains the third chromaticity value of the second pixel unit of the second image in the SDR video, where the second image is any frame of the SDR video, and the second pixel unit is any pixel unit in the second image; the electronic device determines the regional position of the third chromaticity value in the chromaticity diagram; if the electronic device determines that the third chromaticity value is within the third region of the chromaticity diagram, the electronic device performs chromaticity conversion on the third chromaticity value to obtain the fourth chromaticity value of the second pixel unit of the second image in the HDR video; the distance between the fourth chromaticity value and the white point of the chromaticity diagram is greater than the distance between the third chromaticity value and the white point.
[0178] Exemplarily, with reference to Figure 8 , the third region of the chromaticity diagram refers to the region in the SDR color gamut except the △DEF region, that is, the region in △ABC except △DEF. The third chromaticity value may correspond to Figure 8 the f point in, since the f point is outside the △DEF region in the SDR color gamut, that is, the f point is in the third region, the electronic device can map the f point to the f' point based on a preset chromaticity conversion algorithm, and the fourth chromaticity value may correspond to Figure 8 the f' point in. The distance between the fourth chromaticity value and the white point corresponds to the distance between the f' point and the O point, the distance between the third chromaticity value and the white point corresponds to the distance between the f point and the O point, and the distance between the f' point and the O point is greater than the distance between the f point and the O point. Compared with the f point, the f' point is farther from the white point.
[0179] In the above embodiments, if the electronic device determines that the chromaticity value of a certain pixel unit in a certain frame image of the SDR video (such as the above-mentioned third chromaticity value) is located within the third region of the chromaticity diagram, the electronic device performs chromaticity conversion on the chromaticity value of the pixel unit so that the converted chromaticity value (such as the above-mentioned fourth chromaticity value) falls at a position outside the SDR color gamut of the chromaticity diagram, that is, the chromaticity value within the small color gamut is converted to the large color gamut, which can improve the picture quality effect of the converted HDR video.
[0180] In an alternative embodiment, the electronic device performs chromaticity conversion on the third chromaticity value to obtain the fourth chromaticity value of the second pixel unit in the second image of the HDR video, including: The electronic device obtains the second connection line between the third coordinate point and the white point, determines the third intersection point of the second connection line and the SDR color gamut boundary in the chromaticity diagram, and the fourth intersection point of the second connection line and the HDR color gamut boundary in the chromaticity diagram; The third coordinate point is the coordinate point of the third chromaticity value on the chromaticity diagram; The electronic device respectively obtains the fifth distance value between the third coordinate point and the white point, the sixth distance value between the third intersection point and the white point, and the seventh distance value between the fourth intersection point and the white point; The electronic device determines the eighth distance value according to the fifth distance value, the sixth distance value, and the seventh distance value, where the eighth distance value is the distance value between the fourth coordinate point and the white point, and the fourth coordinate point is the coordinate point of the fourth chromaticity value on the chromaticity diagram; The electronic device determines the fourth chromaticity value according to the eighth distance value.
[0181] Exemplarily, referring to Figure 8 , the third coordinate point can be point f, the fourth coordinate point can be point f', the second connection line is Of, the SDR color gamut boundary is the boundary of △ABC, the HDR color gamut boundary is the boundary of △A'B'C', the third intersection point is point g, and the fourth intersection point is point h. The fifth distance value is the distance value x2 between point f and point O, the sixth distance value is the distance value between point g and point O, which can be denoted as dis(Og), the seventh distance value is the distance value between point h and point O, which can be denoted as dis(Oh), and the eighth distance value is the distance value y2 between point f' and point O. In one example, the electronic device determines the distance value y2 between point f' and the white point O through the following formula:
[0182] x2 = f(y2) = βy2 / (α + β) + (α - α*β) / (α + β)
[0183] In the formula, α = dis(Oh) / dis(Og) - 1, and β is a constant. For example, β is taken as 0.2.
[0184] The above embodiments show that based on the position of the third chromaticity value in the chromaticity diagram, through the formula of geometric operation, the third chromaticity value is determined to be converted to the fourth chromaticity value. In this way, the chromaticity value within the small color gamut can be mapped outside the SDR color gamut according to a certain ratio, which can improve the picture quality effect of the converted HDR video.
[0185] In an alternative embodiment, the method further includes: the electronic device determines that the third chromaticity value is within the second region of the chromaticity diagram, and the electronic device uses the third chromaticity value as the chromaticity value of the second pixel unit of the second image in the HDR video.
[0186] In the above embodiment, if the electronic device determines that the chromaticity value of a certain pixel unit in a certain frame of the SDR video (such as the above-mentioned third chromaticity value) is within the second region of the chromaticity diagram, the electronic device may not perform chromaticity conversion on the chromaticity value of the pixel unit, that is, keep the chromaticity value of the pixel unit unchanged.
[0187] In an alternative embodiment, the chromaticity diagram is a CIE1976 chromaticity diagram.
[0188] An embodiment of the present application further provides an electronic device, which includes: one or more processors and a memory. The memory is coupled to the one or more processors. The memory is used to store computer program code, and the computer program code includes computer instructions. The one or more processors call the computer instructions to cause the electronic device to execute the steps in the foregoing method embodiments. The implementation principle and technical effect are similar to those of the foregoing related embodiments and will not be elaborated here.
[0189] An embodiment of the present application further provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions to cause the electronic device to execute the steps in the foregoing method embodiments. The implementation principle and technical effect are similar to those of the foregoing related embodiments and will not be elaborated here.
[0190] An embodiment of the present application further provides a computer-readable storage medium, which includes computer instructions. When the computer instructions run on an electronic device, the electronic device is caused to execute the steps in the foregoing method embodiments. The implementation principle and technical effect are similar to those of the foregoing related embodiments and will not be elaborated here.
[0191] An embodiment of the present application further provides a computer program product, which includes computer program code. When the computer program code runs on an electronic device, the electronic device is caused to execute the steps in the foregoing method embodiments. The implementation principle and technical effect are similar to those of the foregoing related embodiments and will not be elaborated here.
[0192] The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored on or transmitted over a computer-readable medium as one or more instructions or code. A computer-readable medium can include a computer storage medium and a communication medium, and can also include any medium that can transfer a computer program from one place to another. A storage medium can be any target medium accessible by a computer.
[0193] In some embodiments, a computer-readable medium can include RAM, ROM, read-only optical discs (compact disc read-only memory, CD-ROMs) or other optical disc memories, magnetic disk memories or other magnetic storage devices, or any other medium targeted to carry or store the required program code in the form of instructions or data structures and accessible by a computer. Moreover, any connection is properly termed a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of the medium. As used herein, disk and optical disc include optical discs, laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs utilize lasers to optically reproduce data. Combinations of the above should also be included within the scope of computer-readable media.
[0194] Embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable devices to generate a machine, such that the instructions executed by the processing unit of the computer or other programmable data processing device produce means for implementing the functions specified in Figure 1 one or more of the flows or multiple flows and / or blocks Figure 1 one or more of the blocks or multiple blocks.
[0195] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0196] The above specific implementation manners have further elaborated on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above is only the specific implementation manners of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included within the protection scope of the present invention.
Claims
1. A video conversion method, characterized in that, Including: In response to an operation of converting a high dynamic range (HDR) video into a standard dynamic range (SDR) video, an electronic device obtains a first chromaticity value of a first pixel unit of a first image in the HDR video, where the first image is any frame image in the HDR video, and the first pixel unit is any pixel unit in the first image; The electronic device determines a regional position of the first chromaticity value in a chromaticity diagram; If the electronic device determines that the first chromaticity value is within a first region of the chromaticity diagram, the electronic device performs chromaticity conversion on the first chromaticity value to obtain a second chromaticity value of the first pixel unit of the first image in the SDR video; The distance between the second chromaticity value and a white point of the chromaticity diagram is less than the distance between the first chromaticity value and the white point.
2. The method according to claim 1, wherein The electronic device performing chromaticity conversion on the first chromaticity value to obtain the second chromaticity value of the first pixel unit of the first image in the SDR video includes: The electronic device obtains a first connection line between a first coordinate point and the white point, determines a first intersection point of the first connection line and an SDR color gamut boundary in the chromaticity diagram, and a second intersection point of the first connection line and an HDR color gamut boundary in the chromaticity diagram; the first coordinate point is a coordinate point of the first chromaticity value on the chromaticity diagram; The electronic device respectively obtains a first distance value between the first coordinate point and the white point, a second distance value between the first intersection point and the white point, and a third distance value between the second intersection point and the white point; The electronic device determines a fourth distance value according to the first distance value, the second distance value, and the third distance value, where the fourth distance value is a distance value between a second coordinate point and the white point, and the second coordinate point is a coordinate point of the second chromaticity value on the chromaticity diagram; The electronic device determines the second chromaticity value according to the fourth distance value.
3. The method according to claim 1 or 2, characterized in that, The method further includes: If the electronic device determines that the first chromaticity value is within a second region of the chromaticity diagram, the electronic device uses the first chromaticity value as the chromaticity value of the first pixel unit of the first image in the SDR video.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: In response to an operation of converting the SDR video into the HDR video, the electronic device obtains a third chromaticity value of a second pixel unit of a second image in the SDR video, where the second image is any frame image in the SDR video, and the second pixel unit is any pixel unit in the second image; The electronic device determines a regional position of the third chromaticity value in the chromaticity diagram; If the electronic device determines that the third chromaticity value is within a third region of the chromaticity diagram, the electronic device performs chromaticity conversion on the third chromaticity value to obtain a fourth chromaticity value of the second pixel unit of the second image in the HDR video; the distance between the fourth chromaticity value and the white point of the chromaticity diagram is greater than the distance between the third chromaticity value and the white point.
5. The method according to claim 4, wherein The electronic device performing chromaticity conversion on the third chromaticity value to obtain the fourth chromaticity value of the second pixel unit of the second image in the HDR video includes: The electronic device obtains a second connection line between the third coordinate point and the white point, determines a third intersection point of the second connection line and the boundary of the SDR color gamut in the chromaticity diagram, and a fourth intersection point of the second connection line and the boundary of the HDR color gamut in the chromaticity diagram; the third coordinate point is the coordinate point of the third chromaticity value on the chromaticity diagram. The electronic device respectively obtains a fifth distance value between the third coordinate point and the white point, a sixth distance value between the third intersection point and the white point, and a seventh distance value between the fourth intersection point and the white point. The electronic device determines an eighth distance value according to the fifth distance value, the sixth distance value, and the seventh distance value, where the eighth distance value is the distance value between a fourth coordinate point and the white point, and the fourth coordinate point is the coordinate point of the fourth chromaticity value on the chromaticity diagram. The electronic device determines the fourth chromaticity value according to the eighth distance value.
6. The method according to claim 4 or 5, characterized in that, The method further includes: The electronic device determines that the third chromaticity value is within a second region of the chromaticity diagram, and the electronic device uses the third chromaticity value as the chromaticity value of the second pixel unit of the second image in the HDR video.
7. The method according to any one of claims 1 to 6, characterized in that The chromaticity diagram is a CIE1976 chromaticity diagram.
8. An electronic device, characterized in that, The electronic device includes: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code, where the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to execute the method according to any one of claims 1 to 7.
9. A chip system, characterized in that, The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions to cause the electronic device to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions, and when the computer instructions run on an electronic device, they cause the electronic device to execute the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product includes computer program code, and when the computer program code runs on an electronic device, it causes the electronic device to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing device, image processing method, and program
CN109155060A
Image processing method and device and storage medium
CN112995615A
Video editing method and electronic equipment
CN114222187A
Image processing method and electronic equipment
CN116489377A
Video signal conversion device and program
JP2021064917A