Summary of the invention
The embodiment of the invention provides a kind of optimization method, device and terminal of video playback, and so that video is optimized operation, so that terminal can adapt to different playing environments automatically, broadcasting speed and broadcast image quality are improved.
On the one hand, the embodiment of the invention provides a kind of optimization method of video playback, and the method comprises: the video data that obtains separation module output; Whether judge in the configuration file of User Interface has user's optimization that content is set: if having, then according to the optimization in the described configuration file content is set and described video data is carried out intelligent optimization processes, or performance optimization processes, or the image quality optimization process; If nothing is then carried out intelligent optimization to described video data and is processed; To play through the output of the video data after the optimization process.
Preferably, according to the optimization in the described configuration file content being set in the embodiment of the invention carries out intelligent optimization to described video data and processes and to comprise: judge whether described video data belongs to default resolution and default code check: if belong to, then described video data is carried out the image quality optimization process; If do not belong to, then described video data is carried out performance optimization and process.
Preferably, judge in the embodiment of the invention whether described video data belongs to default resolution and default code check comprises: the resolution S that judges described video data whether belong to (0,480P) interval in and code check B whether more than or equal to 300Kbps; The resolution S that perhaps judges described video data whether belong to [480P, 720P) interval in and code check B whether more than or equal to 450Kbps.
Preferably, in the embodiment of the invention described video data is carried out the performance optimization processing and comprise: the detection hardware acceleration environment, judge by testing result whether video card supports decoding:, then by described video card described video data is decoded if support; If do not support, then abandon carrying out described performance optimization and process, by the video decode module of player described video data is decoded.
Preferably, if described video card support decoding in the embodiment of the invention also comprises: judge H.264 whether described video card supported, the decoding of MPEG2 or VC-1 file type: if support, then by described video card described video data is decoded; If do not support, then abandon carrying out described performance optimization and process, by the video decode module of player described video data is decoded.
Preferably, in the embodiment of the invention described video data being carried out the image quality optimization process comprises: each pixel of every frame of described video data is carried out respectively the image quality optimization process of color, gamma correction and gray value.
On the other hand, the embodiment of the invention also provides a kind of optimization device of video playback, and this device comprises: acquiring unit, obtain the video data of separation module output; Judging unit is used for judging whether the configuration file of User Interface has user's optimization that content is set; The optimization process unit, comprise intelligent optimization processing module, performance optimization processing module and image quality optimization process module, when the optimization that the user is arranged in the described configuration file of described judgment unit judges arranges content, according to described optimization content is set, described intelligent optimization processing module is carried out intelligent optimization to described video data and is processed, or described performance optimization processing module carries out performance optimization to described video data and processes, or described image quality optimization process module is carried out the image quality optimization process to described video data; When the optimization of no user in the described configuration file of described judgment unit judges arranged content, described intelligent optimization processing module was carried out intelligent optimization to described video data and is processed; Broadcast unit is used for and will plays through the output of the video data after the optimization process.
Preferably, the intelligent optimization processing module comprises that one judges submodule in the embodiment of the invention, describedly judge that submodule is used for judging whether described video data belongs to default resolution and default code check, if belong to, then described image quality optimization process module is carried out the image quality optimization process to described video data, if do not belong to, then described performance optimization processing module is carried out the performance optimization processing to described video data.
Preferably, judge in the embodiment of the invention submodule is used for specifically judging whether the resolution S of described video data belongs to (0,480P) interval in and code check B whether more than or equal to 300Kbps; The resolution S that perhaps judges described video data whether belong to [480P, 720P) interval in and code check B whether more than or equal to 450Kbps.
Preferably, embodiment of the invention performance optimization process module comprises: detection sub-module, for detection of hardware-accelerated condition; First judges submodule, is used for judging that according to the testing result of described detection sub-module whether video card supports decoding, if support, is then decoded to described video data by described video card; If do not support, then described performance optimization processing module abandons carrying out the performance optimization processing, by the video decode module of player described video data is decoded.
Preferably, the performance optimization processing module of the embodiment of the invention also comprises: second judges submodule, be used for when described first judges that submodule is judged video card support decoding, judge H.264 whether described video card supported, the decoding of MPEG2 or VC-1 file type, then by described video card described video data is decoded if support; If do not support, then described performance optimization processing module abandons carrying out the performance optimization processing, by the video decode module of player described video data is decoded.
Preferably, image quality optimization process module specifically is used for each pixel of every frame of described video data being carried out respectively the image quality optimization process of color, gamma correction and gray value in the embodiment of the invention.
On the other hand, the embodiment of the invention also provides a kind of terminal, the aforesaid optimization device of this terminal.
The embodiment of the invention is owing to can carry out various optimization processes to the video data after separating according to arranging of user, and acquiescence is carried out the intelligent optimization processing to video data, therefore so that terminal can adapt to different playing environments automatically, broadcasting speed and broadcast image quality can be improved.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Be illustrated in figure 1 as the optimization method schematic flow sheet of a kind of video playback that the embodiment of the invention provides, in the present embodiment, the executive agent of the method can be a kind of terminal, and the method comprises the steps:
S101: the video data that obtains separation module output.
Whether S102: judging in the configuration file of User Interface has user's optimization that content is set, if having, then to enter step S103, otherwise enter step S104.
As shown in Figure 2, User Interface is that terminal and user carry out mutual a kind of intuitively interface, for the user, it is to have a plurality of windows that this User Interface embodies the most intuitively, such as having a main window, comprise broadcast window under the main window, the control window, header window etc., this User Interface also comprises the broadcast configuration file of terminal in addition, and the broadcast Logic control module that is used for controlling above-mentioned each window and plays configuration file, in the present embodiment, the user can be optimized setting to playing configuration file under header window.
In the present embodiment, the optimization that can select of user is provided with: whether to video data carry out that intelligent optimization is processed, performance optimization processing or image quality optimization process.
S103: according to the optimization in the above-mentioned configuration file content is set above-mentioned video data is carried out the intelligent optimization processing, or the performance optimization processing, or the image quality optimization process.
In the present embodiment, intelligent optimization is processed and to be referred to that playback terminal selects to carry out performance optimization processing or image quality optimization process according to video data automatically; The performance optimization processing is for the broadcasting speed that improves terminal, and the image quality optimization process is the display frame quality that improves terminal.
S104: above-mentioned video data is carried out intelligent optimization process.
In the present embodiment, if the user does not select to optimize the plan of establishment, present embodiment is given tacit consent to when displaying video and video data is carried out intelligent optimization is processed so.
S105: will play through the output of the video data after the optimization process.
The embodiment of the invention is owing to can carry out various optimization processes to the video data after separating according to arranging of user, and acquiescence is carried out the intelligent optimization processing to video data, therefore so that terminal can adapt to different playing environments automatically, broadcasting speed and broadcast image quality can be improved.
Intelligent optimization processing, performance optimization processing and image quality optimization process during the below arranges above-mentioned optimization are described in detail respectively:
The schematic flow sheet that a kind of intelligent optimization that being illustrated in figure 3 as the embodiment of the invention provides is processed comprises:
S301: begin to carry out intelligent optimization and process;
S302: judge whether video data belongs to default resolution and default code check, then enters step S303 if belong to, if do not belong to, then enters step S304;
S303: video data is carried out the image quality optimization process;
S304: video data is carried out performance optimization process.
In the present embodiment, because video data too high to resolution and that code check is too high carries out the image quality optimization process and will take a large amount of resources and time, can reduce the running quality of terminal integral body, therefore only the video data that belongs to default resolution and default code check is carried out the image quality optimization process in the present embodiment, video data in non-this preset range is then carried out performance optimization process to improve broadcasting speed.
Further, as shown in Figure 4, this intelligent optimization handling process can comprise:
S401: begin to carry out intelligent optimization and process;
S402: the resolution S that judges video data whether belong to (0,480P) in the interval, if then enter step S403, otherwise enter step S405;
S403: whether judge the code check B of video data more than or equal to 300Kbps, if then enter step S406, otherwise enter step S407;
S404: the resolution S that judges video data whether belong to [480P, 720P) in the interval, if then enter step S405, otherwise enter step S407;
S405: whether judge the code check B of video data more than or equal to 450Kbps, if then enter step S406, otherwise enter step S407;
S406: video data is carried out the image quality optimization process;
S407: video data is carried out performance optimization process.
In the present embodiment, only have resolution S ∈ (0,480P) and code check B>=300Kbps, perhaps resolution S ∈ [480P, 720P) and the video data of code check B>=450Kbps just carry out the image quality optimization process, process and the video data outside the above-mentioned scope is only carried out performance optimization, play so that the terminal of the embodiment of the invention can adapt to different video datas automatically, reach optimum effect of optimization.
The schematic flow sheet that a kind of performance optimization that being illustrated in figure 5 as the embodiment of the invention provides is processed comprises:
S501: begin to carry out performance optimization and process;
S502: detection hardware acceleration environment;
S503: judge by testing result whether video card supports decoding, if support then to enter step S504, otherwise enter step S506;
S504: judge H.264 whether video card supported, the decoding of MPEG2 or VC-1 file type, if support then to enter step S505, otherwise enter step S506;
S505: enable hardware-acceleratedly, by video card video data is decoded;
In the present embodiment, video card participates in the concrete condition of video data decoding can be decided according to the performance of video card, video card capabilities can be shared whole decoding work fully, can finish all decoding work by video card, and the video decode module of terminal is responsible for and other module mutual; When video card capabilities is more weak, also can share partial decoding of h work by video card, at this moment video card is finished a part of decoding work, and the video decode module is finished the mutual of another part decoding work and responsible and other module.
S506: abandon carrying out described performance optimization and process, by the video decode module of player video data is decoded.
In the present embodiment, when carrying out performance optimization and process, always attempt to enable hardware-accelerated, have precedence over software decode in the terminal by the hardware decoding of video card, thereby can accelerate video playout speed, give the more smooth viewing experience of user.
Be illustrated in figure 6 as the schematic flow sheet of a kind of image quality optimization process that the embodiment of the invention provides, comprise:
S601: beginning image quality optimization process;
S602: each pixel of every frame to video data is carried out respectively the color optimization process;
S603: each pixel of every frame to video data is carried out respectively the gamma correction optimization process;
S604: each pixel of every frame of video data is carried out respectively the optimization process of gray value.
In the present embodiment, specifically, the color optimization process among the above-mentioned steps S602-603, gamma correction optimization process and grayvalue optimization are processed and can be realized as follows: the color space of every frame of described video data is converted to RGB (RGB) space from YUV (brightness signal Y and two color difference signal U, V) space; RGB three primary colors to each pixel in the frame carry out color enhancing processing; The color space of every frame is converted to yuv space from rgb space; The brightness Y-signal of each pixel in the frame is carried out gamma correction process, this gamma correction is processed such as comprising: by the Gamma correction question blank, the brightness Y-signal of each pixel in the frame is carried out gamma correction process; The GTG value of each pixel in the frame is carried out sharpening at grey jump during more than or equal to preset threshold value to be processed.
Above-mentioned image quality optimization process can improve the image quality of video effectively.
Be illustrated in figure 7 as the optimization device structural representation of a kind of video playback that the embodiment of the invention provides, this device comprises: acquiring unit 710, judging unit 720, optimization process unit 730 and broadcast unit 740, wherein optimization process unit 730 comprises intelligent optimization processing module 731, performance optimization processing module 732 and image quality optimization process module 733.
Acquiring unit 710 is used for obtaining the video data of separation module output.
Judging unit 720 is used for judging whether the configuration file of User Interface has user's optimization that content is set.User Interface is that terminal and user carry out mutual a kind of intuitively interface, specifically can be referring to the description to Fig. 2.In the present embodiment, the user can be optimized setting to playing configuration file under the User Interface header window, the optimization that the user can select is provided with: whether video data is carried out intelligent optimization processing, performance optimization processing or image quality optimization process.
When judging unit 720 judges that the optimization that the user is arranged in the configuration file arranges content, according to described optimization content is set, intelligent optimization processing module 731 can be carried out intelligent optimization to video data and be processed, performance optimization processing module 732 can be carried out the performance optimization processing to video data, and image quality optimization process module 733 can be carried out the image quality optimization process to video data.It is pointed out that specifically selecting which kind of optimization process module is according to user's setting and fixed, can enable simultaneously multiple optimization process, also can only enable a kind of optimization process, and inventive embodiments is not limited to this.
When judging unit 720 judged that the optimization of no user in the configuration file arranges content, 731 pairs of video datas of intelligent optimization processing module carry out intelligent optimization to be processed.
In the present embodiment, intelligent optimization is processed and to be referred to that playback terminal selects to carry out performance optimization processing or image quality optimization process according to video data automatically; The performance optimization processing is for the broadcasting speed that improves terminal, and the image quality optimization process is the display frame quality that improves terminal.
As one embodiment of the present of invention, intelligent optimization processing module 731 can comprise that one judges submodule, this judges that submodule is used for judging whether video data belongs to default resolution and default code check, if belong to, then 733 pairs of video datas of image quality optimization process module carry out the image quality optimization process, if do not belong to, 732 pairs of video datas of then performance optimization processing module carry out performance optimization to be processed.Such as, this judge submodule can judge whether the resolution S of described video data belongs to (0,480P) interval in and code check B whether more than or equal to 300Kbps; The resolution S that perhaps judges described video data whether belong to [480P, 720P) interval in and code check B whether more than or equal to 450Kbps.In the present embodiment, because video data too high to resolution and that code check is too high carries out the image quality optimization process and will take a large amount of resources and time, can reduce the running quality of terminal integral body, therefore only the video data that belongs to default resolution and default code check is carried out the image quality optimization process in the present embodiment, video data in non-this preset range is then carried out performance optimization process to improve broadcasting speed.
As one embodiment of the present of invention, as shown in Figure 8, performance optimization processing module 732 can comprise: detection sub-module 7321, first is judged submodule 7322, wherein:
Detection sub-module 7321 is for detection of hardware-accelerated condition.
First judges that submodule 7322 is used for judging according to the testing result of detection sub-module 7321 whether video card supports decoding, if support, then by video card video data is decoded, video card can be born this decoding work in whole or in part here; If do not support, then performance optimization processing module 732 is abandoned carrying out performance optimization and is processed, by by the video decode module of player video data being decoded.
As one embodiment of the present of invention, as shown in Figure 8, this performance optimization processing module 732 can also comprise: second judges submodule 7323, it is used for after the first judgement submodule 7322 is judged video card supports decoding, further judge H.264 whether this video card supported, the decoding of MPEG2 or VC-1 file type, then by this video card video data is decoded if support; If do not support, then performance optimization processing module 732 is abandoned carrying out performance optimization and is processed, and by the video decode module of player video data is decoded.
As one embodiment of the present of invention, image quality optimization process module 733 specifically is used for each pixel of every frame of described video data being carried out respectively the image quality optimization process of color, gamma correction and gray value.Specifically can referring to the corresponding description of Fig. 6, not repeat them here.
Broadcast unit 740 is used for and will plays through the output of the video data after the optimization process.
The embodiment of the invention is owing to can carry out various optimization processes to the video data after separating according to arranging of user, and acquiescence is carried out the intelligent optimization processing to video data, therefore so that terminal can adapt to different playing environments automatically, broadcasting speed and broadcast image quality can be improved.
Be illustrated in figure 9 as the structural representation of the terminal of a kind of video playback that the embodiment of the invention provides, this terminal 900 comprises aforesaid optimization device 901, no longer gives unnecessary details at this.
In one or more exemplary designs, the described above-mentioned functions of the embodiment of the invention can realize in hardware, software, firmware or this three's combination in any.If realize in software, these functions can be stored on the medium with computer-readable, or are transmitted on the medium of computer-readable with one or more instructions or code form.The computer-readable medium comprises the computer storage medium and is convenient to so that allow computer program transfer to other local communication medium from a place.Storage medium can be the useable medium that any general or special computer can access.For example, such computer readable media can include but not limited to RAM, ROM, EEPROM, CD-ROM or other optical disc storage, disk storage or other magnetic storage device, or other anyly can be used for carrying or storage can be read by general or special computer or general or special processor the program code of form with instruction or data structure and other medium.In addition, any connection can suitably be defined as the computer-readable medium, for example, if software is by a coaxial cable, optical fiber computer, twisted-pair feeder, Digital Subscriber Line (DSL) or also being comprised in the defined computer-readable medium with wireless way for transmittings such as infrared, wireless and microwave from a web-site, server or other remote resource.Described video disc (disk) and disk (disc) comprise Zip disk, radium-shine dish, CD, DVD, floppy disk and Blu-ray Disc, and disk is usually with the magnetic duplication data, and video disc carries out the optical reproduction data with laser usually.Above-mentioned combination also can be included in the computer-readable medium.
Above-described embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is the specific embodiment of the present invention; the protection range that is not intended to limit the present invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.