WO2020107992A1 - 视频处理方法、装置、电子设备及存储介质 - Google Patents

视频处理方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2020107992A1
WO2020107992A1 PCT/CN2019/104203 CN2019104203W WO2020107992A1 WO 2020107992 A1 WO2020107992 A1 WO 2020107992A1 CN 2019104203 W CN2019104203 W CN 2019104203W WO 2020107992 A1 WO2020107992 A1 WO 2020107992A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
load rate
optimization
optimization parameters
display enhancement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/104203
Other languages
English (en)
French (fr)
Inventor
杨海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of WO2020107992A1 publication Critical patent/WO2020107992A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44209Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB

Definitions

  • the present application relates to the technical field of electronic equipment, and more specifically, to a video processing method, device, electronic equipment, and storage medium.
  • Electronic devices such as computers and mobile phones, have become one of the most commonly used consumer electronic products in people's daily lives. With the development of electronic devices, more and more users use electronic devices for video playback, but when using electronic devices for video playback, display freezes may occur.
  • the present application proposes a video processing method, device, electronic device, and computer readable storage medium to improve the above problems.
  • an embodiment of the present application provides a video processing method, the method includes: during a video playback process, detecting a current load rate of an image processor in real time; according to the current load rate, determining to play a video Target optimization parameters of display enhancement processing, the display enhancement processing includes processing the played video using a target image processing algorithm; and performing the display enhancement processing on the played video based on the target optimization parameters.
  • an embodiment of the present application provides a video processing device, including: a load detection module, a parameter determination module, and a display enhancement module, wherein the load detection module is used for real-time detection during video playback The current load rate of the image processor; the parameter determination module is used to determine a target optimization parameter for performing display enhancement processing on the played video according to the current load rate.
  • the display enhancement processing includes using a target image processing algorithm to Process the played video; the display enhancement module is used to perform the display enhancement process on the played video based on the target optimization parameter.
  • an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and Is configured to be executed by the one or more processors, and the one or more application programs are configured to perform the video processing method provided in the first aspect described above.
  • an embodiment of the present application provides a computer-readable storage medium in which program code is stored, and the program code can be called by a processor to execute the video provided in the first aspect Approach.
  • FIG. 1 shows a block diagram of a video playback architecture according to an embodiment of the present application.
  • FIG. 2 shows a flowchart of a video processing method according to an embodiment of the present application.
  • FIG. 3 shows a flowchart of a video processing method according to another embodiment of the present application.
  • FIG. 4 shows a flowchart of a video processing method according to another embodiment of the present application.
  • FIG. 5 shows a block diagram of a video processing device according to an embodiment of the present application.
  • FIG. 6 shows a block diagram of a parameter determination module in a video processing device according to an embodiment of the present application.
  • FIG. 7 is a block diagram of an electronic device for performing a video processing method according to an embodiment of the present application.
  • FIG. 8 is a storage unit for storing or carrying program code for implementing a video processing method according to an embodiment of the present application.
  • the operating system of the electronic device can parse the audio and video data after acquiring the video data to be played.
  • the video file is composed of two parts: video stream and audio stream.
  • the packaging format of audio and video in different video formats will be different.
  • the process of combining audio streams and video streams into files is called muxer (merge file).
  • the inverse process corresponding to muxer is the process of separating audio and video streams from media files called demuxer (separating files).
  • demuxer demuxer
  • the decoded video frame can be directly rendered, and the audio frame can be sent to the buffer of the audio output device for playback.
  • the video Rendering and audio playback timestamps must control synchronization.
  • video decoding can include hard decoding and soft decoding.
  • Hardware decoding is to hand over part of the video data that was originally processed by the Central Processing Unit (CPU) to the graphics processor (Graphics Processing Unit, GPU).
  • the GPU's parallel computing power is much higher than that of the CPU, which can greatly reduce the load on the CPU. After the CPU occupancy rate is low, you can run some other programs at the same time.
  • software decoding can also be used, that is, decoding by a decoding software program in the CPU.
  • FIG. 1 shows a block diagram of a video playback architecture of an electronic device.
  • the Media Framework obtains the video file to be played by the client through the API interface with the client of the player, and hands it to the Video Decode for decoding. Obtain the decoded video data, that is, the image data to be rendered.
  • the Media Framework is a multimedia framework in the Android system.
  • the Media Framework can include three parts: MediaPlayer (Media Player), MediaPlayerService (Media Player Service) and Stagefrightplayer.
  • the multimedia framework part adopts the C/S structure.
  • MediaPlayer serves as the client of the C/S structure.
  • MediaPlayerService and Stagefrightplayer serve as the server of the C/S structure.
  • Video Decode is a decoder that can decode audio data and video data, and is used to decode video data.
  • the decoded video data can be transmitted to SurfaceFlinger (layer transfer module) through the video driver for rendering and display on the screen.
  • SurfaceFlinger is an independent Service, which receives all Window Surface as input, and calculates each Surface in the final composite image according to the parameters of ZOrder (node sorting), transparency, size, position, etc. The location is then handed over to HWComposer (Hardware Composition Abstraction Layer) or OpenGL (Open Graphics Library) to generate the final display buffer, which is then displayed on a specific display device.
  • HWComposer Hardware Composition Abstraction Layer
  • OpenGL Open Graphics Library
  • the CPU When the player is a player that uses soft decoding, the CPU is used to decode the video through software. After decoding, the GPU is called to render and merge the video and display it on the screen. Hard decoding means that the video decoding task can be completed independently through a dedicated daughter card device without resorting to the CPU.
  • the electronic device may perform display enhancement processing for video playback during video playback.
  • the decoded video data is obtained through hard decoding or soft decoding
  • the decoded video data is used as image data to be rendered, and when the image data to be rendered is sent to SurfaceFlinger, it can be HQV (Hollywood Quality Video, (Hollywood Quality Image)
  • the algorithm module intercepts and optimizes it and sends it to SurfaceFlinger for rendering and subsequent display operations on the screen.
  • the HQV algorithm module is used to store the above-mentioned image data to be rendered in the off-screen rendering buffer, and then perform exposure enhancement, denoising, edge sharpening, and contrast enhancement on the multi-frame image data in the off-screen rendering buffer.
  • SurfaceFlinger After the display enhancement processing of optimization operations such as saturation increase, it is transmitted to SurfaceFlinger for rendering and subsequent optimization operations on the screen, so that the displayed video image achieves the effect of ultra-clear visual effects.
  • SurfaceFlinger can call the GPU to implement the above image data for rendering and synthesis, and then put the rendering result into the frame buffer, and then the video controller reads the data in the frame buffer and passes it to the display for display after digital-to-analog conversion, thereby enabling video The display of the display is enhanced.
  • the real-time load rate determines the target optimization parameters for the enhanced processing of the displayed video display, to avoid the video processor from being stuck due to the high load rate of the image processor.
  • an embodiment of the present application provides a video processing method, which can be applied to an electronic device.
  • the video processing method may include:
  • Step S110 During the video playback process, the current load rate of the image processor is detected in real time.
  • the display enhancement processing may include processing the played video using a target image processing algorithm.
  • the target image processing algorithm may be the above-mentioned HQV algorithm, which can achieve the effect of ultra-clear visual effect for the video to be played later.
  • the specific target image processing algorithm may not be limited in the embodiment of the present application, and may be other An algorithm that improves the video playback effect.
  • the current video playback state of the electronic device can be detected to control the display enhancement processing according to the real-time load rate of the image processor when the electronic device plays video, thereby reducing the load of the image processor The amount of video to avoid freezing.
  • the load ratio of the image processor refers to the ratio of the load of the image processor to the maximum load of the image processor.
  • the video playback state may be detected, which may be whether the electronic device's video playback architecture is working to determine whether the electronic device is currently in the video playback state, that is, when the video playback architecture is working, it is determined that the electronic device is in Video playback status.
  • the specific way of detecting whether the video is currently being played is not limited in the embodiments of the present application.
  • the current load rate of the image processor can be detected in real time during video playback, so as to subsequently enhance the display processing based on the current load rate of the image processor detected in real time Take control.
  • the operating system of the electronic device is an Android system
  • you can use the adb command to obtain the GPU usage for example, use adb shell/cat/sys/class/kgsl/kgsl-3d0/gpubusy to obtain the GPU usage.
  • GPU load factor the specific way of detecting the current load rate of the image processor may not be limited in the embodiments of the present application.
  • Step S120 Determine a target optimization parameter for performing display enhancement processing on the played video according to the current load rate.
  • the display enhancement processing includes processing the played video using a target image processing algorithm.
  • performing display enhancement processing on the video may include various optimization parameters for optimizing the video.
  • Various optimization parameters may include: exposure enhancement, denoising, edge sharpening, contrast increase, and saturation increase and other optimization parameters.
  • the optimization parameters specifically optimizing the video may not be limited in the embodiments of the present application.
  • the optimized parameters used for display enhancement processing can be controlled according to the current load rate of the image processor detected in real time, so that the load rate of the image processor will not be too high, which may cause the video playback to freeze.
  • the target optimization parameters used for display enhancement processing can be obtained according to the preset rules and the current load rate detected in real time.
  • the preset rules can be established according to the rule that the higher the load rate, the less the image processor resources occupied by the optimization parameters for display enhancement processing, for example, the higher the image processor load rate, the determined optimization The fewer the parameters, the less the optimization parameters occupy the image processor resources.
  • the way to obtain the target optimization parameters for display enhancement processing may not be limited in the embodiments of the present application, it only needs to meet the image load rate.
  • the higher the current load rate, the display enhancement The processing optimization parameters occupy less image processor resources, so that the load rate of the image processor will not be too high, which will cause video playback to freeze.
  • Step S130 Perform the display enhancement process on the played video based on the target optimization parameter.
  • display enhancement processing can be performed on the played video according to the target optimization parameter. That is, the decoded video data of the played video is used as the image data to be rendered, which is intercepted by the HQV algorithm module.
  • the HQV algorithm module stores the image data to be rendered into the off-screen rendering buffer, and then stores the off-screen rendering buffer.
  • the image of the multi-frame image data is subjected to display enhancement processing of the optimization operation corresponding to the target optimization parameter, and then transmitted to SurfaceFlinger for rendering and subsequent optimization operations on the screen, so that the displayed video image reaches the optimization corresponding to the target optimization parameter Visual effects.
  • the determined target optimization parameters include increased contrast and increased saturation
  • when performing display enhancement processing on the played video only optimization operations for increased contrast and saturation are performed.
  • the optimized parameters for display enhancement processing can be controlled according to the current load rate of the image processor, instead of performing the display enhancement processing according to all optimized parameters in any case, which can make the load rate of the image processor dynamically adjustable and solve the image processing
  • the load rate of the device is too high, which causes the video to freeze.
  • the current load rate of the image processor is detected in real time, and according to the load rate detected in real time, target optimization parameters for performing display enhancement processing on the played video are determined, and Perform display enhancement processing on the played video according to the target optimization parameters.
  • the optimized parameters for display enhancement are determined according to the real-time load rate of the image processor, which can dynamically adjust the load rate of the image processor, thereby solving the problem that the load rate of the image processor is too high. Stuck problem when playing video.
  • FIG. 3 another embodiment of the present application provides a video processing method, which can be applied to an electronic device.
  • the video processing method may include:
  • Step S210 During the video playback process, the current load rate of the image processor is detected in real time.
  • the video processor controls the display enhancement processing, reduces the load on the image processor, and avoids video playback stalls.
  • the system interface of the electronic device may be provided with a switch button for performing a display enhancement processing function, and the user may use this switch button to turn on or off the display enhancement processing function of video playback.
  • the switch button By detecting whether the above switch button is turned on, when the switch button is turned on, the display enhancement processing function is turned on, that is, when the video is currently being played, the display enhancement processing is performed on the played video; when the switch button is turned off, then The display enhancement processing function is turned off, that is to say, when the video is currently playing, the display enhancement processing is not being performed on the played video.
  • the above-mentioned HQV algorithm module is called to perform optimized operation on the decoded video image data to achieve display enhancement of the played video. Therefore, it is possible to detect whether the above HQV algorithm module is called. If the HQV algorithm module is called, it means that the video is currently being played with display enhancement processing; if the HQV algorithm module is not called, it means that the current When playing a video, display enhancement processing is not performed on the played video.
  • the specific way of determining whether to perform display enhancement processing on the played video is not limited in the embodiments of the present application.
  • Step S220 Determine whether the current load rate is less than the first load rate threshold.
  • the current load rate can be compared with the set load rate threshold Based on the comparison result, the target optimization parameters for display enhancement are determined.
  • the first load rate threshold may be a critical value indicating the level of the load rate.
  • the load rate of the image processor is lower than the first load rate threshold, the load rate of the image processor is at a low level. At this time, the image processor has more available resources, and can smoothly process all optimization parameters corresponding to the enhanced processing. Optimization operation.
  • the load rate of the image processor is higher than the first load rate threshold, the load rate of the image processor is at a relatively high level. At this time, the available resources of the image processor are relatively small, and it is impossible to smoothly process all optimizations corresponding to the enhanced processing.
  • the optimization operation corresponding to the parameters may cause the load rate of the image processor to be at a very high level, which may cause the video to freeze.
  • the first load rate threshold may be determined according to parameters of the image processor and the like.
  • the first load rate threshold corresponding to the image processor with a lower maximum operating frequency may be higher.
  • the maximum operating frequencies of the two image processors are 1 GHz and 2 GHz, respectively. If the first load rate threshold corresponding to the maximum operating frequency of 1 GHz is 60%, the first load rate threshold corresponding to the maximum operating frequency of 2 GHz is 65%. .
  • the above first load rate threshold is only an example, and does not represent a limitation on the specific first load rate threshold in the embodiments of the present application.
  • the specific first load rate threshold may not be limited, and when the current load rate of the image processor is less than the first load rate threshold, it can smoothly process the optimization operation corresponding to all optimization parameters. When it is less than the first load rate threshold, it cannot smoothly process the optimization operation corresponding to all optimization parameters.
  • Step S230 If it is less than the first load rate threshold, all optimization parameters are selected as target optimization parameters for performing display enhancement processing on the played video.
  • the image processor when it is determined that the current load rate of the image processor detected in real time is less than the above-mentioned first load rate threshold, then the image processor can smoothly process the optimization operation of displaying all optimization parameters of the enhancement process, so All optimization parameters can be selected as the target optimization parameters for the display enhancement processor of the played video, so that the played video image can achieve the effect of super clear visual effects.
  • Step S240 If it is not less than the first load rate threshold, determine whether the current load rate is less than the second load rate threshold, and the second load rate threshold is greater than the first load rate threshold.
  • the current load rate of the image processor is not less than the first load rate threshold, that is, the current load rate is greater than or equal to the first load rate threshold, it means that the image processor cannot process all If the optimization operation corresponding to the optimization parameter is still performed at this time, the optimization corresponding to all the optimization parameters may cause the video to freeze. Therefore, the situation that the image processor cannot smoothly process all the optimization operations corresponding to all the optimization parameters can be processed to avoid the video playback jam.
  • the image processor may currently be able to smoothly process the operation corresponding to at least one optimization parameter, or may not The operation corresponding to any optimization parameter can be smoothly processed. Therefore, in the embodiment of the present application, when the current load rate of the image processor is not less than the first load rate threshold, it may be determined whether the current image processor is in a state where it cannot process the operation corresponding to any optimization parameter.
  • the current load rate of the image processor when the current load rate of the image processor is not less than the first load rate threshold, it may be determined whether the current load rate of the image processor is less than the second load rate threshold, where the second load rate threshold is greater than the first load rate Threshold to determine whether to continue the display enhancement process when the current load rate of the image processor is not less than the first load rate threshold.
  • the second load rate threshold may be the load rate when the image processor cannot process any operation corresponding to the optimization parameter, and the image processor can also process the load rate during the optimization operation corresponding to at least one optimization parameter.
  • Critical value That is to say, when the current load rate of the image processor is less than the second load rate threshold, its load rate is at a high level, but its remaining available resources can support the optimization operation of smoothly processing at least one optimization parameter; when the image When the current load rate of the processor is not less than the second load rate threshold, its load rate is at a very high level, and its remaining available resources cannot smoothly handle any optimization operation of optimization parameters.
  • the second load rate threshold can also be determined according to the parameters of the image processor and the like.
  • the maximum operating frequency of the image processor when its maximum operating frequency of the image processor is high, since its load rate reaches a higher level, it can still smoothly process the optimization operation corresponding to at least one optimization parameter, so its corresponding second load rate threshold
  • the second load rate threshold corresponding to the image processor with a lower maximum operating frequency may be higher.
  • the maximum operating frequencies of the two image processors are 1 GHz and 2 GHz, respectively. If the second operating load threshold corresponding to the maximum operating frequency of 1 GHz is 80%, the second operating load threshold corresponding to the maximum operating frequency of 2 GHz is 85%.
  • the above second load rate threshold is only an example, and does not represent a limitation on the specific second load rate threshold in the embodiments of the present application.
  • Step S250 If it is less than the second load rate threshold, select some optimization parameters from all optimization parameters as target optimization parameters for performing display enhancement processing on the played video.
  • the image processor when the current load rate of the image processor is less than the second load rate threshold, it means that the image processor can also smoothly process the optimization operation corresponding to at least one optimization parameter at this time, but cannot smoothly process all The optimization operation corresponding to the optimization parameter. Therefore, when the current load rate of the image processor is less than the second load rate threshold, a part of the optimization parameters may be selected from all the optimization parameters as the target optimization parameter for performing display enhancement processing on the played video.
  • At least one optimization parameter can be selected from all optimization parameters according to the set rules as the target optimization parameter for performing display enhancement processing on the played video.
  • the target optimization parameters selected according to the setting rules should satisfy that when the display enhancement processing is performed according to the target optimization parameters, the load rate of the image processor will not be too large.
  • the image processor when the image processor is specifically at a different load rate between the first load rate threshold and the second load rate threshold, it can support optimized parameters for smooth processing and establish correspondence between different load rates and optimized parameters relationship.
  • the current load rate of the image processor is not less than the first load rate threshold, but less than the second load rate threshold
  • the load rate of the image processor will not be too high, and the image processor will not smoothly process the video image.
  • the method of selecting some optimization parameters from all optimization parameters may not be limited in the embodiments of the present application, for example, it may also be set by the user when the current load rate of the image processor is not less than the first load rate When the threshold is smaller than the second load rate threshold, the optimization parameters need to be selected to achieve the determination of the target optimization parameters during the video playback.
  • Step S260 If it is not less than the second load rate threshold, stop the display enhancement process.
  • the display enhancement process may be stopped to avoid the image processor load rate being too high, and causing the image processor to process video images unsmoothly And Caton.
  • Step S270 Perform the display enhancement processing on the played video based on the target optimization parameter.
  • display enhancement processing can be performed on the played video according to the target optimization parameters. Realize the control of the optimized parameters for display enhancement processing according to the current load rate of the image processor, instead of performing the display enhancement processing according to all optimized parameters in any case, so that the load rate of the image processor can be dynamically adjusted to avoid the image processor The load rate is too high and causes video playback to freeze.
  • the video processing method provided in the embodiment of the present application detects the current load rate of the image processor in real time during video playback, and compares the current load rate with the set load rate threshold to determine the target optimization parameter. Determine the target optimization parameters and perform display enhancement processing on the played video.
  • the optimized parameters for display enhancement are determined according to the real-time load rate of the image processor, which can dynamically adjust the load rate of the image processor, thereby solving the problem that the load rate of the image processor is too high. Stuck problem when playing video.
  • yet another embodiment of the present application provides a video processing method that can be applied to electronic devices.
  • the method may include:
  • Step S310 During the video playback process, the current load rate of the image processor is detected in real time.
  • Step S320 Determine whether the current load rate is less than the first load rate threshold.
  • Step S330 if it is less than the first load rate threshold, all optimization parameters are selected as target optimization parameters for performing display enhancement processing on the played video.
  • Step S340 If it is not less than the first load rate threshold, determine whether the current load rate is less than the second load rate threshold, and the second load rate threshold is greater than the first load rate threshold.
  • step S310 to step S340 can refer to the content of the foregoing embodiment, and will not be repeated here.
  • Step S350 If it is less than the second load rate threshold, obtain the optimization priority corresponding to each optimization parameter among all optimization parameters.
  • the optimization when it is determined that the current load rate of the image processor is not less than the first load rate threshold, but is less than the second load rate threshold, when obtaining some optimization parameters from all optimization parameters, the optimization may be based on each optimization The optimization priority of the parameter is used to select the optimization parameter.
  • the above optimization priority may include: a priority established according to the order of picture optimization quality corresponding to the optimization parameter from high to low; or a priority established according to the order of resource occupancy corresponding to the optimization parameter from low to high.
  • the optimization priorities of the above different parameters can be established according to the order of the picture optimization quality corresponding to the optimization parameters from high to low, that is, the optimization priority of each optimization parameter is established, that is, the optimization parameter corresponds to The higher the picture optimization quality, the higher the corresponding optimization priority. It is also possible to establish the optimization priority of each optimization parameter according to the order in which the resource occupancy rate corresponding to the optimization parameter is low, that is, the lower the resource occupancy rate corresponding to the optimization parameter, the corresponding optimization priority The higher.
  • the specific optimization priority may not be limited in the embodiments of the present application.
  • the optimization priority may also be set by the user, that is, the user may set the optimization priority of all optimization parameters.
  • the above optimization priority can be stored in the electronic device, and when it is necessary to obtain some optimization parameters from all optimization parameters, the optimization priority can be read.
  • Step S360 According to the optimization priority, select a part of the optimization parameters from all the optimization parameters, and use the part of the optimization parameters as the target optimization parameter for performing display enhancement processing on the played video, and the priority of the target optimization parameter
  • the priority is greater than the other optimization parameters, and the other optimization parameters are optimization parameters other than the target optimization parameter among all the optimization parameters.
  • the optimization parameter may be selected according to the optimization priority of each optimization parameter.
  • the target number of optimization parameters can be selected according to the optimization priority of each optimization parameter, for example, according to the ranking results of the optimization parameters from high to low, the former target number can be selected from the ranking results
  • the number of optimization parameters that is to say, the priority of the selected number of optimization parameters is greater than the priority of other optimization parameters.
  • the image processor can smoothly execute the display enhancement process. Therefore, when the display enhancement processing is performed on the played video later, it can be processed according to the optimization parameter with high priority.
  • the picture optimization quality corresponding to the target optimization parameter is higher than the picture optimization quality corresponding to other optimization parameters, and the image can be made
  • the processor performs the display enhancement processor according to the target optimization parameter, it can smoothly perform the operation of the display enhancement process. Therefore, when the subsequent display enhancement processing is performed on the played video according to the target optimization parameter, the quality of the video picture can be made higher.
  • the processor When the optimization priority is the priority established according to the order of the resource occupancy corresponding to the optimization parameter from low to high, the resource occupancy corresponding to the target optimization parameter is lower than the resource occupancy corresponding to other optimization parameters, and the image
  • the processor performs the display enhancement processor according to the target optimization parameter, it can smoothly perform the operation of the display enhancement process. Therefore, when the subsequent display enhancement processing is performed on the played video according to the target optimization parameters, the image enhancement processor may consume less resources of the image processor, and the video playback may be blocked.
  • Step S370 If it is not less than the second load rate threshold, stop the display enhancement process.
  • the display enhancement process may be stopped to avoid the image processor load rate being too high, and causing the image processor to process video images unsmoothly And Caton.
  • Step S380 Perform the display enhancement process on the played video based on the target optimization parameter.
  • display enhancement processing can be performed on the played video according to the target optimization parameters. Realize the control of the optimized parameters for display enhancement processing according to the current load rate of the image processor, instead of performing the display enhancement processing according to all optimized parameters in any case, so that the load rate of the image processor can be dynamically adjusted to avoid the image processor The load rate is too high and causes video playback to freeze.
  • the video processing method when it is detected that the current load rate of the image processor is not less than the first load rate, related processing may also be performed to reduce the load rate of the image processor and improve the image processor's display enhancement process. Efficiency, reduce the lag in video playback. Therefore, when the current load rate is not less than the first load rate threshold, the video processing method may further include:
  • the barrage data is the data used by the playback application to obtain the displayed barrage from the video source server or the barrage server. After obtaining the barrage data, the playback application of the electronic device can use the barrage data to play The drawing of the screen is finally combined with the video image to display the same image.
  • the barrage display When the barrage display is realized, it will occupy the resources of the image processor, and the barrage function is a non-essential function during video playback. Therefore, it is possible to detect whether the barrage function is turned on and turn it off when the barrage function is turned on Barrage function. Wherein, to detect whether the barrage function of the application is turned on, it is possible to determine whether the barrage function of the application program currently playing the video is turned on by detecting whether the identifier of the barrage function of the application is an identifier characterizing that the barrage function is turned on.
  • the barrage function of the application that plays video is 0, the barrage function of the application is not turned on, and when the identifier of the barrage function of the application that plays video is 1, the barrage of the application is characterized.
  • the function is turned on.
  • it is also possible to determine whether the barrage function of the application is turned on by detecting whether the data interface corresponding to the barrage function of the currently playing application to obtain barrage data from the barrage server is turned on.
  • the method for specifically detecting the barrage function of the currently playing video application may not be limited in the embodiments of the present application.
  • the barrage function of the currently playing video application When it is detected that the barrage function of the currently playing video application is turned on, the barrage function can be turned off, so that the load rate of the image processor is not less than the first load rate threshold, which is in a situation where it cannot perform all optimization parameters smoothly When optimizing operations, reduce the load rate of the graphics processor to avoid video freezes.
  • the video processing method may further include: closing a target application running in the background, where the target application is another application that occupies resources of the image processor except the application currently playing the video.
  • the application currently running in the background can be obtained through the task management list of the system of the electronic device, and the application currently occupying the resources of the image processor can be obtained by detecting the use state of the image processor. Therefore, the target application running in the background and occupying the resources of the image processor can be obtained. Since the target application is currently running in the background, the user does not need to view the image output by the application, so the target application can be closed to release The available resources of the image processor ensure smooth video playback and avoid freezes during video playback.
  • the current load rate of the image processor is detected in real time during video playback, and the current load rate is compared with the set load rate threshold to determine the target optimization through the optimization priority Parameters, and finally, display enhancement processing is performed on the played video according to the determined target optimization parameters.
  • the optimized parameters for display enhancement are determined according to the real-time load rate of the image processor, which can dynamically adjust the load rate of the image processor, thereby solving the problem that the load rate of the image processor is too high. Stuck problem when playing video.
  • the video processing device 400 may include a load detection module 410, a parameter determination module 420, and a display enhancement module 430.
  • the load detection module 410 is used to detect the current load rate of the image processor in real time during video playback;
  • the parameter determination module 420 is used to determine the display enhancement processing of the played video according to the current load rate Target optimization parameters, the display enhancement processing includes processing the played video using a target image processing algorithm;
  • the display enhancement module 430 is configured to perform the display on the played video based on the target optimization parameters Enhanced processing.
  • the parameter determination module 420 may include: a first load judgment unit 421 and a first parameter selection unit 422.
  • the first load judging unit 421 is used to judge whether the current load rate is less than the first load rate threshold; the first parameter selection unit 422 is used to select all optimization parameters as the video to be played if it is less than the first load rate threshold Target optimization parameters for display enhancement processing.
  • the parameter determination module 420 may further include: a second load judgment unit 423, a second parameter selection unit 424, and a stop execution unit 425.
  • the second load determination unit 423 is used to determine whether the current load rate is less than the second load rate threshold if it is not less than the first load rate threshold, and the second load rate threshold is greater than the first load rate threshold;
  • the second parameter selection unit 424 is used to select a part of the optimization parameters from all the optimization parameters as the target optimization parameters for performing display enhancement processing on the played video if it is smaller than the second load rate threshold; If it is less than the second load rate threshold, the display enhancement process is stopped.
  • the second parameter selection unit 424 may be specifically configured to: if it is less than the second load rate threshold, obtain an optimization priority corresponding to each optimization parameter among all optimization parameters; according to the optimization priority, Selecting partial optimization parameters from all the optimization parameters, and using the partial optimization parameters as the target optimization parameters for performing display enhancement processing on the played video, the priority of the target optimization parameters is greater than that of the other optimization parameters,
  • the other optimization parameters are optimization parameters other than the target optimization parameter among all the optimization parameters.
  • the optimization priority may include: a priority established according to a picture optimization quality corresponding to the optimization parameter in order from high to low; or a priority established according to the order of resource occupancy corresponding to the optimization parameter from low to high.
  • the video processing device 400 may further include: a barrage detection module and a barrage closing module.
  • the barrage detection module is used to detect whether the barrage function of the currently playing video application is turned on when the current load rate is not less than the first load rate threshold; the barrage closing module is used to turn off Describe the barrage function of the currently playing video application.
  • the video processing device 400 may further include: an application closing module.
  • the application closing module is used to close a target application running in the background, where the target application is other applications that occupy resources of the image processor except the application currently playing the video.
  • the coupling between the modules may be electrical, mechanical, or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above integrated modules may be implemented in the form of hardware or software function modules.
  • the solution provided by this application detects the current load rate of the image processor in real time during video playback, and determines the target optimization parameters for the display enhancement processing of the played video according to the real-time detected load rate, and Perform display enhancement processing on the played video according to the target optimization parameters. Since the display enhancement processing is performed on the played video, the optimized parameters for display enhancement are determined according to the real-time load rate of the image processor, so as to avoid the video processor from being stuck when the load rate of the image processor is too high.
  • the electronic device 100 may be an electronic device capable of running an application program such as a smart phone, a tablet computer, an e-book.
  • the electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, a screen 130, and one or more application programs, where one or more application programs may be stored in the memory 120 and configured To be executed by one or more processors 110, one or more programs are configured to perform the method as described in the foregoing method embodiments.
  • the processor 110 may include one or more processing cores.
  • the processor 110 connects various parts of the entire electronic device 100 by using various interfaces and lines, executes or executes instructions, programs, code sets or instruction sets stored in the memory 120, and calls data stored in the memory 120 to execute Various functions and processing data of the electronic device 100.
  • the processor 110 may use at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA programmable logic array
  • the processor 110 may integrate one or a combination of one of a central processor 111 (Central Processing Unit, CPU), an image processor 112 (Graphics Processing Unit, GPU), and a modem.
  • CPU Central Processing Unit
  • image processor 112 Graphics Processing Unit, GPU
  • modem is used for handling wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, and may be implemented by a communication chip alone.
  • the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets.
  • the memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments.
  • the storage data area may also store data created by the electronic device 100 in use (such as a phone book, audio and video data, chat history data), and the like.
  • the screen 130 is used to display information input by the user, information provided to the user, and various graphical user interfaces of the electronic device. These graphical user interfaces may be composed of graphics, text, icons, numbers, video, and any combination thereof. In an example, the touch screen may be disposed on the display panel so as to form a whole with the display panel.
  • FIG. 8 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable storage medium 800 has program codes stored therein, and the program codes can be called by the processor to execute the method described in the above method embodiments.
  • the computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 800 has a storage space for the program code 810 that performs any of the method steps described above. These program codes can be read from or written into one or more computer program products.
  • the program code 810 may be compressed in an appropriate form, for example.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本申请公开了一种视频处理方法、装置、电子设备及存储介质,该视频处理方法包括:在视频播放过程中,实时检测图像处理器的当前负载率;根据所述当前负载率,确定对播放的视频进行显示增强处理的目标优化参数,所述显示增强处理包括利用目标影像处理算法对所述播放的视频进行处理;基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。本方法可以有效减少视频播放中的卡顿。

Description

视频处理方法、装置、电子设备及存储介质
相关申请的交叉引用
本申请要求于2018年11月27日提交的申请号为201811427975.7的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。
技术领域
本申请涉及电子设备技术领域,更具体地,涉及一种视频处理方法、装置、电子设备及存储介质。
背景技术
电子设备,例如电脑、手机等,已经成为人们日常生活中最常用的消费型电子产品之一。随着电子设备的发展,越来越多的用户利用电子设备进行视频的播放,但在利用电子设备进行视频播放时,可能会出现显示卡顿。
发明内容
鉴于上述问题,本申请提出了一种视频处理方法、装置、电子设备及计算机可读取存储介质,以改善上述问题。
第一方面,本申请实施例提供了一种视频处理方法,所述方法包括:在视频播放过程中,实时检测图像处理器的当前负载率;根据所述当前负载率,确定对播放的视频进行显示增强处理的目标优化参数,所述显示增强处理包括利用目标影像处理算法对所述播放的视频进行处理;基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。
第二方面,本申请实施例提供了一种视频处理装置,所述装置包括:负载检测模块、参数确定模块以及显示增强模块,其中,所述负载检测模块用于在视频播放过程中,实时检测图像处理器的当前负载率;所述参数确定模块用于根据所述当前负载率,确定对播放的视频进行显示增强处理的目标优化参数,所述显示增强处理包括利用目标影像处理算法对所述播放的视频进行处理;所述显示增强模块用于基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。
第三方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序配置用于执行上述第一方面提供的视频处理方法。
第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述第一方面提供的视频处理方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述 中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了根据本申请实施例提供的视频播放架构的框图。
图2示出了根据本申请一个实施例的视频处理方法流程图。
图3示出了根据本申请另一个实施例的视频处理方法流程图。
图4示出了根据本申请又一个实施例的视频处理方法流程图。
图5示出了根据本申请一个实施例的视频处理装置的一种框图。
图6示出了根据本申请一个实施例的视频处理装置中参数确定模块的框图。
图7是本申请实施例的用于执行根据本申请实施例的视频处理方法的电子设备的框图。
图8是本申请实施例的用于保存或者携带实现根据本申请实施例的视频处理方法的程序代码的存储单元。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
目前,大多电子设备,例如电脑、手机、平板电脑等,可实现对视频的播放。在电子设备进行视频的播放时,电子设备的操作系统在获取到待播放的视频数据后,可以解析音视频数据。通常视频文件由视频流和音频流两部分组成,不同的视频格式音视频的封装格式将会不同。将音频流和视频流合成文件的过程称为muxer(合并文件)。muxer对应的逆过程,则是从媒体文件中分离音频流和视频流的过程称为demuxer(分离文件)。播放视频文件时,需要从文件流中分离出音频流和视频流,分别对其进行解码,解码后的视频帧可以直接渲染,音频帧可以送到音频输出设备的缓冲区进行播放,当然,视频渲染和音频播放的时间戳一定要控制同步。
其中,视频解码可以包括硬解码和软解码,硬件解码是将原来全部交由中央处理器(Central Processing Unit,CPU)来处理的视频数据的一部分交由图像处理器(Graphics Processing Unit,GPU)来做,而GPU的并行运算能力要远远高于CPU,这样可以大大的降低对CPU的负载,CPU的占用率较低了之后就可以同时运行一些其他的程序了。当然,对于性能较好的处理器而言,也可以使用软件解码,即由CPU中的解码软件程序进行解码。
请参阅图1,示出了电子设备的视频播放架构的框图。当播放器为采用硬解码的播放器时,Media Framework(多媒体框架)通过与播放器的客户端的API接口获取客户端待播放的视频文件,并交由Video Decode(视频解码器)进行解码,以获得解码后的视频数据,即待渲染的图像数据。其中,Media Framework为Android系统中多媒体框架,Media Framework可以包括MediaPlayer(媒体播放器)、MediaPlayerService(媒体播放器服务)和Stagefrightplayer三个部分。具体的,多媒体框架部分采用C/S的结构, MediaPlayer作为C/S结构的Client(客户)端,MediaPlayerService和Stagefrightplayer作为C/S结构Server(服务)端,承担着播放多媒体文件的责任,通过Stagefrightplayer,Server端完成Client端的请求并作出响应。Video Decode为可以解码音频数据以及视频数据的解码器,用于将视频数据解码。在Video Decode对上述的视频文件进行解码后,则可以通过视频驱动程序将解码后的视频数据传输至SurfaceFlinger(图层传递模块)进行渲染以及在屏幕中的显示。SurfaceFlinger是一个独立的Service(服务),它接收所有Window(窗口)的Surface(表层)作为输入,根据ZOrder(节点排序)、透明度、大小、位置等参数,计算出每个Surface在最终合成图像中的位置,然后交由HWComposer(硬件组合抽象层)或OpenGL(Open Graphics Library,开放图形库)生成最终的显示Buffer(缓冲),然后显示到特定的显示设备上。
当播放器为采用软解码的播放器时,即通过软件让CPU来对视频进行解码处理,解码之后再调用GPU对视频渲染合并之后在屏幕上显示。而硬解码,指不借助于CPU,而通过专用的子卡设备来独立完成视频解码任务。
在本申请实施例中,电子设备在视频播放过程中可以进行视频播放的显示增强处理。具体的,在通过硬解码或者软解码获得解码后的视频数据之后,解码后的视频数据作为待渲染的图像数据,将待渲染的图像数据发送至SurfaceFlinger的时候,可以被HQV(Hollywood Quality Video,好莱坞品质影像)算法模块拦截并优化之后再发送给SurfaceFlinger做渲染以及后续在屏幕上的显示操作。HQV算法模块用于将上述待渲染的图像数据存储至离屏渲染缓冲区之后,对离屏渲染缓冲区内的多帧图像数据的图像进行曝光度增强、去噪、边缘锐化、对比度增加以及饱和度增加等优化操作的显示增强处理之后,再传输至SurfaceFlinger进行渲染以及后续在屏幕上的优化操作,以使显示的视频图像达到超清视效的效果。具体的,SurfaceFlinger可以调用GPU实现上述图像数据进行渲染和合成后将渲染结果放入帧缓冲区,随后视频控制器读取帧缓冲区的数据,经过数模转换传递给显示器显示,从而可以实现视频显示的显示增强。
但是,发明人经过研究发现,在视频播放过程中,进行显示增强时,会使GPU的负载率增加,而在GPU的负载率过高时,容易出现播放视频时的卡顿。因此,针对该技术问题,发明人经过长时间的研究并提出了本申请实施例提供的视频处理方法、装置、电子设备以及计算机可读取存储介质,通过在视频播放过程中,根据图像处理器的实时负载率确定对播放的视频显示增强处理的目标优化参数,避免图像处理器的负载率过高而导致的视频播放时的卡顿。
下面对本申请实施例的视频处理方法进行详细介绍。
请参阅图2,本申请实施例提供了一种视频处理方法,可应用于电子设备,该视频处理方法可以包括:
步骤S110:在视频播放过程中,实时检测图像处理器的当前负载率。
在电子设备进行视频播放过程中,通常为了保证视频的显示效果,会进行显示增强处理。而在进行显示增强处理时,会增加图像处理器的负载率,当图像处理器的负载率过高时,会导致视频播放出现卡顿。其中,显示增强处理可以包括利用目标影像处理算法对播放的视频进行处理。目标影像处理算法可以为上述HQV算法,其可以使后续播放的视频达到超清视效的效果,当然具体的目标影像处理算法在本申请实施例中可以不作为限定,也可以为其他对视频进行处理使视频的播放效果提升的算法。
在本申请实施例中,可以对电子设备当前的视频播放状态进行检测,以在电子设备播放视频时,根据图像处理器的实时的负载率,对显示增强处理进行控制,减少图像处理器的负载量,避免视频播放的卡顿。其中,图像处理器的负载率指图像处理器的负载与图像处理器的最大负载的比值。
在一些实施方式中,可以对视频播放状态进行检测,可以是检测电子设备的视频播放架构中是否工作,以确定电子设备当前是否处于视频播放状态,即在视频播放架构工作时,确定电子设备处于视频播放状态。另外,也可以检测视频播放时所使用的相关模块是否工作,以确定电子设备是否处于播放状态,例如,当检测到视频解码器、图层传递模块及视频播放器等处于工作状态时,检测出电子设备当前处于视频播放的状态。当然,具体检测当前是否处于视频播放的状态的方式在本申请实施例中并不作为限定。
进一步的,在电子设备处于视频播放状态时,则可以在视频播放过程中,对图像处理器的当前负载率进行实时检测,以便后续根据实时检测的图像处理器的当前负载率,对显示增强处理进行控制。在一些方式中,电子设备的操作系统为安卓系统时,可以通过adb命令获取GPU的使用情况,例如通过adb shell cat/sys/class/kgsl/kgsl-3d0/gpubusy获取GPU的使用情况,以得到GPU的负载率。当然,具体检测图像处理器的当前负载率的方式在本申请实施例中可以不作为限定。
步骤S120:根据所述当前负载率,确定对播放的视频进行显示增强处理的目标优化参数,所述显示增强处理包括利用目标影像处理算法对所述播放的视频进行处理。
在本申请实施例中,对视频进行显示增强处理可以包括多种对视频进行优化的优化参数。多种优化参数可以包括:曝光度增强、去噪、边缘锐化、对比度增加以及饱和度增加等优化参数。当然,具体对视频进行优化的优化参数在本申请实施例中可以不作为限定。
其中,在利用上述多种优化参数进行显示增强处理时,即对视频进行优化时,每种优化参数对应的优化处理均会占用图像处理器的资源,并且每种优化参数占用图像处理器的资源可能不同。因此,可以根据实时检测的图像处理器的当前负载率,对用于进行显示增强处理的优化参数进行控制,以使图像处理器的负载率不会过高,而导致视频播放的卡顿。作为一 种方式,可以根据预先设定的规则,根据实时检测的当前负载率,获取用于进行显示增强处理的目标优化参数。其中,预先设定的规则,可以按照负载率越高,用于显示增强处理的优化参数所占用图像处理器的资源越少的规则建立,例如,图像处理器的负载率越高,确定的优化参数越少,以使优化参数占用图像处理器的资源较少。当然,具体根据实时检测的当前负载率,获取用于进行显示增强处理的目标优化参数的方式在本申请实施例中可以不作为限定,仅需满足图像负载率的当前负载率越高,显示增强处理的优化参数所占用图像处理器的资源越少即可,以使图像处理器的负载率不会过高,而导致视频播放的卡顿。
步骤S130:基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。
在确定出图像处理器的当前负载率所对应的目标优化参数之后,则可以根据目标优化参数,对播放的视频进行显示增强处理。即播放的视频被解码后的视频数据作为待渲染的图像数据,被上述HQV算法模块拦截,HQV算法模块将上述待渲染的图像数据存储至离屏渲染缓冲区之后,对离屏渲染缓冲区内的多帧图像数据的图像进行目标优化参数对应的优化操作的显示增强处理之后,再传输至SurfaceFlinger进行渲染以及后续在屏幕上的优化操作,以使显示的视频图像达到目标优化参数对应的优化后的视效的效果。例如,在确定出的目标优化参数包括对比度增加以及饱和度增加时,则对播放的视频进行显示增强处理时,仅进行对比度增加以及饱和度增加的优化操作。从而实现根据图像处理器的当前负载率,控制进行显示增强处理的优化参数,而不是任何情况下均根据所有优化参数进行显示增强处理,可以使图像处理器的负载率可以动态调整,解决图像处理器的负载率过高而导致视频播放的卡顿问题。
本申请实施例提供的视频处理方法,通过在在视频播放过程中,实时检测图像处理器的当前负载率,根据实时检测的负载率,确定对播放的视频进行显示增强处理的目标优化参数,并根据目标优化参数对播放的视频进行显示增强处理。由于对播放的视频进行显示增强处理时,进行显示增强的优化参数根据图像处理器的实时负载率确定,可以使图像处理器的负载率实现动态调整,从而解决图像处理器的负载率过高而导致的视频播放时的卡顿问题。
请参阅图3,本申请另一个实施例提供了一种视频处理方法,可应用于电子设备,该视频处理方法可以包括:
步骤S210:在视频播放过程中,实时检测图像处理器的当前负载率。
在本申请实施例中,在视频播放过程中,可以确定出当前对播放的视频进行显示增强处理时,对电子设备当前的视频播放状态进行检测,以在电子设备播放视频时,根据图像处理器的实时的负载率,对显示增强处理进行控制,减少图像处理器的负载量,避免视频播放的卡顿。
在本申请实施例中,在视频播放过程中,可以通过多种方式确定当前 是否对播放的视频进行显示增强处理。
作为一种方式,电子设备的系统界面中可以设置有用于进行显示增强处理的功能的开关按钮,用户可通过该开关按钮开启或者关闭视频播放的显示增强处理的功能。通过检测上述开关按钮是否开启,当该开关按钮开启时,则显示增强处理的功能开启,也就是说,当前播放视频时,在对播放的视频进行显示增强处理;当该开关按钮关闭时,则显示增强处理的功能关闭,也就是说,当前播放视频时,未在对播放的视频进行显示增强处理。作为另一种方式,由于在进行视频播放中的显示增强处理时,会调用上述HQV算法模块对解码后的视频图像数据进行优化操作,以实现播放的视频的显示增强。因此,可以通过检测上述HQV算法模块是否被调用,如果该HQV算法模块被调用,则表示当前播放视频时,在对播放的视频进行显示增强处理;如果该HQV算法模块未被调用,则表示当前播放视频时,未对播放的视频进行显示增强处理。当然,具体的确定是否对播放的视频进行显示增强处理的方式在本申请实施例中并不作为限定。
步骤S220:判断所述当前负载率是否小于第一负载率阈值。
在本申请实施例中,在根据实时检测的图像处理器的当前负载率,确定对播放的视频进行显示增强处理的目标优化参数时,可以通过将当前负载率与设定的负载率阈值进行比较,根据比较结果,对用于进行显示增强的目标优化参数进行确定。
进一步的,可以判断当前负载率是否小于第一负载率阈值。其中,第一负载率阈值可以为表示负载率所处的高低水平的临界值。在图像处理器的负载率低于第一负载率阈值时,图像处理器的负载率处于较低水平,此时图像处理器的可用资源较多,可以顺畅的处理显示增强处理的所有优化参数对应的优化操作。在图像处理器的负载率高于第一负载率阈值时,图像处理器的负载率处于较高水平,此时图像处理器的可用资源相对较少,不能顺畅的处理显示增强处理对应的所有优化参数对应的优化操作,可能会导致图像处理器的负载率处于非常高的水平,而导致播放视频时的卡顿。
在本申请实施例中,第一负载率阈值可以根据图像处理器的参数等确定。作为一种实施方式,在图像处理器的最大工作频率高时,由于其负载率达到一定水平时,其依然可以顺畅处理所有的优化参数对应的优化操作,因此其对应的第一负载率阈值,可以相对最大工作频率低的图像处理器对应的第一负载率阈值高。例如,两个图像处理器的最大工作频率分别为1GHz和2GHz,如果最大工作频率为1GHz对应的第一负载率阈值为60%,则最大工作频率为2GHz对应的第一负载率阈值为65%。当然,以上第一负载率阈值仅为举例,并不代表对本申请实施例中具体的第一负载率阈值的限定。
在本申请实施例中,具体第一负载率阈值可以不作为限定,其满足图像处理器的当前负载率小于第一负载率阈值时,其可以顺畅的处理所有优化参数对应的优化操作,在不小于第一负载率阈值时,其不能顺畅的处理 所有优化参数对应的优化操作。
步骤S230:如果小于所述第一负载率阈值,选取所有优化参数,作为对播放的视频进行显示增强处理的目标优化参数。
在本申请实施例中,当判断出实时检测的图像处理器的当前负载率小于上述第一负载率阈值,则此时图像处理器可以顺畅的处理显示增强处理的所有优化参数的优化操作,因此可以选取所有优化参数,作为对播放的视频进行显示增强处理器的目标优化参数,以使播放的视频图像达到超清视效的效果。
步骤S240:如果不小于第一负载率阈值,则判断所述当前负载率是否小于第二负载率阈值,所述第二负载率阈值大于所述第一负载率阈值。
在本申请实施例中,如果判断出图像处理器的当前负载率不小于第一负载率阈值,即当前负载率大于或者等于第一负载率阈值,则表示此时图像处理器不能顺畅的处理所有优化参数所对应的优化操作,如果此时依然进行所有优化参数对应的优化,则可能导致视频播放的卡顿。因此,可以对图像处理器不能顺畅的处理所有优化参数对应的优化操作的情况进行处理,以避免视频播放的卡顿。
当图像处理器的当前负载率不小于第一负载率阈值时,由于图像处理器剩下的可用资源较少,图像处理器可能当前还可以顺畅处理至少一个优化参数所对应的操作,也可能不可以顺畅处理任何优化参数所对应的操作。因此,在本申请实施例中,当图像处理器的当前负载率不小于第一负载率阈值时,可以确定当前图像处理器是否处于不能处理任何优化参数所对应的操作的状态。
进一步的,可以在图像处理器的当前负载率不小于第一负载率阈值时,判断图像处理器的当前负载率是否小于第二负载率阈值,其中,该第二负载率阈值大于第一负载率阈值,以确定在图像处理器的当前负载率不小于第一负载率阈值时,是否继续进行显示增强处理。
在本申请实施例中,第二负载率阈值可以为图像处理器不能处理任何优化参数对应的操作时的负载率,与图像处理器还能处理至少一个优化参数对应的优化操作时的负载率的临界值。也就是说,当图像处理器的当前负载率小于第二负载率阈值时,其负载率处于较高的水平,但其剩余的可用资源可以支持顺畅的处理至少一个优化参数的优化操作;当图像处理器的当前负载率不小于第二负载率阈值时,其负载率处于非常高的水平,其剩余的可用资源不能顺畅处理任何优化参数的优化操作。
进一步的,第二负载率阈值同样可以根据图像处理器的参数等确定。作为一种实施方式,在图像处理器的最大工作频率高时,由于其负载率达到较高水平时,其依然可以顺畅处理至少一个优化参数对应的优化操作,因此其对应的第二负载率阈值,可以相对最大工作频率低的图像处理器对应的第二负载率阈值高。例如,两个图像处理器的最大工作频率分别为1GHz和2GHz,如果最大工作频率为1GHz对应的第二负载率阈值为80%, 则最大工作频率为2GHz对应的第二负载率阈值为85%。当然,以上第二负载率阈值仅为举例,并不代表对本申请实施例中具体的第二负载率阈值的限定。
步骤S250:如果小于所述第二负载率阈值,从所有优化参数中选取部分优化参数,作为对播放的视频进行显示增强处理的目标优化参数。
在本申请实施例中,当图像处理器的当前负载率小于第二负载率阈值时,则表示此时图像处理器还可以顺畅的处理至少一个优化参数对应的优化操作,但不能顺畅的处理所有优化参数对应的优化操作。因此,可以在图像处理器的当前负载率小于第二负载率阈值时,从所有优化参数中选取部分优化参数,作为对播放的视频进行显示增强处理的目标优化参数。
进一步的,从所有优化参数中选取部分优化参数,可以根据设定的规则,从所有优化参数中选取至少一个优化参数,作为对播放的视频进行显示增强处理的目标优化参数。其中,根据设定规则选取的目标优化参数,应当满足在根据目标优化参数进行显示增强处理时,不会使图像处理器的负载率过大。作为一种方式,可以通过实验检测图像处理器具体处于第一负载率阈值与第二负载率阈值之间的不同负载率时,可以支持顺畅处理的优化参数,建立不同负载率与优化参数的对应关系。作为另一种方式,也可以通过选取设定个数的优化参数,作为目标优化参数,也就是说,在图像处理器的当前负载率不小于第一负载率阈值,但是小于第二负载率阈值时,图像处理器处理上述设定个数的优化参数对应的优化操作时,图像处理器的负载率不会过高,出现图像处理器处理视频图像时不顺畅。当然,具体从所有优化参数中选取部分优化参数的方式,在本申请实施例中可以不作为限定,例如,也还可以是通过用户设定当图像处理器的当前负载率不小于第一负载率阈值,但是小于第二负载率阈值时,需要选取的优化参数,以实现视频播放过程中目标优化参数的确定。
步骤S260:如果不小于所述第二负载率阈值,停止所述显示增强处理。
在本申请实施例中,当图像处理器的当前负载率不小于第二负载率阈值时,则表示此时图像处理器不能顺畅的处理任何优化参数对应的优化操作。因此,可以在判断出图像处理器的当前负载率不小于第二负载率阈值时,停止显示增强处理,以避免图像处理器的负载率过高,而使图像处理器处理视频图像时出现不顺畅而卡顿。
步骤S270:基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。
在确定出上述的目标优化参数后则可以根据目标优化参数,对播放的视频进行显示增强处理。实现根据图像处理器的当前负载率,控制进行显示增强处理的优化参数,而不是任何情况下均根据所有优化参数进行显示增强处理,可以使图像处理器的负载率可以动态调整,避免图像处理器的负载率过高而导致视频播放的卡顿。
本申请实施例提供的视频处理方法,通过在视频播放过程中,实时检 测图像处理器的当前负载率,并将当前负载率与设定的负载率阈值进行比较,确定出目标优化参数,最后根据确定的目标优化参数,对播放的视频进行显示增强处理。由于对播放的视频进行显示增强处理时,进行显示增强的优化参数根据图像处理器的实时负载率确定,可以使图像处理器的负载率实现动态调整,从而解决图像处理器的负载率过高而导致的视频播放时的卡顿问题。
请参阅图4,本申请又一个实施例提供了一种视频处理方法,可应用于电子设备,该方法可以包括:
步骤S310:在视频播放过程中,实时检测图像处理器的当前负载率。
步骤S320:判断所述当前负载率是否小于第一负载率阈值。
步骤S330:如果小于所述第一负载率阈值,选取所有优化参数,作为对播放的视频进行显示增强处理的目标优化参数。
步骤S340:如果不小于第一负载率阈值,则判断所述当前负载率是否小于第二负载率阈值,所述第二负载率阈值大于所述第一负载率阈值。
在本申请实施例中,步骤S310至步骤S340的内容,可以参阅上述实施例的内容,在此不再赘述。
步骤S350:如果小于所述第二负载率阈值,获取所有优化参数中每个优化参数对应的优化优先级。
在本申请实施例中,在判断出图像处理器的当前负载率不小于第一负载率阈值,但是小于第二负载率阈值时,从所有优化参数中获取部分优化参数时,可以根据每个优化参数的优化优先级,对优化参数进行选取。
其中,上述优化优先级可以包括:根据优化参数对应的画面优化质量从高到低的顺序建立的优先级;或者根据优化参数对应的资源占用率从低到高的顺序建立的优先级。
可以理解的是,上述不同参数的优化优先级,可以是根据优化参数对应的画面优化质量从高到低的顺序,对每种优化参数的优化优先级进行建立,也就是说,优化参数所对应的画面优化质量越高,则其对应的优化优先级越高。也可以是根据优化参数对应的资源占用率从低的顺序,对每种优化参数的优化优先级进行建立,也就是说,优化参数所对应的资源占用率越低,则其对应的优化优先级越高。
当然,具体的优化优先级可以在本申请实施例中不作为限定,例如,优化优先级也可以通过用户设定,即用户可以对所有优化参数的优化优先级进行设定。上述优化优先级可以存储于电子设备中,在需要从所有优化参数中获取部分优化参数时,则可以对优化优先级进行读取。
步骤S360:根据所述优化优先级,从所述所有优化参数中选取部分优化参数,将所述部分优化参数作为对播放的视频进行显示增强处理的目标优化参数,所述目标优化参数的优先级大于所述其他优化参数的优先级,所述其他优化参数为所述所有优化参数中除所述目标优化参数以外的优化参数。
在本申请实施例中,在获取到每个优化参数的优化优先级之后,则可以根据每个优化参数的优化优先级,对优化参数进行选取。作为一种实施方式,可以根据每个优化参数的优化优先级,选取目标个数的优化参数,例如,根据优化参数的优化优先级从高到低的排序结果,从排序结果中选取前目标个数优化参数,也就是说,选取出的目标个数的优化参数的优先级,均大于其他优化参数的优先级。其中,目标个数的设定,需要满足目标个数的优化参数为任意优化参数时,图像处理器能顺畅执行显示增强处理。从而,可以使后对播放的视频进行显示增强处理时,可以根据优先级高的优化参数进行处理。
当优化优先级为上述根据优化参数对应的画面优化质量从高到低的顺序建立的优先级时,则目标优化参数对应的画面优化质量高于其他优化参数对应的画面优化质量,且可以使图像处理器在根据目标优化参数进行显示增强处理器时可以顺畅执行显示增强处理的操作。从而,可以使后续根据目标优化参数对播放的视频进行显示增强处理时,可以使视频画面的质量较高。
当优化优先级为上述根据优化参数对应的资源占用率从低到高的顺序建立的优先级时,则目标优化参数对应的资源占用率低于其他优化参数对应的资源占用率,且可以使图像处理器在根据目标优化参数进行显示增强处理器时可以顺畅执行显示增强处理的操作。从而,可以使后续根据目标优化参数对播放的视频进行显示增强处理时,可以使显示增强处理所占用图像处理器的资源较少,避免视频播放的卡顿。
步骤S370:如果不小于所述第二负载率阈值,停止所述显示增强处理。
在本申请实施例中,当图像处理器的当前负载率不小于第二负载率阈值时,则表示此时图像处理器不能顺畅的处理任何优化参数对应的优化操作。因此,可以在判断出图像处理器的当前负载率不小于第二负载率阈值时,停止显示增强处理,以避免图像处理器的负载率过高,而使图像处理器处理视频图像时出现不顺畅而卡顿。
步骤S380:基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。
在确定出上述的目标优化参数后则可以根据目标优化参数,对播放的视频进行显示增强处理。实现根据图像处理器的当前负载率,控制进行显示增强处理的优化参数,而不是任何情况下均根据所有优化参数进行显示增强处理,可以使图像处理器的负载率可以动态调整,避免图像处理器的负载率过高而导致视频播放的卡顿。
在本申请实施例中,当检测出图像处理器的当前负载率不小于第一负载率时,还可以进行相关处理,以减少图像处理器的负载率,提升图像处理器进行显示增强处理时的效率,减少视频播放时的卡顿。因此,在当前负载率不小于第一负载率阈值时,该视频处理方法还可以包括:
检测当前播放视频的应用的弹幕功能是否开启;如果开启,则关闭当 前播放视频的应用的弹幕功能。
可以理解的是,在应用播放视频时,由于播放视频的应用具有弹幕功能,因此可以将弹幕与视频图像一起显示。而在需要将视频图像与弹幕一起显示时,中央处理器需要对弹幕数据处理后,利用图像处理器将弹幕与视频图像渲染为同一图像后在屏幕进行显示,因此实现弹幕显示需要占用图像处理器的资源。其中,弹幕数据为播放应用程序从视频源服务器或者弹幕服务器获取的用于渲染为显示的弹幕的数据,电子设备的播放应用程序在得到弹幕数据后,可以利用弹幕数据进行弹幕的绘制,最后与视频图像合成为同一图像进行显示。
由于在实现弹幕显示时,会占用图像处理器的资源,而弹幕功能为视频播放时非必须的功能,因此,可以对弹幕功能是否开启进行检测,以在弹幕功能开启时,关闭弹幕功能。其中,检测应用的弹幕功能是否开启,可以通过检测该应用的弹幕功能的标识是否为表征弹幕功能开启的标识,以确定出当前播放视频的应用程序的弹幕功能是否开启。例如,上述播放视频的应用的弹幕功能的标识为0时,则表征该应用的弹幕功能未开启,上述播放视频的应用的弹幕功能的标识为1时,则表征该应用的弹幕功能开启。当然,也还可以通过检测当前播放应用的弹幕功能对应的从弹幕服务器获取弹幕数据的数据接口是否开启,以确定该应用的弹幕功能是否开启。具体检测当前播放视频的应用的弹幕功能的方法在本申请实施例中可以不作为限定。
当检测出当前播放视频的应用的弹幕功能开启时,则可以将其弹幕功能关闭,以在图像处理器的负载率不小于第一负载率阈值,处于不能顺畅的执行所有优化参数对应的优化操作时,降低图形处理器的负载率,避免视频播放时的卡顿。
在本申请实施例中,还可以在进行视频播放过程中,关闭一些未在前台运行,且占用图像处理器的资源的应用,以保证顺畅的播放视频。因此,该视频处理方法还可以包括:关闭后台运行的目标应用,所述目标应用为除当前播放视频的应用以外的占用所述图像处理器的资源的其他应用。
可以理解的是,可以通过电子设备的系统的任务管理列表,获取当前处于后台运行的应用,并且可以通过检测图像处理器的使用状态,获取当前正占用图像处理器的资源的应用。从而,可以获取到处于后台运行且占用图像处理器的资源的目标应用,由于该目标应用当前处于后台运行状态,用户不需要查看该应用输出的图像,因此,可以关闭该目标应用,以释放出图像处理器的可用资源,保证视频播放的顺畅,避免播放视频时的卡顿。
本申请实施例提供的视频处理方法,通过在视频播放过程中,实时检测图像处理器的当前负载率,并将当前负载率与设定的负载率阈值进行比较,通过优化优先级确定出目标优化参数,最后根据确定的目标优化参数,对播放的视频进行显示增强处理。由于对播放的视频进行显示增强处理时,进行显示增强的优化参数根据图像处理器的实时负载率确定,可以使图像 处理器的负载率实现动态调整,从而解决图像处理器的负载率过高而导致的视频播放时的卡顿问题。
请参阅图5,其示出了本申请实施例提供的一种视频处理装置的框图。该视频处理装置400可以包括:负载检测模块410、参数确定模块420以及显示增强模块430。其中,所述负载检测模块410用于在视频播放过程中,实时检测图像处理器的当前负载率;所述参数确定模块420用于根据所述当前负载率,确定对播放的视频进行显示增强处理的目标优化参数,所述显示增强处理包括利用目标影像处理算法对所述播放的视频进行处理;所述显示增强模块430用于基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。
在本申请实施例中,请参见图6,参数确定模块420可以包括:第一负载判断单元421以及第一参数选取单元422。第一负载判断单元421用于判断所述当前负载率是否小于第一负载率阈值;第一参数选取单元422用于如果小于所述第一负载率阈值,选取所有优化参数,作为对播放的视频进行显示增强处理的目标优化参数。
进一步的,请参见图6,参数确定模块420还可以包括:第二负载判断单元423、第二参数选取单元424以及停止执行单元425。其中,第二负载判断单元423用于如果不小于第一负载率阈值,则判断所述当前负载率是否小于第二负载率阈值,所述第二负载率阈值大于所述第一负载率阈值;第二参数选取单元424用于如果小于所述第二负载率阈值,从所有优化参数中选取部分优化参数,作为对播放的视频进行显示增强处理的目标优化参数;停止执行单元425用于如果不小于所述第二负载率阈值,停止所述显示增强处理。
在本申请实施例中,第二参数选取单元424可以具体用于:如果小于所述第二负载率阈值,获取所有优化参数中每个优化参数对应的优化优先级;根据所述优化优先级,从所述所有优化参数中选取部分优化参数,将所述部分优化参数作为对播放的视频进行显示增强处理的目标优化参数,所述目标优化参数的优先级大于所述其他优化参数的优先级,所述其他优化参数为所述所有优化参数中除所述目标优化参数以外的优化参数。
进一步的,所述优化优先级可以包括:根据优化参数对应的画面优化质量从高到低的顺序建立的优先级;或者根据优化参数对应的资源占用率从低到高的顺序建立的优先级。
在本申请实施例中,该视频处理装置400还可以包括:弹幕检测模块以及弹幕关闭模块。其中,弹幕检测模块用于如果所述当前负载率不小于所述第一负载率阈值时,检测当前播放视频的应用的弹幕功能是否开启;弹幕关闭模块用于如果开启,则关闭所述当前播放视频的应用的弹幕功能。
在本申请实施例中,该视频处理装置400还可以包括:应用关闭模块。应用关闭模块用于关闭后台运行的目标应用,所述目标应用为除当前播放视频的应用以外的占用所述图像处理器的资源的其他应用。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
综上所述,本申请提供的方案,通过在视频播放过程中,实时检测图像处理器的当前负载率,根据实时检测的负载率,确定对播放的视频进行显示增强处理的目标优化参数,并根据目标优化参数对播放的视频进行显示增强处理。由于对播放的视频进行显示增强处理时,进行显示增强的优化参数根据图像处理器的实时负载率确定,从而避免图像处理器的负载率过高而导致的视频播放时的卡顿。
请参考图7,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备100可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120、屏幕130以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。
处理器110可集成中央处理器111(Central Processing Unit,CPU)、图像处理器112(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现 下述各个方法实施例的指令等。存储数据区还可以存储电子设备100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
屏幕130用于显示由用户输入的信息、提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、数字、视频和其任意组合来构成,在一个实例中,触摸屏可设置于所述显示面板上从而与所述显示面板构成一个整体。
请参考图8,其示出了本申请实施例提供的一种计算机可读取存储介质的结构框图。该计算机可读取存储介质800中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读取存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读取存储介质800包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读取存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种视频处理方法,其特征在于,所述方法包括:
    在视频播放过程中,实时检测图像处理器的当前负载率;
    根据所述当前负载率,确定对播放的视频进行显示增强处理的目标优化参数,所述显示增强处理包括利用目标影像处理算法对所述播放的视频进行处理;
    基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述当前负载率,确定对播放的视频进行显示增强处理的目标优化参数,包括:
    判断所述当前负载率是否小于第一负载率阈值;
    如果小于所述第一负载率阈值,选取所有优化参数,作为对播放的视频进行显示增强处理的目标优化参数。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    如果不小于第一负载率阈值,则判断所述当前负载率是否小于第二负载率阈值,所述第二负载率阈值大于所述第一负载率阈值;
    如果小于所述第二负载率阈值,从所有优化参数中选取部分优化参数,作为对播放的视频进行显示增强处理的目标优化参数;
    如果不小于所述第二负载率阈值,停止所述显示增强处理。
  4. 根据权利要求3所述的方法,其特征在于,所述如果小于所述第二负载率阈值,从所有优化参数中选取部分优化参数,作为对播放的视频进行显示增强处理的目标优化参数,包括:
    如果小于所述第二负载率阈值,获取所有优化参数中每个优化参数对应的优化优先级;
    根据所述优化优先级,从所述所有优化参数中选取部分优化参数,将所述部分优化参数作为对播放的视频进行显示增强处理的目标优化参数,所述目标优化参数的优先级大于所述其他优化参数的优先级,所述其他优化参数为所述所有优化参数中除所述目标优化参数以外的优化参数。
  5. 根据权利要求4所述的方法,其特征在于,所述优化优先级包括:
    根据优化参数对应的画面优化质量从高到低的顺序建立的优先级;或者
    根据优化参数对应的资源占用率从低到高的顺序建立的优先级。
  6. 根据权利要求3-5任一项所述的方法,其特征在于,所述从所有优化参数中选取部分优化参数,作为对播放的视频进行显示增强处理的目标优化参数,包括:
    从所有优化参数中选取设定个数的优化参数,作为对播放的视频进行显示增强处理的目标优化参数。
  7. 根据权利要求3-6任一项所述的方法,其特征在于,所述从所有优化参数中选取部分优化参数,作为对播放的视频进行显示增强处理的目标优 化参数,包括:
    从所有优化参数中选取用户设定的优化参数,作为对播放的视频进行显示增强处理的目标优化参数。
  8. 根据权利要求3-7任一项所述的方法,其特征在于,如果所述当前负载率不小于所述第一负载率阈值时,所述方法还包括:
    检测当前播放视频的应用的弹幕功能是否开启;
    如果开启,则关闭所述当前播放视频的应用的弹幕功能。
  9. 根据权利要求8所述的方法,其特征在于,所述检测当前播放视频的应用的弹幕功能是否开启,包括:
    检测当前播放视频的应用的弹幕功能的标识是否为表征弹幕功能开启的标识。
  10. 根据权利要求8或9所述的方法,其特征在于,所述检测当前播放视频的应用的弹幕功能是否开启,包括:
    检测当前播放视频的应用的弹幕功能对应的从弹幕服务器获取弹幕数据的数据接口是否开启。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述方法还包括:
    关闭后台运行的目标应用,所述目标应用为除当前播放视频的应用以外的占用所述图像处理器的资源的其他应用。
  12. 根据权利要求1-11任一项所述的方法,其特征在于,在所述在视频播放过程中,实时检测图像处理器的当前负载率之前,所述方法还包括:
    检测当前是否处于视频播放的状态;
    当检测到当前处于视频播放的状态时,在视频播放过程中,实时检测图像处理器的当前负载率。
  13. 根据权利要求12所述的方法,其特征在于,所述检测到当前处于视频播放的状态,包括:
    当检测到视频解码器、图层传递模块及视频播放器处于工作状态时,则检测到当前处于视频播放的状态。
  14. 根据权利要求1-13任一项所述的方法,其特征在于,所述在视频播放过程中,实时检测图像处理器的当前负载率,包括:
    在视频播放过程中,确定当前对播放的视频进行显示增强处理时,实时检测图像处理器的当前负载率。
  15. 根据权利要求14所述的方法,其特征在于,所述确定当前对播放的视频进行显示增强处理,包括:
    当检测到系统界面中设置的用于进行显示增强处理的功能的开关按钮开启时,确定当前对播放的视频进行显示增强处理。
  16. 根据权利要求14或15所述的方法,其特征在于,所述确定当前对播放的视频进行显示增强处理,包括:
    当检测到HQV(好莱坞品质影像)算法模块被调用时,则确定当前对 播放的视频进行显示增强处理。
  17. 根据权利要求1-16任一项所述的方法,其特征在于,所述优化参数至少包括:曝光度增强、去噪、边缘锐化、对比度增加以及饱和度增加中的一种。
  18. 一种视频处理装置,其特征在于,所述装置包括:负载检测模块、参数确定模块以及显示增强模块,其中,
    所述负载检测模块用于在视频播放过程中,实时检测图像处理器的当前负载率;
    所述参数确定模块用于根据所述当前负载率,确定对播放的视频进行显示增强处理的目标优化参数,所述显示增强处理包括利用目标影像处理算法对所述播放的视频进行处理;
    所述显示增强模块用于基于所述目标优化参数,对所述播放的视频进行所述显示增强处理。
  19. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储器;
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序配置用于执行如权利要求1-17任一项所述的方法。
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-17任一项所述的方法。
PCT/CN2019/104203 2018-11-27 2019-09-03 视频处理方法、装置、电子设备及存储介质 Ceased WO2020107992A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811427975.7 2018-11-27
CN201811427975.7A CN109379626A (zh) 2018-11-27 2018-11-27 视频处理方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020107992A1 true WO2020107992A1 (zh) 2020-06-04

Family

ID=65377348

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/104203 Ceased WO2020107992A1 (zh) 2018-11-27 2019-09-03 视频处理方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN109379626A (zh)
WO (1) WO2020107992A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109379626A (zh) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 视频处理方法、装置、电子设备及存储介质
CN112019918B (zh) * 2019-05-28 2023-05-26 杭州海康威视数字技术股份有限公司 一种视频播放方法及设备

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102595193A (zh) * 2011-01-05 2012-07-18 联发科技股份有限公司 视频处理装置与视频处理方法
CN102710963A (zh) * 2011-02-22 2012-10-03 仁宝电脑工业股份有限公司 调整视频串流影音质量的方法以及系统
CN103577269A (zh) * 2012-08-02 2014-02-12 英特尔公司 媒体工作负荷调度器
US20140146677A1 (en) * 2012-11-09 2014-05-29 Aruba Networks, Inc. Dynamic determination of transmission parameters based on packet priority and network conditions
CN104093072A (zh) * 2014-06-30 2014-10-08 京东方科技集团股份有限公司 一种视频信息播放系统和方法
CN105657321A (zh) * 2015-11-09 2016-06-08 乐视致新电子科技(天津)有限公司 视频清晰度自适应调节方法、装置及终端
CN105898348A (zh) * 2015-12-15 2016-08-24 乐视网信息技术(北京)股份有限公司 一种用于降低视频播放终端的cpu温度的方法及设备
CN106792165A (zh) * 2016-12-02 2017-05-31 武汉斗鱼网络科技有限公司 一种资源动态调整方法及装置
CN108377421A (zh) * 2018-04-26 2018-08-07 深圳Tcl数字技术有限公司 视频的播放方法及显示设备、计算机可读存储介质
CN109379626A (zh) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 视频处理方法、装置、电子设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0887263A (ja) * 1994-09-19 1996-04-02 Sega Enterp Ltd 画像処理装置および画像処理回路
CN102073545B (zh) * 2011-02-28 2013-02-13 中国人民解放军国防科学技术大学 操作系统中防止用户界面卡屏的进程调度方法及装置
KR101668282B1 (ko) * 2011-07-22 2016-10-24 엔트릭스 주식회사 화면 가상화 기반 어플리케이션 구동 시스템 및 방법
CN106210853B (zh) * 2016-07-08 2019-04-09 上海幻电信息科技有限公司 弹幕显示系统及其cpu消耗控制方法

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102595193A (zh) * 2011-01-05 2012-07-18 联发科技股份有限公司 视频处理装置与视频处理方法
CN102710963A (zh) * 2011-02-22 2012-10-03 仁宝电脑工业股份有限公司 调整视频串流影音质量的方法以及系统
CN103577269A (zh) * 2012-08-02 2014-02-12 英特尔公司 媒体工作负荷调度器
US20140146677A1 (en) * 2012-11-09 2014-05-29 Aruba Networks, Inc. Dynamic determination of transmission parameters based on packet priority and network conditions
CN104093072A (zh) * 2014-06-30 2014-10-08 京东方科技集团股份有限公司 一种视频信息播放系统和方法
CN105657321A (zh) * 2015-11-09 2016-06-08 乐视致新电子科技(天津)有限公司 视频清晰度自适应调节方法、装置及终端
CN105898348A (zh) * 2015-12-15 2016-08-24 乐视网信息技术(北京)股份有限公司 一种用于降低视频播放终端的cpu温度的方法及设备
CN106792165A (zh) * 2016-12-02 2017-05-31 武汉斗鱼网络科技有限公司 一种资源动态调整方法及装置
CN108377421A (zh) * 2018-04-26 2018-08-07 深圳Tcl数字技术有限公司 视频的播放方法及显示设备、计算机可读存储介质
CN109379626A (zh) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 视频处理方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN109379626A (zh) 2019-02-22

Similar Documents

Publication Publication Date Title
CN109151966B (zh) 终端控制方法、装置、终端设备及存储介质
CN109379627B (zh) 视频处理方法、装置、电子设备以及存储介质
CN109587546B (zh) 视频处理方法、装置、电子设备和计算机可读介质
CN109361950B (zh) 视频处理方法、装置、电子设备及存储介质
CN110377263B (zh) 图像合成方法、装置、电子设备及存储介质
US7885472B2 (en) Information processing apparatus enabling an efficient parallel processing
WO2020062924A1 (zh) 视频增强控制方法、装置、电子设备及存储介质
CN109587560A (zh) 视频处理方法、装置、电子设备以及存储介质
CN103946789A (zh) 图形处理单元中的再现模式选择
CN109587555B (zh) 视频处理方法、装置、电子设备及存储介质
WO2020038130A1 (zh) 视频处理方法、装置、电子设备及计算机可读介质
US11456013B2 (en) Video decoding control method, electronic device, and storage medium
CN109120988B (zh) 解码方法、装置、电子设备以及存储介质
CN113473226B (zh) 提高视频渲染效率的方法、装置、计算机设备及存储介质
CN113625983B (zh) 图像显示方法、装置、计算机设备及存储介质
CN113038222B (zh) 视频处理方法、装置、电子设备及存储介质
WO2017129119A1 (zh) 一种图像绘制的方法、用户设备、服务器及系统
WO2023045392A1 (zh) 一种云手机的实现方法及装置
CN109688462B (zh) 降低设备功耗的方法、装置、电子设备及存储介质
WO2020107992A1 (zh) 视频处理方法、装置、电子设备及存储介质
CN109587561B (zh) 视频处理方法、装置、电子设备及存储介质
WO2020078130A1 (zh) 视频处理方法、装置、电子设备以及存储介质
WO2021072760A1 (zh) 触摸屏报点方法、装置、电子设备及存储介质
CN115442345A (zh) 一种媒体数据处理方法、装置、电子设备及存储介质
CN110347463A (zh) 图像处理方法、相关设备及计算机存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19890887

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19890887

Country of ref document: EP

Kind code of ref document: A1