CN104980788B - Video encoding/decoding method and device - Google Patents

Video encoding/decoding method and device Download PDF

Info

Publication number
CN104980788B
CN104980788B CN201510073425.XA CN201510073425A CN104980788B CN 104980788 B CN104980788 B CN 104980788B CN 201510073425 A CN201510073425 A CN 201510073425A CN 104980788 B CN104980788 B CN 104980788B
Authority
CN
China
Prior art keywords
video
decoding
hardware
decoder
mobile terminal
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.)
Active
Application number
CN201510073425.XA
Other languages
Chinese (zh)
Other versions
CN104980788A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510073425.XA priority Critical patent/CN104980788B/en
Publication of CN104980788A publication Critical patent/CN104980788A/en
Application granted granted Critical
Publication of CN104980788B publication Critical patent/CN104980788B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention provides a kind of video encoding/decoding method, including:The type information for obtaining mobile terminal, judge the mobile terminal type information whether with the information match in white list, record has the type information for supporting the decoded mobile terminal of hardware in the white list;If mismatching, pass through software decoder decoding video;If matching, corresponding video is obtained according to the version information of the processor of the mobile terminal and decodes library, and library is decoded according to the video and judges whether the format of the video is preset video coding standard format;If so, the video is decoded by hardware decoder, if it is not, then executing the step of being somebody's turn to do through software decoder decoding video.In addition, the present invention also provides a kind of video decoders.The decoded flexibility of video and success rate can be improved in above-mentioned video encoding/decoding method and device.

Description

Video encoding/decoding method and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of video encoding/decoding methods and device.
Background technology
Video decoding process based on mobile terminal generally comprises soft solution and hard two kinds of solution.Hard solution namely hardware decoding are Refer to by the multi-media processing unit of the chip of mobile terminal be decoded in the way of.Soft solution namely software decoding, refer to utilizing Decoding program is in such a way that primary processor is decoded.
But decoded using software merely, although more stable effect can be obtained, solved when playing complicated video Code speed can influence the fluency of video playing and compare power consumption more slowly, and it is very high to use hardware to decode then error probability merely.
Invention content
In view of this, the present invention provides a kind of video encoding/decoding method and device, can be improved the decoded flexibility of video and at Power.
A kind of video encoding/decoding method provided in an embodiment of the present invention, including:
Obtain mobile terminal type information, judge the mobile terminal type information whether with the information in white list Match, record has the type information for supporting the decoded mobile terminal of hardware in the white list;
If mismatching, pass through software decoder decoding video;
If matching, corresponding video is obtained according to the version information of the processor of the mobile terminal and decodes library, and Library, which is decoded, according to the video judges whether the format of the video is preset video coding standard format;
If so, decoding the video by hardware decoder, regarded if it is not, then executing described decoded by software decoder The step of frequency.
A kind of video decoder provided in an embodiment of the present invention, including:
Acquisition module, the type information for obtaining mobile terminal;
Judgment module, for judge the mobile terminal that the acquisition module obtains type information whether with white list In information match, record has the type information for supporting the decoded mobile terminal of hardware in the white list;
Decoder module is regarded if the judging result for the judgment module is to mismatch by software decoder decoding Frequently;
The acquisition module, if the judging result for being additionally operable to the judgment module is to match, according to described mobile whole The version information of the processor at end obtains corresponding video and decodes library;
The judgment module is additionally operable to the video obtained according to the acquisition module decoding library and judges the video Whether format is preset video coding standard format;
The decoder module is decoded if the judging result for being additionally operable to the judgment module is yes by hardware decoder The video, if it is not, the step of then described in execution by software decoder decoding video.
Video encoding/decoding method and device provided in an embodiment of the present invention pass through the type according to mobile terminal before video decoding Number information in white list the match condition of information and the format of video to be decoded whether be preset video encoding standard Format selects corresponding decoding process, can be that the video determines most suitable decoding process, improve the decoded flexibility of video And success rate.
For the above and other objects, features and advantages of the present invention can be clearer and more comprehensible, preferred embodiment cited below particularly, And coordinate institute's accompanying drawings, it is described in detail below.
Description of the drawings
Fig. 1 shows a kind of structure diagram of mobile terminal;
Fig. 2 is the flow chart for the video encoding/decoding method that first embodiment of the invention provides;
Fig. 3 is the applied environment figure for the video encoding/decoding method that first embodiment of the invention provides;
Fig. 4 is the flow chart for the video encoding/decoding method that second embodiment of the invention provides;
Fig. 5 is the flow chart of a step in the video encoding/decoding method that second embodiment of the invention provides;
Fig. 6 is the flow chart of another step in the video encoding/decoding method that second embodiment of the invention provides;
Fig. 7 is the structural schematic diagram for the video decoder that third embodiment of the invention provides;
Fig. 8 is the structural schematic diagram for the video decoder that fourth embodiment of the invention provides.
Specific implementation mode
Further to illustrate that the present invention is the technological means and effect realized predetermined goal of the invention and taken, below in conjunction with Specific implementation mode, structure, feature and its effect according to the present invention is described in detail as after in attached drawing and preferred embodiment.
Fig. 1 shows a kind of structure diagram of mobile terminal.As shown in Figure 1, mobile terminal 200 includes:Memory 202, Storage control 204, one or more (one is only shown in figure) processors 206, Peripheral Interface 208, radio-frequency module 210, sound Frequency module 212, display module 214, key-press module 216 and hardware decoder 218.These components pass through one or more communication Bus/signal wire 220 mutually communicates.
It is appreciated that structure shown in FIG. 1 is only to illustrate, mobile terminal 200 may also include it is more than shown in Fig. 1 or Less component, or with the configuration different from shown in Fig. 1.Each component shown in Fig. 1 may be used hardware, software or its Combination is realized.
Memory 202 can be used for storing software program and module, as in the embodiment of the present invention video encoding/decoding method and Corresponding program instruction/the module of device, processor 206 are stored in software program and module in memory 202 by operation, To perform various functions application and data processing, that is, realize above-mentioned video encoding/decoding method.
Memory 202 may include high speed random access memory, may also include nonvolatile memory, such as one or more magnetic Property storage device, flash memory or other non-volatile solid state memories.In some instances, memory 202 can further comprise The memory remotely located relative to processor 206, these remote memories can pass through network connection to mobile terminal 200. The example of above-mentioned network includes but not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.Processor 206 and other possible components the access of memory 202 can be carried out under the control of storage control 204.
Various softwares in 206 run memory 202 of processor, instruction with execute the various functions of mobile terminal 200 with And carry out data processing.
Peripheral Interface 208 is used to couple various external equipments to CPU and memory 202.
In some embodiments, storage control 204, processor 206 and Peripheral Interface 208 can be in one single chips It realizes.In some other example, they can be realized by independent chip respectively.
Radio-frequency module 210 is used to receive and transmit electromagnetic wave, realizes the mutual conversion of electromagnetic wave and electric signal, thus with Communication network or other equipment are communicated.Radio-frequency module 210 may include the various existing electricity for executing these functions Circuit component, for example, antenna, RF transceiver, digital signal processor, encryption/deciphering chip, subscriber identity module (SIM) card, Memory etc..Radio-frequency module 210 can be communicated or be led to various networks such as internet, intranet, wireless network Wireless network is crossed to be communicated with other equipment.Above-mentioned wireless network may include cellular telephone networks, WLAN or Metropolitan Area Network (MAN).Above-mentioned wireless network can use various communication standards, agreement and technology, the including but not limited to whole world mobile logical Letter system (Global System for Mobile Communication, GSM), enhanced mobile communication technology (Enhanced Data GSM Environment, EDGE), Wideband CDMA Technology (wideband code division Multiple access, W-CDMA), Code Division Multiple Access (Code division access, CDMA), time division multiple access technology (time division multiple access, TDMA), bluetooth, adopting wireless fidelity technology (Wireless, Fidelity, WiFi) (such as American Institute of Electrical and Electronics Engineers's standard IEEE 802.11a, IEEE802.11b, IEEE802.11g and/or IEEE802.11n), the networking telephone (Voice over internet protocol, VoIP), worldwide interoperability for microwave accesses (Worldwide Interoperability for Microwave Access, Wi-Max), other for mail, Instant Messenger The agreement and any other suitable communications protocol of letter and short message, or even may include that those are not developed currently yet Agreement.
Audio-frequency module 212 provides a user audio interface, may include that one or more microphones, one or more raises Sound device and voicefrequency circuit.Voicefrequency circuit receives voice data from Peripheral Interface 208, and voice data is converted to power information, Power information is transmitted to loud speaker.Power information is converted to the sound wave that human ear can be heard by loud speaker.Voicefrequency circuit is also from microphone Place receives power information, converts electrical signals to voice data, and by data transmission in network telephony to Peripheral Interface 208 with into advancing one The processing of step.Audio data can obtain from memory 202 or by radio-frequency module 210.In addition, audio data can also It stores into memory 202 or is sent by radio-frequency module 210.In some instances, audio-frequency module 212 may also include One earphone broadcasts hole, for providing audio interface to earphone or other equipment.
Display module 214 provides an output interface between mobile terminal 200 and user, shows that video is defeated to user Go out, the content of these videos output may include word, figure, video and its arbitrary combination.Some outputs are the result is that correspond to one A little user interface objects.It should be understood that display module 214 can also provide one simultaneously between mobile terminal 200 and user A output and input interface.Specifically, other than showing video output to user, display module 214 also receives the defeated of user Enter, for example, user the gesture operations such as click, sliding, so that user interface object responds the input of these users.Inspection It can be based on resistance-type, condenser type or any other possible touch control detection technology to survey technology input by user.Show mould The specific example of 214 display unit of block includes but is not limited to liquid crystal display or light emitting polymer displays.
Key-press module 216 equally provides user's interface inputted to mobile terminal 200, and user can be by pressing not Same button is so that mobile terminal 200 executes different functions.
Hardware decoder 218, is used for decoding video, and specific example includes but is not limited to multimedia, audio, video decoding Chip.
Mobile terminal 200 may include:Android or other similar operations systems are installed and support video playing, network number According to transmission and smart mobile phone, tablet computer, E-book reader, MP4 (Moving Picture with browser environment Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) it is player, on knee portable Computer, vehicle-mounted computer, wearable device, navigator etc..
First embodiment
Fig. 2 is the flow chart for the video encoding/decoding method that first embodiment of the invention provides.This method can be by shown in FIG. 1 Mobile terminal 200 realizes video decoding.As shown in figure 3, this method includes:
Step S101 obtains the type information of mobile terminal;
In this present embodiment, browser is preset in mobile terminal 200, it can be specified by running browser acquisition user Video, then execute each step in the present embodiment, realize decoding and broadcasting to the video.Wherein, user specifies Video is either the Online Video for being stored in server can also be to be stored in local offline video.Mobile terminal 200 Include the version information of mobile terminal 200 in type information.
Step S102, judge the mobile terminal type information whether with the information match in white list, the white list Middle record has the type information for supporting the decoded mobile terminal of hardware;
Record has the type information that can support the decoded one or more mobile terminals of hardware after tested in white list.It will move The type information of dynamic terminal 200 is matched one by one with the information recorded in white list, when include in the white list it is a plurality of can Support the matching for having a type information and the type information of mobile terminal 200 in the type information of the decoded mobile terminal of hardware Degree is more than preset value, it is determined that the type information of mobile terminal 200 and the information match in the white list, mobile terminal 200 support hardware decoding;Otherwise, it determines the type information of mobile terminal 200 is mismatched with the information in the white list, it is mobile whole Hardware is not supported to decode in end 200.
If mismatching, S103 is thened follow the steps;If matching, S104 is thened follow the steps.
Step S103 passes through software decoder decoding video;
When the information in the type information of mobile terminal 200 and the white list mismatches, decoded by software decoder Video.Wherein, software decoder can be, but not limited to include:FFMpeg (Fast Forward Mpeg, it is a kind of cross-platform more Media handling tool) decoder, VLC multimedia players (Visible Light Communication) etc..For example, when moving When the type information of dynamic terminal 200 is mismatched with the information in the white list, then it can be solved by preset browser execution FFMepg The video that code device decoding user specifies.
Step S104 obtains corresponding video according to the version information of the processor of the mobile terminal and decodes library;
The processor of mobile terminal can be, but not limited to:Arm processor (Advanced RISC Machines, it is high The classical instruction set machine of grade), Intel ATOM processor (Chineses: Atom processor) or other similar places Manage device.
Specifically, when the information match in the type information of mobile terminal 200 and the white list, then by preset clear Device of looking at obtains the version information of the arm processor of mobile terminal 200, and obtaining corresponding video according to the version information decodes library.
Step S105 decodes library according to the video and judges whether the format of the video is preset video coding standard format;
Preset video encoding standard is preferably H.264.H.264 it is a kind of high-performance encoding and decoding agreement, is International standardization Tissue (ISO) and International Telecommunication Union (ITU) propose jointly after MPEG4 (Moving Picture Experts Group4, Dynamic image expert group 4) after new-generation digital video compression format.
Specifically, the video that library decoding user specifies is decoded by loading and running the video, then according to operation result Judge whether the format of the video is H.264 format.
If so, thening follow the steps S106;If it is not, thening follow the steps S103.
Step S106 decodes the video by hardware decoder.
Hardware decoder can be, but not limited to:Multimedia, audio, video decoding chip.Specifically, when user is specified Video format be H.264 format when, then by preset browser indicate hardware decoder decode the video.
Video encoding/decoding method provided in an embodiment of the present invention passes through the type information according to mobile terminal before video decoding Whether it is preset video coding standard format with the match condition of the information in white list and the format of video to be decoded, Select corresponding decoding process, can be that the video determine most suitable decoding process, improve the decoded flexibility of video and at Power.
Second embodiment
Fig. 3 is the flow chart for the video encoding/decoding method that second embodiment of the invention provides.This method can be applied to shown in Fig. 4 Application environment in, and pass through mobile terminal 200 shown in Fig. 4, realize video decoding.In Fig. 4, server 100 is whole with movement End 200 is located in wired or wireless network, and information exchange is carried out by the network.As shown in figure 3, this method includes:
Step S201 obtains the type information of mobile terminal;
In this present embodiment, browser is preset in mobile terminal 200, it can be specified by running browser acquisition user Video, then execute each step in the present embodiment, realize decoding and broadcasting to the video.Wherein, user specifies Video is either the Online Video for being stored in server can also be to be stored in local offline video.Mobile terminal 200 Include the version information of mobile terminal 200 in type information.
The type information of the mobile terminal is sent to server by step S202 so that the server is by the mobile terminal Type information matched with the information in the white list;
Record has the type information that can support the decoded one or more mobile terminals of hardware after tested in the white list.Tool Body, the type information of the mobile terminal 200 obtained by preset browser is sent to server 100 by mobile terminal 200, is made Server 100 is obtained to match the type information with the information in the white list.Server 100 is by the mobile terminal of reception 200 type information is matched one by one with the information recorded in the white list, when include in the white list a plurality of supports There is the matching degree of a type information and the type information of mobile terminal 200 big in the type information of the decoded mobile terminal of hardware In preset value, it is determined that the type information of mobile terminal 200 and the information match in the white list, mobile terminal 200 Hold hardware decoding;Otherwise, it determines the type information of mobile terminal 200 is mismatched with the information in the white list, mobile terminal 200 Hardware is not supported to decode;Then, matching result is returned into mobile terminal 200.
Step S203, according to the server return matching result judge the mobile terminal type information whether with white name Information match in list;
If mismatching, S204 is thened follow the steps;If matching, S206 is thened follow the steps.
Step S204 is sent to the service by software decoder decoding video, and by the type information of the mobile terminal Device so that the server updates the white list according to the type information of the mobile terminal;
Software decoder can be, but not limited to:FFMpeg decoders, VLC multimedia players etc..
Specifically, if the matching result that server 100 returns is shown in the type information and the white list of mobile terminal 200 Information mismatch, then the video specified of user is decoded by preset browser execution FFMepg decoders.Meanwhile it will be mobile whole The type information at end 200 is sent to server 100 so that server 100 obtains in the white list not just according to the type information True information is (such as:The model that there is the mobile terminal of the case of decoding failure in hardware decoding but practical decoding is supported in test Information), and shielded or deleted.
Step S205, if decoding error occurs in decoding process, switching system player decodes the video;
System plays device be mobile terminal operating system in carry player, passing through software decoder decoding video During the entire process of, including software decoding initialization and two stages of formal decoding, as long as appointing in the above-mentioned two stage One stage of meaning receives the error message (e.g., error code) of system return, then switches the system plays by preset browser Device decodes the video.
Step S206 obtains corresponding video according to the version information of the processor of the mobile terminal and decodes library;
The processor of mobile terminal can be, but not limited to:Arm processor, Intel ATOM processors or other are same Class processor.
Specifically, if the matching result that server 100 returns is shown in the type information and the white list of mobile terminal 200 Information match, then by preset browser obtain mobile terminal 200 arm processor version information, according to the version Information obtains corresponding decoding library from server 100.
Step S207 judges whether the format of the video is preset video coding standard format according to the decoding library;
Preset video encoding standard is preferably H.264.H.264 it is a kind of high-performance encoding and decoding agreement, is International standardization The new-generation digital video compression format after MPEG4 that tissue (ISO) and International Telecommunication Union (ITU) propose jointly.
Specifically, mobile terminal 200 is loaded by preset browser and runs what video decoding library decoding user specified Then video to be decoded judges whether the format of the video is H.264 format according to operation result.
If so, thening follow the steps S208;If it is not, thening follow the steps S204.
Step S208 executes hardware by hardware decoder and decodes initialization operation, judges hardware decoding initialization behaviour Whether mistake is occurred;
Specifically, as shown in figure 5, this step specifically may include:
Step S2081 analyzes one group in the video specified video features parameter by the hardware decoder, with Determine whether the hardware decoder supports the video features parameter;
The specified video features parameter of the group can be, but not limited to:Configuration parameter, level parameters and the width of video High parameter.Wherein, the configuration parameter of video is used to illustrate that the complexity of Video coding, the level parameters of video to refer to the resolution of video The range of rate, wide high parameter refer to the width of video and the value of height.
Specifically, mobile terminal 200 by hardware decoder (e.g., multimedia, video, audio decoder chip) from the video File in obtain above-mentioned video features parameter, read and analyze the video features parameter, with determine the hardware decoder whether Support the video features parameter.
Step S2082, if not supporting, it is determined that the hardware decodes initialization operation and mistake occurs;
Step S2083 judges that renderer supports what the format of the color of display was supported with the hardware decoder if supporting Whether video decompression format matches;
When using hardware mode render video, because color when renderer is shown is usually RGB565 formats, and it is hard The format for the video decompression that part decoder is supported is generally yuv format, and according to different chip yuv format meetings, there are many plant version This, system would generally have decompressed format matching requirement, for example, the video of the yuv format of some versions can directly switch to RGB565 formats, and the video of the yuv format of some versions then cannot directly switch to RGB565 formats, and working as directly to convert When namely when format undesirable (mismatch), system can return to error message.
Step S2084, if mismatching, it is determined that the hardware decodes initialization operation and mistake occurs.
When system returns to error message, determine that renderer supports the format of the color of display to be supported with the hardware decoder Video decompression format mismatching, the hardware decode initialization operation occur mistake.
If the hardware, which decodes initialization operation, occurs mistake, S204 is thened follow the steps;If the hardware decodes initialization operation Mistake does not occur, thens follow the steps S209.
Step S209 formally decodes the video by the hardware decoder, judges whether the formal decoding occurs mistake;
Specifically, as shown in fig. 6, this step may include:
Step S2091 decodes the first frame of the video by the hardware decoder, if the front and back video features parameter of decoding Information is inconsistent, then when reaffirming the video features parameter obtained after decoding, and occurring wrong during confirming, determines Mistake occurs for the formal decoding;
The video features obtained after the information of the video features parameter sometimes obtained in initialization and decoding are joined Several information can be inconsistent, for example, video wide high parameter, the value for the width high parameter that when initialization obtains with decode the video First frame after the value that obtains be likely to inconsistent, hardware decoder can reaffirm that the video obtained after decoding is special at this time The information for levying parameter, in order to subsequently be correctly decoded.If mistake occurs during reaffirming, it is determined that formal decoding occurs Mistake.
If the information of the front and back video features parameter of decoding is consistent, or during confirming mistake does not occur for step S2092, Then continue to decode other frames of the video, and when mistake occurs in decoding process, determines formal decoding generation mistake.
If the letter of the video features parameter obtained after the information of the video features parameter obtained when initialization and decoding Breath is consistent, or mistake does not occur during the information of the video features parameter obtained after reaffirming decoding, then continues Other frames of the video are decoded, and when receiving the error code of system return in decoding process, it is wrong to determine that formal decoding occurs Accidentally.
If mistake occurs for the formal decoding, S204 is thened follow the steps.
Video encoding/decoding method provided in an embodiment of the present invention passes through the type information according to mobile terminal before video decoding Whether it is preset video coding standard format with the match condition of the information in white list and the format of video to be decoded, Select corresponding decoding process, can be that the video determine most suitable decoding process, improve the decoded flexibility of video and at Power.In addition, by during according to selected decoding process decoding video, according to the mistake occurred in decoding process and When switch other decoding processes, can be further reduced the decoded error rate of video, improve decoding efficiency.
3rd embodiment
Fig. 7 is the structural schematic diagram for the video decoder that third embodiment of the invention provides.It is provided in this embodiment to regard Frequency decoding apparatus 30 can be run in mobile terminal 200 shown in FIG. 1, for realizing the video decoding side in above-described embodiment Method.As shown in fig. 7, video decoder 30 includes:
Acquisition module 301, the type information for obtaining mobile terminal;
Judgment module 302, for judge acquisition module 301 obtain the mobile terminal type information whether with white list In information match, record has the type information for supporting the decoded mobile terminal of hardware in the white list;
Decoder module 303 is decoded if the judging result for judgment module 302 is to mismatch by software decoder Video;
Acquisition module 301, if the judging result for being additionally operable to judgment module 302 is to match, according to the mobile terminal The version information of processor obtains corresponding video and decodes library;
Judgment module 302 is additionally operable to the video obtained according to acquisition module 301 decoding library and judges that the format of the video is No is preset video coding standard format;
Decoder module 303 should by hardware decoder decoding if the judging result for being additionally operable to judgment module 302 is yes Video, if it is not, then executing the step of being somebody's turn to do through software decoder decoding video.
The present embodiment refers to above-mentioned the detailed process of the respective function of each Implement of Function Module of video decoder 40 Particular content described in Fig. 1 to embodiment illustrated in fig. 6, details are not described herein again.
Video decoder provided in an embodiment of the present invention passes through the type information according to mobile terminal before video decoding Whether it is preset video coding standard format with the match condition of the information in white list and the format of video to be decoded, Select corresponding decoding process, can be that the video determine most suitable decoding process, improve the decoded flexibility of video and at Power.
Fourth embodiment
Fig. 8 is the structural schematic diagram for the video decoder that fourth embodiment of the invention provides.It is provided in this embodiment to regard Frequency decoding apparatus 40 can be run in mobile terminal 200 shown in FIG. 1, for realizing the video decoding side in above-described embodiment Method.As shown in figure 8, unlike video decoder 30 shown in Fig. 7:
Further, decoder module 303 includes:
Judging unit 3031 decodes initialization operation for executing hardware by the hardware decoder, judges the hardware solution Whether code initialization operation occurs mistake;
Decoding unit 3032, if mistake occurs for hardware decoding initialization operation, executing should be decoded by software The step of device decoding video;
Judging unit 3031 is decoded if being additionally operable to hardware decoding initialization operation, mistake does not occur by the hardware Device formally decodes the video, judges whether the formal decoding occurs mistake;
Decoding unit 3032, if being additionally operable to the formal decoding occurs mistake, executing should be regarded by software decoder decoding The step of frequency.
Further, judging unit 3031 are additionally operable to through the hardware decoder to one group in the video specified video Characteristic parameter is analyzed, to determine whether the hardware decoder supports the video features parameter, if not supporting, it is determined that this is hard Part decodes initialization operation and mistake occurs, if supporting, judges that renderer supports the format of the color of display to be decoded with the hardware Whether the video decompression format that device is supported matches, if mismatching, it is determined that the hardware decodes initialization operation and mistake occurs.
Further, judging unit 3031 are additionally operable to decode the first frame of the video by the hardware decoder, if before decoding The information of the video features parameter is inconsistent afterwards, then reaffirms the video features parameter obtained after decoding, and when acknowledged When mistake occurring in journey, determine that mistake occurs for the formal decoding, if being additionally operable to the information one of the front and back video features parameter of decoding It causes, or mistake does not occur during confirming, then continue other frames for decoding the video, and when mistake occurs in decoding process, Determine that mistake occurs for the formal decoding.
Further, judgment module 302 includes:
Transmission unit 3021, for the type information of the mobile terminal to be sent to server so that the server should The type information of mobile terminal is matched with the information in the white list;
Information matches judging unit 3022, the matching result for being returned according to the server judge the type of the mobile terminal Number information whether with the information match in white list.
Further, decoder module 303 are additionally operable to decode the video by the software decoder, if sending out in decoding process Decoding error is given birth to, then switching system player decodes the video.
Further, video decoder 40 further includes:
Sending module 404, for the type information of the mobile terminal to be sent to the server so that the server according to The type information of the mobile terminal updates the white list.
The present embodiment refers to above-mentioned the detailed process of the respective function of each Implement of Function Module of video decoder 40 Particular content described in Fig. 1 to embodiment illustrated in fig. 6, details are not described herein again.
Video decoder provided in an embodiment of the present invention passes through the type information according to mobile terminal before video decoding Whether it is preset video coding standard format with the match condition of the information in white list and the format of video to be decoded, Select corresponding decoding process, can be that the video determine most suitable decoding process, improve the decoded flexibility of video and at Power.In addition, by during according to selected decoding process decoding video, according to the mistake occurred in decoding process and When switch other decoding processes, can be further reduced the decoded error rate of video, improve decoding efficiency.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment weight Point explanation is all difference from other examples, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so fairly simple, the related place ginseng of description See the part explanation of embodiment of the method.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that process, method, article or device including a series of elements are not only wanted including those Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or device Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or device including element.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware Complete, relevant hardware can also be instructed to complete by program, program can be stored in a kind of computer-readable storage In medium, storage medium mentioned above can be read-only memory, disk or CD etc..
More than, only it is presently preferred embodiments of the present invention, is not intended to limit the present invention in any form, although this Invention is disclosed above with preferred embodiment, and however, it is not intended to limit the invention, any person skilled in the art, It does not depart within the scope of technical solution of the present invention, when the technology contents using the disclosure above make a little change or are modified to equivalent The equivalent embodiment of variation, as long as being without departing from technical solution of the present invention content, according to the technical essence of the invention to above real Any simple modification, equivalent change and modification made by example are applied, in the range of still falling within technical solution of the present invention.

Claims (13)

1. a kind of video encoding/decoding method, which is characterized in that the method includes:
The type information for obtaining mobile terminal, is sent to server so that the service by the type information of the mobile terminal Device matches the type information of the mobile terminal with the information in white list;
According to the server return matching result judge the mobile terminal type information whether with the letter in white list Manner of breathing matches, and record has the type information for supporting the decoded mobile terminal of hardware in the white list;
If mismatching, pass through software decoder decoding video;
If matching, according to the version information of the processor of mobile terminal acquisition corresponding video decoding library, and according to Video decoding library judges whether the format of the video is preset video coding standard format;
If so, the video is decoded by hardware decoder, if it is not, passing through software decoder decoding video described in then executing Step.
2. according to the method described in claim 1, it is characterized in that, described decode the video by hardware decoder and include:
Hardware is executed by the hardware decoder and decodes initialization operation, judges whether the hardware decoding initialization operation is sent out Raw mistake;
If mistake occurs for hardware decoding initialization operation, execute it is described by software decoder decoding video the step of;
If mistake does not occur for the hardware decoding initialization operation, the video is formally decoded by the hardware decoder, Judge whether the formal decoding occurs mistake;
If mistake occurs for the formal decoding, execute it is described by software decoder decoding video the step of.
3. according to the method described in claim 2, it is characterized in that, described execute hardware decoding just by the hardware decoder Beginningization operates, and judges whether the hardware decoding initialization operation occurs mistake and include:
One group in the video specified video features parameter is analyzed by the hardware decoder, it is described hard with determination Whether part decoder supports the video features parameter;
If not supporting, it is determined that mistake occurs for the hardware decoding initialization operation.
4. according to the method described in claim 3, it is characterized in that, the method further includes:
If supporting, the video decompression lattice that renderer supports the format of the color of display to be supported with the hardware decoder are judged Whether formula matches;
If mismatching, it is determined that mistake occurs for the hardware decoding initialization operation.
5. according to the method described in claim 4, it is characterized in that, described by being regarded described in the hardware decoder formally decoding Frequently, judge whether the formal decoding occurs mistake and include:
The first frame of the video is decoded by the hardware decoder, if the information of the front and back video features parameter of decoding differs When causing, then reaffirm the video features parameter that obtains after decoding, and mistake occurs during confirming, determine it is described just Mistake occurs for formula decoding;
If the information of the front and back video features parameter of decoding is consistent, or mistake does not occur during confirming, then continue to decode institute Other frames of video are stated, and when mistake occurs in decoding process, determines that mistake occurs for the formal decoding.
6. according to any one of them method of claim 1 to 5, which is characterized in that described to decode institute by software decoder Stating video includes:
The video is decoded by the software decoder;
If decoding error occurs in decoding process, switching system player decodes the video.
7. according to the method described in claim 6, it is characterized in that, it is described by the software decoder decode the video it After include:
The type information of the mobile terminal is sent to the server so that the server is according to the mobile terminal Type information updates the white list.
8. a kind of video decoder, which is characterized in that described device includes:
Acquisition module, the type information for obtaining mobile terminal;
Judgment module, for judge the mobile terminal that the acquisition module obtains type information whether in white list Information match, record has the type information for supporting the decoded mobile terminal of hardware in the white list;
Decoder module passes through software decoder decoding video if the judging result for the judgment module is to mismatch;
The acquisition module, if the judging result for being additionally operable to the judgment module is to match, according to the mobile terminal The version information of processor obtains corresponding video and decodes library;
The judgment module is additionally operable to the format that the video obtained according to the acquisition module decoding library judges the video Whether it is preset video coding standard format;
The decoder module, if the judging result for being additionally operable to the judgment module is yes, decoded by hardware decoder described in Video, if it is not, the step of then described in execution by software decoder decoding video;
Wherein, the judgment module includes:
Transmission unit, for the type information of the mobile terminal to be sent to server so that the server is by the shifting The type information of dynamic terminal is matched with the information in the white list;
Information matches judging unit, the matching result for being returned according to the server judge the model letter of the mobile terminal Breath whether with the information match in white list.
9. device according to claim 8, which is characterized in that the decoder module includes:
Judging unit decodes initialization operation for executing hardware by the hardware decoder, judges the hardware decoding just Whether beginningization operation occurs mistake;
Decoding unit passes through software decoder solution if mistake occurs for hardware decoding initialization operation described in execution The step of code video;
The judging unit is decoded if being additionally operable to the hardware decoding initialization operation, mistake does not occur by the hardware Device formally decodes the video, judges whether the formal decoding occurs mistake;
The decoding unit executes described decoded by software decoder and regards if being additionally operable to the formal decoding occurs mistake The step of frequency.
10. device according to claim 9, which is characterized in that
The judging unit, be additionally operable to by the hardware decoder video features parameter specified to one group in the video into Whether row analysis, support the video features parameter, if not supporting, it is determined that the hardware solution with the determination hardware decoder Mistake occurs for code initialization operation, if supporting, judges that renderer supports the format of the color of display and the hardware decoder Whether the video decompression format of support matches, if mismatching, it is determined that mistake occurs for the hardware decoding initialization operation.
11. device according to claim 10, which is characterized in that
The judging unit is additionally operable to decode the first frame of the video by the hardware decoder, if being regarded described in decoding is front and back The information of frequency characteristic parameter is inconsistent, then reaffirms the video features parameter obtained after decoding, and during confirming When mistake occurs, determine that mistake occurs for the formal decoding, if being additionally operable to the information one of the front and back video features parameter of decoding It causes, or mistake does not occur during confirming, then continue other frames for decoding the video, and work as in decoding process and mistake occurs When, determine that mistake occurs for the formal decoding.
12. according to any one of them device of claim 8 to 11, which is characterized in that the decoder module is additionally operable to pass through The software decoder decodes the video, if decoding error occurs in decoding process, described in the decoding of switching system player Video.
13. device according to claim 12, which is characterized in that described device further includes:
Sending module, for the type information of the mobile terminal to be sent to the server so that the server according to The type information of the mobile terminal updates the white list.
CN201510073425.XA 2015-02-11 2015-02-11 Video encoding/decoding method and device Active CN104980788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510073425.XA CN104980788B (en) 2015-02-11 2015-02-11 Video encoding/decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510073425.XA CN104980788B (en) 2015-02-11 2015-02-11 Video encoding/decoding method and device

Publications (2)

Publication Number Publication Date
CN104980788A CN104980788A (en) 2015-10-14
CN104980788B true CN104980788B (en) 2018-08-07

Family

ID=54276794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510073425.XA Active CN104980788B (en) 2015-02-11 2015-02-11 Video encoding/decoding method and device

Country Status (1)

Country Link
CN (1) CN104980788B (en)

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104980797B (en) * 2015-05-27 2019-03-15 腾讯科技(深圳)有限公司 Video encoding/decoding method and client
CN105898496A (en) * 2015-11-18 2016-08-24 乐视网信息技术(北京)股份有限公司 HLS stream hardware decoding method based on Android device and device
CN106131319A (en) * 2016-06-29 2016-11-16 努比亚技术有限公司 A kind of information processing method and device, terminal
CN106231051B (en) * 2016-08-01 2020-04-03 腾讯科技(深圳)有限公司 Video decoding test method and related equipment
CN106658174A (en) * 2016-10-31 2017-05-10 努比亚技术有限公司 Video decoding terminal and method
CN106792066A (en) * 2016-12-20 2017-05-31 暴风集团股份有限公司 The method and system that the video decoding of optimization is played
CN109309867A (en) * 2017-07-28 2019-02-05 中兴通讯股份有限公司 Display methods, display terminal and the computer readable storage medium of terminal
CN109391843B (en) * 2017-08-03 2022-02-25 腾讯科技(深圳)有限公司 Online video speed doubling playing method, device, medium and intelligent terminal
CN108235096A (en) * 2018-01-18 2018-06-29 湖南快乐阳光互动娱乐传媒有限公司 Method for intelligently switching soft decoding and playing video through hard decoding of mobile terminal
CN108600813A (en) * 2018-05-17 2018-09-28 上海七牛信息技术有限公司 a kind of media file playing method, device and media play system
CN108882010A (en) * 2018-06-29 2018-11-23 深圳市九洲电器有限公司 A kind of method and system that multi-screen plays
CN110198427B (en) * 2018-07-05 2021-09-21 腾讯科技(深圳)有限公司 Video call method and device
CN110858920A (en) * 2018-08-23 2020-03-03 武汉斗鱼网络科技有限公司 Video decoding method, mobile terminal, server, system and storage medium
CN109088887A (en) * 2018-09-29 2018-12-25 北京金山云网络技术有限公司 A kind of decoded method and device of Streaming Media
CN109151574B (en) 2018-10-15 2020-03-24 Oppo广东移动通信有限公司 Video processing method, video processing device, electronic equipment and storage medium
CN109257646B (en) 2018-10-15 2020-09-22 Oppo广东移动通信有限公司 Video processing method and device, electronic equipment and computer readable medium
CN112823529B (en) * 2018-11-29 2023-06-13 深圳市欢太科技有限公司 Video decoding method, device, electronic equipment and computer readable storage medium
CN110138725B (en) * 2019-03-26 2021-12-03 视联动力信息技术股份有限公司 Data exchange method and security gateway
CN111757168B (en) * 2019-03-29 2022-08-19 腾讯科技(深圳)有限公司 Audio decoding method, device, storage medium and equipment
CN110753265B (en) * 2019-10-28 2022-04-19 北京奇艺世纪科技有限公司 Data processing method and device and electronic equipment
CN112003976B (en) * 2020-07-31 2022-04-29 北京达佳互联信息技术有限公司 Hard-coding and hard-decoding test method and device
CN112203097A (en) * 2020-09-30 2021-01-08 苏州臻迪智能科技有限公司 Adaptive video decoding method and device, terminal equipment and storage medium
CN113596469B (en) * 2021-06-23 2024-10-11 天津津航计算技术研究所 Soft-hard combined and high-efficiency transmission video decoding method
CN114302176B (en) * 2021-12-03 2024-02-09 杭州海康威视系统技术有限公司 Video playing method and device
CN115334352A (en) * 2022-08-11 2022-11-11 北京蔚领时代科技有限公司 Automatic matching video decoding method, device, decoder and storage medium
CN116546273B (en) * 2023-06-27 2023-08-25 北京麟卓信息科技有限公司 Video playing optimization method based on multi-decoder dynamic fusion

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761736A (en) * 2011-04-29 2012-10-31 腾讯科技(深圳)有限公司 Video decoding method and device
CN103260021A (en) * 2012-02-21 2013-08-21 腾讯科技(深圳)有限公司 Method and device for decoding videos

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014207536A (en) * 2013-04-12 2014-10-30 ソニー株式会社 Image processing device and method
JP6208993B2 (en) * 2013-06-28 2017-10-04 ルネサスエレクトロニクス株式会社 Image decoding apparatus and decoding processing method of image decoding apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761736A (en) * 2011-04-29 2012-10-31 腾讯科技(深圳)有限公司 Video decoding method and device
CN103260021A (en) * 2012-02-21 2013-08-21 腾讯科技(深圳)有限公司 Method and device for decoding videos

Also Published As

Publication number Publication date
CN104980788A (en) 2015-10-14

Similar Documents

Publication Publication Date Title
CN104980788B (en) Video encoding/decoding method and device
CN112087633B (en) Video decoding method, device and storage medium
CN105528229B (en) Improve the method and device that mobile terminal first powers on speed
CN108076226B (en) Method for adjusting call quality, mobile terminal and storage medium
CN106412687B (en) Method and device for intercepting audio and video clips
US20150030084A1 (en) Techniques for streaming video quality analysis
CN106664458A (en) Direct streaming for wireless display
TWI279156B (en) Wireless audio system using wireless LAN
CN107481709A (en) Audio data transmission method and device
CN104837057B (en) Video file broadcasting method, device and system
CN106611402B (en) Image processing method and device
US20150039322A1 (en) Apparatus, system and method for merging code layers for audio encoding and decoding
CN105657479B (en) Video processing method and device
CN106331846B (en) The method and device of audio transparent transmission
US20230370774A1 (en) Bluetooth speaker control method and system, storage medium, and mobile terminal
CN112995730A (en) Sound and picture synchronous adjustment method and device, electronic equipment and medium
CN105704106B (en) A kind of visualization IVR implementation method and mobile terminal
US20150288737A1 (en) Media streaming method and electronic device thereof
CN109753262B (en) Frame display processing method and device, terminal equipment and storage medium
CN112823519B (en) Video decoding method, device, electronic equipment and computer readable storage medium
US20230156265A1 (en) Method and apparatus for synchronizing audio and video signals of multimedia content
CN103401580A (en) Voice recording and playing interphone
CN107957899B (en) Screen recording method and device, computer readable storage medium and mobile terminal
CN102572364A (en) Decoding method and device for video communication data
CN105049982A (en) Intelligent sound box and music play method based on intelligent sound box

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant