Detailed Description
In order to make the technical solutions better understood by those skilled in the art, 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.
Referring to fig. 1, fig. 1 shows a video playing process. Specifically, when the operating system acquires data to be played, the next task is to analyze audio/video data. The general video file is composed of a video stream and an audio stream, and the audio and video packaging formats of different video formats are different. The process of combining audio and video streams into a file is called muxer, whereas the process of separating audio and video streams from a media file is called demux. The audio stream and the video stream need to be separated from the file stream for playing the video file and decoded respectively, the decoded video frame can be directly rendered, the audio frame can be sent to a buffer area of the audio output device for playing, and certainly, timestamps of the video rendering and the audio playing need to be controlled to be synchronous.
Specifically, the video decoding may include hard decoding and soft decoding, where the hardware decoding is performed by submitting a part of video data, which is originally completely processed by a Central Processing Unit (CPU), to a Graphics Processing Unit (GPU), and the GPU has a parallel operation capability much higher than that of the CPU, so that a load on the CPU can be greatly reduced, and some other programs can be run simultaneously after the CPU has a low occupancy rate, and certainly, for a better processor, such as i 52320 or any type of AMD four-core processor, both hard decoding and soft decoding can be performed.
Specifically, as shown in fig. 1, a multimedia Framework (Media Framework) acquires a Video file to be played by a client through an API interface with the client, and delivers the Video file to a Video codec (Video decoder), where the Media Framework is a multimedia Framework in an Android system, and three parts, namely, MediaPlayer, mediaplayservice and stagefrigidplayer, form a basic Framework of an Android multimedia. The multimedia frame part adopts a C/S structure, the MediaPlayer is used as a Client terminal of the C/S structure, the mediaplayservice and the stagefrigtheyer are used as a C/S structure Server terminal, the responsibility of playing the multimedia file is born, and the Server terminal completes the request of the Client terminal and responds through the stagefrigtheyer. Video Decode is a super decoder that integrates the most common audio and Video decoding and playback for decoding Video data.
In the soft decoding, the CPU decodes the video through software. And hard decoding means that the video decoding task is independently completed through a special daughter card device without the aid of a CPU.
Whether the decoding is hard decoding or soft decoding, after the video data is decoded, the decoded video data is sent to a layer delivery module (surfefinger), and the decoded video data is rendered and synthesized by the surfefinger and then displayed on a display screen. The Surface flunger is an independent Service, receives all the Surface of windows as input, calculates the position of each Surface in a final composite image according to parameters such as ZOrder, transparency, size and position, and then sends the position to HWComposer or OpenGL to generate a final display Buffer, and then displays the final display Buffer on a specific display device.
As shown in fig. 1, in the soft decoding, the CPU decodes the video data and then gives it to the surface flag rendering and compositing, and in the hard decoding, the CPU decodes the video data and then gives it to the surface flag rendering and compositing. And the SurfaceFlinger calls the GPU to render and synthesize the image, and the image is displayed on the display screen.
For example, when the electronic device plays the video content, the processing mode of the electronic device is the same for the video content regardless of whether the environment of the electronic device is indoor or outdoor or the brightness of the environment of the electronic device, such as maintaining the same processing mode or the same brightness, etc., resulting in poor output video effect and poor user viewing effect. In view of the above problems, the inventors have found and proposed a video processing method, an apparatus, an electronic device, and a storage medium according to embodiments of the present application through long-term research, and perform tone mapping on image content in a played video resource when the brightness of an environment where the electronic device is located is higher than a preset brightness, so as to ensure that a better visual experience is achieved under the condition of higher brightness. The specific video processing method is described in detail in the following embodiments.
Examples
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a video processing method according to an embodiment of the present application. The video processing method is used for carrying out tone mapping processing on the image content of the played video resource when the brightness of the environment where the electronic equipment is located is higher than the preset brightness so as to ensure better visual experience under the condition of higher brightness. In a specific embodiment, the video processing method is applied to the video processing apparatus 200 shown in fig. 6 and the electronic device 100 (fig. 7) configured with the video processing apparatus 200. The specific flow of the embodiment will be described below by taking an electronic device as an example, and it is understood that the electronic device applied in the embodiment may be a smart phone, a tablet computer, a wearable electronic device, a vehicle-mounted device, a gateway, and the like, and is not limited specifically herein. As will be described in detail with respect to the flow shown in fig. 2, the video processing method may specifically include the following steps:
step S110: when the electronic equipment runs with video resources, the brightness of the environment where the electronic equipment is located is detected.
In this embodiment, the video resources run by the electronic device may include video resources running in a foreground of the electronic device, video resources running in a background of the electronic device, and video resources switched to run in the foreground and the background of the electronic device, which is not limited specifically herein. Specifically, the video resource operated in the foreground refers to a video resource which can be interacted with a user and displayed in the foreground, and is suspended when the video resource is invisible; video resources running in the background mean that the interaction with a user is very limited, and except during configuration, the life time of the video resources is hidden; the video resources switched to operate in the foreground and the background of the electronic equipment refer to the video resources which can be switched between the foreground and the background at will. It is to be appreciated that when a video asset is not turned off, the video asset is characterized as running on the electronic device.
It can be understood that the electronic device may only run one video resource, and may also run a plurality of video resources simultaneously, where when the electronic device only runs one video resource, the video resource may run in a foreground of the electronic device, run in a background of the electronic device, or switch between the foreground and the background of the electronic device; when the electronic device simultaneously operates a plurality of video resources, the plurality of video resources may all operate in a background of the electronic device, one or more video resources of the plurality of video resources operate in a foreground of the electronic device, the remaining video resources operate in the background of the electronic device or one or more video resources of the plurality of video resources switch between the foreground and the background of the electronic device, the remaining video resources operate in the background of the electronic device, and the like, which is not limited herein.
As a mode, when it is determined that the electronic device runs with the video resource, it may be further determined whether the foreground of the electronic device runs with the video resource, and on the basis of determining that the foreground of the electronic device runs with the video resource, the brightness of the environment where the electronic device is located may be detected. In this embodiment, whether the foreground of the electronic device runs the video resource may be determined by detecting a picture displayed on a screen of the electronic device, and whether the foreground of the electronic device runs the video resource may also be determined by detecting a program run by the electronic device.
Further, the detection of the brightness of the environment in which the electronic device is located may be performed by a brightness detection device disposed inside the electronic device, for example, by a proximity light transmitter, a light sensor, and the like. The brightness detection device can be controlled in real time to detect the brightness, can be controlled at preset time intervals to detect the brightness, and can also be controlled in a user self-configuration mode to detect the brightness. Optionally, since the brightness of the environment where the electronic device is located may change in real time, in order to obtain accurate brightness, in this embodiment, the brightness detection device may be controlled in real time to detect the brightness.
Step S120: and judging whether the brightness is greater than the preset brightness.
In this embodiment, the electronic device stores a preset brightness level, where the preset brightness level may be configured by the electronic device at a factory setting, may be configured automatically after the electronic device is at the factory setting, or may be configured by a user manually, which is not limited herein. Further, the preset brightness is used as a judgment basis for the detected brightness of the environment where the electronic device is located, so that when the brightness of the environment where the electronic device is located is detected, the brightness of the environment where the electronic device is located is compared with the preset brightness to judge whether the brightness of the environment where the electronic device is located is greater than the preset brightness.
As a manner, the preset brightness may be a specific value, at this time, the value of the brightness of the environment where the electronic device is located may be compared with the preset brightness value, and when the value of the brightness of the environment where the electronic device is located is greater than the preset brightness value, it may be determined that the brightness of the environment where the electronic device is located is greater than the preset brightness value; when the brightness of the environment where the electronic device is located is smaller than or equal to the preset brightness value, it can be determined that the brightness of the environment where the electronic device is located is not greater than the preset brightness.
As another mode, the preset brightness may be a value interval, at this time, the value of the brightness of the environment where the electronic device is located may be compared with the value interval of the preset brightness, and when the value of the brightness of the environment where the electronic device is located is greater than the maximum value of the value interval, it may be determined that the brightness of the environment where the electronic device is located is greater than the preset brightness; when the brightness of the environment where the electronic device is located is smaller than or equal to the maximum value of the numerical value interval, it can be determined that the brightness of the environment where the electronic device is located is not larger than the preset brightness.
When the numerical value of the brightness of the environment where the electronic device is located is within the numerical value range, the brightness of the environment representing the electronic device may be greater than the preset brightness at a next moment, so that the video resource can be preprocessed or the electronic device can be preprocessed in advance, and the problem of low user experience during the reprocessing process after the brightness of the environment where the electronic device is located is greater than the preset brightness is solved.
Step S130: and when the brightness is higher than the preset brightness, carrying out tone mapping processing on the image content in the video resource.
It is to be understood that the video asset includes at least image content, that is, the video asset may include only image content, the video asset may also include image content and other content, for example, the video asset may include image content and audio content. In this embodiment, when it is determined that the brightness of the environment where the electronic device is located is greater than the preset brightness, the image content in the video resource may be extracted, and then the tone mapping process may be performed on the image content.
The tone mapping process may include first calculating an average brightness of a scene according to a current scene, then selecting a suitable brightness domain according to the average brightness, and then mapping the entire scene to the brightness domain to obtain a correct result. The tone mapping process may include the following important parameters:
middle grey: the average gray scale of the whole scene is related to the brightness domain of the scene.
Key: the Key of the scene will determine the brightness trend of the whole scene, whether the trend is brighter or dimmer.
Firstly, the average brightness of the whole scene needs to be calculated, there are many methods for calculating the average brightness, and currently, the log-average brightness is commonly used as the average brightness of the scene, and can be obtained by the following formula:
wherein L isω(x, y) is the brightness of pixel x, y, N is the pixel in the scene, and δ is a small number for the case of corresponding pixel being pure black.
The above formula is used to map the luminance domain, where α is the Key value, to control the luminance tendency of the scene, and typically, several specific values are used, 0.18 is a moderate Key value, 0.36 or 0.72 is relatively bright, and 0.09 or even 0.045 is dark. In order to satisfy the range that the electronic device can display, the mapped scene also needs to remap the brightness range to the [0,1] interval, and the brightness of the [0,1] interval can be simply obtained through the following formula.
Wherein L isdNamely the brightness value of the mapped x and y pixel points.
According to the video processing method provided by the embodiment of the application, when the electronic equipment runs with the video resources, the brightness of the environment where the electronic equipment is located is detected, whether the brightness is larger than the preset brightness is judged, when the brightness is larger than the preset brightness, tone mapping processing is carried out on the image content in the video resources, therefore, when the brightness of the environment where the electronic equipment is located is higher than the preset brightness, tone mapping processing is carried out on the image content of the played video resources, and better visual experience is guaranteed under the condition that the brightness is higher.
Referring to fig. 3, fig. 3 is a flow chart illustrating a video processing method according to another embodiment of the present application. As will be explained in detail with respect to the flow shown in fig. 3, the method may specifically include the following steps:
step S210: when the electronic equipment runs with video resources, the brightness of the environment where the electronic equipment is located is detected.
Step S220: and judging whether the brightness is greater than the preset brightness.
For the detailed description of steps S210 to S220, refer to steps S110 to S120, which are not described herein again.
Step S230: and when the brightness is higher than the preset brightness, carrying out tone mapping on image content in the video resource, and increasing the current screen brightness of the electronic equipment by a preset ratio to obtain first screen brightness.
In this embodiment, while performing tone mapping on image content in a video resource, the current screen brightness of the electronic device may also be increased, and as a manner, the current screen brightness of the electronic device is increased according to a preset ratio to obtain a first screen brightness, where the preset ratio may be configured by the electronic device when the electronic device is factory set, may be configured automatically by the electronic device after the electronic device is factory set, or may be set manually by a user, which is not limited herein. Specifically, the preset ratio may include 10%, 20%, 30%, and the like, and optionally, in this embodiment, the preset ratio is 20%.
Of course, in this embodiment, in addition to performing tone mapping on the image content in the video resource and improving the screen brightness of the electronic device, the image content may be optimized according to a preset video enhancement algorithm, where the optimization of the image content may include at least one of exposure enhancement, drying removal, edge sharpening, contrast enhancement, or saturation enhancement.
Specifically, the image content in the video resource operated by the electronic device is decoded image content, and since the decoded image content is data in an RGBA format, in order to optimize the image content, the data in the RGBA format needs to be converted into an HSV format, specifically, a histogram of the image content is obtained, a parameter for converting the data in the RGBA format into the HSV format is obtained by performing statistics on the histogram, and the data in the RGBA format is converted into the HSV format according to the parameter.
In order to enhance the brightness of an image by enhancing the exposure, the luminance value of an area where the luminance values intersect may be increased by a histogram of the image, or the luminance of the image may be increased by nonlinear superposition, specifically, if I denotes a dark image to be processed and T denotes a comparatively bright image after the processing, the exposure may be enhanced by T (x) I (x) (1-I (x)). Wherein, T and I are both [0,1] valued images. The algorithm can iterate multiple times if one is not effective.
The image content is denoised to remove noise of the image, and particularly, the image is degraded due to interference and influence of various noises in the generation and transmission processes, which adversely affects the processing of subsequent images and the image visual effect. The noise may be of various types, such as electrical noise, mechanical noise, channel noise, and other noise. Therefore, in order to suppress noise, improve image quality, and facilitate higher-level processing, it is necessary to perform denoising preprocessing on an image. From the probability distribution of noise, there are gaussian noise, rayleigh noise, gamma noise, exponential noise and uniform noise.
Specifically, the image can be denoised by a gaussian filter, wherein the gaussian filter is a linear filter, and can effectively suppress noise and smooth the image. The principle of action is similar to that of an averaging filter, and the average value of pixels in a filter window is taken as output. The coefficients of the window template are different from those of the average filter, and the template coefficients of the average filter are all the same and are 1; while the coefficients of the template of the gaussian filter decrease with increasing distance from the center of the template. Therefore, the gaussian filter blurs the image to a lesser extent than the mean filter.
For example, a 5 × 5 gaussian filter window is generated, and sampling is performed with the center position of the template as the origin of coordinates. And substituting the coordinates of each position of the template into a Gaussian function, wherein the obtained value is the coefficient of the template. And then the Gaussian filter window is convolved with the image to denoise the image.
Wherein edge sharpening is used to sharpen the blurred image. There are generally two methods for image sharpening: one is a differential method, and the other is a high-pass filtering method.
In particular, contrast stretching is a method for enhancing an image, and also belongs to a gray scale transformation operation. By stretching the grey value through the grey scale transformation to the whole interval 0-255, the contrast is clearly greatly enhanced. The following formula can be used to map the gray value of a certain pixel to a larger gray space:
I(x,y)=[(I(x,y)-Imin)/(Imax-Imin)](MAX-MIN)+MIN;
where Imin, Imax are the minimum and maximum grayscale values of the original image, and MIN and MAX are the minimum and maximum grayscale values of the grayscale space to be stretched.
Referring to fig. 4, fig. 4 is a flowchart illustrating step S230 of the video processing method illustrated in fig. 3 of the present application. As will be explained in detail with respect to the flow shown in fig. 4, the method may specifically include the following steps:
step S231: and judging whether the current screen brightness is the maximum screen brightness of the electronic equipment.
Specifically, in this embodiment, the current screen brightness of the electronic device is detected, where the screen brightness of the electronic device may be automatically adjusted or may be manually adjusted by a user, and specifically, the screen brightness of the electronic device may be automatically adjusted according to the brightness of the environment where the electronic device is located, or may be adjusted according to a brightness adjustment instruction sent by the user, where the screen adjustment instruction may be generated when the user touches an entity key or a virtual key on the electronic device, which indicates to perform brightness adjustment, or may be generated when the electronic device receives a voice message, which indicates to perform brightness adjustment by the user, without limitation.
It can be understood that, because the current screen brightness of the electronic device may also change in real time, in order to improve the accuracy of detecting the current screen brightness, the current screen brightness of the electronic device may be detected in real time. As one mode, the electronic device stores the brightness of the electronic device at the corresponding time, and when detecting that the screen brightness of the electronic device is changed, reads the brightness after the screen brightness is changed, and then updates the previously stored brightness to the brightness after the brightness is changed, thereby obtaining the current screen brightness.
The screen brightness of the electronic device may be a specific brightness value, for example, the screen brightness of the electronic device may be 50 nits, may be 80 nits, and the like; the screen brightness of the electronic device may also be a ratio, for example, the screen brightness of the brightness device is 50%, and may be 80%, where 50% refers to the screen brightness of the electronic device being 50% of the maximum brightness, and 80% indicates the screen brightness of the electronic device being 80% of the maximum brightness.
As one way, the screen brightness of the electronic device is taken as a specific brightness value as an example. The electronic device is configured to pre-store a maximum screen brightness value, where the maximum screen brightness value is used as a judgment basis for a current screen brightness value, and it can be understood that, after the current screen brightness value is detected, the current screen brightness value is compared with the maximum screen brightness value to judge whether the current screen brightness value is the maximum screen brightness of the electronic device. When determining whether the current screen brightness value is equal to the maximum screen brightness value, it is not limited that the current screen brightness value is completely equal to the maximum screen brightness value, and when the difference between the current screen brightness value and the maximum screen brightness value is within a preset range, the current screen brightness value may also be considered as the maximum screen brightness value.
For example, when the current screen brightness value of the electronic device is 200 nits and the maximum screen brightness of the electronic device is also 200 nits, it may be determined that the current screen brightness value is the maximum screen brightness value; when the current screen brightness value of the electronic device is 195 nits, the maximum screen brightness of the electronic device is 200 nits, and the preset range is 10 nits, since the difference value between the current screen brightness value and the maximum screen brightness is 5 nits, within the preset range, it may be determined that the current screen brightness is the maximum screen brightness.
As another way, take the screen brightness of the electronic device as a scale for example. The electronic device stores a maximum screen brightness in advance, for example, 100%, where the maximum screen brightness is used as a criterion for determining a ratio of the current screen brightness, and it can be understood that, after the ratio of the current screen brightness is detected, the ratio of the current screen brightness is compared with the ratio of the maximum screen brightness to determine whether the current screen brightness is the maximum screen brightness. It is to be understood that the current screen brightness is not characterized as the maximum screen brightness when the proportion of the current screen brightness is less than the proportion of the maximum screen brightness, and is characterized as the maximum screen brightness when the proportion of the current screen brightness is equal to the proportion of the maximum screen brightness. Similarly, when determining whether the ratio of the current screen brightness is equal to the ratio of the maximum screen brightness, the ratio of the current screen brightness is not limited to be completely equal to the ratio of the maximum screen brightness, and when the difference between the ratio of the current screen brightness and the ratio of the maximum screen brightness is within a preset range, the current screen brightness may also be considered as the maximum screen brightness.
For example, when the ratio of the current screen brightness of the electronic device is 100% and the ratio of the maximum screen brightness of the electronic device is also 100%, it may be determined that the current screen brightness value is the maximum screen brightness value; when the ratio of the current screen brightness of the electronic device is 95%, the ratio of the maximum screen brightness of the electronic device is 100%, and the preset range is 10%, since the difference between the ratio of the current screen brightness and the ratio of the maximum screen brightness is 5%, the current screen brightness is determined to be the maximum screen brightness within the preset range.
Step S232: and when the current screen brightness is not the maximum screen brightness of the electronic equipment, increasing the current screen brightness of the electronic equipment by a preset ratio to obtain the first screen brightness.
Wherein, if the current screen brightness of the electronic device does not reach the maximum screen brightness, the video playing effect can be promoted in a mode of promoting the screen brightness, therefore, in this embodiment, the current screen brightness of the electronic device can be promoted to the first screen brightness in a preset proportion, so that the viewing experience of the user can be promoted.
As a manner, in a process of increasing a current screen brightness of an electronic device by a preset ratio, it is estimated whether a screen brightness obtained after increasing the current screen brightness by the preset ratio exceeds a maximum screen brightness, for example, if the current screen brightness is 80%, the maximum screen brightness is 100%, and the preset ratio is 20%, it may be estimated that the screen brightness after increasing the current screen brightness by the preset ratio is 80% × (1+ 20%) -96%, and it may be considered that the current screen brightness after increasing the preset ratio does not exceed the maximum screen brightness; for example, if the current screen brightness is 80%, the maximum screen brightness is 100%, and the preset ratio is 20%, it may be estimated that the screen brightness after the current screen brightness is increased by the preset ratio is 90% × (1+ 20%) -108%, and it may be considered that the current ratio is increased by the preset ratio and then exceeds the maximum screen brightness.
In the embodiment, when it is determined that the current screen brightness does not exceed the maximum screen brightness after being increased by the preset ratio, the current screen brightness model can be increased according to the preset ratio; when the current screen brightness is determined to exceed the maximum screen brightness after being increased by the preset proportion, the current screen brightness is not increased when being increased to the maximum screen brightness, so that the video playing effect is improved, and meanwhile, the loss of the screen of the electronic equipment is reduced.
Step S233: when the current screen brightness is the maximum screen brightness of the electronic equipment, the current screen brightness is forcibly increased to a second screen brightness, wherein the second screen brightness is larger than the first screen brightness.
In this embodiment, when the current screen brightness has reached the maximum screen brightness, in order to ensure a video playing effect and ensure the maximum visual experience of a user under a high brightness condition, the current screen may be forcibly increased to the second screen brightness, that is, the screen brightness is forcibly excited to a high brightness state. In this embodiment, the second screen brightness is greater than the first screen brightness, and the second screen brightness may include 500 nit, 600 nit, and 700 nit, and optionally, in this embodiment, the second screen brightness is 600 nit.
Referring to fig. 5, fig. 5 is a flowchart illustrating step S233 of the video processing method illustrated in fig. 4 according to the present application. As will be explained in detail with respect to the flow shown in fig. 5, the method may specifically include the following steps:
step S2331: when the current screen brightness is the maximum screen brightness of the electronic equipment, detecting the residual capacity of the electronic equipment.
As one method, since a large amount of power is consumed by the electronic device when the screen brightness of the electronic device is adjusted to the high-brightness state, in this embodiment, the remaining power of the electronic device may be detected before the current screen brightness of the electronic device is adjusted to the high-brightness state. The method comprises the steps that the residual electric quantity of the electronic equipment at the corresponding moment is stored in the electronic equipment, when the electric quantity of the electronic equipment is detected to be changed, the residual electric quantity after the electric quantity of the electronic equipment is changed is read, and then the stored residual electric quantity is updated to the residual electric quantity after the brightness is changed, so that the current residual electric quantity of the electronic equipment is obtained. In addition, the remaining power of the electronic device can be obtained by identifying the current display interface of the electronic device, which is not described herein again.
Step S2332: and judging whether the residual electric quantity is larger than a preset electric quantity.
In this embodiment, the electronic device stores a preset electric quantity, where the preset electric quantity may be configured by the electronic device at a factory setting, may be configured automatically after the electronic device is factory set, or may be configured by a user manually, and the like, and is not limited herein. Further, the preset electric quantity is used as a judgment basis for the detected remaining electric quantity of the electronic device, so that when the remaining electric quantity of the electronic device is detected, the remaining electric quantity of the electronic device is compared with the preset electric quantity to judge whether the remaining electric quantity of the electronic device is greater than the preset photoelectric quantity. Similarly, the remaining power may be a specific power value or a ratio, which is not described herein again.
Step S2333: and when the residual electric quantity is greater than the preset electric quantity, forcibly increasing the current screen brightness to the second screen brightness.
It can be understood that, when the remaining power of the electronic device is greater than the preset power, the remaining power of the electronic device may be considered to be sufficient, and the screen highlight has little influence on power consumption, so that the current screen brightness may be forcibly increased to the second screen brightness.
In addition, as a mode, when the remaining power of the electronic device is not greater than the preset brightness, it may be further detected whether the electronic device is in a charging state, and if the electronic device is in the charging state, it may also be considered that the remaining power of the electronic device is sufficient, and the screen highlight has little influence on the consumption of the power, and the current screen brightness may be forcibly increased to the second screen brightness.
In another embodiment of the present application, when an electronic device runs with a video resource, detecting brightness of an environment where the electronic device is located, determining whether the brightness is greater than a preset brightness, when the brightness is greater than the preset brightness, performing tone mapping on image content in the video resource, and increasing a current screen brightness of the electronic device by a preset ratio to obtain a first screen brightness. Compared with the video processing method shown in fig. 2, the present embodiment also improves the current screen brightness of the electronic device to the first screen brightness, so as to further improve the video effect and improve the user experience.
Referring to fig. 6, fig. 6 is a block diagram illustrating a video processing apparatus 200 according to an embodiment of the present disclosure. The video processing apparatus 200 is applied to the electronic device. As will be explained below with respect to the block diagram shown in fig. 6, the video processing apparatus 200 includes: a detection module 210, a determination module 220, and a processing module 230, wherein:
the detecting module 210 is configured to detect, when the electronic device runs with a video resource, light brightness of an environment where the electronic device is located.
The determining module 220 is configured to determine whether the brightness is greater than a preset brightness.
The processing module 230 is configured to perform tone mapping processing on image content in the video resource when the brightness is greater than the preset brightness. Further, the processing module 230 includes: a lifting submodule, wherein:
and the boosting submodule is used for carrying out tone mapping processing on the image content in the video resource when the light brightness is higher than the preset light brightness, and boosting the current screen brightness of the electronic equipment by a preset proportion to obtain first screen brightness. Further, the lifting sub-module comprises: first judgement unit, first hoisting unit, second judgement unit, second hoisting unit and third hoisting unit, wherein:
and the first judging unit is used for judging whether the current screen brightness is the maximum screen brightness of the electronic equipment.
The first boosting unit is used for boosting the current screen brightness of the electronic equipment by a preset proportion to obtain the first screen brightness when the current screen brightness is not the maximum screen brightness of the electronic equipment.
And the second judging unit is used for judging whether the screen brightness after the current screen brightness is increased by a preset proportion is larger than the maximum screen brightness.
And the second lifting unit is used for lifting the current screen brightness to the maximum screen brightness when the screen brightness after the current screen brightness is lifted by a preset proportion is larger than the maximum screen brightness.
And a third boosting unit, configured to, when the current screen brightness is a maximum screen brightness of the electronic device, forcibly boost the current screen brightness to a second screen brightness, where the second screen brightness is greater than the first screen brightness. Further, the third lifting unit includes: surplus electric quantity detection subunit, surplus electric quantity judgment subunit and promotion subunit, wherein:
and the residual capacity detection subunit is used for detecting the residual capacity of the electronic equipment when the current screen brightness is the maximum screen brightness of the electronic equipment.
And the residual electric quantity judging subunit is used for judging whether the residual electric quantity is greater than a preset electric quantity.
And the boosting subunit is configured to, when the remaining power is greater than the preset power, forcibly boost the current screen brightness to the second screen brightness.
The embodiment of the application provides a video processing apparatus includes detection module, judgment module and processing module, wherein, detection module is used for working when electronic equipment moves and has video resource, detects the luminance of the environment that electronic equipment locates, judgment module are used for judging whether luminance is greater than predetermineeing luminance, processing module is used for working as luminance is greater than when predetermineeing luminance, it is right image content in the video resource carries out tone mapping and handles to when being higher than predetermineeing luminance through the luminance at the environment that electronic equipment locates, carry out tone mapping and handle the image content of the video resource of broadcast, have the visual experience of preferred under the higher condition of luminance in order to guarantee.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 7, a block diagram of an electronic device 100 according to an embodiment of the present disclosure is shown. The electronic device 100 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a screen 130, a codec 140, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the method as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores, among other things. The processor 110 connects various parts within the overall electronic device 100 using various interfaces and lines, and performs various functions of the electronic device 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
The codec 140 may be configured to encode or decode video data, and then transmit the decoded video data to the screen 130 for display, where the codec 140 may be a GPU, a dedicated DSP, an FPGA, an ASIG chip, or the like.
Referring to fig. 8, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 300 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 300 includes a non-volatile computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 310 may be compressed, for example, in a suitable form.
To sum up, according to the video processing method, the video processing device, the electronic device, and the storage medium provided in the embodiments of the present application, when a video resource is operated in the electronic device, the luminance brightness of an environment where the electronic device is located is detected, whether the luminance brightness is greater than a preset luminance brightness is determined, and when the luminance brightness is greater than the preset luminance brightness, tone mapping processing is performed on image content in the video resource, so that when the luminance brightness of the environment where the electronic device is located is higher than the preset luminance brightness, tone mapping processing is performed on the image content of the played video resource, and thus better visual experience is ensured under the condition of higher luminance brightness.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.