Video display method and electronic device

By identifying the effective areas in HDR videos and generating corresponding metadata, it solves the display problems caused by metadata errors after HDR video editing, improves the display effect and improves efficiency.

CN117714768BActive Publication Date: 2024-10-11HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311018848.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2024-10-11
Estimated Expiration
2043-08-11

AI Technical Summary

Technical Problem

There may be errors in the metadata generated after editing of HDR videos, resulting in poor video display effects. Especially during the video encoding and decoding process, the impact of masking caused by editing operations is difficult to effectively handle.

Method used

By identifying the effective area in the HDR video, the corresponding HDR metadata is generated, and the image parameters are adjusted during the video encoding and decoding stages to avoid the impact of masking caused by editing, and processing is only based on the metadata of the effective area.

Benefits of technology

It improves the display effect of HDR video, reduces the processing complexity, and improves the efficiency of the video display process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117714768B_ABST
    Figure CN117714768B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a video display method and electronic device, including: when a first operation is detected, a first HDR video is obtained, the first operation is an operation of exporting a source HDR video after editing, the source HDR video is a video stored in an electronic device, and the first HDR video is video data after the source HDR video is edited; the first HDR video is identified, and a valid area in the first HDR video is determined, the valid area in the first HDR video is an area in the first HDR video where video content is presented; according to the valid area in the first HDR video, HDR metadata corresponding to the first HDR video is generated, and an HDR video stream is generated according to the first HDR video encoding; when a second operation is detected, the valid area in the HDR video stream is identified, and according to the HDR metadata corresponding to the first HDR video, the image parameters of the valid area in the HDR video stream are adjusted to display the first HDR video, and the second operation requests the display of the first HDR video. This can improve the display effect of the HDR video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a video display method and an electronic device. Background Art

[0002] Currently, electronic devices support more and more video types. For example, to improve the display effect of videos, electronic devices can support high dynamic range (HDR) imaging. In some scenarios, users can use the camera application of electronic devices to shoot HDR videos and browse the HDR videos through the gallery application.

[0003] Generally, HDR video needs to go through the video encoding and video decoding process to be displayed normally. In the video encoding stage, HDR video stream and HDR metadata need to be output for HDR video stream compression and HDR metadata packaging. If the HDR video has undergone other editing operations, the generated HDR metadata may have errors, resulting in poor display effects of the HDR video. Summary of the invention

[0004] The present application provides a video display method and an electronic device, which can improve the display effect of HDR video.

[0005] In a first aspect, the present application provides a video display method, which is performed by an electronic device and includes:

[0006] When a first operation is detected, a first HDR video is acquired, where the first operation is an operation of exporting a source HDR video after editing, the source HDR video is a video stored in an electronic device, and the first HDR video is video data after the source HDR video is edited;

[0007] Identify the first HDR video and determine a valid area in the first HDR video, where the valid area in the first HDR video is an area in the first HDR video where video content is presented;

[0008] Generate HDR metadata corresponding to the first HDR video according to the valid area in the first HDR video, and generate an HDR video stream according to the first HDR video encoding;

[0009] When the second operation is detected, a valid area in the HDR video stream is identified, and image parameters of the valid area in the HDR video stream are adjusted according to the HDR metadata corresponding to the first HDR video to display the first HDR video, and the second operation requests the display of the first HDR video.

[0010] Among them, the first operation can be an operation of exporting the source HDR video after editing, for example, the source HDR video can be edited and exported through the editing control in the gallery application. The source HDR video here can be obtained by shooting through the camera application of the electronic device, or it can be transmitted and sent from other electronic devices, or obtained by other means. In short, it is an HDR video that has been stored in the electronic device. Because the first HDR video is an edited video, there may be a mask in the upper and lower positions of the first HDR video, which does not actually belong to the video content, that is, the added mask is not the effective area of ​​the video, and the added mask will affect the generation result of the metadata. Therefore, when generating HDR metadata, the present application can only generate HDR metadata corresponding to the effective area in the first HDR video. Then in the video encoding stage of the electronic device, the HDR metadata obtained is the HDR metadata corresponding to the effective area. If so, when the electronic device decodes the video in the subsequent video, the HDR metadata should also adjust the image parameters corresponding to the effective area of ​​the video. Therefore, when the user triggers the display and playback of the first HDR video, that is, in the video decoding stage, the electronic device also needs to identify the effective area in the HDR video stream, and adjust the image parameters of the effective area in the HDR video stream according to the HDR metadata, and finally display the first HDR video.

[0011] Optionally, the HDR metadata may be dynamic metadata, while the static metadata applied to the entire video stream may still be generated according to the entire first HDR video.

[0012] In the above implementation, when the electronic device performs video encoding on the edited first HDR video, it can determine the valid area in the first HDR video and only generate HDR metadata corresponding to the valid area, and when performing video decoding, it can determine the valid area in the HDR video stream and only adjust the image parameters of the valid area in the HDR video stream according to the HDR metadata corresponding to the valid area to display the first HDR video. As a result, the electronic device no longer considers the impact of the masking caused by the editing operation in the HDR video, thereby improving the display effect of the HDR video; at the same time, performing video decoding only according to the HDR metadata of the valid area can also reduce the computational complexity of the processing process and improve the efficiency of the video display process.

[0013] In combination with the first aspect, in some implementations of the first aspect, the image frames in the above-mentioned HDR video stream include I frames, P frames and B frames, and the above-mentioned identifying the valid area in the HDR video stream includes: identifying the valid areas in the I frames, P frames and B frames respectively.

[0014] Among them, the image frames in the HDR video stream obtained by video encoding may include I frames, P frames and B frames. I frames, P frames and B frames are different types of image frames. I frames are intra-frame coded frames, P frames are forward prediction coded frames, and B frames are bidirectional prediction interpolation coded frames. Then the electronic device can respectively identify the valid areas in the I frames, P frames and B frames to obtain the valid areas in the HDR video stream.

[0015] In some implementations, the identifying of valid areas in I-frames, P-frames, and B-frames, respectively, includes:

[0016] When the image frame is an I frame, obtaining residual data of all coding blocks in the I frame;

[0017] Mark the coding block whose residual data is 0 as the first coding block;

[0018] Determine the largest rectangular area formed by the first coding block as a non-valid area, and determine the area other than the non-valid area in the I frame as a valid area;

[0019] When the image frame is a P frame or a B frame, obtaining block types of all coding blocks in the P frame or the B frame;

[0020] Marking a coding block whose block type is skip type as the first coding block;

[0021] The largest rectangular area formed by the first coding block is determined as a non-valid area, and the area other than the non-valid area in the P frame or the B frame is determined as a valid area.

[0022] Among them, because I frames, P frames and B frames are different types of image frames, the electronic device can perform different recognition processes for I frames, P frames and B frames. For I frames, the residual data of the coding block can be carried in the coding block after encoding. The residual data represents the difference between the predicted pixel value and the actual pixel value of the coding block. If there is no difference between the predicted pixel value and the actual pixel value, the residual data of the coding block is 0, which can represent the coding block as an area without color difference, that is, a non-valid area. For P frames and B frames, because P frames and B frames are reference frames, they need to refer to other frames for encoding and decoding. Then, for a P frame (or B frame), if a coding block has the same color (pixel value) as the coding block it refers to, the coding block can be marked as a skip type, which can also represent the coding block as an area without color difference, that is, a non-valid area.

[0023] Therefore, after the electronic device obtains the HDR video stream, if a certain frame image is an I frame, the electronic device can obtain the residual data of all coding blocks in the I frame, and mark the coding block with residual data of 0 as the first coding block, for example, marked as 0; if a certain frame image is a P frame or a B frame, the electronic device can obtain the block type of all coding blocks in the P frame or the B frame, and mark the coding block with the block type of the skip type as the first coding block, for example, marked as 0. Then, the electronic device can determine that the largest rectangular area composed of the first coding block is a non-valid area, and the remaining area is a valid area.

[0024] In the above implementation, the electronic device can respectively identify the valid areas in I frames, P frames and B frames by performing different types of recognition processes on different types of coded frames, so as to improve the accuracy of the recognition results of the valid areas in the HDR video stream.

[0025] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned identifying the first HDR video and determining the valid area in the first HDR video includes: identifying each frame image in the first HDR video, determining the valid area in each frame image, so as to obtain the valid area in the first HDR video.

[0026] Among them, because the video is formed by continuous image frames, the electronic device can identify each frame of the first HDR video, determine the effective area in each frame of the image, and finally obtain the effective area in the first HDR video.

[0027] In some implementations, the electronic device may use an image recognition algorithm to identify each frame of the first HDR video to determine a valid area in each frame of the image. Optionally, the image recognition algorithm includes but is not limited to a depth-first search algorithm, a breadth-first search algorithm, and a convolutional neural network algorithm.

[0028] In combination with the first aspect, in some implementations of the first aspect, after determining the valid area in the first HDR video, the method further includes: storing information about the valid area in the first HDR video, the information about the valid area including position information of the valid area in the image frame of the first HDR video and size information of the valid area.

[0029] Here, after the electronic device recognizes the valid area in the first HDR video, if the information of the valid area is stored, then when performing video decoding later, the valid area in the HDR video stream can be directly determined based on the information of the valid area to improve recognition efficiency.

[0030] Optionally, the electronic device may append the information of the valid area to supplemental enhancement information (SEI) or a private space (such as a private box) for storage.

[0031] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned identification of the valid area in the HDR video stream includes: obtaining information about the valid area in the stored first HDR video; and determining the valid area in the HDR video stream based on the information about the valid area in the first HDR video.

[0032] That is, the electronic device can determine the effective area of ​​the second image corresponding to the first image in the HDR video stream according to the information of the effective area in the stored first HDR video, such as the position coordinates, size and other information of the effective area in the first image (i.e. any frame image), that is, identify the effective area in the HDR video stream. In this way, the effective area in the HDR video stream can be efficiently identified.

[0033] In combination with the first aspect, in some implementations of the first aspect, before identifying the first HDR video and determining the valid area in the first HDR video, the method further includes:

[0034] Determining whether the upper and lower positions in the first HDR video include a mask of a preset color;

[0035] Correspondingly, when the upper and lower positions in the first HDR video include a mask of a preset color, the first HDR video is identified to determine a valid area in the first HDR video.

[0036] Among them, considering the diversity of users' HDR video editing operations and in order to play this HDR video normally on other electronic devices, the electronic device in this application can determine the valid area in the first HDR video only when it recognizes that the upper and lower masks in the first HDR video are preset colors (such as black and white). If the upper and lower masks in the first HDR video are not preset colors, the electronic device does not execute the video display method provided by this application, and can still execute it according to the method in the relevant technology.

[0037] In a second aspect, the present application provides a device, which is included in an electronic device, and the device has the function of implementing the electronic device behavior in the above-mentioned first aspect and the possible implementation of the above-mentioned first aspect. The function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a receiving module or unit, a processing module or unit, etc.

[0038] In a third aspect, the present application provides an electronic device, comprising: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the first aspect.

[0039] In a fourth aspect, the present application provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to call instructions so that an electronic device executes the method in the first aspect and any possible implementation thereof.

[0040] Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.

[0041] Further optionally, the chip also includes a communication interface.

[0042] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor calls instructions to enable the electronic device to execute any one of the methods in the technical solution of the first aspect.

[0043] In a sixth aspect, the present application provides a computer program product, the computer program product comprising: a computer program code, when the computer program code runs on an electronic device, the electronic device executes any one of the methods in the technical solution of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 This is a schematic diagram of a scenario in which the HDR shooting function is enabled, provided in an embodiment of the present application;

[0045] Figure 2 This is a schematic diagram of a scene for recording using the HDR shooting function provided in an embodiment of the present application;

[0046] Figure 3 This is a schematic diagram of a scene for browsing an HDR video provided in an embodiment of the present application;

[0047] Figure 4 This is a schematic diagram of a video encoding and decoding process provided by an embodiment of the present application;

[0048] Figure 5 This is a schematic diagram of a scenario for editing an HDR video provided in an embodiment of the present application;

[0049] Figure 6 This is a schematic diagram of a scenario of adding a mask to an HDR video provided in an embodiment of the present application;

[0050] Figure 7 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0051] Figure 8 is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0052] Fig. 9 is a flowchart of a video display method provided in an embodiment of the present application;

[0053] Fig.10 This is a schematic diagram comparing an effective area and an ineffective area of ​​an HDR video provided in an embodiment of the present application;

[0054] Fig.11 is a schematic diagram of an example of coding block information provided in an embodiment of the present application;

[0055] Fig.12 is a schematic diagram of a process for determining a valid area in a second image provided by an embodiment of the present application;

[0056] Fig.13 is a schematic diagram of a scene of marking a coding block in a second image provided by an embodiment of the present application;

[0057] Fig.14 This is a module interaction timing diagram of a video display method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0059] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.

[0060] In order to make the description of the following embodiments clear and concise, a brief introduction to the relevant concepts or technologies is first given:

[0061] HDR: HDR is a processing technology that improves image brightness and contrast. Compared with ordinary images, HDR can provide more dynamic range and image details. It uses low dynamic range (LDR) images with the best details corresponding to each exposure time to synthesize the final HDR image (or HDR video), which can better reflect the visual effects in the real environment.

[0062] HDR metadata: Metadata is a type of information attached to HDR video that can help display devices display the content of the picture in a better way. The metadata content can include the maximum brightness, minimum brightness, average brightness, color gamut and other information of the video. Among them, HDR metadata can include static metadata and dynamic metadata. Static metadata is a fixed brightness and contrast range for the entire video, which can be applied to the entire video stream. Dynamic metadata is dynamically generated based on each frame of the image, and can dynamically adjust the brightness and contrast for each frame of the image.

[0063] Video encoding: Video encoding refers to the method of converting the original video format file into another video format file through compression technology. For example, encoding the NV12 format file into the H264 format file.

[0064] Video decoding: Video decoding is to decompress the video encoded file to restore the original video and display it on the electronic device.

[0065] A video is usually formed by continuous image frames, and the image frames obtained after video encoding may include I frames, P frames, and B frames.

[0066] I frame: Intra-frame coded frame, also known as intra picture, I frame is usually the first frame of each group of pictures (GOP). When decoding I frame, it can be decompressed into a single complete picture by video decompression algorithm without referring to other frames.

[0067] P frame: Forward prediction coding frame, also known as predictive-frame, is a coded image that compresses the amount of transmission data by fully reducing the temporal redundant information of the previously coded frames in the image sequence (motion prediction, motion compensation, etc.). When decoding a P frame, it is necessary to refer to the previous frame to generate a complete picture.

[0068] B frame: Bidirectional prediction interpolated coding frame, also known as bi-directional interpolated prediction frame, is a coded image that compresses the amount of transmission data by considering both the previous coded frame and the subsequent coded frame in the source image sequence. When decoding a B frame, it is necessary to refer to the previous frame and the subsequent frame to generate a complete picture.

[0069] Currently, electronic devices support more and more video types. For example, to improve the display effect of videos, electronic devices can support the display of HDR images or HDR videos. In some scenarios, users can use the camera application of electronic devices to shoot HDR videos and browse the HDR videos through the gallery application.

[0070] For example, taking the electronic device as a mobile phone, Figure 1 As shown, the user clicks on the camera application icon on the mobile phone desktop to trigger the camera application to run. On the running interface of the camera application, a setting control 11 is presented. If the user clicks on the setting control 11, the electronic device can jump to the setting interface. It can be seen from the content displayed on the setting interface that the properties of the photo or video can be set according to needs; for example, the photo ratio, video resolution, etc. can be set. In particular, on the setting interface, a switch control 12 for HDR video is presented. If the user clicks on the switch control 12, the electronic device can turn on the function of the camera application to shoot HDR video.

[0071] After the electronic device turns on the function of shooting HDR video in the camera application, Figure 2 As shown, users can use the camera app to record videos, and the recorded HDR videos can be saved to the gallery app. Figure 3 As shown, the user clicks the gallery application icon on the mobile phone desktop to trigger the gallery application to run. On the running interface of the gallery application, the photos and videos that have been taken are displayed. If the user clicks the HDR video taken, the electronic device can play the HDR video.

[0072] Generally, HDR videos need to go through the video encoding and decoding process to be displayed normally. That is, the process from the completion of the HDR video shooting by the camera application to the playback by the gallery application requires video encoding and then video decoding. Figure 4As shown, in the video encoding stage, the electronic device obtains the captured HDR video, and will first pre-process the HDR video, output HDR video stream and HDR metadata, and transmit the HDR video stream and HDR metadata to the video encoder for HDR video stream compression and HDR metadata packaging to generate a video code stream. Next, in the video decoding stage, after the electronic device obtains the video code stream, it decodes it through the video decoder to obtain the HDR video stream and HDR metadata, and then adjusts the parameters such as brightness and saturation of each frame image in the HDR video stream according to the HDR metadata (including static metadata and dynamic metadata), and sends the adjusted HDR video stream to the display screen (which may include an HDR display device or an SDR display device) for display.

[0073] In some scenarios, if the HDR video has been edited by other operations, such as editing, special effects, etc., the resolution of the HDR video may change. Figure 5 As shown, when browsing HDR videos in the gallery application, operation controls are presented below the HDR video interface, such as sharing, collection, editing, and deletion controls. If the user clicks the edit control 51, the electronic device can jump to the editing interface of the HDR video. On the editing interface, the user can choose to perform editing operations such as clipping, filtering, and adjustment. After completing the editing operation, the user can click the export control 52 to export and save the edited video. At this time, the exported video may have a different resolution from the original HDR video. In addition, after the editing operation, the electronic device needs to regenerate the HDR video for the edited video, that is, it needs to re-encode and decode the video; if the resolution of the edited video changes, the electronic device usually adds a mask to the upper and lower positions of the video, and the added mask will affect the distribution of the video brightness histogram. Because the HDR metadata generates an adjustment curve based on the brightness histogram, the added mask will affect the generation of the HDR metadata in the video encoding process, that is, the generated HDR metadata may have errors, resulting in errors in the HDR metadata used in the video decoding stage, and ultimately resulting in poor display of the HDR video.

[0074] For example, the electronic device adds a mask at the upper and lower positions of the video. Figure 6 ,exist Figure 6 In the example, video A is the original HDR video, video B is the video with black masking, and video C is the video with white masking. By parsing video A, video B, and video C, the corresponding metadata can be obtained respectively. Figure 6It can be seen from the RGB parameters in the metadata that the metadata corresponding to video A, video B and video C are different, and some values ​​are quite different, and these parameter values ​​will affect the display effect of HDR video.

[0075] In view of this, an embodiment of the present application provides a video display method. When the electronic device generates HDR metadata (especially dynamic metadata) in the video encoding stage, only the valid area in the image frame in the HDR video is considered to generate the HDR metadata corresponding to the video valid area. In the video decoding stage, the image parameters such as brightness and saturation of the video valid area are adjusted only according to the HDR metadata corresponding to the video valid area, thereby avoiding the increased masking effect on the HDR video, thereby improving the display effect of the HDR video. It should be noted that the video display method provided in the embodiment of the present application can be applied to mobile phones, tablet computers, vehicle-mounted equipment, augmented reality (AR) / virtual reality (VR) equipment, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) and other electronic devices that can support the display of HDR videos. The embodiment of the present application does not impose any restrictions on the specific type of electronic devices.

[0076] For example, Figure 7 1 is a schematic diagram of the structure of an example of an electronic device 100 provided in an embodiment of the present application. Taking the electronic device 100 as a mobile phone as an example, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0077] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0078] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0079] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0080] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0081] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0082] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0083] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0084] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0085] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

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

[0087] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Figure 7 The structures of antenna 1 and antenna 2 in the electronic device 100 are only examples. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0088] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0089] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

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

[0091] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

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

[0093] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0094] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0095] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0096] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0097] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0098] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0099] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0100] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0101] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0102] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0103] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0104] Figure 8 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, 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, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages, such as the Android application package (Android application package, APK).

[0105] like Figure 8 As shown, the application package may include a photo gallery APK (photos APK), a video editor APK (videoeditor APK), etc. In some embodiments, the video editor APK may be integrated into the photo gallery APK, and a video editing entry may be provided in the photo gallery application, such as the above Figure 5 As shown, when browsing HDR videos in the gallery app, you can operate the editing controls to enter the video editing interface. The video editing APK can also identify the effective area of ​​the video and hand it over to the lower-level module for processing.

[0106] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0107] like Figure 8 As shown, the application framework layer may include an audio and video generator (MediaMuxer), an audio and video codec (MediaCodec), and an audio and video player (MediaPlayer).

[0108] Among them, the role of MediaMuxer is to generate audio or video files, and can also mix audio and video into an audio and video file. MediaCodec can access the underlying media codec framework to implement video encoding and video decoding processes. MediaPlayer can be used to play videos after video decoding, such as playing HDR videos.

[0109] In addition, the application framework layer can also include window managers, content providers, view systems, phone managers, resource managers, notification managers, etc. ( Figure 8 not shown).

[0110] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures. The phone manager is used to provide communication functions for the electronic device 100. For example, the management of call status (including connected, hung up, etc.). The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the top status bar of the system in the form of an icon or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window, such as a text message in the status bar, a beep, a vibration of an electronic device, a flashing indicator light, etc.

[0111] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0112] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

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

[0114] The system library (vendor) may include multiple functional modules, such as video codec (VideoCodec), filter module (Filter) and metadata generation algorithm module (Metadata Generate Algo).

[0115] Among them, VideoCodec can provide video encoding and decoding capabilities for MediaCodec. Filter can call Metadata Generate Algo to generate HDR metadata based on the effective area of ​​the video, and pass the HDR metadata and video data to VideoCodec for processing.

[0116] In addition, system libraries can also include surface managers, media libraries, 3D graphics processing libraries (such as OpenGL ES), 2D graphics engines (such as SGL), etc. ( Figure 8 not shown).

[0117] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.

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

[0119] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 7 and Figure 8 Taking the electronic device with the structure shown as an example, the video display method provided in the embodiment of the present application is specifically described in combination with the accompanying drawings and application scenarios.

[0120] The video display method provided in the embodiment of the present application can be applied to the above Figures 1 to 5 In the scenario, that is, the user can use the camera application to shoot HDR video, the shot HDR video can be saved to the gallery application, and then the user can play the HDR video through the gallery application. When browsing HDR videos through the gallery application, the user can also operate the editing controls to edit the HDR video and export and save the edited video. The embodiment of the present application realizes that after the HDR video editing is completed, in the process of regenerating the HDR video, the valid area in the HDR video is identified and HDR metadata is generated in the video encoding stage, and the video valid area parameters are adjusted according to the HDR metadata corresponding to the video valid area in the video decoding stage, and finally the HDR video is displayed.

[0121] Fig. 9: is a flow chart of a video display method provided in an embodiment of the present application. The method is executed by an electronic device and may specifically include:

[0122] S101: When a first operation is detected, a first HDR video is acquired.

[0123] The first operation may be an operation of exporting the source HDR video after editing. For the convenience of description, the embodiment of the present application may refer to the captured HDR video as the source HDR video, and the edited HDR video data as the first HDR video. It can be understood that the source HDR video may be obtained by shooting, or may be transmitted from other electronic devices, or obtained by other means. In short, it is an HDR video already stored in the electronic device. When the electronic device detects the first operation, the edited first HDR video may be obtained.

[0124] S102: Identify the first HDR video and determine a valid area in the first HDR video.

[0125] Since the first HDR video is an edited video, there may be masking at the upper and lower positions in the first HDR video, and the masking does not actually belong to the video content, that is, the added masking is not a valid area of ​​the video.

[0126] Therefore, after acquiring the first HDR video, the electronic device can identify the first HDR video and determine the effective area of ​​the video. Since the video is formed by continuous image frames, the electronic device can identify each frame of the first HDR video and determine the effective area of ​​each frame.

[0127] For example, the schematic diagram of the first image (any frame image) in the first HDR video is shown in Fig.10 , Fig.10 The middle area containing the video content is the valid area, and the area above and below the middle area are not valid areas (ie, non-valid areas).

[0128] In one achievable manner, the electronic device may identify each frame of the image based on an image recognition algorithm to determine the valid area in each frame of the image. Optionally, the image recognition algorithm includes but is not limited to a depth-first search algorithm, a breadth-first search algorithm, and a convolutional neural network algorithm.

[0129] In one achievable manner, after determining the valid area in each frame of the image, the electronic device may also store information of the valid area (such as position coordinates, size, etc.) for use in subsequent video decoding. Optionally, the electronic device may append the information of the valid area to supplemental enhancement information (SEI) or a private space (such as a private box) for storage.

[0130] In an achievable manner, considering the diversity of HDR video editing operations by users and in order to be able to play this HDR video normally on other electronic devices, the electronic device in the embodiment of the present application can determine the valid area in the first HDR video only when it is recognized that the upper and lower positions of the mask in the first HDR video are black and white. If the upper and lower positions of the mask in the first HDR video are not black and white, the electronic device does not execute the video display method provided in the embodiment of the present application, and can still execute it according to the method in the related art.

[0131] S103: Generate HDR metadata corresponding to the first HDR video according to the valid area in the first HDR video, and generate an HDR video stream according to the first HDR video.

[0132] That is, in the embodiment of the present application, only the HDR metadata corresponding to the valid area needs to be generated. Therefore, the electronic device can generate HDR metadata only according to the valid area in the first HDR video to improve the quality of the HDR metadata. Optionally, the HDR metadata generated here can be dynamic metadata, and the static metadata used for application to the entire video stream can still be generated according to the entire first HDR video.

[0133] In one implementable manner, the electronic device may sequentially generate an effective area for each frame image in the first HDR video. Optionally, the process of generating HDR metadata based on the effective area in the first image (any frame image) may include: preprocessing the RGB pixel buffer of the image in the effective area to obtain a preprocessed RGB pixel buffer; calculating the minimum brightness value, maximum brightness value, average brightness value and brightness variation range of the image in the effective area based on the preprocessed RGB pixel buffer; generating basic curve parameter metadata based on the obtained data, generating cubic spline parameter metadata based on the basic curve parameter metadata, and finally performing time domain filtering to obtain dynamic metadata.

[0134] It can be understood that the above-mentioned generation of HDR metadata corresponding to the first HDR video is performed in the video encoding stage. In this stage, in addition to generating HDR metadata, the electronic device also needs to generate an HDR video stream, and transmit the HDR video stream and HDR metadata to the video encoder for HDR video stream compression and HDR metadata packaging to generate a video code stream. It can also be understood that the image frames in the encoded HDR video stream may include I frames, P frames, and B frames. This process is similar to the relevant technology and will not be repeated here.

[0135] S104, identifying a valid area in the HDR video stream, and adjusting image parameters of the valid area in the HDR video stream according to HDR metadata corresponding to the first HDR video, so as to display the first HDR video.

[0136] Among them, the above S103 process completes the video encoding process, and the electronic device can store the generated video code stream in the gallery application. If the user wants to play the video through the gallery application, the electronic device must perform video decoding to normally play the first HDR video.

[0137] Since the purpose of identifying the effective area of ​​the first HDR video is to generate HDR metadata corresponding to the effective area, and the generated HDR video stream is still obtained based on the first HDR video, then the HDR video stream includes effective areas and ineffective areas, that is, the HDR video stream still includes upper and lower masks. Therefore, if the electronic device wants to apply the HDR metadata to the HDR video stream to adjust the image parameters (such as brightness, saturation, etc.) of the HDR video stream, the electronic device also needs to identify the effective area in the HDR video stream and adjust the image parameters of the effective area in the HDR video stream only according to the HDR metadata.

[0138] In one feasible manner, if the electronic device stores information of the effective area after determining the effective area in each frame image as described above, the electronic device can determine the effective area of ​​the second image corresponding to the first image in the HDR video stream based on the stored information, such as the position coordinates, size and other information of the effective area in the first image (i.e., any frame image), that is, identify the effective area in the HDR video stream.

[0139] In another implementable manner, image frames in an HDR video stream obtained by video encoding may include I frames, P frames, and B frames, and I frames, P frames, and B frames are different types of image frames. Then, the electronic device may determine the valid area in the HDR video stream based on the properties of the I frames, P frames, and B frames.

[0140] Among them, in the video encoding stage, electronic devices usually divide the image into multiple coding blocks for encoding. The coding block information of I frames is different from that of P frames and B frames, so I frames, P frames and B frames can be analyzed separately. For I frames, the residual data of the coding block can be carried in the coding block after encoding. The residual data represents the difference between the predicted pixel value and the actual pixel value of the coding block. If there is no difference between the predicted pixel value and the actual pixel value, the residual data of the coding block is 0, which can represent the coding block as an area with no color difference, that is, a non-valid area. For P frames and B frames, because P frames and B frames are reference frames, they need to refer to other frames for encoding and decoding. Then, for a P frame (or B frame), if a coding block has the same color (pixel value) as the coding block it refers to, the coding block can be marked as a skip type, which can also represent the coding block as an area with no color difference, that is, a non-valid area. Exemplarily, Fig.11 It is the attribute information of a coding block in the P frame. As can be seen from the figure, the intertype field in the attribute information of the coding block indicates the block type, and the coding block is of skip type.

[0141] Then, if Fig.12 As shown, the electronic device can obtain the second image (i.e., any frame image) in the HDR video stream. If the second image is an I frame, the residual data of all coding blocks in the second image are obtained, and the coding blocks with residual data of 0 are marked. Optionally, the coding blocks with residual data of 0 can be marked as 0, and the remaining coding blocks can be marked as 1. Then, the largest rectangular area composed of coding blocks marked as 0 in the second image is the invalid area. If the second image is a P frame or a B frame, the block type of all coding blocks in the second image is obtained, and the coding blocks with block type of skip type are marked. Optionally, the coding blocks with block type of skip type can be marked as 0, and the remaining coding blocks can be marked as 1. Then, the largest rectangular area composed of coding blocks marked as 0 in the second image is the invalid area. When the invalid area is determined, the remaining area in the second image is the valid area, thereby identifying the valid area in the HDR video stream.

[0142] For example, Fig.13 As shown, the coding blocks at the upper and lower positions in the second image are marked as 0, the rectangular area formed by the upper coding blocks is the upper masked area, and the rectangular area formed by the lower coding blocks is the lower masked area. These two areas are non-valid areas, and the middle area is the valid area.

[0143] After the electronic device determines the valid area in the HDR video stream, it can adjust the image parameters of the valid area in the HDR video stream according to the HDR metadata corresponding to the first HDR video obtained above, such as adjusting the brightness, hue and saturation of the valid area, and finally generate an HDR video for playback and display.

[0144] In the above-mentioned video display method, when the electronic device performs video encoding on the first HDR video obtained by editing, it can determine the valid area in the first HDR video and only generate HDR metadata corresponding to the valid area, and when performing video decoding, it can determine the valid area in the HDR video stream and only adjust the image parameters of the valid area in the HDR video stream according to the HDR metadata corresponding to the valid area to display the first HDR video. As a result, the electronic device no longer considers the impact of the masking caused by the editing operation in the HDR video, thereby improving the display effect of the HDR video; at the same time, performing video decoding only according to the HDR metadata of the valid area can also reduce the computational complexity of the processing process and improve the efficiency of the video display process.

[0145] Regarding the video display method provided in the embodiment of the present application, Figure 8 The software architecture shown is used for introduction. Fig.14 This is a module interaction timing diagram of a video display method provided in an embodiment of the present application, which may specifically include:

[0146] S11, the video editing APK detects a first operation and obtains a first HDR video.

[0147] Among them, the first operation can be an operation exported after the shot HDR video is edited, that is, the first operation is input through the video editing function, then the video editing APK can detect the first operation and obtain the data of the first HDR video.

[0148] S12, the video editing APK identifies the first HDR video and determines a valid area in the first HDR video.

[0149] That is, the video editing APK can identify each frame image in the first HDR video, determine the valid area in each frame image, and correspondingly determine the valid area in the first HDR video.

[0150] S13, the video editing APK sends the first HDR video and the valid area in the first HDR video to MediaCodec.

[0151] The valid area sent here refers to information such as the coordinate position and size of the valid area.

[0152] S14, MediaCodec generates an HDR video stream according to the first HDR video, and calls VideoCodec to compress the HDR video stream.

[0153] That is to say, in the video encoding stage, MediaCodec will call VideoCodec to compress the HDR video stream for subsequent packaging and other operations.

[0154] S15, MediaCodec sends the compressed HDR video stream and the valid area in the first HDR video to VideoCodec.

[0155] S16, VideoCodec sends the valid area in the first HDR video to Filter.

[0156] S17, Filter calls the metadata generation algorithm module to generate HDR metadata corresponding to the first HDR video according to the valid area in the first HDR video.

[0157] Since the HDR metadata corresponding to the valid area is generated in the embodiment of the present application, the Filter can call the metadata generation algorithm module to generate the HDR metadata corresponding to the valid area. The specific process can be found in the description of S103 above, which will not be repeated here.

[0158] S18, Filter returns the HDR metadata to VideoCodec.

[0159] S19, VideoCodec uploads the compressed HDR video stream and HDR metadata to MediaMuxer.

[0160] S20, MediaMuxer packages the compressed HDR video stream and HDR metadata to generate a video bitstream.

[0161] At this point, the electronic device has completed the video encoding process, and the video code stream packaged and generated by MediaMuxer can be stored and displayed in the gallery application.

[0162] S21, the gallery APK detects the second operation and calls MediaPlayer to play the HDR video.

[0163] The second operation may be an operation input by the user in the gallery application to trigger the playback of the HDR video. If the gallery APK detects the second operation, it triggers the start of the video decoding process.

[0164] S22, MediaPlayer calls VideoCodec to decode the video code stream to obtain HDR video stream and HDR metadata.

[0165] Here, after MediaPlayer calls VideoCodec to decode the video code stream, the image frames in the obtained HDR video stream may include I frames, P frames, and B frames.

[0166] S23, VideoCodec identifies a valid area in the HDR video stream.

[0167] The process of VideoCodec identifying the valid area in the HDR video stream can be found in the description of S104 above, which will not be repeated here.

[0168] S24, VideoCodec encapsulates the valid area, HDR metadata and decoded frame in the HDR video stream and sends them to the display driver.

[0169] Among them, the decoded frames here can be the above-mentioned I frames, P frames and B frames. After VideoCodec sends the valid area, HDR metadata and decoded frames to the display driver, the display driver can generate HDR video based on them and display the HDR video on the display.

[0170] S25: The display driver adjusts image parameters of a valid area in the HDR video stream according to the HDR metadata to display the first HDR video.

[0171] In the above-mentioned video display method, when the electronic device performs video encoding on the first HDR video obtained by editing, it can determine the valid area in the first HDR video and only generate HDR metadata corresponding to the valid area, and when performing video decoding, it can determine the valid area in the HDR video stream and only adjust the image parameters of the valid area in the HDR video stream according to the HDR metadata corresponding to the valid area to display the first HDR video. As a result, the electronic device no longer considers the impact of the masking caused by the editing operation in the HDR video, thereby improving the display effect of the HDR video; at the same time, performing video decoding only according to the HDR metadata of the valid area can also reduce the computational complexity of the processing process and improve the efficiency of the video display process.

[0172] The above describes in detail an example of a video display method provided by an embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the present application.

[0173] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0174] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0175] The electronic device provided in this embodiment is used to execute the above-mentioned video display method, and thus can achieve the same effect as the above-mentioned implementation method.

[0176] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.

[0177] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0178] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 7 Device of the structure shown.

[0179] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the video display method of any of the above embodiments.

[0180] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the video display method in the above-mentioned embodiment.

[0181] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory so that the chip executes the video display method in the above-mentioned method embodiments.

[0182] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0183] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0184] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0185] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0186] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0187] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0188] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A video display method, the method being executed by an electronic device, characterized in that: The method comprises: When a first operation is detected, a first high dynamic range HDR video is acquired, wherein the first operation is an operation of exporting a source HDR video after editing, the source HDR video is a video stored in the electronic device, and the first HDR video is video data after the source HDR video is edited; Identify the first HDR video and determine a valid area in the first HDR video, where the valid area in the first HDR video is an area in the first HDR video where video content is presented; Generate HDR metadata corresponding to the first HDR video according to the valid area in the first HDR video, and generate an HDR video stream according to the first HDR video encoding; When a second operation is detected, a valid area in the HDR video stream is identified, and image parameters of the valid area in the HDR video stream are adjusted according to the HDR metadata corresponding to the first HDR video to display the first HDR video, and the second operation requests display of the first HDR video.

2. The method according to claim 1, characterized in that: The image frames in the HDR video stream include I frames, P frames, and B frames, and the identifying the valid area in the HDR video stream includes: Valid areas in the I frame, P frame and B frame are identified respectively.

3. The method according to claim 2, characterized in that The respectively identifying the valid areas in the I frame, the P frame and the B frame comprises: When the image frame is an I frame, obtaining residual data of all coding blocks in the I frame; Mark the coding block whose residual data is 0 as the first coding block; Determine a maximum rectangular area formed by the first coding block as a non-valid area, and determine an area in the I frame other than the non-valid area as a valid area; When the image frame is a P frame or a B frame, obtaining block types of all coding blocks in the P frame or the B frame; Marking a coding block whose block type is skip type as the first coding block; The largest rectangular area formed by the first coding block is determined as a non-valid area, and the area other than the non-valid area in the P frame or the B frame is determined as a valid area.

4. The method according to any one of claims 1 to 3, characterized in that The identifying the first HDR video and determining a valid area in the first HDR video includes: Each frame of the first HDR video is identified, and a valid area in each frame of the first HDR video is determined to obtain a valid area in the first HDR video.

5. The method according to claim 4, characterized in that The identifying each frame of the image in the first HDR video includes: An image recognition algorithm is used to recognize each frame of the first HDR video.

6. The method according to claim 1, characterized in that After determining the valid area in the first HDR video, the method further includes: The information of the valid area in the first HDR video is stored, where the information of the valid area includes position information of the valid area in the image frame of the first HDR video and size information of the valid area.

7. The method according to claim 6, characterized in that The identifying a valid area in the HDR video stream comprises: Obtaining information about a valid area in the stored first HDR video; Determine a valid area in the HDR video stream according to information about the valid area in the first HDR video.

8. The method according to any one of claims 1 to 3, characterized in that Before identifying the first HDR video and determining the valid area in the first HDR video, the method further includes: Determining whether the upper and lower positions in the first HDR video include a mask of a preset color; Correspondingly, when the upper and lower positions in the first HDR video include a mask of a preset color, the first HDR video is identified to determine a valid area in the first HDR video.

9. The method according to any one of claims 1 to 3, characterized in that The HDR metadata corresponding to the first HDR video is dynamic metadata.

10. An electronic device, characterized in that: include: one or more processors; one or more memories; The memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes the method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor calls instructions so that the electronic device executes the method according to any one of claims 1 to 9.