Video editing method and electronic device

By using video editing methods to convert HDR and SDR video formats to be compatible with electronic device screen specifications, the compatibility issues of video materials are resolved, and video quality and display effects are improved.

CN119767076BActive Publication Date: 2026-01-20HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311270771.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2026-01-20
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

Different electronic devices have different screen specifications, which makes HDR and SDR video footage collected by ordinary users incompatible, resulting in poor video quality.

Method used

A video editing method is provided that converts a video from a first format to a second format by detecting user operations, performs format conversion based on the video brightness range of the target screen specification, including brightness range adjustment and dynamic tone mapping, to ensure that the video is compatible with electronic device screens.

Benefits of technology

It improves the video quality output by electronic devices, avoids overexposure issues, and ensures consistent video display across devices with different screen sizes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119767076B_ABST
    Figure CN119767076B_ABST
Patent Text Reader

Abstract

The application provides a video editing method and an electronic device. The method can be applied to an electronic device with image processing capability, such as a smart phone, a tablet computer, etc. When mixing editing an HDR video and an SDR video by using a video editor, the electronic device can perform format conversion on the HDR video and the SDR video based on a video brightness range corresponding to a required output video format, unify the format of the video, and be compatible with the screen specification of the electronic device, thereby facilitating improvement of the video quality output by the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the terminal field, and in particular to a video editing method and an electronic device. BACKGROUND

[0002] Different electronic devices have different screen specifications. For example, the screen of some electronic devices can display both HDR videos and SDR videos, while the screen of some electronic devices can only display SDR videos.

[0003] For ordinary video enthusiasts (users without professional video editing ability), the video materials collected by them are relatively extensive in source. For example, the video materials are video clips on the network, or high-dynamic range (HDR) videos or standard dynamic range (SDR) videos collected by the user themselves. Since the video formats of the collected video materials are relatively complex, there is a problem of incompatibility with the screen specifications of electronic devices, thereby leading to poor video quality displayed by the electronic devices. SUMMARY

[0004] The embodiments of the present application provide a video editing method and an electronic device, which can perform video format conversion on a video, so as to be compatible with the screen specifications of the electronic device, thereby facilitating improvement of the video quality output by the electronic device.

[0005] In a first aspect, the embodiments of the present application provide a video editing method, which comprises: detecting a first operation acting on a video, the first operation being used to trigger conversion of the video from a first video format to a second video format; and in response to the first operation, performing video format conversion on the video based on a video brightness range of the second video format, to obtain a video in the second video format.

[0006] After the method provided by the first aspect is implemented, the electronic device can perform format conversion on HDR videos and SDR videos based on the video brightness range corresponding to the video format required to be output, unify the format of the video, so as to be compatible with the screen specifications of the electronic device, thereby facilitating improvement of the video quality output by the electronic device.

[0007] In combination with the first aspect, in an optional implementation manner, the video brightness range of the first video format can represent a color brightness range that is greater than a color brightness range represented by the video brightness range of the second video format. In this way, the electronic device can convert a video in the HDR video format into a video in the SDR video format.

[0008] In an optional implementation of the first aspect, the video is converted into the second video format based on a video brightness range of the second video format, to obtain the video in the second video format, including: converting a maximum brightness of each video frame in the video into a maximum brightness of the video brightness range of the second video format, to obtain the video in the second video format.

[0009] After the method provided by the implementation is implemented, in the case of converting the video in the HDR video format into the video in the SDR video format, the electronic device can avoid the problem of overexposure of the SDR picture corresponding to the picture in each video frame in the HDR video format, by converting the maximum brightness of each video frame corresponding to the video in the HDR video format into the maximum brightness of the SDR video brightness range.

[0010] In an optional implementation of the first aspect, the method further includes: dividing each video frame in the video into a plurality of regions to obtain a plurality of regions corresponding to each video frame; and determining the maximum brightness of each video frame based on the RGB values of the pixel points corresponding to each region in the plurality of regions corresponding to each video frame.

[0011] After the method provided by the implementation is implemented, in the case of converting the video in the HDR video format into the video in the SDR video format, the electronic device can determine the maximum brightness of each video frame corresponding to the video in the HDR video format, thereby facilitating the conversion of the brightness of each video frame based on the maximum brightness of each video frame, and further facilitating the avoidance of the problem of overexposure of the SDR picture corresponding to the picture in each video frame in the HDR video format.

[0012] In an optional implementation of the first aspect, the video is converted into the second video format based on a video brightness range of the second video format, to obtain the video in the second video format, including: converting a maximum brightness of each video frame in the video into a maximum brightness of the video brightness range of the second video format; determining a brightness threshold corresponding to each video frame based on the converted maximum brightness of each video frame; and converting the brightness of each pixel point in each converted video frame based on the brightness of each pixel point in each converted video frame and the brightness threshold corresponding to each video frame, to obtain the video in the second video format.

[0013] After the method provided by the embodiment is implemented, in the case of converting a video in an HDR video format into a video in an SDR video format, the electronic device can avoid overexposure of SDR pictures corresponding to pictures in each video frame in the HDR video format by converting the maximum luminance of each video frame corresponding to the video in the HDR video format into the maximum luminance of the SDR video luminance range. In addition, the display effect of dark pictures in each converted video frame can be effectively improved by re-converting the luminance of each pixel in each converted video frame based on the luminance of each pixel in each converted video frame and the luminance threshold corresponding to each video frame.

[0014] With reference to the first aspect, in an optional implementation, the luminance of each pixel in each converted video frame is converted based on the luminance value of each pixel in each converted video frame and the luminance threshold corresponding to each video frame to obtain a video in a second video format, including: for a first type of pixel in each converted video frame, whose luminance value is greater than or equal to the luminance threshold corresponding to the video frame, the luminance of the first type of pixel is converted in a linear luminance conversion manner; for a second type of pixel in each converted video frame, whose luminance value is less than the luminance threshold corresponding to the video frame, the luminance of the second type of pixel is converted in a non-linear luminance conversion manner; and the video in the second video format is obtained based on the luminance-converted pixels.

[0015] After the method provided by the embodiment is implemented, the display effect of dark pictures in each converted video frame can be effectively improved by re-converting the luminance of each pixel in each converted video frame by the dynamic tone mapping method.

[0016] With reference to the first aspect, in an optional implementation, the video is converted into a video in a second video format based on the video luminance range of the second video format, including: converting the maximum luminance of each video frame in the video into the maximum luminance of the video luminance range of the second video format; determining the luminance threshold corresponding to each video frame based on the maximum luminance of each converted video frame; converting the luminance of each pixel in each video frame based on the luminance value of each pixel in each converted video frame and the luminance threshold corresponding to each video frame to obtain each video frame after luminance conversion; and performing luminance smoothing processing between each adjacent two video frames in the multiple video frames after luminance conversion to obtain the video in the second video format.

[0017] After the method provided by the embodiment is implemented, in the case of converting the video in the HDR video format into the video in the SDR video format, the electronic device can avoid the problem of overexposure of the SDR picture corresponding to the picture in each video frame in the HDR video format by converting the maximum luminance of each video frame corresponding to the video in the HDR video format into the maximum luminance of the SDR video luminance range; the display effect of the dark picture in each converted video frame can be effectively improved by re-converting the luminance of each pixel point in each converted video frame based on the luminance of each pixel point in the converted video frame and the luminance threshold corresponding to each video frame. In addition, the electronic device can effectively avoid the problem of unnatural luminance jump between frames by performing luminance smoothing processing between the adjacent two video frames, so that the filtering between frames is more natural.

[0018] With reference to the first aspect, in an optional implementation, the range of brightness and darkness of colors that can be represented by the video luminance range of the first video format is smaller than the range of brightness and darkness of colors that can be represented by the video luminance range of the second video format. In this way, the electronic device can convert the video in the SDR video format into the video in the HDR video format.

[0019] With reference to the first aspect, in an optional implementation, the video format conversion of the video based on the video luminance range of the second video format comprises: performing weighted processing on the luminance of each video frame in the video based on the video luminance range of the second video format to obtain the video in the second video format; wherein the luminance of each pixel point in each video frame after luminance weighting is within the video luminance range of the second video format.

[0020] After the method provided by the embodiment is implemented, in the case of converting the video in the SDR video format into the video in the HDR video format, the electronic device can obtain the video in the HDR video format by performing weighted processing on the luminance of the video frame corresponding to the video in the SDR video format based on the video luminance range of the video in the HDR video format.

[0021] With reference to the first aspect, in an optional implementation, the method further comprises: displaying any one video frame in the video in the second video format on the first interface.

[0022] With reference to the first aspect, in an optional implementation, the method further comprises: detecting a second operation acting on the save control in the first interface; and in response to the second operation, saving the video in the second video format.

[0023] After the method provided by the embodiment is implemented, the electronic device can encapsulate the edited video frames into one video according to the user operation of detecting that the user saves the video, and save the video into the 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, and the memory is configured to store computer program code, the computer program code comprising computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform: detecting a first operation acting 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, performing video format conversion on the video based on a video brightness range of the second video format, to obtain the video in the second video format.

[0025] In combination with the second aspect, in an optional implementation, a range of brightness and darkness of colors that can be represented by the video brightness range of the first video format is greater than a 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 implementation, the one or more processors invoke the computer instructions to cause the electronic device to perform: converting a maximum brightness of each video frame in the video into a maximum brightness of the video brightness range of the second video format, to obtain the video in the second video format.

[0027] In combination with the second aspect, in an optional implementation, the one or more processors invoke the computer instructions to cause the electronic device to perform: dividing each video frame in the video into regions to obtain a plurality of regions corresponding to each video frame; determining the maximum brightness of each video frame based on RGB values of pixel points corresponding to each region in the plurality of regions corresponding to each video frame.

[0028] In combination with the second aspect, in an optional implementation, the one or more processors invoke the computer instructions to cause the electronic device to perform: 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 a brightness threshold corresponding to each video frame based on the converted maximum brightness of each video frame; converting the brightness of each pixel point in the converted each video frame based on the brightness of each pixel point in the converted each video frame and the brightness threshold corresponding to each video frame, to obtain the video in the second video format.

[0029] In an optional implementation of the second aspect, the one or more processors invoke the computer instructions to cause the electronic device to perform: converting, for each video frame in the video, a maximum luminance of the video frame to a maximum luminance of a video luminance range of the second video format; determining, based on the converted maximum luminance of each video frame, a luminance threshold corresponding to each video frame; converting, based on luminance values of the pixels in each video frame and the luminance threshold corresponding to each video frame, the luminance of the pixels in each video frame, to obtain each video frame after luminance conversion; performing luminance smoothing between each pair of adjacent video frames in the plurality of video frames after luminance conversion, to obtain the video in the second video format.

[0030] In an optional implementation of the second aspect, the one or more processors invoke the computer instructions to cause the electronic device to perform: converting, for each video frame in the video, a maximum luminance of the video frame to a maximum luminance of a video luminance range of the second video format; determining, based on the converted maximum luminance of each video frame, a luminance threshold corresponding to each video frame; converting, based on luminance values of the pixels in each video frame and the luminance threshold corresponding to each video frame, the luminance of the pixels in each video frame, to obtain each video frame after luminance conversion; performing luminance smoothing between each pair of adjacent video frames in the plurality of video frames after luminance conversion, to obtain the video in the second video format.

[0031] In an optional implementation of the second aspect, a range of brightness levels of colors that can be represented by the video luminance range of the first video format is smaller than a range of brightness levels of colors that can be represented by the video luminance range of the second video format.

[0032] In an optional implementation of the second aspect, the one or more processors invoke the computer instructions to cause the electronic device to perform: performing, based on the video luminance range of the second video format, weighting processing on the luminance of each video frame in the video, to obtain the video in the second video format; wherein the luminance of each pixel in each video frame after luminance weighting is within the video luminance range of the second video format.

[0033] In an optional implementation of the second aspect, the one or more processors invoke the computer instructions to cause the electronic device to perform: displaying, in the first interface, any video frame in the video in the second video format.

[0034] In an optional implementation of the second aspect, the one or more processors invoke the computer instructions to cause the electronic device to perform: detecting a second operation on a save control in the first interface; and in response to the second operation, saving the video in the second video format.

[0035] In a third aspect, an electronic device is provided, including 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. The one or more memories are configured to store computer program codes. The computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device performs the method according to the first aspect or any possible implementation of the first aspect.

[0036] In a fourth aspect, a chip system is provided. The chip system is applied to a device. The chip system includes one or more processors. The processor is configured to invoke computer instructions to cause the device to perform the method according to the first aspect or any possible implementation of the first aspect.

[0037] In a fifth aspect, a computer program product is provided. The computer program product includes instructions. When the computer program product is executed on a device, the electronic device performs the method according to the first aspect or any possible implementation of the first aspect.

[0038] In a sixth aspect, a computer readable storage medium is provided. The computer readable storage medium includes instructions. When the instructions are executed on an electronic device, the electronic device performs the method according to the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1A is a schematic diagram of an HDR video and an SDR video mixed editing and outputting an SDR video provided by an embodiment of the present application;

[0040] Figure 1B is a schematic diagram of an HDR video and an SDR video mixed editing and outputting an HDR video provided by an embodiment of the present application;

[0041] Figures 2A-2H is a set of user interface schematic diagrams provided by an embodiment of the present application;

[0042] Figure 3 is a software architecture schematic diagram of an electronic device 100 provided by an embodiment of the present application;

[0043] Figure 4 is a flowchart of a video editing method provided by an embodiment of the present application;

[0044] Figure 5 is a flowchart of an electronic device 100 performing format conversion on an HDR video frame provided by an embodiment of the present application;

[0045] Figure 6is a schematic diagram of partitioned statistical luminance information provided by an embodiment of the present application.

[0046] Figure 7A is a schematic diagram of light-light conversion based on luminance statistics provided by an embodiment of the present application.

[0047] Figure 7B is a schematic diagram of light-light conversion based on fixed luminance.

[0048] Figure 8 is an effect comparison diagram of light-light conversion based on luminance statistics and light-light conversion based on fixed luminance provided by an embodiment of the present application.

[0049] Figure 9A is a schematic diagram of dynamic TM OOTF provided by an embodiment of the present application.

[0050] Figure 9B is a schematic diagram of linear OOTF.

[0051] Figure 10 is an effect comparison diagram of dynamic TM OOTF and linear OOTF after first luminance conversion provided by an embodiment of the present application.

[0052] Figure 11 is a visual schematic diagram of a group of different luminance dynamic TM curves provided by an embodiment of the present application.

[0053] Figure 12 is an effect comparison diagram of luminance smoothing processing before and after luminance smoothing processing between adjacent video frames provided by an embodiment of the present application.

[0054] Figure 13 is a hardware structure schematic diagram of an electronic device 100 provided by 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 with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. In this text, the phrase "embodiments" means that the specific features, structures or characteristics described in combination with the embodiments can be contained in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiments, nor is it independent or alternative to other embodiments. Those skilled in the art can explicitly and implicitly understand that the embodiments described in this text can be combined with other embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0056] First, some concepts involved in the present application are described.

[0057] 1、SDR video

[0058] In SDR video, the bit depth for representing color is 8 bits. The bit depth refers to the method used by electronic devices to record the color of digital images using bits. 8 bits of bit depth means that the electronic device uses 8 bits as the unit of measurement, and the electronic device can represent 2 8 (256, 0-255) colors through these 8 bits.

[0059] The BT709 color gamut is used in SDR video, where the color gamut refers to the range of colors that can be displayed when video is encoded.

[0060] 2、HDR video

[0061] HDR video adopts a wider color and brightness range than ordinary video, which can improve the contrast of light and shade of video images and present a more realistic picture effect. There are several main formats of HDR video: HDR10, HDR10+, and Dolby Vision.

[0062] In HDR10, the bit depth for representing color is 10 bits. 10 bits of bit depth means that the electronic device uses 10 bits as the unit of measurement, and the electronic device can represent 2 10 (1024, 0-1023) colors through these 10 bits. The peak brightness of HDR10 is 1000 nits to 4000 nits. HDR10 video uses the BT2020 color gamut. HDR10 only requires the provision of static metadata, which only needs to obtain the highest peak brightness of the image to determine the dynamic range of the entire image. Metadata refers to “intermediate data” or “data packets”, and in general, a metadata records a specific number of 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 level of HDR on a per-scene or per-frame basis. However, the bit depth for representing color in HDR10+ is still 10 bits, and the BT2020 color gamut is still used.

[0064] In Dolby Vision, the bit depth for representing color is 12 bits, the peak brightness is 4000 nits, and the metadata used is dynamic metadata.

[0065] In addition, the domestic original HDR Vivid is a standard of HDR. Compared with SDR video, the high light brightness of HDR Vivid video is 40 times that of SDR video. The HDR Vivid technology enables different electronic devices to present the optimal picture viewing effect through intelligent calculation. Whether it is a television, a computer, or a mobile phone, a mobile tablet or other electronic devices, lighting up the HDR Vivid is to activate the entire screen, so that the picture presents more rich colors and details.

[0066] In summary, the color gamut used by the HDR video is wider than that used by the SDR video, and the color and detail are more abundant.

[0067] Different electronic devices have different screen specifications. For example, the screen of some electronic devices can display both HDR video and SDR video, while the screen of some electronic devices can only display SDR video.

[0068] For professional video producers, they usually use electronic devices that support shooting HDR video to shoot high dynamic range HDR video, and then when editing the shot HDR video, they generally edit frame by frame to obtain high-quality edited HDR video and / or high-compatibility edited SDR video.

[0069] However, for ordinary video enthusiasts (users without professional video editing capabilities or professional equipment), the sources of the video materials they collect are more extensive, such as video clips (e.g., SDR video, HDR 10 video, HDR10+ video, HDR Vivid video, Dolby Vision, etc.) on the network or their own collected HDR video or SDR video.

[0070] After collecting the video materials, these users usually perform editing operations on the collected video materials to make the edited video more meet the individual needs of the users. For example, the electronic device 100 responds to the user's operation of mixing and editing the self-collected HDR video (denoted as HDR video 1) and the SDR video clip (denoted as SDR video 1) on the network to mix and edit the HDR video 1 and the SDR video 1, thereby obtaining the edited video.

[0071] However, if the edited video is an HDR video and the electronic device 100 can only display SDR video, then the edited video and the screen of the electronic device 100 are not compatible, 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 video, then the quality of the edited video presented in the electronic device 100 is poor, thereby reducing the user's experience.

[0072] To solve the above problems, the video editing method provided by the embodiments of the present application is provided. The video editing method can be applied to an electronic device with image processing capability.

[0073] By implementing the video editing method provided by the embodiments of the present application, the electronic device 100 can input the HDR video and the SDR video into the video editor, and perform format conversion on the HDR video and the SDR video based on the video brightness range corresponding to the required output video format, so as to unify the format of the video and be compatible with the screen specification of the electronic device 100, thereby facilitating to maintain or improve the video quality output by the electronic device 100.

[0074] The video editing method provided by the embodiments of the present application can be applied to various scenes. In the following, the application scenarios of the video editing method provided by the embodiments of the present application are introduced in combination with Figure 1A and Figure 1B .

[0075] Please refer to Figure 1A , Figure 1A is a schematic diagram of mixed editing of an HDR video and an SDR video and outputting an SDR video provided by the embodiments of the present application. As shown in Figure 1A , the electronic device 100 can detect a mixed editing operation for SDR video, HDR10 / 10+ video, HDR Vivid video and Dolby Vision video, and in response to the operation, convert the HDR video data (i.e. HDR10 / 10+ video, HDR Vivid video and Dolby Vision video) with bit depth of 10bit or 12bit and color gamut of BT2020 format into SDR video data with 8bit and BT709 format by using a clip Android package (APK) (or referred to as a video editor); and render the SDR video data with 8bit and BT709 format, so as to display the edited SDR video data in the main interface of the video editor.

[0076] Please refer to Figure 1B , Figure 1B is a schematic diagram of mixed editing of an HDR video and an SDR video and outputting an HDR video provided by the embodiments of the present application. As shown in Figure 1BAs shown, the electronic device 100 can detect a mixed editing operation for SDR video, HDR10 / 10+ video, HDR Vivid video, and Dolby Vision video, and in response to the operation, convert SDR video data in 8-bit, BT709 format into HDR video data in 10-bit or 12-bit, BT2020 format by using a clip APK (video editor); render the HDR video data in 10-bit or 12-bit, BT2020 format, so as to display the edited HDR video data in the main interface of the video editor.

[0077] The following takes the scenario of mixing and editing HDR video and SDR video and outputting SDR video as an example, and combines the above-mentioned embodiments to introduce the application scenario of the video editing method provided by the embodiments of the present application. Figures 2A-2H The application scenario of the video editing method provided by the embodiments of the present application is introduced. Figures 2A-2H is a set of user interface schematic diagrams provided by the embodiments of the present application.

[0078] Figure 2A is a user interface provided by the embodiments of the present application on an electronic device 100 to display installed application icons, i.e., a home page. As shown in Figure 2A , the home page displays a plurality of application icons, such as a "clock" application icon, a "calendar" application icon, a "weather" application icon, and the like.

[0079] The plurality of application icons in the home page include a "gallery" application (hereinafter referred to as "gallery") icon, i.e., icon 111. The electronic device 100 can detect a user operation acting on the icon 111. The above-mentioned operation is, for example, a click operation, a long press operation, and the like. In response to the above-mentioned operation, the electronic device 100 can display Figure 2B the user interface shown in.

[0080] Figure 2B is a main interface of the "gallery" when the "gallery" is running on the electronic device 100 provided by the embodiments 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 video, such as LOG video. The above-mentioned LOG video refers to a low-saturation, low-luminance video taken in LOG mode, which can also be referred to as LOG gray film.

[0081] As shown in Figure 2BAs shown, icon 121 indicates an SDR video; icon 122 indicates an HDR10 video. When the electronic device 100 displays an HDR10 or SDR video, the icon indicating the video displays the video's type. This allows the user to understand the video's type through the information displayed in the icon. For example, icon 121 displays "SDR" in the lower left corner; icon 122 displays "HDR10" in the lower left corner. Figure 2B The video in the bottom left corner that is not marked is a LOG video.

[0082] Electronic device 100 can detect user actions on icon 121, and in response to the actions, electronic device 100 can display... Figure 2C The user interface shown. For example, a long press is a user action performed on icon 121.

[0083] Figure 2C This application provides an embodiment of an electronic device 100 that displays a user interface for selecting a specific image or video. Figure 2C As shown, in this user interface, each image or video may include a selection window "○" in the lower right corner. This selection window can be used to receive confirmation editing operations from the user for the image or video corresponding to the icon.

[0084] For example, in Figure 2B In the middle, the user long-presses the SDR video indicated by icon 121. Then, Figure 2B An "○" appears in the bottom right corner of all images or videos, indicating that... Figure 2C The user interface is shown. At this time, the electronic device 100 can detect a selection operation performed on the selection window and, in response to the selection operation, mark a "√" in the selection window. For example, after detecting a user's selection operation on the selection window "○" 131 in the lower left corner of icon 121, the electronic device 100 can mark a "√" in "○" 131. Subsequently, the electronic device 100 can also mark a "√" in "○" 132 after detecting a user's selection operation on the selection window "○" 132 in the lower left corner of icon 122. At this time, the electronic device 100 can display as shown... Figure 2D The user interface shown.

[0085] Figure 2D This application provides an embodiment of an electronic device 100 that displays a user interface indicating that a selected image or video has been selected. For example... Figure 2D As shown, the user interface also includes a sharing control 141, a favorites control 142, an editing control 143, a deletion control 144, etc.

[0086] The sharing control 141 can be used to send one or more pictures or videos in the user interface to other applications. For example, when a user operation acting on the sharing control is detected, in response to the operation, the electronic device 100 can display one or more application icons, including an icon of a social software A (e.g., QQ, WeChat, etc.). When a user operation acting on the application icon of the social software A is detected, in response to the operation, the electronic device 100 can send the video A to the social software A, and further, the user can share the video through the social software to friends.

[0087] The collection control 142 can be used to mark a video. In the user interface shown in FIG. 1C, when a user operation acting on the collection control is detected, in response to the operation, the electronic device 100 can mark the selected at least one video (e.g., the video A) as a video that the user likes. The electronic device 100 can generate a photo album for displaying videos that are marked as videos that the user likes. In this way, in the case that the video A is marked as a video that the user likes, the user can quickly view the video A through the photo album displaying videos that the user likes. Figure 2D The collection control 142 can be used to mark a video. In the user interface shown in FIG. 1C, when a user operation acting on the collection control is detected, in response to the operation, the electronic device 100 can mark the selected at least one video (e.g., the video A) as a video that the user likes. The electronic device 100 can generate a photo album for displaying videos that are marked as videos that the user likes. In this way, in the case that the video A is marked as a video that the user likes, the user can quickly view the video A through the photo album displaying videos that the user likes.

[0088] The collection control 142 can be used to mark a video. In the user interface shown in FIG. 1C, when a user operation acting on the collection control is detected, in response to the operation, the electronic device 100 can mark the selected at least one video (e.g., the video A) as a video that the user likes. The electronic device 100 can generate a photo album for displaying videos that are marked as videos that the user likes. In this way, in the case that the video A is marked as a video that the user likes, the user can quickly view the video A through the photo album displaying videos that the user likes.

[0089] Figure 2E The collection control 142 can be used to mark a video. In the user interface shown in FIG. 1C, when a user operation acting on the collection control is detected, in response to the operation, the electronic device 100 can mark the selected at least one video (e.g., the video A) as a video that the user likes. The electronic device 100 can generate a photo album for displaying videos that are marked as videos that the user likes. In this way, in the case that the video A is marked as a video that the user likes, the user can quickly view the video A through the photo album displaying videos that the user likes.

[0090] Figure 2E The collection control 142 can be used to mark a video. In the user interface shown in FIG. 1C, when a user operation acting on the collection control is detected, in response to the operation, the electronic device 100 can mark the selected at least one video (e.g., the video A) as a video that the user likes. The electronic device 100 can generate a photo album for displaying videos that are marked as videos that the user likes. In this way, in the case that the video A is marked as a video that the user likes, the user can quickly view the video A through the photo album displaying videos that the user likes. Figure 2E

[0091] The collection control 142 can be used to mark a video. In the user interface shown in FIG. 1C, when a user operation acting on the collection control is detected, in response to the operation, the electronic device 100 can mark the selected at least one video (e.g., the video A) as a video that the user likes. The electronic device 100 can generate a photo album for displaying videos that are marked as videos that the user likes. In this way, in the case that the video A is marked as a video that the user likes, the user can quickly view the video A through the photo album displaying videos that the user likes.

[0092] The collection control 142 can be used to mark a video. In the user interface shown in FIG. 1C, when a user operation acting on the collection control is detected, in response to the operation, the electronic device 100 can mark the selected at least one video (e.g., the video A) as a video that the user likes. The electronic device 100 can generate a photo album for displaying videos that are marked as videos that the user likes. In this way, in the case that the video A is marked as a video that the user likes, the user can quickly view the video A through the photo album displaying videos that the user likes. Figure 2E ​​The user interface further includes a ruler 157. The electronic device 100 can detect a user operation of swiping left or right on the window 152. In response to the user operation, the electronic device 100 displays a video frame at a position of the video frame stream indicated by the ruler 157. The video frame at the position of the ruler 157 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 can display icons of multiple video editing operations. Generally, one icon displayed in the operation bar 153 indicates one category of editing operations. The operation bar 154 can display video editing operations belonging to the category according to the currently selected category of editing operations in the operation bar 153. For example, the operation bar 153 includes “conversion”. The bold “conversion” indicates that the currently selected category of video editing operations is “conversion”. At this time, the operation bar 154 displays some operations belonging to the category of “conversion”, such as “HDR10 to SDR”, “HDR10+ to SDR”, “SDR to HDR10”, and the like.

[0094] The operation bar 153 further includes “clip”, “filter”, “sticker”, and the like.

[0095] The user interface further includes a save control 156. When the electronic device 100 detects a user operation on the save control 156, the electronic device 100 saves the video in the current state in response to the operation. The video in the current state can be a video with additional editing operations or a video without editing operations.

[0096] The electronic device 100 can detect a user operation on the “HDR10 to SDR” control. In response to the operation, the electronic device 100 converts the video frame of the HDR10 video in the window 152 to an SDR video frame.

[0097] After converting the HDR10 video to an SDR video, the electronic device 100 can detect a user operation on the save control 156. In response to the user operation, the electronic device 100 saves the SDR video.

[0098] Optionally, after converting the HDR10 video to an SDR video, the electronic device 100 can further detect a user operation on other controls in the operation bar 153 and / or the operation bar 154. In response to the editing operation, the electronic device 100 displays the edited video in the window 151. For example, the electronic device 100 can detect a user operation on the “sticker” control in the operation bar 153. In response to the operation, the electronic device 100 displays the user interface as shown. Figure 2F ​

[0099] Figure 2F is a user interface provided by an electronic device 100 for adding a sticker to a video. As shown in Figure 2F , the sticker includes a plurality of sticker options. Each sticker option corresponds to a sticker with a different display effect. The user can select one of the plurality of stickers provided by the electronic device 100. In response to the user operation of selecting the sticker, the electronic device 100 can perform image processing on the edited video as indicated by the user-selected sticker, so that the processed video has a display effect consistent with the display effect of the sticker.

[0100] As shown in Figure 2F , the interface for selecting a sticker can display a plurality of sticker controls, such as sticker control 161, sticker control 162, sticker control 163, sticker control 164, sticker control 165, and the like. Each sticker control indicates an image processing method for rendering an image using a sticker.

[0101] When detecting a user operation on a sticker control, the electronic device 100 can display the user-selected sticker in window 151 in response to the operation. For example, the electronic device 100 detects a user operation on sticker control 162, and in response to the operation, the electronic device 100 can display the user interface shown in Figure 2G .

[0102] Figure 2G is a user interface provided by an electronic device 100 for adding a sticker to a video. As shown in Figure 2G , the sticker includes a plurality of sticker options. Each sticker option corresponds to a sticker with a different display effect. The user can select one of the plurality of stickers provided by the electronic device 100. In response to the user operation of selecting the sticker, the electronic device 100 can perform image processing on the edited video as indicated by the user-selected sticker, so that the processed video has a display effect consistent with the display effect of the sticker.

[0103] The user interface also includes confirmation control 158 (“√”) and cancel control 159 (“X”). When the user determines that the currently selected sticker meets their needs, they can click confirmation control 158. Of course, when the user determines that the currently selected sticker does not meet their needs, they can click other sticker controls to select other stickers. In response to a user operation on any sticker control, the electronic device 100 can display the video after adding the sticker indicated by the sticker control in window 151. When none of the stickers provided by the electronic device 100 meets the user's needs, or the user pauses the addition of stickers, the user can click cancel control 159.

[0104] As shown in Figure 2G , the electronic device 100 can detect a user operation on save control 156, and in response to the operation, the electronic device 100 can perform an operation to save the edited SDR video. After saving is complete, the electronic device 100 can displayFigure 2H The video displayed in the window 171 at this time is the edited SDR video obtained by editing the SDR video indicated by the icon 121 and the HDR10 video indicated by the icon 122.

[0105] Implementation Figures 2A-2H In the method, the user can convert the HDR video into an SDR video during the mixed editing of the SDR video and the HDR video, so as to obtain the edited SDR video with high compatibility. In this way, the display effect of the edited SDR video can be ensured, and the edited SDR video can be normally displayed on the electronic device capable of displaying only the SDR video.

[0106] The specific process in which the electronic device 100 implements the video editing capability shown in the user interface will be introduced below. Figures 2A-2H The specific process in which the electronic device 100 implements the video editing capability shown in the user interface will be introduced below.

[0107] First, please refer to Figure 3 , Figure 3 is a schematic diagram of a software architecture of the electronic device 100 provided by an embodiment of the present application.

[0108] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 100.

[0109] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, and from top to bottom, they are an application layer, an application framework layer, an Android runtime and a system library, and a kernel layer.

[0110] The application layer can include a series of application packages. As Figure 3 shown, the application packages can include camera, gallery, video, music, navigation, calendar, map, WLAN, and the like. In the embodiment of the present application, the application layer further includes a video editing application. The video editing application has video data processing capability and can provide the user with the function of editing the video, including format conversion, cropping, rendering, adding materials, and the like. Figures 2E-2H The user interface shown can be regarded as the user interface provided by the video editing application described above.

[0111] The application framework layer provides the application programming interface (API) and the programming framework for the application programs of the application layer. The application framework layer includes some pre-defined functions. AsFigure 3 As shown, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0112] The window manager is used to manage windows. The window manager can acquire the size of the display screen, determine whether there is a status bar, lock the screen, and capture the screen, etc.

[0113] The content provider is used to store and acquire data, and make the data accessible to the application. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, phonebook, etc.

[0114] The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, etc. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.

[0115] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call state (including call connection, call hang-up, etc.).

[0116] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.

[0117] The notification manager makes the application display notification information in the status bar, which can be used to convey a type of message that can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform the completion of the download, message reminders, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as a notification of an application running in the background, or a notification in the form of a dialogue window appearing on the screen. For example, prompting text information in the status bar, issuing a prompt sound, the electronic device vibrating, the indicator light flashing, etc.

[0118] In the embodiments of the present application, the application framework layer further includes a media framework. The media framework provides a plurality of tools for editing videos and audios. The tools include an encoder and a decoder.

[0119] The encoder can convert a video or audio in one form input into the encoder into another form through compression technology, and the decoder performs the reverse process of encoding, and can convert a video or audio in one form input into the decoder into another form through decompression technology.

[0120] For example, the video inputted into the decoder can be an HDR video, which is composed of N video frames with BT2020 color gamut, where N is a positive integer greater than 1. After receiving the HDR video, the decoder can split the video composed of the N video frames with BT2020 color gamut into N independent video frames for subsequent image processing of each video frame by the electronic device 100.

[0121] For another example, the video inputted into the decoder can be an SDR video, which is composed of M video frames with BT709 color gamut, where M is a positive integer greater than 1. After receiving the SDR video, the decoder can split the video composed of the M video frames with BT709 color gamut into M independent video frames for subsequent image processing of each video frame by the electronic device 100.

[0122] The Android Runtime includes a core library and a virtual machine. The Android Runtime is responsible for scheduling and management of the Android system. The core library contains two parts: one part is the function function called by the java language, and the other part is the core library of Android.

[0123] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.

[0124] The system library can include a plurality of functional modules. For example: surface manager, media library, three-dimensional graphics processing library (such as: OpenGL ES), 2D graphics engine (such as: SGL) and the like. The surface manager is used to manage the display subsystem and provides 2D and 3D layer fusion for multiple applications. The media library supports playback and recording of a variety of commonly used audio, video formats, and static image files and the like. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG and the like. The three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis, and layer processing and the like. The 2D graphics engine is a drawing engine for 2D drawing.

[0125] The Open Graphics Library (OpenGL) provides numerous image rendering functions that can be used to draw everything from simple graphics to complex 3D scenes. In this embodiment, the OpenGL provided by the system library can be used to divide the texture corresponding to a video frame into multiple sub-regions, for example, 50*50=2500 sub-regions, and perform statistics on the brightness of each sub-region.

[0126] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0127] Please see Figure 4 , Figure 4 This is a flowchart illustrating a video editing method provided in an embodiment of this application. The following is a summary of the process. Figures 2A-2H The user interface shown and Figure 3 The software architecture of the electronic device 100 shown is illustrated, and the flow of the video editing method provided in the embodiments of this application is introduced.

[0128] S401, Electronic device 100 determines the video to be edited selected by the user.

[0129] The user selects one or more videos to be edited, which can be HDR videos and / or SDR videos.

[0130] When displaying images, videos, and other image resources stored in the gallery for users to browse, the electronic device 100 can display editing controls. These editing controls provide users with the service of editing the currently displayed image resources. The video editing method provided in this application embodiment is mainly applied to video-type image resources. Subsequent embodiments will use video as an example to introduce the video editing method provided in this application embodiment.

[0131] refer to Figure 2B The user interface shown allows the electronic device 100 to detect user actions on icon 121 and, in response to these actions, display... Figure 2C The user interface shown.

[0132] Taking multiple videos to be edited as an example, refer to... Figure 2C In the user interface shown, the electronic device 100 can detect a selection operation performed on the selection window "○" 131 in the lower left corner of icon 121, and in response to the selection operation, mark "√" in "○" 131. Subsequently, the electronic device 100 can also detect a selection operation performed on the selection window "○" 132 in the lower left corner of icon 122, and in response to the selection operation, mark "√" in "○" 132. Simultaneously, the electronic device 100 can display as shown... Figure 2DThe user interface shown. At this time, the electronic device 100 can 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] After that, with reference to the user interface shown in Figure 2D The electronic device can detect a user operation acting on the editing control 143, and in response to the operation, display the user interface shown in Figure 2E

[0134] S402, the electronic device 100 decodes the video to be edited to obtain the video frame to be edited.

[0135] After detecting the user operation acting on the editing control 143, the electronic device 100 can initialize the video editing environment. Initializing the video editing environment means creating or applying the tools, storage space required for editing the video, so that the electronic device 100 can perform data processing for editing the video.

[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 video frame sequence; the OpenGL can be used to adjust the video frame and / or modify the pixel points in the video frame, so as to change the image content included in the video, that is, to 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 can use the decoder to decode the determined SDR video and HDR10 video to obtain an SDR video frame sequence and an HDR10 video frame sequence. For example, the electronic device 100 detects a selection operation acting on the selection window "O" in the lower left corner of the icon 122 in the user interface shown in Figure 2C

[0138] S403, the electronic device 100 converts N video frames in the first video format in the video frame to be edited into N video frames in the second video format based on the video brightness range of the second video format.

[0139] With reference to the user interface shown in Figure 2E The window 151 can provide the user with the browsing of image resources stored in the electronic device 100; the conversion control in the operation bar 153 can provide the user with the service of video format conversion. The window 152 displays the video frame stream of the video to be edited. At this time, the 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 illustrate that the electronic device 100 converts the video frames in the first video format in the video to be edited to video frames in 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 greater than the range of brightness and darkness of colors that can be represented by the video brightness range of the second video format.

[0141] After detecting the user operation on the operation bar 153, the electronic device 100 can perform different editing strategies on the video to be edited in response to the operation to meet the personalized needs of the user. For example, the electronic device 100 can detect a left swipe operation on the window 152, and in response to the operation, display the HDR10 video frames in the window 151. Then, the electronic device 100 can detect a user operation on the conversion control in the operation bar 153, and in response to the operation, display operations belonging to the “conversion” category, such as “HDR10 to SDR”, “HDR10+ to SDR”, “SDR to HDR10”, and the like, in the operation bar 154. After that, the electronic device 100 can detect a user operation on the “HDR10 to SDR” control, and in response to the operation, perform format conversion on the HDR10 video frames to obtain SDR video frames.

[0142] Specifically, please refer to Figure 5 , Figure 5 is a flowchart of the electronic device 100 performing format conversion on HDR video frames provided by an embodiment of the present application. Figure 5 (1)-(3) in the above table show the flow of the electronic device 100 converting HDR video frames to SDR video frames.

[0143] Firstly, (1) the electronic device 100 can process each video frame (HDR video frame) in the N video frames corresponding to the sequence of HDR video frames 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 sequence of HDR10 video frames. Wherein, 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, which can be camera preview or video decoding data. Then, the electronic device 100 uses the 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 to obtain the normalized electronic RGB texture (Normalized Ellectronic RGB Texture), and the frame light information (or called brightness information) of the video frame is calculated to obtain the light information of the video frame.

[0144] Secondly, (2) the electronic device 100 converts the normalized electronic RGB texture into an optical signal using an electrical optical transfer function (EOTF), and normalizes the optical signal to obtain a normalized optical signal. Wherein, EOTF is a key technology in HDR technical standard, which is a mathematical function that maps mathematically encoded pixel values to display luminance. In other words, an ETOF defines how mathematically encoded pixel values in an image are displayed as visible light by a display or projector. The HDREOTF 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 by tone mapping (TM) method based on the video brightness range of SDR.

[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 first brightness converted video frame.

[0147] In the 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, the electronic device 100 can divide the texture of the normalized optical signal of the video frame into a plurality of sub-regions, such as 50*50=2500 sub-regions, by Open GL, and determine the maximum brightness of the video frame based on the RGB values of the pixel points corresponding to each sub-region.

[0148] Referring to Figure 6 , Figure 6 is a schematic diagram of partitioned brightness information statistics provided by the embodiment of the present application. As shown in Figure 6 , the electronic device 100 can divide the video frame into 50 parts at equal intervals in the horizontal direction, and divide the video frame into 50 parts at equal intervals in the vertical direction, thereby forming 50*50=2500 rectangular regions. That is, the electronic device 100 can divide the video frame into 50*50=2500 sub-regions. Each sub-region is replaced by a pixel point, so that the video frame is sampled into a set of 2500 pixel points. Optionally, the RGB value of the pixel point corresponding to each sub-region can be the average value of R, G, and B in the sub-region, or the maximum value of R, G, and B in the sub-region.

[0149] Optionally, when the electronic device 100 determines the maximum brightness of the video frame based on the RGB value of the pixel point corresponding to each sub-region, the following formula (1) can 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 R, G, and B in each sub-region, which is used to replace the RGB value of the pixel point corresponding to each sub-region; 2500max(R,G,B) represents the RGB value of the pixel point corresponding to each of the 2500 sub-regions; top20max(R,G,B) represents the RGB value of the sub-region whose RGB value is ranked first among the 2500 sub-regions; and avg() represents an average value 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 can be converted into 1.

[0153] For example, referring to Figure 7A , Figure 7A is a schematic diagram of optical-to-optical conversion based on brightness statistics provided by the embodiment of the present application. As shown in Figure 7AAs shown, the horizontal axis represents the absolute brightness of the HDR image, and the vertical axis represents the relative brightness of the SDR image. The electronic device 100 can convert the maximum brightness of the video frame (the maximum absolute brightness in the HDR image) obtained based on brightness statistics into a relative brightness of 1 for SDR. Specifically, the electronic device 100 can use an opticato optical transfer function (OOTF) to convert the maximum brightness of the video frame into a relative brightness of 1 for SDR. OOTF is a mathematical function that maps the brightness of a captured scene to the brightness of a display.

[0154] See Figure 7B , Figure 7B This is a schematic diagram of light-to-light conversion based on a fixed brightness. For example... Figure 7B As shown, the horizontal axis represents the absolute brightness of the HDR image, and the vertical axis represents the relative brightness of the SDR image. The electronic device 100 can convert an HDR video frame with a brightness of 1000 nits to an SDR relative brightness of 1. This results in overexposure of the SDR image corresponding to HDR video frames with a brightness exceeding 1000 nits, and underexposure of the SDR image corresponding to HDR video frames with a brightness below 1000 nits.

[0155] See Figure 8 , Figure 8 This is a comparison diagram showing the effects of photo-to-photon conversion based on brightness statistics and photo-to-photon statistics based on fixed brightness, provided in an embodiment of this application. Figure 8 Image (a) is the image after photo-to-photo conversion based on a fixed brightness of 1000 nits. Figure 8 Image (b) is the image after photo-to-photo conversion based on luminance statistics. It can be seen that the electronic device 100 converts the maximum luminance of the video frame obtained from luminance statistics into a relative luminance of 1 in SDR. Compared with the method of converting the fixed luminance (e.g., 1000 nits) of the video frame into a relative luminance of 1 in SDR, it can avoid the overexposure problem of the SDR image corresponding to the image with a luminance exceeding 1000 nits in the video frame.

[0156] After converting the maximum brightness of the video frame to 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 further determine, based on the maximum luminance of the video frame, a luminance threshold corresponding to the video frame after the first luminance conversion; and convert the luminance of each pixel in the video frame based on the luminance value of each pixel and the luminance threshold corresponding to the video frame, to obtain the video frame after the second luminance conversion.

[0158] Optionally, when determining the luminance threshold corresponding to the video frame after the first luminance conversion based on the maximum luminance of the video frame, the electronic device 100 can use the following formula (2).

[0159]

[0160] In formula (2), L represents the maximum luminance of the video frame, and z represents the luminance threshold corresponding to the video frame after the first luminance conversion.

[0161] Optionally, the electronic device 100 converts the luminance of each pixel in the video frame based on the luminance of each pixel and the luminance threshold corresponding to the video frame after the first luminance conversion, to obtain the video frame after the second luminance conversion, can include: for a first type of pixel in the video frame after the first luminance conversion, whose luminance is greater than or equal to the luminance threshold, converting the luminance of the first type of pixel in a linear luminance conversion manner; for a second type of pixel in the video frame after the first luminance conversion, whose luminance is less than the luminance threshold, converting the luminance of the second type of pixel in a non-linear luminance conversion manner; and obtaining the video frame after the second luminance conversion based on the luminance-converted pixels. The video format of the video frame after the second luminance conversion is SDR.

[0162] Specifically, the electronic device 100 can convert the luminance of each pixel in the video frame after the first luminance conversion using the following formula (3).

[0163]

[0164] In formula (3), x represents the normalized value of the pixel value of R, G, and B channels of a pixel in the video frame, that is, the three pixel values of R, G, and B channels each correspond to one f(x); z represents the luminance threshold corresponding to the video frame after the first luminance conversion; and f(x) represents the luminance after luminance conversion of the pixel value x of the pixel.

[0165] The above method of converting the luminance of each pixel in the video frame after the first luminance conversion using formula (2) and (3) can also be referred to as dynamic TM OOTF. That is, the electronic device 100 can perform second luminance conversion on the luminance of each pixel in the video frame after the first luminance conversion through the method of dynamic TM OOTF.

[0166] Please refer to Figure 9A , Figure 9A is a schematic diagram of a dynamic TM OOTF provided by an embodiment of the present application. As shown in Figure 9A , the horizontal coordinate represents the absolute luminance of the HDR picture, and the vertical coordinate represents the relative luminance of the SDR picture. Assuming that the maximum luminance of the video frame obtained by the electronic device 100 based on the luminance statistics is 4000 nits, it can be obtained based on the above formulas (2) and (3) that the HDR absolute luminance 400 nits can be converted into the SDR relative luminance 0.136.

[0167] Please refer to Figure 9B , Figure 9B is a schematic diagram of a linear OOTF. As shown in Figure 9B , the horizontal coordinate represents the absolute luminance of the HDR picture, and the vertical coordinate represents the relative luminance of the SDR picture. Assuming that the maximum luminance of the HDR picture is 400 nits, the HDR absolute luminance 400 nits can be converted into the SDR relative luminance 1, and when the maximum luminance of the HDR picture is 4000 nits, the HDR absolute luminance 400 nits can be converted into the SDR relative luminance 0.1.

[0168] Please refer to Figure 10 , Figure 10 is a comparison diagram of the effects of the dynamic TM OOTF and the linear OOTF on the video frame after the first luminance conversion provided by an embodiment of the present application. In the comparison diagram, Figure 10 , (a) is a picture obtained by performing linear OOTF processing on the picture, Figure 10 , (b) is a picture obtained by performing dynamic TM OOTF processing on the picture. It can be seen that the electronic device 100 performs again the luminance conversion on each pixel point in the video frame after the first luminance conversion by the method of the dynamic TM OOTF, and compared with performing again the luminance conversion on each pixel point in the video frame after the first luminance conversion by the method of the linear OOTF, the display effect of the dark part of the video frame after the first luminance conversion can be effectively improved.

[0169] Please refer to Figure 11 , Figure 11 is a visual schematic diagram of a group of different luminance dynamic TM curves provided by an embodiment of the present application. Figure 11In the pictures 1101-1106, the abscissa represents the absolute luminance of the normalized HDR picture, and the ordinate represents the relative luminance of the SDR picture after the second luminance conversion of the luminance of each pixel in the video frame after the first luminance conversion. In the picture 1101, the maximum luminance maxPQ of the video frame is 500; in the picture 1102, the maximum luminance maxPQ of the video frame is 1000; in the picture 1103, the maximum luminance maxPQ of the video frame is 2000; in the picture 1104, the maximum luminance maxPQ of the video frame is 3000; in the picture 1105, the maximum luminance maxPQ of the video frame is 4000; and in the picture 1106, the maximum luminance maxPQ of the video frame is 10000.

[0170] After the electronic device 100 performs the above processing on each of the N video frames corresponding to the sequence of HDR10 video frames, the electronic device 100 can obtain N video frames after the second luminance conversion, wherein the video format of the N video frames after the second luminance 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 an explanation of the electronic device 100 converting the video frames in the first video format in the video to be edited to video frames in the second video format based on the video luminance range of the second video format. In the following, an example in which the first video format is SDR and the second video format is HDR is used to explain the electronic device 100 converting the video frames in the first video format in the video to be edited to video frames in the second video format based on the video luminance range of the second video format. In this case, the range of brightness and darkness of colors that can be represented by the video luminance range of the first video format is smaller than the range of brightness and darkness of colors that can be represented by the video luminance range of the second video format.

[0172] The electronic device 100 can detect a left swipe operation acting on the window 152, and in response to the operation, display the SDR video frame in the window 151. Then, the electronic device 100 can detect a user operation acting on the conversion control in the operation bar 153, and in response to the operation, display operations belonging to the “conversion” category, such as “SDR to HDR10”, “SDR to HDR10+”, etc., in the operation bar 154. After that, the electronic device 100 can detect a user operation acting 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 of the N video frames (SDR video frames) corresponding to the SDR video frame sequence to obtain a normalized electronic RGB texture corresponding to the video frame (SDR video frame) and frame light information of the video frame. Second, the electronic device 100 converts the normalized electronic RGB texture into an optical signal using an electrical optical transfer function (EOTF), and normalizes the optical signal to obtain a normalized optical signal. The SDR EOTF is a gamma EOTF. Then, the electronic device 100 can perform weighting processing on the luminance of the SDR video frame based on the video luminance range of the HDR video to obtain a luminance-weighted video frame, wherein the luminance value of each pixel point in the luminance-weighted video frame is within the HDR video luminance range. That is, the video format of the luminance-weighted video frame is HDR.

[0174] S404, the electronic device 100 processes the N video frames of the second video format to obtain a video of the second video format.

[0175] When the electronic device 100 processes the N video frames of the second video format to obtain a video of the second video format, the electronic device 100 can first perform luminance smoothing processing between each adjacent two video frames in the N video frames after the second luminance conversion to obtain N video frames after luminance smoothing processing; and process the N video frames after luminance smoothing processing to obtain a video of the second video format.

[0176] Optionally, when the electronic device 100 performs luminance smoothing processing between each adjacent two video frames in the N video frames after the second luminance conversion to obtain N video frames after luminance smoothing processing, for each video frame in the N video frames after the second luminance conversion, the electronic device 100 can use the following formula (4) to obtain the video frame after luminance smoothing processing.

[0177] X(t) = 0.9 * X(t-1) + 0.1 * M(t) (4)

[0178] In formula (4), M(t) represents the luminance obtained after luminance statistics of the current video frame; X(t-1) represents the luminance of the previous video frame of the current video frame; and X(t) represents the luminance of the current video frame after luminance smoothing processing (or the luminance of the current video frame after luminance correction).

[0179] Referring to Figure 12 , Figure 12is an effect comparison chart provided by the embodiment of the present application before and after the brightness smoothing processing between adjacent video frames. Wherein, Figure 12 (a) in the figure is four video frames before the brightness smoothing processing between adjacent video frames, Figure 12 (b) in the figure is four video frames after the brightness smoothing processing between adjacent video frames. It can be seen that the electronic device 100 can effectively avoid the problem of unnatural brightness jump between frames by using the method of time domain filtering to perform brightness smoothing processing between frames, so as to make 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 the method of color gamut mapping. Specifically, as shown in (4) in the figure, Figure 5 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 the normalized BT709 light information.

[0181] Then, the electronic device 100 can also display any one video frame in the video in the second video format in the window 152 in the user interface shown in Figure 2E Specifically, as shown in (5) in the figure, Figure 5 After obtaining the video in the second video format, the electronic device 100 can convert the video in the second video format into an electrical signal by using an optical electronic transfer function (OETF), and display it in the user interface shown in Figure 2E Wherein, the OETF is a mathematical function that maps the scene brightness (light of a certain scene) and the transmittable compressed digital coded pixel value.

[0182] Optionally, after obtaining the video in the second video format, the electronic device 100 can also detect the user operation acting on the save control 156 in the user interface shown in Figure 2E In response to the operation, the video in the second video format is saved.

[0183] In the embodiment of the present application, the electronic device 100 can input the HDR video and the SDR video into the video editor, and convert the format of the HDR video and the SDR video based on the video brightness range corresponding to the required output video format, unify the format of the video, and be compatible with the screen specification of the electronic device 100, thereby facilitating to maintain or improve the video quality output by the electronic device 100.

[0184] Figure 13This is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application.

[0185] like Figure 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, a headphone jack 170D, a sensor module 180, buttons 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, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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 understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more than Figure 13 This may involve more or fewer components, or combining certain components, or splitting certain components, or different component arrangements. Figure 13 The components shown can be implemented in hardware, software, or a combination of both.

[0187] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These 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 the timing signal, and complete the control of fetching and executing instructions.

[0189] The processor 110 can 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 can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0190] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can 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 can include multiple sets of I2C buses. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example, the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, 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 sets of I2S buses. The processor 110 can be coupled with the audio module 170 through the I2S buses to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the I2S interface to enable the function of answering a phone call through a Bluetooth earphone.

[0193] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 can be coupled with the wireless communication module 160 through a PCM bus interface. In some embodiments, the audio module 170 can also deliver audio signals to the wireless communication module 160 through the PCM interface to enable the function of playing music through a Bluetooth earphone. Both the I2S interface and the PCM interface can be used for audio communication.

[0194] The UART interface is a universal serial bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually 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 enable Bluetooth functionality. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the UART interface to enable the function of playing music through a Bluetooth earphone.

[0195] The MIPI interface can be used to connect the processor 110 and 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), and the like. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to enable the camera function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to enable the display function of the electronic device 100.

[0196] The GPIO interface can be configured through 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 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.

[0197] The USB interface 130 is an interface conforming to the USB standard specification, and 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 transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0198] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.

[0199] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 140B while also supplying power to 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 to supply power to the processor 110, the internal memory 120B, the display screen 194, the camera 193, and the wireless communication module 160, etc. The power management module 140A can also be used to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), etc. In other embodiments, the power management module 140A can also be provided in the processor 110. In other embodiments, the power management module 140A and the charging management module 140 can also be provided in the same device.

[0201] The wireless communication function of the electronic device 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0202] Antennas 1 and 2 are used for transmitting and receiving 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 multiplexed to improve the utilization of antennas. For example, antenna 1 can be multiplexed as a diversity antenna for wireless local area networks. In some other embodiments, antennas can be used in combination with tuning switches.

[0203] Mobile communication module 150 can provide solutions for wireless communication including 2G / 3G / 4G / 5G, etc. applied on electronic device 100. Mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. Mobile communication module 150 can receive electromagnetic waves by antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to a modem processor for demodulation. Mobile communication module 150 can also amplify signals modulated by the modem processor, and convert the amplified signals into electromagnetic waves radiated by antenna 1. In some embodiments, at least part of the functional modules of mobile communication module 150 can be arranged in processor 110. In some embodiments, at least part of the functional modules of mobile communication module 150 can be arranged in the same device as at least part of the modules of processor 110.

[0204] The modem processor can include a modulator and a demodulator. The modulator is used to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to a baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to an application processor. The application processor outputs a sound signal through an audio device (not limited to loudspeaker 170A, microphone 170B, etc.), or displays an image or video through display screen 194. In some embodiments, the modem processor can be a separate device. In some other embodiments, the modem processor can be independent of processor 110, and arranged in the same device as mobile communication module 150 or other functional modules.

[0205] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, frequency-modulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and radiate it as an electromagnetic wave via the antenna 2.

[0206] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can 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, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0207] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.

[0208] In the embodiments of the present application, the electronic device 100 displays Figures 2A-2H The user interface shown can be completed through a decoder, OpenGL, FrameWork, a third-party SDK, and the display screen 194.

[0209] The display screen 194 is configured to display images, videos, and the like. 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 (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-OLED, a quantum dot light emitting diode (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0210] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.

[0211] In the embodiments of the present application, the video to be edited can be obtained by the electronic device 100 from other electronic devices through the wireless communication function, or can be obtained by the electronic device 100 through the ISP, the camera 193, the video codec, the GPU, and the display screen 194.

[0212] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, 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 the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the algorithm of the noise and brightness of the image. The ISP can also optimize the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be arranged in the camera 193.

[0213] The camera 193 is used to capture still images or videos. Objects project optical images through the lens to 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 transmits the electrical signal to the ISP to convert 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 a standard RGB, YUV, etc. format image signal. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.

[0214] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 is in frequency selection, the digital signal processor is used to perform Fourier transform on the frequency energy, etc.

[0215] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0216] The NPU is a neural-network (NN) computing processor, which learns from the structure of biological neural networks, such as the transmission mode between human brain neurons, and can quickly process input information and continuously self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition applications, such as: image recognition, face recognition, voice recognition, text understanding, etc.

[0217] The internal memory 120B can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs).

[0218] The random access memory can 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, such as the fifth generation DDR SDRAM commonly referred to as DDR5 SDRAM), and the like.

[0219] The non-volatile memory can include a magnetic disk storage device, flash memory.

[0220] The flash memory can include NOR FLASH, NAND FLASH, 3D NAND FLASH, and the like according to the operating principle, single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), and the like according to the storage unit potential order, and universal flash storage (UFS), embedded multi media Card (eMMC), and the like 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 an operating system or other programs running, and can also be used to store data of users and application programs, and the like.

[0222] The non-volatile memory can also store executable programs and store data of users and application programs, and the like, which can be loaded in advance into the random access memory for direct reading and writing by the processor 110.

[0223] The external memory interface 120A can be used to connect an external nonvolatile memory to extend the storage capacity of the electronic device 100. The external nonvolatile memory communicates with the processor 110 through the external memory interface 120A to implement a data storage function. For example, files such as music, videos, and the like are saved in the external nonvolatile memory. In embodiments of the present application, if the video to be edited is captured by the user through the electronic device 100, the electronic device 100 can capture sound through the microphone 170C when capturing the video. During the process of playing the video, the loudspeaker 170A or the loudspeaker connected to the earphone interface 170D can support playing the audio in the video.

[0224] The electronic device 100 can implement an audio function through the audio module 170, the loudspeaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, and the like. For example, music playing, recording, and the like.

[0225] The audio module 170 is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode an audio signal. In some embodiments, the audio module 170 can be disposed in the processor 110, or part of the function modules of the audio module 170 can be disposed in the processor 110.

[0226] The loudspeaker 170A, also known as a "horn", 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 loudspeaker 170A.

[0227] The receiver 170B, also known as a "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be heard by placing the receiver 170B close to the ear.

[0228] The microphone 170C, also known as a "microphone", "sound collector", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can make a sound by placing the mouth close to the microphone 170C to input the sound signal into the 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, in addition to collecting sound signals, it can also implement a 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, and also identify the source of the sound to implement a directional recording function, and the like.

[0229] The earphone interface 170D is used to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm 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 a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the force according to the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view a short message is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.

[0231] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake photography. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of shaking of the electronic device 100, and calculates the distance that the lens module needs to compensate according to the angle, so that the lens counteracts the shaking of the electronic device 100 by reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B can also be used for navigation and motion sensing game scenarios.

[0232] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude, assists positioning and navigation by using the air pressure value measured by the barometric pressure sensor 180C.

[0233] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect opening and closing of a flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the cover or the flip, a feature such as automatic unlocking of the flip is set.

[0234] The acceleration sensor 180E can detect the magnitude of acceleration of the electronic device 100 in each direction (typically, three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the electronic device posture, applied to landscape / portrait switching, pedometer, etc.

[0235] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance by infrared or laser. In some embodiments, when a scene is photographed, the electronic device 100 can measure distance using the distance sensor 180F to achieve fast focusing.

[0236] The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode. The electronic device 100 emits infrared light outwardly through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using the photodiode. 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 detect that the user holds the electronic device 100 close to the ear for a call using the proximity light sensor 180G, so as to automatically turn off the screen to achieve power saving. The proximity light sensor 180G can also be used for automatic unlocking and locking of the cover mode and pocket mode.

[0237] The ambient light sensor 180L is used to sense ambient light brightness. The electronic device 100 can adaptively adjust the display screen 194 brightness according to the sensed 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 the pocket to prevent accidental touch.

[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 lock, fingerprint photographing, fingerprint answering incoming calls, etc.

[0239] The temperature sensor 180J is configured to detect temperature. In some embodiments, the electronic device 100 performs temperature handling strategies based on the temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In another example, 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 caused by low temperature. In another example, when the temperature is lower than yet 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 referred to as a "touch device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch panel". The touch sensor 180K is configured to detect a touch operation acting on or near the touch sensor 180K. The touch sensor 180K can transmit 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 another example, the touch sensor 180K can also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0241] In the embodiments of the present application, the electronic device 100 detects whether there is a user operation acting on the display screen 194 of the electronic device 100 through the touch sensor 180K. After the touch sensor 180K detects the user operation, the electronic device 100 can perform image processing indicated by the 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 human body sound vibration bone block. The bone conduction sensor 180M can also contact the human body pulse to receive a blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M can also be disposed in a headset to form a bone conduction headset. The audio module 170 can analyze a voice signal based on the vibration signal of the sound vibration bone block obtained by the bone conduction sensor 180M to achieve a voice function. The application processor can analyze heart rate information based on the blood pressure pulsation signal obtained by the bone conduction sensor 180M to achieve a heart rate detection function.

[0243] The keys 190 include a power-on key, a volume key, and the like. The keys 190 can be mechanical keys. Alternatively, the keys 190 can be touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0244] The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompt, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations acting on different regions of the display screen 194. Different application scenarios (such as time reminders, received messages, alarms, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0245] The indicator 192 can be an indicator light, which can be used to indicate the charging state, the power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0246] The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into or pulled out of the SIM card interface 195 to realize contact and separation with the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, and N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. The same SIM card interface 195 can simultaneously insert multiple cards. 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 storage cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calling and data communication. In some embodiments, the electronic device 100 uses an eSIM, that is, 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 the user clicking the conversion control for triggering the conversion of the video from the first video format to the second video format can be referred to as a first operation, for example, Figure 2E the operation of clicking the conversion control in the operation bar 153. The electronic device 100 can convert the video frame of the first video format into a 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 of the second video format can be referred to as a second operation, for example, Figure 2E the operation of clicking the save control 156.

[0250] The term "user interface (UI)" in the specification and claims of the present application and the accompanying drawings is a medium interface for interaction and information exchange between an application or an operating system and a user, which realizes conversion between an internal form of information and a form acceptable by the user. The user interface of an application is source code written in a specific computer language such as Java, extensible markup language (XML), etc., and the interface source code is parsed, rendered, and finally presented as content recognizable by the user such as a picture, a text, a button, etc. on a terminal device. A control (also referred to as a widget) is a basic element of a user interface, and typical controls include a toolbar, a menu bar, a text box, a button, a scrollbar, a picture, and a text. The properties and content of a control in an interface are defined by a tag or a node, such as an XML tag. <textview> 、 <imgview> 、 <videoview>The interface is defined by nodes that specify the controls contained in the interface. One node corresponds to one control or property in the interface, and the nodes are parsed and rendered to present the content visible to the user. In addition, many applications, such as hybrid applications, also contain web pages in the interface. A web page, also referred to as a page, can be understood as a special control embedded in the interface of an application. The web page is a source code written in a specific computer language, such as hyper text markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed by a browser or a web page display component similar to the function of a browser to present content recognizable to the user. The specific content contained in the web page is also defined by tags or nodes in the web page source code, such as HTML defines the content by tags, and the content is displayed by a browser or a web page display component similar to the function of a browser. 、 、 <video> 、 <canvas>to define the elements and attributes of a web page.

[0251] A common form of user interface is a graphic user interface (GUI), which refers to a user interface that displays in a graphical manner. It can be an icon, a window, a control, etc. interface element displayed in the display screen of an electronic device, wherein the control can include an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, a Widget, etc. visual interface element.

[0252] As used in the specification and the appended claims of the application, the singular forms "a", "an" and "the" are intended to include plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or", as used in the application, refers to and encompasses any and all possible combinations of one or more of the associated items. As used in the above description, the term "when" can be interpreted to mean "if" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "in response to determining" or "if detecting (a stated condition or event)" can be interpreted to mean "in response to determining" or "in response to detecting (a stated condition or event)", depending on the context.

[0253] The terms "first", "second", etc. in the specification and claims of the application and the drawings are used to distinguish different objects, not to describe a particular sequential order. In addition, the terms "comprises", "comprising", and "has", "having", and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, product, or apparatus that comprises a list of steps or elements, or optionally, further comprises additional steps or elements not listed, or optionally, further includes other steps or elements inherent in such process, method, product, or apparatus.

[0254] Only parts of the application are shown in the drawings and not all details of the application are shown. Before any exemplary embodiments are explained in detail, it is to be understood that the exemplary embodiments are described as processes or methods depicted as flow diagrams. Although the processes are described in a particular sequential order, many of the processes can be performed concurrently, in parallel, or simultaneously. In addition, the order of the processes can be re-arranged. The processes terminate when their functions are completed, but can also terminate in the middle of the processes. The processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0255] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented 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, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. 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 one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk) and the like.

[0256] Those of ordinary skill in the art understand that all or part of the processes in the above embodiments can be implemented by a computer program to instruct the relevant hardware, which can be stored in a computer readable storage medium. The program can include the processes of the above method embodiments when executed. The aforementioned storage medium includes ROM or random access memory (RAM), magnetic disk or optical disk, and various media that can store program codes.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A video editing method characterized by, The method comprises: detecting a first operation acting 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, converting a maximum brightness of each video frame in the video to a maximum brightness of a video brightness range of the second video format; determining a brightness threshold corresponding to each video frame according to the maximum brightness of the video frame; for a first type of pixel point in the converted each video frame, 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 point in a linear brightness conversion manner; for a second type of pixel point in the converted each video frame, whose brightness value is less than the brightness threshold corresponding to the video frame, converting the brightness of the second type of pixel point in a non-linear brightness conversion manner; obtaining the video in the second video format according to the pixel points after brightness conversion.

2. The method of claim 1, wherein, The range of brightness of colors that can be represented by the video brightness range of the first video format is greater than the range of brightness of colors that can be represented by the video brightness range of the second video format.

3. The method of claim 1, wherein, The method further comprises: dividing each video frame in the video into regions to obtain a plurality of regions corresponding to the each video frame; determining the maximum brightness of the each video frame according to the RGB values of the pixel points corresponding to each region in the plurality of regions corresponding to the each video frame.

4. The method of claim 1, wherein: performing brightness smoothing processing between each adjacent two video frames in the plurality of video frames after brightness conversion.

5. The method of claim 1, wherein, The range of brightness of colors that can be represented by the video brightness range of the first video format is less than the range of brightness of colors that can be represented by the video brightness range of the second video format.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: displaying any one video frame in the video in the second video format on a first interface.

7. The method of claim 6, wherein, The method further comprises: detecting a second operation acting on a save control in the first interface; in response to the second operation, saving the video in the second video format.

8. An electronic device, comprising: comprise: a memory, a processor and a touch screen; wherein: the touch screen is used to display content; the memory is used to store a computer program, the computer program comprising program instructions; the processor is used to invoke the program instructions, so that the electronic device executes the method of any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • 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