[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN105657540B - A kind of video encoding/decoding method and its device being adapted to Android system - Google Patents

A kind of video encoding/decoding method and its device being adapted to Android system Download PDF

Info

Publication number
CN105657540B
CN105657540B CN201610010332.7A CN201610010332A CN105657540B CN 105657540 B CN105657540 B CN 105657540B CN 201610010332 A CN201610010332 A CN 201610010332A CN 105657540 B CN105657540 B CN 105657540B
Authority
CN
China
Prior art keywords
module
cache
decoder
video
information
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
CN201610010332.7A
Other languages
Chinese (zh)
Other versions
CN105657540A (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.)
Allwinner Technology Co Ltd
Original Assignee
Allwinner Technology 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 Allwinner Technology Co Ltd filed Critical Allwinner Technology Co Ltd
Priority to CN201610010332.7A priority Critical patent/CN105657540B/en
Publication of CN105657540A publication Critical patent/CN105657540A/en
Application granted granted Critical
Publication of CN105657540B publication Critical patent/CN105657540B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/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
    • H04N21/440218Processing 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 by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The present invention provides a kind of video encoding/decoding method and its device for being adapted to Android system, and video encoding/decoding method includes: the step of video information is transferred to decoder module;The step of obtaining cache information from decoder module;The step of display module creates cache module according to cache information;The step of decoder module is decoded the bit stream data in cache module;In the step of cache module saves decoded video data;The step of display module shows video data.And the video decoder using the video encoding/decoding method.By being applied by display module cache module, make to decode and show that the application for decreasing cache module number while the setting cached altogether advantageously reduces copy number uses, and cache module is applied by obtaining video information corresponding cache information, it is effectively reduced the application size and number of cache module, then improves the decoded performance of video and decoding efficiency.

Description

A kind of video encoding/decoding method and its device being adapted to Android system
Technical field
The present invention relates to video decoding fileds more particularly to a kind of video encoding/decoding method for being adapted to Android system and use should The video decoder of method.
Background technique
Android (Android) system is a kind of freedom and exploitation source code based on Linux by Google's exploitation Operating system is mainly used for the mobile devices such as smart phone, tablet computer, and nowadays, Android platform occupies in field of mobile phones The global maximum market share.The success of android system has benefited from its way for developing source code to a certain extent, will The numerous permissions and interface of system, which are all opened to, to be come, and allows each hardware vendor according to itself hardware feature and android System is adapted to.In terms of multimedia, android defines two socket of mediaplayer and mediacodec, and system is certainly The nuplayer and stagefrightplayer of band are inherited then to carry out with mediacodec pair in mediaplayer, softomx It connecing, hardware vendor can dock the encoding and decoding resource (including hardware and software resource) of itself with this two socket, from And the respective resources advantage of manufacturer is played, android system is also able to the difference between compatible different hardware manufacturer.
During realizing interface, mechanism and the strategy decision performance and efficiency of interface of realization, to influence whole The superiority-inferiority of a Android system.So the performance for how being preferably adapted to the interface of Android system, promoting interface, to each For a hardware vendor, all become most important.
Mediaplayer is the multimedia interface of complete set, and the realization class of this interface must be assisted comprising Streaming Media Modules, the upper layer callers such as view processing, solution Document encapsulation, Broadcast Control, audio/video decoding, caption decoding only need to be by medium resource access Path or url (Internet resources identifier) are transmitted to mediaplayer, and mediaplayer then calls modules in media Appearance plays out.And mediacodec be then a set of encoding and decoding interface its work is connect with decoder, addressable port is responsible for will be defeated The coding source code entered at target code stream, be responsible for the bit stream data of input being decoded into audio frame or video frame by decoding interface, letter For be exactly to handle the data of input, finally will treated that data are output to upper layer caller.Android is used OpenmaxIL is docked with mediacodec, and each manufacturer is actually using driver (openmaxIL), then real Existing driver and decoder interact use.It realizes in openmaxIL and is output and input in use, how to manage for storing The buffer (buffer) of data, will directly influence the efficiency of interface.For now, there is applications for buffer management The disadvantages of space buffer is excessive, buffer copy inefficiency.The space buffer of application is too big, it will occupies more Installed System Memory influences the fluency of system, can then reduce whole encoding and decoding performance under buffer copy efficiency, and cause to set Standby power consumption increases.
Summary of the invention
The first object of the present invention is to provide video encoding/decoding method that is a kind of efficient and being adapted to Android system.
The second object of the present invention is to provide video decoder that is a kind of efficient and being adapted to Android system.
In order to realize that the first object of the present invention, the present invention provide a kind of video encoding/decoding method for being adapted to Android system, In, comprising: the step of video information is transferred to decoder module;The step of obtaining cache information from decoder module;Display module The step of creating cache module according to cache information;The step of decoder module is decoded the bit stream data in cache module; In the step of cache module saves decoded video data;The step of display module shows video data.
By above scheme as it can be seen that without applying for the cache module for storing video data inside decoder module, but By being applied by display module, decoding is read out by the cache module in display module when decoding, when display passes through Display module reads decoded video data in cache module and is shown, realizes decoder module and display module shared buffer memory Module, the setting of shared buffer memory decreases cache module number application while advantageously reducing copy number use, with And cache module is applied by obtaining video information corresponding cache information, it is effectively reduced the application of cache module Size and number then realize the copy efficiency for improving cache module or the number for reducing copy, to improve video decoding Performance and decoding efficiency.
Further scheme is that before the step of video information is transferred to decoder module, video encoding/decoding method is also wrapped It includes: the step of creating drive module and initializing drive module;Drive module creates the step of decoder module.
Further scheme is that after the step of obtaining cache information from decoder module, video encoding/decoding method is also wrapped It includes: judging whether the step of successfully obtaining cache information;Cache information is such as successfully obtained, then executes and exports cache information to aobvious Show module.
Further scheme is, after display module creates cache module according to cache information, video encoding/decoding method Further include: the step of address of cache module is transferred to decoder module.
Before further scheme is the step of decoder module is decoded the bit stream data in cache module, depending on Frequency coding/decoding method further includes the steps that management module is monitored cache module.
Further scheme is that cache information includes buffer memory capacity and caching number.
Therefore by the way that the video information of video is passed to decoder module first, acquisition decoding can be then fed back Required cache information, then cache module is targetedly applied according to cache information by display module, so that with The capacity and number of minimum cache module are guaranteeing that normal operation is smooth, while using the setting of management module to cache module State is monitored, and carries out Coordination Treatment by drive module, and cache module is avoided to cause confusion when reading and writing data, thus Be conducive to improve the decoded efficiency of video and stability.
In order to realize that the first object of the present invention, the present invention provide a kind of video decoder for being adapted to Android system, packet Include display module and decoder module, wherein decoder module receives video information, and decoder module exports caching letter to display module Breath, display module create cache module according to cache information, and decoder module is decoded the bit stream data in cache module, delay Storing module saves decoded video data, and display module shows video data.
By above scheme as it can be seen that without applying for the cache module for storing video data inside decoder module, but By being applied by display module, decoding is read out by the cache module in display module when decoding, when display passes through Display module reads decoded video data in cache module and is shown, realizes decoder module and display module shared buffer memory Module, the setting of shared buffer memory decreases cache module number application while advantageously reducing copy number use, with And cache module is applied by obtaining video information corresponding cache information, it is effectively reduced the application of cache module Size and number then realize the copy efficiency for improving cache module or the number for reducing copy, to improve video decoding Performance and decoding efficiency.
Detailed description of the invention
Fig. 1 is the system block diagram of video decoder embodiment of the present invention.
Fig. 2 is the flow chart of video encoding/decoding method embodiment of the present invention.
The invention will be further described with reference to the accompanying drawings and embodiments.
Specific embodiment
Video decoder embodiment:
Referring to Fig.1, Fig. 1 is the system block diagram for being adapted to the video decoder of Android system, and video decoder includes driving Dynamic model block 2, display module 3, decoder module 4, cache module 5 and management module 6, decoder module 4 receive video information, decode mould Block 4 exports cache information to display module 3, and display module 3 creates cache module 5,4 pairs of decoder module cachings according to cache information Bit stream data in module 5 is decoded, and cache module 5 saves decoded video data, display module 3 to video data into Row display, drive module 2 is for creating decoder module 4, and management module 6 is for being monitored cache module 5 and obtaining state Signal, management module 6 is to drive module feedback states signal.
Video encoding/decoding method embodiment:
It is the flow chart for being adapted to the video encoding/decoding method of Android system referring to Fig. 2 and in conjunction with Fig. 1, Fig. 2.Step is first carried out S11, program start, Android system interface layer 1 create drive module 2, by corresponding initialization information be transmitted to drive module 2 with Drive module 2 is initialized, step S12 is then executed, drive module 2 creates decoder module 4, and by video information with structural body Form passes to decoder module 4, and decoder module 4 initializes built-in variable and state, and it is related that drive module 2 enters main thread processing Message and task.
Then step S13 is executed, obtains cache information from decoder module 4, cache information includes the number and caching of caching Amount of capacity.Then execution step S14, judges whether to obtain successfully, such as unsuccessful acquisition, then return step S13, until obtaining Cache information is taken, such as cache information is successfully obtained, thens follow the steps S15, cache information is exported to display module 3, and will be driven Dynamic model block 2 is set to halted state, and display module 3 is waited to transmit the cache module applied.Since drive module 2 can not It learns that decoder module 4 parses the time point of cache information, therefore is obtained using this method constantly inquired.
Step S16 is then executed, display module 3 goes out the slow of respective volume size and corresponding number according to cache information application Storing module 5.By one play resolution ratio be 1080*720, the application for the H264 video with 3 reference frames to cache module 5 It is illustrated, when creating decoder module 4, the setting of the video format information of the resolution information of 1080*720 and h264 is arrived In decoder module, decoder initializes corresponding resource according to these video informations, and decoder module parses in video information When the number of reference frame is 3, then it can be equal to reference frame number, buffering number and display module occupancy according to cache module number Several sums, buffering number are generally 4, and display module occupies number and is generally 2, therefore the number of cache module is 9.And work as When video format is YV12, each pixel is by tri- representation in components of Y, U, V, ratio 4:1:1, therefore the capacity of cache module is big Small is resolution ratio * 3/2, i.e., the amount of capacity of cache module is 1080*720*3/2.
Step S17 is then executed, the address of cache module 5 is transferred to drive module 2, then executes step S18, driving The address of cache module 5 is transferred to decoder module 4 by module 2, then executes step S19, creative management module 6, management module 6 Be monitored to cache module 5, there are three states for each cache module 5: decoder module occupies, display module occupies and idle, Cache module state is converted successively are as follows: decoder module occupancy-display module occupancy-free time, by management module 6 to cache module 5 monitoring simultaneously obtains status signal, and management module 6 is to 2 feedback states signal of drive module, so that drive module 2 passes through caching The conversion of module status is to reach being used interchangeably for decoder module and display module.
Then step S20 is executed, bit stream data is copied from cache module 5 and is decoded to decoder module 4, decoded view Frequency finally executes step S21, display module 3 obtains decoded view from cache module 5 according to the preservation of cache module 5 is stored in Frequency is shown.In video playing, does not select circulation to execute step S20 and step S21, constantly video is decoded and is broadcast It puts, until video playing finishes.
Therefore without applying for the cache module for storing video data inside decoder module, but by by Display module applied, is read out decoding by the cache module in display module when decoding, and when display passes through display mould Block reads decoded video data in cache module and is shown, realizes decoder module and display module shared buffer memory module, The setting of shared buffer memory decreases cache module number application while advantageously reducing copy number uses, and passes through The corresponding cache information of video information is obtained to apply cache module, be effectively reduced cache module application size and Number then realizes the copy efficiency for improving cache module or the number for reducing copy, to improve the decoded performance of video With decoding efficiency.

Claims (5)

1. a kind of video encoding/decoding method for being adapted to Android system characterized by comprising
The step of creating drive module and initializing the drive module;
The step of drive module creation decoder module;
The step of video information is transferred to decoder module;
The step of obtaining cache information from the decoder module;
The step of display module creates cache module according to the cache information;
The step of decoder module is decoded the bit stream data in the cache module;
The step of management module is monitored the cache module, the cache module have decoder module occupied state, show Show module occupied state and idle state, the state conversion of the cache module is followed successively by decoder module occupied state, display mould Block occupied state, idle state, the management module monitor to the cache module and obtain status signal, the management module To the drive module feedback states signal, the drive module is solved according to the conversion and control of the state of the cache module Code module is used interchangeably with the display module;
Under the decoder module occupied state the step of cache module saves decoded video data;
The step of display module shows the video data under the display module occupied state.
2. video encoding/decoding method according to claim 1, it is characterised in that:
After the step of obtaining the cache information from the decoder module, the video encoding/decoding method further include:
Judge whether the step of successfully obtaining the cache information;
The cache information as described in successfully obtaining, then execute and export the cache information to the display module.
3. video encoding/decoding method according to claim 1, it is characterised in that:
After the display module creates the cache module according to the cache information, the video encoding/decoding method is also wrapped It includes:
The step of address of the cache module is transferred to the decoder module.
4. video encoding/decoding method according to any one of claims 1 to 3, it is characterised in that:
The cache information includes buffer memory capacity and caching number.
5. a kind of video decoder for being adapted to Android system, which is characterized in that including display module and decoder module, feature It is:
The decoder module receives video information, and the decoder module exports cache information, the display to the display module Module creates cache module according to the cache information, and the decoder module solves the bit stream data in the cache module Code, the cache module save decoded video data, and the display module shows the video data;
The video decoder further includes drive module, and the drive module is for creating the decoder module;
The video decoder further includes management module, and the management module is for being monitored and obtaining to the cache module Status signal is obtained, the management module feeds back the status signal to the drive module;
The video decoder is for executing the described in any item video encoding/decoding methods of the claims 1 to 4.
CN201610010332.7A 2016-01-05 2016-01-05 A kind of video encoding/decoding method and its device being adapted to Android system Active CN105657540B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610010332.7A CN105657540B (en) 2016-01-05 2016-01-05 A kind of video encoding/decoding method and its device being adapted to Android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610010332.7A CN105657540B (en) 2016-01-05 2016-01-05 A kind of video encoding/decoding method and its device being adapted to Android system

Publications (2)

Publication Number Publication Date
CN105657540A CN105657540A (en) 2016-06-08
CN105657540B true CN105657540B (en) 2019-02-22

Family

ID=56490636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610010332.7A Active CN105657540B (en) 2016-01-05 2016-01-05 A kind of video encoding/decoding method and its device being adapted to Android system

Country Status (1)

Country Link
CN (1) CN105657540B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113015003B (en) * 2021-03-08 2022-11-25 展讯通信(上海)有限公司 Video frame caching method and device
CN113596495B (en) * 2021-07-28 2023-11-24 广州方硅信息技术有限公司 Live broadcast push stream processing method and device, equipment and medium thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101282467A (en) * 2008-05-15 2008-10-08 中兴通讯股份有限公司 Method and apparatus for caching data when playing medium with low speed
CN102868908A (en) * 2011-07-04 2013-01-09 哈尔滨融智达网络科技有限公司 High-efficiency streaming media playing method and device
CN102984576A (en) * 2012-12-21 2013-03-20 四川九洲电器集团有限责任公司 Audio-video stripping method and system for TS media
CN103067774A (en) * 2012-12-28 2013-04-24 四川九洲电器集团有限责任公司 Method and system capable of enabling set top box to display add-on subtitles
CN103281528A (en) * 2013-04-10 2013-09-04 深圳康佳通信科技有限公司 Streaming media decoding method, system and mobile terminal
CN104182355A (en) * 2014-08-29 2014-12-03 广州华多网络科技有限公司 Method and device for memory allocation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130279877A1 (en) * 2012-04-19 2013-10-24 Qnx Software Systems Limited System and Method Of Video Decoder Resource Sharing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101282467A (en) * 2008-05-15 2008-10-08 中兴通讯股份有限公司 Method and apparatus for caching data when playing medium with low speed
CN102868908A (en) * 2011-07-04 2013-01-09 哈尔滨融智达网络科技有限公司 High-efficiency streaming media playing method and device
CN102984576A (en) * 2012-12-21 2013-03-20 四川九洲电器集团有限责任公司 Audio-video stripping method and system for TS media
CN103067774A (en) * 2012-12-28 2013-04-24 四川九洲电器集团有限责任公司 Method and system capable of enabling set top box to display add-on subtitles
CN103281528A (en) * 2013-04-10 2013-09-04 深圳康佳通信科技有限公司 Streaming media decoding method, system and mobile terminal
CN104182355A (en) * 2014-08-29 2014-12-03 广州华多网络科技有限公司 Method and device for memory allocation

Also Published As

Publication number Publication date
CN105657540A (en) 2016-06-08

Similar Documents

Publication Publication Date Title
US11128879B2 (en) Hybrid decoding
US20160353160A1 (en) Smart terminal as well as fast channel switching method and device thereof
CN104780378A (en) Method, device and player for decoding video
US11490173B2 (en) Switch of audio and video
CN106797388B (en) Cross-system multimedia data encoding and decoding method and device, electronic equipment and computer program product
US8681861B2 (en) Multistandard hardware video encoder
CN108881916A (en) The video optimized processing method and processing device of remote desktop
US20070266168A1 (en) Prioritization of audio streams for platform adaptive audio decoding
CN104837052A (en) Playing method of multimedia data and device
CN109151966A (en) terminal control method, device, terminal device and storage medium
CN109325145A (en) Acquisition methods, terminal and the computer readable storage medium of video thumbnails
WO2018119611A1 (en) Multimedia data encoding/decoding method and device for multi-operating system, electronic device, and computer program product
CN102981887A (en) Data processing method and electronic device
WO2018119711A1 (en) Multimedia encoding/decoding method and device for multi-operating system, and electronic device
CN107613302B (en) Decoding method and device, storage medium and processor
CN113055681A (en) Video decoding display method, device, electronic equipment and storage medium
CN105657540B (en) A kind of video encoding/decoding method and its device being adapted to Android system
CN106470353B (en) Multimedia data processing method and device and electronic equipment
CN110933495A (en) Video playing method and device based on embedded system
CN103686195A (en) Video information processing method and video information processing equipment
CN101009836B (en) Embedded video playing device based on the dual processor
CN105577781A (en) Method and system for sound frequency redirection in virtualization desktop
CN104202656A (en) Segmented decoding method for scrambled network audio MP3 (moving picture experts group audio layer 3) streams
CN106716998B (en) Multiple operating system multi-medium data decoding method, device and electronic equipment
US20050262311A1 (en) Hierarchical processor architecture for video processing

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