Video editing method and electronic equipment
Through video editing methods, the format conversion and brightness adjustment of HDR and SDR videos are solved, which solves the video quality problems caused by different screen specifications of electronic devices, realizes compatibility between video formats and device screen specifications, and improves video quality and user experience.
Patent Information
- Application Number
- CN202311270771.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2043-09-27
AI Technical Summary
Different electronic devices have different screen specifications, resulting in poor video quality when collected HDR and SDR video materials. Especially ordinary video enthusiasts lack professional video editing capabilities and are difficult to deal with the problem of incompatibility of video formats.
Provided is a video editing method that triggers the process of converting video from a first video format (such as HDR) to a second video format (such as SDR) by detecting user operations, ensuring that the video format is compatible with the screen specifications of the electronic device. The specific steps include detecting user operations, performing video format conversion, adjusting the maximum brightness of the video frame, dividing the video frame areas, determining the maximum brightness of each area, and performing brightness conversion to avoid overexposure problems.
Through video format conversion and brightness adjustment, the video quality output from electronic devices is improved, ensuring that the video is displayed consistently on different devices, and improving user experience.
Smart Images

Figure CN119767076A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a video editing method and an electronic device. Background Art
[0002] The screen specifications of different electronic devices are different. For example, the screens of some electronic devices can display both HDR videos and SDR videos, while the screens of some electronic devices can only display SDR videos.
[0003] For ordinary video enthusiasts (users who do not have professional video editing skills), the sources of video materials they collect are relatively wide. For example, the video materials are video clips on the Internet, or high-dynamic range (HDR) videos or standard dynamic range (SDR) videos collected by users themselves. Since the video formats of the collected video materials are relatively complex and incompatible with the screen specifications of electronic devices, the video quality displayed by the electronic devices is poor. Summary of the invention
[0004] The embodiments of the present application provide a video editing method and an electronic device, which can convert the video format to be compatible with the screen specifications of the electronic device, thereby facilitating improving the quality of the video output by the electronic device.
[0005] In a first aspect, an embodiment of the present application provides a video editing method, the method comprising: detecting a first operation applied to a video, the first operation being used to trigger conversion of the video from a first video format to a second video format; in response to the first operation, converting the video format based on a video brightness range of the second video format to obtain a video in the second video format.
[0006] After implementing the method provided in the first aspect, the electronic device can convert the format of HDR video and SDR video based on the video brightness range corresponding to the video format to be output, unify the format of the video to be compatible with the screen specifications of the electronic device, thereby helping to improve the video quality output by the electronic device.
[0007] In combination with the first aspect, in an optional implementation, the range of brightness and darkness of colors that can be represented by the video brightness range of the first video format is greater than the range of brightness and darkness of colors that can be represented by the video brightness range of the second video format. In this way, the electronic device can convert a video in an HDR video format into a video in an SDR video format.
[0008] In combination with the first aspect, in an optional implementation, based on the video brightness range of the second video format, the video format is converted to obtain a video in the second video format, including: converting the maximum brightness of each video frame in the video into the maximum brightness of the video brightness range of the second video format to obtain a video in the second video format.
[0009] After implementing the method provided in this embodiment, when converting a video in HDR video format into a video in SDR video format, the electronic device can avoid overexposure of the SDR picture corresponding to the picture in each video frame in HDR video format by converting the maximum brightness of each video frame corresponding to the video in HDR video format into the maximum brightness of the SDR video brightness range.
[0010] In combination with the first aspect, in an optional implementation, the method further includes: dividing each video frame in the video into regions to obtain multiple regions corresponding to each video frame; determining the maximum brightness of each video frame based on the RGB value of the pixel points corresponding to each region in the multiple regions corresponding to each video frame.
[0011] After implementing the method provided in this embodiment, when converting a video in HDR video format into a video in SDR video format, the electronic device can determine the maximum brightness of each video frame corresponding to the HDR video format video, which is beneficial for facilitating brightness conversion of each video frame based on the maximum brightness of each video frame, and further, helps to avoid overexposure problems in the SDR picture corresponding to the picture in each video frame in the HDR video format.
[0012] In combination with the first aspect, in an optional implementation, based on the video brightness range of the second video format, the video format is converted to obtain a video in the second video format, including: converting the maximum brightness of each video frame in the video into the maximum brightness of the video brightness range of the second video format; determining the brightness threshold corresponding to each video frame based on the maximum brightness of each video frame after the conversion; based on the brightness of each pixel in each video frame after the conversion and the brightness threshold corresponding to each video frame, converting the brightness of each pixel in each video frame after the conversion to obtain a video in the second video format.
[0013] After implementing the method provided in this embodiment, when converting a video in HDR video format into a video in SDR video format, the electronic device can avoid overexposure of the SDR picture corresponding to the picture in each video frame in HDR video format by converting the maximum brightness of each video frame corresponding to the video in HDR video format into the maximum brightness of the SDR video brightness range; in addition, based on the brightness of each pixel in each video frame after conversion and the brightness threshold corresponding to each video frame, the brightness of each pixel in each video frame after conversion is converted again, which can effectively improve the display effect of the dark picture in each video frame after conversion.
[0014] In combination with the first aspect, in an optional implementation, based on the brightness value of each pixel in each video frame after conversion and the brightness threshold corresponding to each video frame, the brightness of each pixel in each video frame after conversion is converted to obtain a video in a second video format, including: for first-category pixel points in each video frame after conversion whose brightness value is greater than or equal to the brightness threshold corresponding to the video frame, converting the brightness of the first-category pixel points in a linear brightness conversion manner; for second-category pixel points in each video frame after conversion whose brightness value is less than the brightness threshold corresponding to the video frame, converting the brightness of the second-category pixel points in a nonlinear brightness conversion manner; and obtaining a video in a second video format based on each pixel after the brightness conversion.
[0015] After implementing the method provided in this embodiment, the electronic device re-converts the brightness of each pixel in each converted video frame through a dynamic tone mapping method, which can effectively improve the display effect of the dark part of each converted video frame.
[0016] In combination with the first aspect, in an optional implementation, based on the video brightness range of the second video format, the video format is converted to obtain a video in the second video format, including: converting the maximum brightness of each video frame in the video into the maximum brightness of the video brightness range of the second video format; determining the brightness threshold corresponding to each video frame based on the maximum brightness of each video frame after the conversion; converting the brightness of each pixel in each video frame based on the brightness value of each pixel in each video frame after the conversion and the brightness threshold corresponding to each video frame to obtain each video frame after the brightness conversion; performing brightness smoothing processing between each two adjacent video frames in the multiple video frames after the brightness conversion to obtain a video in the second video format.
[0017] After implementing the method provided in this embodiment, when converting a video in HDR video format to a video in SDR video format, the electronic device can avoid overexposure of the SDR picture corresponding to the picture in each video frame in HDR video format by converting the maximum brightness of each video frame corresponding to the video in HDR video format to the maximum brightness of the SDR video brightness range; based on the brightness of each pixel in each converted video frame and the brightness threshold corresponding to each video frame, the brightness of each pixel in each converted video frame is converted again, which can effectively improve the display effect of the dark picture in each converted video frame. In addition, the electronic device can effectively avoid the problem of unnatural brightness jumps between frames by performing brightness smoothing between two adjacent video frames, thereby making the filtering between frames more natural.
[0018] In combination with the first aspect, in an optional implementation, the brightness range of colors that can be represented by the video brightness range of the first video format is smaller than the brightness range of colors that can be represented by the video brightness range of the second video format. In this way, the electronic device can convert a video in an SDR video format into a video in an HDR video format.
[0019] In combination with the first aspect, in an optional implementation, based on the video brightness range of the second video format, the video format is converted to obtain the video in the second video format, including: based on the video brightness range of the second video format, weighted processing is performed on the brightness of each video frame in the video to obtain the video in the second video format; wherein the brightness of each pixel in each video frame after brightness weighting is within the video brightness range of the second video format.
[0020] After implementing the method provided in this embodiment, when converting a video in an SDR video format into a video in an HDR video format, the electronic device performs weighted processing on the brightness of the video frames corresponding to the video in the SDR video format based on the video brightness range of the HDR video format, thereby obtaining a video in an HDR video format.
[0021] In combination with the first aspect, in an optional implementation, the method further includes: displaying any one video frame of the video in the second video format on the first interface.
[0022] In combination with the first aspect, in an optional implementation, the method further includes: detecting a second operation acting on a save control in the first interface; and saving the video in a second video format in response to the second operation.
[0023] After implementing the method provided in this embodiment, the electronic device can detect a user operation of saving a video. In response to the operation, the electronic device can encapsulate the edited video frames into a video and save it to a local storage space for the user to browse, forward, etc. at any time.
[0024] In a second aspect, the present application provides an electronic device, comprising: 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, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute: detecting a first operation acting on a video, the first operation is used to trigger conversion of the video from a first video format to a second video format; in response to the first operation, based on a video brightness range of the second video format, converting the video format to obtain a video in the second video format.
[0025] In combination with the second aspect, in an optional implementation, the range of brightness and darkness of colors that can be represented by the video brightness range of the first video format is greater than the range of brightness and darkness of colors that can be represented by the video brightness range of the second video format.
[0026] In combination with the second aspect, in an optional embodiment, the one or more processors call the computer instructions to cause the electronic device to execute: converting the maximum brightness of each video frame in the video into the maximum brightness of the video brightness range in the second video format to obtain a video in the second video format.
[0027] In combination with the second aspect, in an optional embodiment, the one or more processors call the computer instructions to cause the electronic device to execute: divide each video frame in the video into regions to obtain multiple regions corresponding to each video frame; and determine the maximum brightness of each video frame based on the RGB values of the pixels corresponding to each region in the multiple regions corresponding to each video frame.
[0028] In combination with the second aspect, in an optional embodiment, the one or more processors call the computer instructions to cause the electronic device to execute: converting the maximum brightness of each video frame in the video into the maximum brightness of the video brightness range in the second video format; determining the brightness threshold corresponding to each video frame based on the maximum brightness of each video frame after the conversion; converting the brightness of each pixel in each video frame after the conversion based on the brightness of each pixel in each video frame after the conversion and the brightness threshold corresponding to each video frame to obtain a video in the second video format.
[0029] In combination with the second aspect, in an optional embodiment, the one or more processors call the computer instructions to cause the electronic device to execute: for the first type of pixel points in each video frame after conversion whose brightness value is greater than or equal to the brightness threshold corresponding to the video frame, converting the brightness of the first type of pixel points according to a linear brightness conversion method; for the second type of pixel points in each video frame after conversion whose brightness value is less than the brightness threshold corresponding to the video frame, converting the brightness of the second type of pixel points according to a nonlinear brightness conversion method; and obtaining a video in a second video format based on each pixel point after the brightness conversion.
[0030] In combination with the second aspect, in an optional embodiment, the one or more processors call the computer instructions to cause the electronic device to execute: converting the maximum brightness of each video frame in the video into the maximum brightness of the video brightness range in the second video format; determining the brightness threshold corresponding to each video frame based on the maximum brightness of each video frame after the conversion; converting the brightness of each pixel in each video frame based on the brightness value of each pixel in each video frame after the conversion and the brightness threshold corresponding to each video frame to obtain each video frame after brightness conversion; performing brightness smoothing processing between each adjacent two video frames in the multiple video frames after the brightness conversion to obtain a video in the second video format.
[0031] In combination with the second aspect, in an optional implementation, the range of brightness and darkness of colors that can be represented by the video brightness range of the first video format is smaller than the range of brightness and darkness of colors that can be represented by the video brightness range of the second video format.
[0032] In combination with the second aspect, in an optional embodiment, the one or more processors call the computer instructions to cause the electronic device to execute: based on the video brightness range of the second video format, weighted processing is performed on the brightness of each video frame in the video to obtain a video in the second video format; wherein the brightness of each pixel in each video frame after brightness weighting is within the video brightness range of the second video format.
[0033] In combination with the second aspect, in an optional implementation, the one or more processors call the computer instruction to cause the electronic device to execute: displaying any one video frame in the video in the second video format on the first interface.
[0034] In combination with the second aspect, in an optional implementation, the one or more processors call the computer instructions to cause the electronic device to execute: detecting a second operation acting on a save control in the first interface; and saving a video in a second video format in response to the second operation.
[0035] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a touch screen, a camera, one or more processors and one or more memories; the one or more processors are coupled to the touch screen, the camera, and the one or more memories, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect or any optional implementation method of the first aspect.
[0036] In a fourth aspect, the present application provides a chip system, which is applied to a device, and the chip system includes one or more processors, which are used to call computer instructions so that the device executes the method described in the first aspect or any optional embodiment of the first aspect.
[0037] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a device, enables the electronic device to execute a method as described in the first aspect or any optional implementation of the first aspect.
[0038] In a sixth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, causes the electronic device to execute a method as described in the first aspect or any optional embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1A This is a schematic diagram of mixing and editing an HDR video and an SDR video to output an SDR video provided by an embodiment of the present application;
[0040] Figure 1B This is a schematic diagram of a mixed editing of HDR video and SDR video and outputting HDR video provided by an embodiment of the present application;
[0041] Figure 2A-2H is a set of user interface schematic diagrams provided in an embodiment of the present application;
[0042] Figure 3 is a schematic diagram of a software architecture of an electronic device 100 provided in an embodiment of the present application;
[0043] Figure 4 It is a flowchart of a video editing method provided in an embodiment of the present application;
[0044] Figure 5 This is a flow chart of an electronic device 100 performing format conversion on an HDR video frame provided by an embodiment of the present application;
[0045] Figure 6This is a schematic diagram of a partition statistical brightness information provided by an embodiment of the present application;
[0046] Fig. 7A It is a schematic diagram of light-to-light conversion based on brightness statistics provided by an embodiment of the present application;
[0047] Figure 7B It is a schematic diagram of light-to-light conversion based on fixed brightness;
[0048] Figure 8 This is a comparison diagram of the effects of performing light-to-light conversion based on brightness statistics and performing light-to-light statistics based on fixed brightness, provided in an embodiment of the present application;
[0049] Fig. 9A is a schematic diagram of a dynamic TM OOTF provided in an embodiment of the present application;
[0050] Fig. 9B It is a schematic diagram of a linear OOTF;
[0051] Fig.10 This is a comparison diagram of the effects of performing dynamic TMOOTF and linear OOTF on a video frame after a first brightness conversion, provided by an embodiment of the present application;
[0052] Fig.11 It is a visualization schematic diagram of a group of dynamic TM curves with different brightness provided in an embodiment of the present application;
[0053] Fig.12 This is a comparison diagram of the effects before and after brightness smoothing processing is performed between adjacent video frames provided by an embodiment of the present application;
[0054] Fig.13 It is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiments may be included in at least one embodiment of the present embodiment application. The appearance of this phrase in various positions in the specification is not necessarily the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0056] First, some concepts involved in this application are explained.
[0057] 1. SDR Video
[0058] In SDR video, the bit depth for color is 8 bits. Bit depth refers to the method by which electronic devices use "bits" to record the color of digital images. A bit depth of 8 bits means that the number of bits used by electronic devices is 8, and electronic devices can use these 8 bits to represent 2 8 (256, 0-255) colors.
[0059] The BT709 color gamut is used in SDR videos, where the color gamut represents the range of colors that can be displayed when encoding the video.
[0060] 2. HDR Video
[0061] HDR video uses a wider range of colors and brightness than ordinary videos, which can improve the contrast between light and dark in video images and present a more realistic picture effect. There are several main HDR video formats: HDR10, HDR10+ and Dolby Vision.
[0062] Among them, in HDR10, the bit depth for representing color is 10 bits. The bit depth of 10 bits can indicate that the number of bits used by the electronic device is 10, and the electronic device can use these 10 bits to represent 2 10 (1024, 0-1023) colors. The peak brightness of HDR10 is 1000 nits to 4000 nits. HDR10 video uses the BT2020 color gamut. HDR10 only requires static metadata, and only needs to obtain the highest peak brightness of the image to determine the dynamic range of the entire image. Among them, metadata refers to "intermediary data" or "data packet". Usually, a metadata records multiple specific data information. A video contains multiple metadata information.
[0063] HDR10+ updates HDR10 by adding dynamic metadata, which can be used to more accurately adjust the brightness levels of HDR on a scene-by-scene or frame-by-frame basis. However, the bit depth for representing colors in HDR10+ is still 10 bits, and the BT2020 color gamut is still used.
[0064] In Dolby Vision, the color bit depth is 12 bits, the peak brightness is 4000 nit, and the metadata used is dynamic metadata.
[0065] In addition, the HDR Vivid standard was created in China. Compared with SDR video, the highlight brightness of HDR Vivid video is 40 times that of SDR video. HDR Vivid technology uses intelligent calculations to enable different electronic devices to present the best viewing effect. Whether it is a TV, computer, or other electronic devices such as mobile phones and mobile tablets, lighting up HDR Vivid activates the entire screen, allowing the picture to present richer colors and details.
[0066] To sum up, the color gamut used by HDR video is wider than that used by SDR video, and the colors are richer and the details are richer.
[0067] The screen specifications of different electronic devices are different. For example, the screens of some electronic devices can display both HDR videos and SDR videos, while the screens of some electronic devices can only display SDR videos.
[0068] For professional video producers, they usually use electronic devices that support shooting HDR videos to shoot high dynamic range HDR videos. Later, when editing the shot HDR videos, they usually edit them frame by frame to obtain high-quality edited HDR videos and / or highly compatible edited SDR videos.
[0069] However, for ordinary video enthusiasts (users who do not have professional video editing capabilities or professional equipment), the sources of video materials they collect are relatively wide. For example, the video materials are video clips on the Internet (such as SDR video, HDR 10 video, HDR10+ video, HDR Vivid video, Dolby Vision, etc.), or HDR video or SDR video collected by themselves.
[0070] After collecting the video materials, these users usually edit the collected video materials so that the edited videos can better meet the personalized needs of the users. For example, in response to the user's operation of mixing and editing the HDR video collected by the user (recorded as HDR video 1) and the SDR video clip on the network (recorded as SDR video 1), the electronic device 100 mixes and edits the HDR video 1 and the SDR video 1 to obtain the edited video.
[0071] However, if the edited video is an HDR video, and the electronic device 100 can only display SDR videos, then the edited video is incompatible with the screen of the electronic device 100, so that the visual effect of the picture presented by the electronic device 100 is poor. If the edited video is an SDR video, and the electronic device 100 can display HDR videos, the quality of the edited video presented in the electronic device 100 is poor, thereby reducing the user experience.
[0072] In order to solve the above problems, an embodiment of the present application provides a video editing method, which can be applied to electronic devices with image processing capabilities.
[0073] By implementing the video editing method provided in the embodiment of the present application, the electronic device 100 can input HDR video and SDR video into a video editor, and convert the format of the HDR video and the SDR video based on the video brightness range corresponding to the video format to be output, and unify the format of the video to be compatible with the screen specifications of the electronic device 100, thereby facilitating maintaining or improving the video quality output by the electronic device 100.
[0074] The video editing method provided in the embodiment of the present application can be applied to a variety of scenarios. Figure 1A and Figure 1B , the application scenarios of the video editing method provided in the embodiments of the present application are introduced.
[0075] See also Figure 1A , Figure 1A Schematic diagram of a mixed editing of HDR video and SDR video and output of SDR video provided by an embodiment of the present application. Figure 1A As shown, the electronic device 100 can detect a mixed editing operation for SDR video, HDR10 / 10+ video, HDRVivid video and Dolby Vision video. In response to the operation, the HDR video data (i.e., HDR10 / 10+ video, HDRVivid video and Dolby Vision video) with a bit depth of 10-bit or 12-bit and a color gamut of BT2020 format (i.e., HDR10 / 10+ video, HDRVivid video and Dolby Vision video) is converted into 8-bit, BT709 format SDR video data; the 8-bit, BT709 format SDR video data is rendered, thereby displaying the edited SDR video data in the main interface of the video editor.
[0076] See also Figure 1B , Figure 1B FIG. 1 is a schematic diagram of a mixed editing of HDR video and SDR video and outputting HDR video provided by an embodiment of the present application. Figure 1BAs shown, the electronic device 100 can detect mixed editing operations for SDR video, HDR10 / 10+ video, HDRVivid video and Dolby Vision video, and in response to the operation, use the clip APK (video editor) to convert 8-bit, BT709 format SDR video data into 10-bit or 12-bit, BT2020 format HDR video data; render the 10-bit or 12-bit, BT2020 format HDR video data, and display the edited HDR video data in the main interface of the video editor.
[0077] The following example takes the scene of mixing HDR video and SDR video and outputting SDR video as an example. Figure 2A-2H The application scenarios of the video editing method provided in the embodiments of the present application are introduced. Figure 2A-2H This is a set of user interface schematic diagrams provided in an embodiment of the present application.
[0078] Figure 2A This is a user interface for displaying installed application icons on an electronic device 100 provided in an embodiment of the present application, namely, a home page. Figure 2A As shown, the main page displays multiple application icons, such as a "clock" application icon, a "calendar" application icon, a "weather" application icon, and the like.
[0079] The multiple application icons in the main page include a "Gallery" application (hereinafter referred to as "Gallery") icon, namely icon 111. The electronic device 100 can detect a user operation on icon 111. The operation is, for example, a click operation, a long press operation, etc. In response to the operation, the electronic device 100 can display Figure 2B The user interface shown.
[0080] Figure 2B It is the main interface of the "Gallery" when the "Gallery" is run on an electronic device 100 provided in an embodiment of the present application. The interface can display one or more pictures or videos. Among them, the one or more videos include HDR10 video, HDR10+ video, HDR Vivid video, Dolby Vision video, SDR video and other types of videos, such as LOG video. The above-mentioned LOG video refers to a low-saturation, low-brightness video shot in LOG mode, which can also be called a LOG gray film.
[0081] like Figure 2BAs shown, the video indicated by icon 121 may be an SDR video; the video indicated by icon 122 may be an HDR10 video. When the electronic device 100 displays an HDR10 video or an SDR video, the icon indicating the video may display the type of the video. In this way, the user can understand the type of the video through the information displayed in the icon. For example, SDR is displayed in the lower left corner of icon 121; HDR10 is displayed in the lower left corner of icon 122. Figure 2B The video not marked in the lower left corner is a LOG video.
[0082] The electronic device 100 may detect a user operation on the icon 121, and in response to the operation, the electronic device 100 may display Figure 2C The user interface shown in FIG. 1 shows a schematic diagram of an exemplary user interface of an icon 121. The user operation acting on the icon 121 is, for example, a long press operation.
[0083] Figure 2C This is a user interface for displaying and selecting a certain picture or video provided by an electronic device 100 in an embodiment of the present application. Figure 2C As shown, in the user interface, the lower right corner of each picture or video may include a selection window "○". The selection window may be used to receive a user's operation of confirming and editing the picture or video corresponding to the icon.
[0084] For example, in Figure 2B In the example, the user long presses the SDR video indicated by icon 121. Then, Figure 2B A “○” will appear in the lower right corner of all pictures or videos, showing Figure 2C The user interface shown. At this time, the electronic device 100 can detect the selection operation applied to the selection window, and in response to the selection operation, mark “√” in the selection window. For example, after the electronic device 100 detects the selection operation applied to the selection window “○” 131 at the lower left corner of the icon 121 by the user, it can mark “√” in “○” 131. Thereafter, after the electronic device 100 detects the selection operation applied to the selection window “○” 132 at the lower left corner of the icon 122 by the user, it can mark “√” in “○” 132. At this time, the electronic device 100 can display the following Figure 2D The user interface shown.
[0085] Figure 2D This is a user interface of an electronic device 100 provided in an embodiment of the present application for displaying that a certain picture or video has been selected. Figure 2D As shown, the user interface also includes a sharing control 141 , a favorite control 142 , an editing control 143 , a deletion control 144 and the like.
[0086] The sharing control 141 can be used to send one or more pictures or videos in the user interface to other applications for use. For example, after detecting a user operation on the sharing control, in response to the operation, the electronic device 100 can display one or more application icons, and the icons of the one or more applications include icons of social software A (such as QQ, WeChat, etc.). After detecting an application icon acting on social software A, in response to the operation, the electronic device 100 can send video A to social software A, and further, the user can share the above video with friends through the social software.
[0087] The favorites control 142 can be used to mark a video. Figure 2D In the user interface shown, when a user operation acting on the favorite control is detected, in response to the operation, the electronic device 100 may mark at least one selected video (e.g., video A) as a favorite video of the user. The electronic device 100 may generate an album for displaying videos marked as favorite videos of the user. In this way, when video A is marked as a favorite video of the user, the user can quickly view video A through the album displaying the favorite videos of the user.
[0088] The delete control 144 may be used to delete a video that the user has selected.
[0089] The editing control 143 is used to receive the user's operation of editing the video (or picture) and display the user interface for editing the video (or picture). For example, after "√" is displayed in "○" 131 and "√" is displayed in "○" 132, the electronic device 100 can receive the user's operation on the editing control 143, and in response to the operation, the electronic device can display Figure 2E The user interface shown.
[0090] Figure 2E This is a user interface for a user to edit a video (or picture) provided in an embodiment of the present application. Figure 2E As shown, the user interface may include window 151 , window 152 , operation bar 153 , and operation bar 154 .
[0091] Window 151 can be used to display a preview image of the edited video. Generally, window 151 will display the cover video frame of the video. When a user operation acting on play button 155 is detected, window 151 can sequentially display the video frame stream of the video, that is, play the video.
[0092] Window 152 may be used to display a video frame stream of the edited video. The user may drag window 152 to adjust the video frame displayed in window 151. Specifically, Figure 2EA ruler 157 is also displayed in the window 151. The electronic device 100 can detect a user operation of sliding left or right on the window 152. In response to the above user operation, the position of the video frame stream where the ruler 157 is located is different. At this time, the electronic device 100 can display the video frame where the current ruler 157 is located in the window 151. The video frame where the current ruler 157 is located can be a video frame of the SDR video indicated by the icon 121, or a video frame of the HDR10 video indicated by the icon 122.
[0093] The operation bar 153 and the operation bar 154 may display icons of multiple video editing operations. Generally, an icon displayed in the operation bar 153 indicates a major category of editing operations. The operation bar 154 may display video editing operations belonging to the major category of operations currently selected in the operation bar 153. For example, the operation bar 153 includes "Conversion". The bold "Conversion" may indicate that the type of video editing operation currently selected by the user is "Conversion". At this time, the operation bar 154 displays some operations belonging to the "Conversion" category, such as "HDR10 to SDR", "HDR10+ to SDR", "SDR to HDR10", etc.
[0094] The operation bar 153 also includes “Clip”, “Filter”, “Stickers” and the like.
[0095] The user interface also includes a save control 156. When a user operation acting on the save control 156 is detected, the electronic device 100 can save the video in the current state in response to the operation. The video in the current state can be a video with an editing operation added or a video without an editing operation.
[0096] The electronic device 100 may detect a user operation on the “HDR10 to SDR” control, and in response to the operation, the electronic device 100 may convert the video frames of the HDR10 video in the window 152 into SDR video frames.
[0097] After converting the HDR10 video into an SDR video, the electronic device 100 may detect a user operation on the save control 156 and save the SDR video in response to the user operation.
[0098] Optionally, after converting the HDR10 video to an SDR video, the electronic device 100 may further detect an editing operation performed by the user on the operation bar 153 and / or other controls in the operation bar 154, and in response to the editing operation, display the edited video in the window 151. For example, the electronic device 100 may detect a user operation performed on the "sticker" control in the operation bar 153, and in response to the operation, the electronic device 100 may display the Figure 2F The user interface shown.
[0099] Figure 2F The electronic device 100 provided in the embodiment of the present application displays a user interface for adding stickers to a video. Figure 2F As shown, "Stickers" includes multiple sticker options. Each sticker option corresponds to a sticker with a different screen display effect. The user can select one of the multiple stickers provided by the electronic device 100. In response to the user operation of selecting a sticker, the electronic device 100 can perform the image processing indicated by the sticker selected by the user on the edited video, so that the screen of the processed video has a display effect consistent with the display effect of the sticker.
[0100] like Figure 2F As shown, a plurality of sticker controls may be displayed in the sticker selection interface, such as sticker control 161, sticker control 162, sticker control 163, sticker control 164, sticker control 165, etc. Each of the above sticker controls indicates an image processing method for rendering an image using stickers.
[0101] When a user operation on a sticker control is detected, in response to the operation, the electronic device 100 may display the sticker selected by the user in the window 151. For example, the electronic device 100 detects a user operation on the sticker control 162, and in response to the operation, the electronic device 100 may display the sticker selected by the user in the window 151. Figure 2G The user interface shown.
[0102] Figure 2G The electronic device 100 provided in the embodiment of the present application displays a user interface for adding stickers to a video. Figure 2G As shown, a heart display effect indicated by the sticker control 162 is displayed in the window 151 .
[0103] The user interface also includes a confirmation control 158 ("√") and a cancel control 159 ("ⅹ"). When it is determined that the currently selected sticker meets the user's needs, the user can click the confirmation control 158. Of course, when it is determined that the currently selected sticker does not meet the user's needs, the user can click other sticker controls to select other stickers. In response to the user operation acting on any sticker control, the electronic device 100 can display a video after adding the stickers indicated by any of the above sticker controls in window 151. When none of the stickers provided by the electronic device 100 meet the user's needs, or when the user pauses adding stickers, the user can click the cancel control 159.
[0104] like Figure 2G As shown, the electronic device 100 may detect a user operation on the save control 156, and in response to the operation, the electronic device 100 may perform an operation of saving the edited SDR video. After the saving is completed, the electronic device 100 may display Figure 2H At this time, the video displayed in window 171 is the edited SDR video obtained by editing the SDR video indicated by the aforementioned icon 121 and the HDR10 video indicated by the icon 122.
[0105] Implementation Figure 2A-2H According to the method, the user can convert the HDR video into the SDR video during the mixed editing of the SDR video and the HDR video, thereby obtaining a highly compatible edited SDR video. In this way, not only can the display effect of the edited SDR video be guaranteed, but the edited SDR video can also be normally displayed in electronic devices that can only display SDR videos.
[0106] The electronic device 100 is described below. Figure 2A-2H The specific process of video editing capabilities is shown.
[0107] First, see Figure 3 , Figure 3 It is a schematic diagram of the software architecture of an electronic device 100 provided in an embodiment of the present application.
[0108] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.
[0109] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0110] The application layer can include a series of application packages. Figure 3 As shown, the application package may include applications such as camera, gallery, video, music, navigation, calendar, map, WLAN, etc. In the embodiment of the present application, the application layer also includes a video editing application. The video editing application has video data processing capabilities and can provide users with video editing functions, including video data processing such as format conversion, cropping, rendering, and adding materials. Figure 2E-2H The user interface shown may be considered as the user interface provided by the above-mentioned video editing application.
[0111] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0112] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0113] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0114] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0115] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0116] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0117] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0118] In the embodiment of the present application, the application framework layer also includes a media framework. The media framework provides a plurality of tools for editing video and audio. Among them, the above tools include encoders and decoders.
[0119] Among them, the encoder can convert one form of video or audio input to the encoder into another form through compression technology, and the decoder performs the reverse process of encoding and can convert one form of video or audio input to the decoder into another form through decompression technology.
[0120] For example, the video input to the decoder may be an HDR video, which is composed of N video frames with a color gamut of BT2020, where N is a positive integer greater than 1. After receiving the above HDR video, the decoder may split the video composed of the N video frames with a color gamut of BT2020 into N independent video frames, so that the subsequent electronic device 100 can perform image processing on each video frame.
[0121] For another example, the video input to the decoder may be an SDR video, which is composed of M video frames with a BT709 color gamut, where M is a positive integer greater than 1. After receiving the SDR video, the decoder may split the video composed of the M video frames with a BT709 color gamut into M independent video frames, so that the electronic device 100 can subsequently perform image processing on each video frame.
[0122] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system. The core library contains two parts: one is the function that the Java language needs to call, and the other is the Android core library.
[0123] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0124] The system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.
[0125] The Open Graphics Library (OpenGL) provides multiple image rendering functions that can be used to draw simple graphics to complex three-dimensional scenes. In the embodiment of the present application, the OpenGL provided by the system library can be used to divide the texture corresponding to the video frame into multiple sub-areas, for example, 50*50=2500 sub-areas, and perform statistics on the brightness of each sub-area.
[0126] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0127] See also Figure 4 , Figure 4 1 is a flow chart of a video editing method provided by an embodiment of the present application. Figure 2A-2H The user interface shown and Figure 3 The software architecture of the electronic device 100 is shown to introduce the process of the video editing method provided in the embodiment of the present application.
[0128] S401: The electronic device 100 determines a video to be edited selected by a user.
[0129] The video to be edited selected by the user includes one or more videos, and the one or more videos may be HDR videos and / or SDR videos.
[0130] When displaying image resources such as pictures and videos stored in the gallery for users to browse, the electronic device 100 can display an editing control. The editing control can provide users with a service for editing the currently displayed image resources. The video editing method provided in the embodiment of the present application is mainly applied to video image resources. The subsequent embodiments will take video as an example to introduce the video editing method provided in the embodiment of the present application.
[0131] refer to Figure 2B The user interface shown in FIG. 1 shows an example of an electronic device 100. The electronic device 100 can detect a user operation on the icon 121 and display the user operation in response to the operation. Figure 2C The user interface shown.
[0132] Take the video to be edited as an example, refer to Figure 2C In the user interface shown in FIG. 1 , the electronic device 100 may detect a selection operation on the selection window “○” 131 at the lower left corner of the icon 121, and in response to the selection operation, mark “√” in “○” 131. Afterwards, the electronic device 100 may also detect a selection operation on the selection window “○” 132 at the lower left corner of the icon 122, and in response to the selection operation, mark “√” in “○” 132. At the same time, the electronic device 100 may display the following: Figure 2DAt this time, the electronic device 100 may determine that the video to be edited selected by the user is the SDR video indicated by the icon 121 and the HDR10 video indicated by the icon 122 .
[0133] Afterwards, refer to Figure 2D The user interface shown in FIG. 14 shows an example of an electronic device that can detect a user operation on the editing control 143 and, in response to the operation, display the user operation. Figure 2E The user interface shown.
[0134] S402: The electronic device 100 decodes the video to be edited to obtain a video frame to be edited.
[0135] After detecting the user operation on the editing control 143, the electronic device 100 may initialize the video editing environment. Initializing the video editing environment means creating or applying for tools and storage space required for video editing so that the electronic device 100 can perform data processing for video editing.
[0136] Initializing the video editing environment includes: creating a decoder and OpenGL. The decoder can be used to split the video to be edited into a sequence of video frames; OpenGL can be used to adjust the video frame and / or modify the pixels in the video frame to change the image content included in the video, that is, render the video frame. The above-mentioned adjustment of the video frame includes adjusting to increase or decrease the video frame and modifying the size of the video frame.
[0137] The electronic device 100 may use a decoder to decode the determined SDR video and HDR10 video to obtain an SDR video frame sequence and an HDR10 video frame sequence. Figure 2C After the selection operation of the selection window “○” in the lower left corner of the icon 122 in the user interface shown, in response to the selection operation, the HDR10 video indicated by the icon 122 is decoded using a decoder to obtain an HDR10 video frame sequence.
[0138] S403: The electronic device 100 converts N video frames in the first video format in the video frames to be edited into N video frames in the second video format based on the video brightness range of the second video format.
[0139] refer to Figure 2E In the user interface shown, window 151 can provide the user with a way to browse image resources stored in the electronic device 100; the conversion control in the operation bar 153 can provide the user with a video format conversion service. Window 152 displays the video frame stream of the video to be edited. At this time, window 152 displays the video frame stream of the SDR video corresponding to the aforementioned icon 121 and the video frame stream of the HDR10 video corresponding to the icon 122.
[0140] The following takes the first video format as HDR and the second video format as SDR as an example to explain how the electronic device 100 converts a video frame in the first video format in the video to be edited into a video frame in the second video format based on the video brightness range of the second video format. In this case, the brightness range of the color that can be represented by the video brightness range of the first video format is greater than the brightness range of the color that can be represented by the video brightness range of the second video format.
[0141] After detecting the user operation acting on the operation bar 153, in response to the operation, the electronic device 100 can perform different editing strategies on the video to be edited to meet the personalized needs of the user. For example, the electronic device 100 can detect the left sliding operation acting on the window 152, and in response to the operation, the HDR10 video frame is displayed in the window 151. Then, the electronic device 100 can detect the user operation acting on the conversion control in the operation bar 153, and in response to the operation, the operation belonging to the "conversion" category is displayed in the operation bar 154, such as "HDR10 to SDR", "HDR10+ to SDR", "SDR to HDR10", etc. Afterwards, the electronic device 100 can detect the user operation acting on the "HDR10 to SDR" control, and in response to the operation, the HDR10 video frame is format converted to obtain an SDR video frame.
[0142] For details, see Figure 5 , Figure 5 This is a flowchart of an electronic device 100 performing format conversion on an HDR video frame provided in an embodiment of the present application. Figure 5 (1) to (3) in FIG. 1 show the process of the electronic device 100 converting the HDR video frame into the SDR video frame.
[0143] First, (1) the electronic device 100 can process each video frame (HDR video frame) of the N video frames corresponding to the HDR video frame sequence to obtain the normalized electronic RGB texture corresponding to the video frame (HDR video frame) and the frame light information of the video frame. Specifically, the electronic device 100 can first use Surface Texture to obtain the image frame in the HDR10 video frame sequence. Among them, Surface Texture is a combination of Surface and OpenGL ES (GLES) texture, which can be used to capture video frames in a video frame stream, and the video frame stream can be a camera preview or video decoding data. Then, the electronic device 100 uses a sampler Sampler to sample the video frame to obtain the pixel information of the video frame. After that, the pixel information of the video frame is processed by the normalized electronic RGB texture (Normalized Ellectronic RGB Texture) to obtain the normalized electronic RGB texture; and the frame light information (or brightness information) of the video frame is calculated to obtain the light information of the video frame.
[0144] Secondly, (2) the electronic device 100 uses an electro-optical transfer function (EOTF) to convert the normalized electronic RGB texture into an optical signal, and normalizes the optical signal to obtain a normalized optical signal. Among them, EOTF is a key technology in the HDR technical standard, and is a mathematical function that maps mathematically encoded pixel values to display brightness. In other words, an ETOF defines how the mathematically encoded pixel values in an image are displayed as visible light by a display or projector. HDR EOTF is mainly divided into hybrid log-gamma (HLG) EOTF and perceptual quantizer (PQ) EOTF.
[0145] After obtaining the normalized optical signal of the video frame, (3) the electronic device 100 can convert the video frame into an SDR video frame through a tone mapping (TM) method based on the SDR video brightness range.
[0146] Specifically, the electronic device 100 can perform brightness statistics on the video frame to determine the maximum brightness of the video frame; then, convert the maximum brightness of the video frame into the maximum brightness of the SDR video brightness range to obtain the video frame after the first brightness conversion.
[0147] In an embodiment of the present application, when the electronic device 100 performs brightness statistics on the video frame and determines the maximum brightness of the video frame, it can divide the texture of the normalized optical signal of the video frame into multiple sub-regions through Open GL, such as 50*50=2500 sub-regions, and determine the maximum brightness of the video frame based on the RGB value of the pixel point corresponding to each sub-region.
[0148] See also Figure 6 , Figure 6 Schematic diagram of a partition statistical brightness information provided by an embodiment of the present application. Figure 6 As shown, the electronic device 100 can divide the video frame into 50 parts at equal intervals in the horizontal direction and 50 parts at equal intervals in the vertical direction, thereby forming 50*50=2500 rectangular areas. In other words, the electronic device 100 can divide the video frame into 50*50=2500 sub-areas. Each sub-area is replaced by a pixel point, so that the video frame is sampled into a set of 2500 pixels. Optionally, the RGB value of the pixel point corresponding to each sub-area can be the average value of R, G, B in the sub-area, or the maximum value of R, G, B in the sub-area.
[0149] Optionally, when the electronic device 100 determines the maximum brightness of the video frame based on the RGB values of the pixels corresponding to each sub-region, the following formula (1) may be used.
[0150] result=avg(top20max(R,G,B) / 2500max(R,G,B))(1)
[0151] In formula (1), result represents the maximum brightness of the video frame; max(R,G,B) represents the maximum value of the R,G,B values of each sub-region, which is used to replace the RGB value of the pixel corresponding to each sub-region; 2500max(R,G,B) represents the RGB value of the pixel corresponding to each of the 2500 sub-regions; top20max(R,G,B) represents the RGB value of the top 20 sub-regions among the 2500 sub-regions; avg() represents the averaging function.
[0152] In the embodiment of the present application, the electronic device 100 converts the maximum brightness of the video frame into the maximum brightness of the SDR video brightness range, which may be to convert the maximum brightness of the video frame into 1.
[0153] For example, see Fig. 7A , Fig. 7A Schematic diagram of a light-to-light conversion based on brightness statistics provided by an embodiment of the present application. Fig. 7AAs shown, the abscissa represents the absolute brightness of the HDR picture, and the ordinate represents the relative brightness of the SDR picture. The electronic device 100 can convert the maximum brightness of the video frame obtained based on brightness statistics (the maximum value of the absolute brightness corresponding to the HDR picture) into the relative brightness 1 of the SDR. The electronic device 100 can use the optical to optical transfer function (OOTF) to convert the maximum brightness of the video frame into the relative brightness 1 of the SDR. The OOTF is a mathematical function that maps the brightness of the captured scene to the brightness of the display.
[0154] See also Figure 7B , Figure 7B This is a schematic diagram of light-to-light conversion based on fixed brightness. Figure 7B As shown in the figure, the abscissa represents the absolute brightness of the HDR picture, and the ordinate represents the relative brightness of the SDR picture. The electronic device 100 can convert the picture with a brightness of 1000 nit in the HDR video frame into a relative brightness of 1 in the SDR. In this way, the SDR picture corresponding to the picture with a brightness exceeding 1000 nit in the HDR video frame is overexposed, and the SDR picture corresponding to the picture with a brightness less than 1000 nit in the HDR video frame is too dark.
[0155] See also Figure 8 , Figure 8 : is a comparison diagram of the effects of performing light-to-light conversion based on brightness statistics and performing light-to-light statistics based on fixed brightness provided by an embodiment of the present application. Figure 8 (a) is the image after light-to-light conversion based on a fixed brightness of 1000 nit. Figure 8 (b) is a picture after light-to-light conversion based on brightness statistics. It can be seen that the electronic device 100 converts the maximum brightness of the video frame obtained based on brightness statistics into the SDR relative brightness 1. Compared with the method of converting the fixed brightness (such as 1000nit) of the video frame into the SDR relative brightness 1, the overexposure problem of the SDR picture corresponding to the picture with brightness exceeding 1000nit in the video frame can be avoided.
[0156] After converting the maximum brightness of the video frame into the relative brightness 1 of SDR, the electronic device 100 obtains the video frame after the first brightness conversion. At this time, the video format of the video frame after the first brightness conversion is SDR.
[0157] Afterwards, the electronic device 100 can also determine the brightness threshold corresponding to the video frame after the first brightness conversion based on the maximum brightness of the video frame; based on the brightness value of each pixel in the video frame after the first brightness conversion and the brightness threshold corresponding to the video frame, convert the brightness of each pixel to obtain the video frame after the second brightness conversion.
[0158] Optionally, when the electronic device 100 determines the brightness threshold corresponding to the video frame after the first brightness conversion based on the maximum brightness of the video frame, the following formula (2) may be used.
[0159]
[0160] In formula (2), L represents the maximum brightness of the video frame; z represents the brightness threshold corresponding to the video frame after the first brightness conversion.
[0161] Optionally, the electronic device 100 converts the brightness of each pixel in the video frame after the first brightness conversion based on the brightness of each pixel and the brightness threshold corresponding to the video frame to obtain the video frame after the second brightness conversion, which may include: for the first type of pixel whose brightness is greater than or equal to the brightness threshold in the video frame after the first brightness conversion, converting the brightness of the first type of pixel in accordance with a linear brightness conversion method; for the second type of pixel whose brightness is less than the brightness threshold in the video frame after the first brightness conversion, converting the brightness of the second type of pixel in accordance with a nonlinear brightness conversion method; based on each pixel after the brightness conversion, obtaining the video frame after the second brightness conversion. Wherein, the video format of the video frame after the second brightness conversion is SDR.
[0162] Specifically, the electronic device 100 may use the following formula (3) to convert the brightness of each pixel in the video frame after the first brightness conversion.
[0163]
[0164] In formula (3), x represents the value after normalizing the pixel values of the three channels R, G, and B of a certain pixel point in the video frame, that is, the three pixel values of the three channels R, G, and B correspond to one f(x) respectively; z represents the brightness threshold corresponding to the video frame after the first brightness conversion; f(x) represents the brightness after the brightness conversion of the pixel value x of the pixel point.
[0165] The above method of converting the brightness of each pixel in the video frame after the first brightness conversion using formulas (2) and (3) can also be called dynamic TM OOTF. That is, the electronic device 100 can perform another brightness conversion on the brightness of each pixel in the video frame after the first brightness conversion using the dynamic TM OOTF method.
[0166] See also Fig. 9A , Fig. 9A FIG. 1 is a schematic diagram of a dynamic TM OOTF provided in an embodiment of the present application. Fig. 9A As shown in the figure, the abscissa represents the absolute brightness of the HDR picture, and the ordinate represents the relative brightness of the SDR picture. Assuming that the maximum brightness of the video frame obtained by the electronic device 100 based on brightness statistics is 4000 nits, based on the above formulas (2) and (3), it can be obtained that the HDR absolute brightness of 400 nits can be converted into the SDR relative brightness of 0.136.
[0167] See also Fig. 9B , Fig. 9B is a schematic diagram of a linear OOTF. Fig. 9B As shown in the figure, the horizontal axis represents the absolute brightness of the HDR picture, and the vertical axis represents the relative brightness of the SDR picture. Assuming that the maximum brightness of the HDR picture is 400nits, the absolute brightness of HDR 400nits can be converted to the relative brightness of SDR 1, then when the maximum brightness of the HDR picture is 4000nits, the absolute brightness of HDR 400nits can be converted to the relative brightness of SDR 0.1.
[0168] See also Fig.10 , Fig.10 1 is a comparison diagram of the effects of performing dynamic TM OOTF and linear OOTF on a video frame after first brightness conversion provided by an embodiment of the present application. Fig.10 (a) is the image obtained after linear OOTF processing. Fig.10 (b) in the figure is a picture obtained after dynamic TM OOTF processing. It can be seen that the electronic device 100 re-converts the brightness of each pixel in the video frame after the first brightness conversion by the dynamic TM OOTF method, which can effectively improve the display effect of the dark part of the video frame after the first brightness conversion, compared with re-converting the brightness of each pixel in the video frame after the first brightness conversion by the linear OOTF method.
[0169] See also Fig.11 , Fig.11 It is a visualization schematic diagram of a group of dynamic TM curves with different brightness provided in an embodiment of the present application. Fig.11In the figure, the horizontal coordinates of pictures 1101 to 1106 represent the absolute brightness of the normalized HDR picture, and the vertical coordinates represent the relative brightness of the SDR picture after the brightness of each pixel in the video frame after the first brightness conversion is performed again. Among them, in picture 1101, the maximum brightness maxPQ of the video frame is 500; in picture 1102, the maximum brightness maxPQ of the video frame is 1000; in picture 1103, the maximum brightness maxPQ of the video frame is 2000; in picture 1104, the maximum brightness maxPQ of the video frame is 3000; in picture 1105, the maximum brightness maxPQ of the video frame is 4000; in picture 1106, the maximum brightness maxPQ of the video frame is 10000.
[0170] After performing the above processing on each of the N video frames corresponding to the HDR10 video frame sequence, the electronic device 100 can obtain N video frames after the second brightness conversion, wherein the video format of the N video frames after the second brightness conversion is SDR.
[0171] The above is an example in which the first video format is HDR and the second video format is SDR, and the electronic device 100 converts the video frames of the first video format in the video to be edited into the video frames of the second video format based on the video brightness range of the second video format. The following is an example in which the first video format is SDR and the second video format is HDR, and the electronic device 100 converts the video frames of the first video format in the video to be edited into the video frames of the second video format based on the video brightness range of the second video format. In this case, the range of brightness and darkness of colors that can be represented by the video brightness range of the first video format is smaller than the range of brightness and darkness of colors that can be represented by the video brightness range of the second video format.
[0172] The electronic device 100 may detect a left swipe operation on the window 152, and in response to the operation, display an SDR video frame in the window 151. Then, the electronic device 100 may detect a user operation on the conversion control in the operation bar 153, and in response to the operation, display an operation belonging to the "conversion" category in the operation bar 154, such as "SDR to HDR10", "SDR to HDR10+", etc. Afterwards, the electronic device 100 may detect a user operation on the "SDR to HDR10" control, and in response to the operation, perform format conversion on the SDR video frame to obtain an HDR video frame.
[0173] Specifically, first, the electronic device 100 can process each video frame (SDR video frame) of the N video frames corresponding to the SDR video frame sequence to obtain the normalized electronic RGB texture corresponding to the video frame (SDR video frame) and the frame light information of the video frame. Secondly, the electronic device 100 uses the electrical optical transfer function (EOTF) to convert the normalized electronic RGB texture into an optical signal, and normalizes the optical signal to obtain a normalized optical signal. Among them, the SDR EOTF is a gamma EOTF. Then, the electronic device 100 can weight the brightness of the SDR video frame based on the video brightness range of the HDR video to obtain a brightness-weighted video frame, wherein the brightness value of each pixel in the brightness-weighted video frame is within the HDR video brightness range. In other words, the video format of the brightness-weighted video frame is HDR.
[0174] S404: The electronic device 100 processes the N video frames in the second video format to obtain a video in the second video format.
[0175] When the electronic device 100 processes N video frames in the second video format to obtain a video in the second video format, it can first perform brightness smoothing processing between each two adjacent video frames in the N video frames after the second brightness conversion to obtain N video frames after the brightness smoothing processing; and process the N video frames after the brightness smoothing processing to obtain a video in the second video format.
[0176] Optionally, when the electronic device 100 performs brightness smoothing processing between each two adjacent video frames in the N video frames after the second brightness conversion to obtain N video frames after the brightness smoothing processing, for each video frame in the N video frames after the second brightness conversion, the electronic device 100 may use the following formula (4) to obtain the video frame after the brightness smoothing processing.
[0177] X(t)=0.9*X(t-1)+0.1*M(t)(4)
[0178] In formula (4), M(t) represents the brightness obtained after brightness statistics of the current video frame; X(t-1) represents the brightness of the previous video frame of the current video frame; X(t) represents the brightness of the current video frame after brightness smoothing (or the brightness of the current video frame after brightness correction) after brightness smoothing of the current video frame.
[0179] See also Fig.12 , Fig.12is a comparison diagram of the effects before and after brightness smoothing processing between adjacent video frames provided by an embodiment of the present application. Among them, Fig.12 (a) in FIG. 4 is the 4 video frames before brightness smoothing is performed between adjacent video frames. Fig.12 (b) in the figure shows four video frames after brightness smoothing is performed between adjacent video frames. It can be seen that the electronic device 100 can effectively avoid the problem of unnatural brightness jumps between frames by using the time domain filtering method to perform brightness smoothing between frames, thereby making the filtering between frames more natural.
[0180] After obtaining the video in the second video format, the electronic device 100 also converts the color gamut of the video frame from BT2020 to BT709 by a color gamut mapping method. Specifically, Figure 5 In (4), after obtaining the video in the second video format, the electronic device 100 can convert the color gamut of the video from BT2020 to BT709, and normalize the brightness of the video with the color gamut of BT709 to obtain normalized BT709 light information.
[0181] Afterwards, the electronic device 100 may also Figure 2E The window 152 in the user interface shown in FIG. 1 displays any one video frame in the video in the second video format. Specifically, Figure 5 In (5), after obtaining the video in the second video format, the electronic device 100 can use an optical electronic transfer function (OETF) to convert the video in the second video format into an electrical signal and display it on Figure 2E The OETF is a mathematical function that maps scene brightness (the light in a scene) to transmittable compressed digitally encoded pixel values.
[0182] Optionally, after obtaining the video in the second video format, the electronic device 100 may also detect the Figure 2E The user interface shown includes a user operation of the save control 156; in response to the operation, a video in a second video format is saved.
[0183] In an embodiment of the present application, the electronic device 100 can input HDR video and SDR video into a video editor, and based on the video brightness range corresponding to the video format to be output, convert the format of the HDR video and the SDR video to unify the format of the video to be compatible with the screen specifications of the electronic device 100, thereby helping to maintain or improve the video quality output by the electronic device 100.
[0184] Fig.13It is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application.
[0185] like Fig.13 As shown, the electronic device 100 may include a processor 110, an external memory interface 120A, an internal memory 120B, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 140A, a battery 140B, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0186] It is to be understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include Fig.13 More or fewer components may be shown, or some components may be combined or separated, or the components may be arranged differently. Fig.13 The components shown may be implemented in hardware, software or a combination of software and hardware.
[0187] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0188] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0189] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0190] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0191] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0192] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0193] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0194] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0195] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0196] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0197] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can 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 electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0198] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0199] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 140B, it may also power the electronic device through the power management module 140A.
[0200] The power management module 140A is used to connect the battery 140B, the charging management module 140 and the processor 110. The power management module 140A receives input from the battery 140B and / or the charging management module 140, and provides power to the processor 110, the internal memory 120B, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 140A can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 140A can also be set in the processor 110. In other embodiments, the power management module 140A and the charging management module 140 can also be set in the same device.
[0201] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0202] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0203] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0204] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0205] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0206] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0207] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects 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 that execute program instructions to generate or change display information.
[0208] In the embodiment of the present application, the electronic device 100 displays Figure 2A-2H The user interface shown can be completed through a decoder, OpenGL, FrameWork, a third-party SDK, and a display screen 194 .
[0209] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0210] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0211] In an embodiment of the present application, the video to be edited can be obtained by the electronic device 100 from other electronic devices through a wireless communication function, or it can be captured by the electronic device 100 through an ISP, a camera 193, a video codec, a GPU, and a display screen 194.
[0212] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, etc. of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0213] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0214] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0215] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0216] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0217] The internal memory 120B may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0218] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.;
[0219] Non-volatile memory may include disk storage devices and flash memory.
[0220] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; can be divided into universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0221] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0222] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0223] The external memory interface 120A can be used to connect an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120A to implement a data storage function. For example, music, video and other files are stored in an external non-volatile memory. In an embodiment of the present application, if the video to be edited is taken by the user through the electronic device 100, the electronic device 100 can collect sound through the microphone 170C when taking the video. During the video playback process, the speaker 170A or the speaker connected to the headphone interface 170D can support the audio in the video.
[0224] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0225] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0226] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0227] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0228] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0229] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0230] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0231] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0232] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0233] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0234] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0235] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0236] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0237] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0238] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0239] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 140B to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 140B to avoid abnormal shutdown caused by low temperature.
[0240] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0241] In the embodiment of the present application, the electronic device 100 can detect whether there is a user operation on the display screen 194 of the electronic device 100 through the touch sensor 180K. After the touch sensor 180K detects the above user operation, the electronic device 100 can perform image processing indicated by the above user operation to achieve corresponding processing.
[0242] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0243] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0244] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0245] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0246] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0247] In the embodiments of the present application:
[0248] 1. The operation of a user clicking a conversion control for triggering the conversion of a video from a first video format to a second video format may be referred to as a first operation. For example, Figure 2E The electronic device 100 may convert the video frame of the first video format into the video frame of the second video format when detecting the first operation.
[0249] 2. The operation of the user clicking the save control for saving the video in the second video format may be referred to as the second operation. For example, Figure 2E Click the operation of saving control 156.
[0250] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as . A node corresponds to a control or attribute in the interface. After parsing and rendering, the node is presented as user-visible content. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is source code written in a specific computer language, such as hypertext markup language (GTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code. For example, GTML is defined by 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.
[0251] The most common form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operation that is displayed in a graphical manner. It can be an icon, window, control or other interface element displayed on the display screen of an electronic device, where a control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.
[0252] As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items. As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrase "when determining..." or "if (stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "when (stated condition or event) is detected" or "in response to detecting (stated condition or event)", depending on the context.
[0253] The terms "first", "second", etc. in the specification and claims of the present application and the drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a series of steps or units are included, or optionally, steps or units not listed are included, or optionally, other steps or units inherent to these processes, methods, products or devices are included.
[0254] Only the part relevant to the present application but not all content is shown in the accompanying drawings.Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processing or methods described as flow charts.Although flow charts describe various operations (or steps) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously.In addition, the order of various operations can be rearranged.Described processing can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings.Described processing can correspond to method, function, procedure, subroutine, subprogram etc.
[0255] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0256] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.< / canvas> < / video> < / videoview> < / imgview> < / textview>
Claims
1. A video editing method, characterized in that: The method comprises: Detecting a first operation on a video, the first operation being used to trigger conversion of the video from a first video format to a second video format; In response to the first operation, the video format is converted according to the video brightness range of the second video format to obtain a video in the second video format.
2. The method according to claim 1, characterized in that The range of brightness and darkness of colors that can be represented by the video brightness range of the first video format is greater than the range of brightness and darkness of colors that can be represented by the video brightness range of the second video format.
3. The method according to claim 2, characterized in that The converting the video format according to the video brightness range of the second video format to obtain the video in the second video format includes: The maximum brightness of each video frame in the video is converted into the maximum brightness of the video brightness range of the second video format to obtain a video in the second video format.
4. The method according to claim 3, characterized in that The method further comprises: Performing region division on each video frame in the video to obtain a plurality of regions corresponding to each video frame; The maximum brightness of each video frame is determined according to the RGB value of a pixel point corresponding to each area in the multiple areas corresponding to each video frame.
5. The method according to claim 2, characterized in that: The converting the video format according to the video brightness range of the second video format to obtain the video in the second video format includes: Converting the maximum brightness of each video frame in the video into the maximum brightness of the video brightness range of the second video format; Determine a brightness threshold corresponding to each video frame according to the maximum brightness of each video frame after conversion; According to the brightness of each pixel in each video frame after the conversion and the brightness threshold corresponding to each video frame, the brightness of each pixel in each video frame after the conversion is converted to obtain the video in the second video format.
6. The method according to claim 5, characterized in that The step of converting the brightness of each pixel in each video frame after the conversion according to the brightness value of each pixel in each video frame after the conversion and the brightness threshold corresponding to each video frame to obtain the video in the second video format includes: For the first type of pixel points whose brightness value in each of the converted video frames is greater than or equal to the brightness threshold corresponding to the video frame, converting the brightness of the first type of pixel points in a linear brightness conversion manner; For the second type of pixel points whose brightness value in each of the converted video frames is less than the brightness threshold corresponding to the video frame, converting the brightness of the second type of pixel points according to a nonlinear brightness conversion method; A video in the second video format is obtained according to each pixel point after brightness conversion.
7. The method according to claim 2, characterized in that The converting the video format according to the video brightness range of the second video format to obtain the video in the second video format includes: Converting the maximum brightness of each video frame in the video into the maximum brightness of the video brightness range of the second video format; Determine a brightness threshold corresponding to each video frame according to the maximum brightness of each video frame after conversion; According to the brightness value of each pixel in each video frame after the conversion and the brightness threshold corresponding to each video frame, the brightness of each pixel in each video frame is converted to obtain each video frame after the brightness conversion; Among the multiple video frames after brightness conversion, brightness smoothing processing is performed between every two adjacent video frames to obtain the video in the second video format.
8. The method according to claim 1, characterized in that The range of brightness and darkness of colors that can be represented by the video brightness range of the first video format is smaller than the range of brightness and darkness of colors that can be represented by the video brightness range of the second video format.
9. The method according to claim 8, characterized in that The converting the video format according to the video brightness range of the second video format to obtain the video in the second video format includes: According to the video brightness range of the second video format, weighted processing is performed on the brightness of each video frame in the video to obtain a video in the second video format; wherein the brightness of each pixel in each video frame after brightness weighting is within the video brightness range of the second video format.
10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: Any video frame of the video in the second video format is displayed on the first interface.
11. The method according to claim 10, characterized in that The method further comprises: detecting a second operation acting on a save control in the first interface; In response to the second operation, the video in the second video format is saved.
12. An electronic device, characterized in that: include: Memory, processor and touch screen; wherein: The touch screen is used to display content; The memory is used to store a computer program, wherein the computer program includes program instructions; The processor is used to call the program instructions so that the electronic device executes the method according to any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Video display method and device
CN105979192A
Display device, method for controlling display device, control program, and recording medium
CN108370428A
Methods for processing audio and / or video contents and corresponding signal, devices, electronic assembly, system, computer readable program products and computer readable storage media
CN113228694A
Television terminal, method for converting HDR image into SDR image, and computer readable storage medium
WO2018223607A1
Cited By
Applying effects to HDR video
US20260065449A1