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

CN106993220B - Method and device for adjusting multimedia decoding information buffer zone - Google Patents

Method and device for adjusting multimedia decoding information buffer zone Download PDF

Info

Publication number
CN106993220B
CN106993220B CN201710252385.4A CN201710252385A CN106993220B CN 106993220 B CN106993220 B CN 106993220B CN 201710252385 A CN201710252385 A CN 201710252385A CN 106993220 B CN106993220 B CN 106993220B
Authority
CN
China
Prior art keywords
buffer
multimedia
reallocated
parameters
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
CN201710252385.4A
Other languages
Chinese (zh)
Other versions
CN106993220A (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.)
Yuanxin Information Technology Group Co ltd
Original Assignee
Yuanxin Technology
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 Yuanxin Technology filed Critical Yuanxin Technology
Priority to CN201710252385.4A priority Critical patent/CN106993220B/en
Publication of CN106993220A publication Critical patent/CN106993220A/en
Application granted granted Critical
Publication of CN106993220B publication Critical patent/CN106993220B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0871Allocation or management of cache space

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention provides a method and a device for adjusting a multimedia decoding information buffer area, wherein the method comprises the steps of judging whether the buffer area needs to be redistributed or not based on multimedia parameters acquired according to decoding data when the completion of the decoding of multimedia information is monitored so as to cache the decoding data; when the buffer area needs to be reallocated, determining the reallocated buffer area based on the multimedia parameters; buffering the decoded data into a reallocated buffer. By applying the technical scheme of the invention, the purpose of dynamically adjusting the preset buffer area based on the multimedia parameters of the multimedia information to be played can be realized, the multimedia information to be played can be smoothly played, the situation of jamming or error in the process of playing the multimedia information to be played is avoided, and meanwhile, the occupation of redundant system memory can be reduced, thereby avoiding influencing the system operation performance of the playing equipment and the operation of other applications, and improving the use experience of users.

Description

Method and device for adjusting multimedia decoding information buffer zone
Technical Field
The present invention relates to the field of information technology, and in particular, to a method and an apparatus for adjusting a multimedia decoding information buffer.
Background
With the development of information technology, multimedia technology is also receiving more and more attention, and is a technology for playing audio and video to users by acquiring, encoding, decoding and outputting audio and video signals through a terminal; therefore, the multimedia technology is applied to the fields of video phones, multimedia monitoring, video conferences, multimedia teaching and the like, and brings convenience to the life of people.
Generally, for an embedded device having a function of playing multimedia information, a decoding process of multimedia information requires that the decoding device decodes the multimedia information in advance, stores the decoded multimedia information in a preset output buffer area, and plays the decoded multimedia information through the embedded device to complete transmission of the multimedia information, such as audio and video transmission. When multimedia information is transmitted, if the decoded data of the multimedia information is large, for example, the decoded video data with the resolution of 1280 × 720, a large-capacity output buffer area is required to store the decoded data, and if the decoded data of the multimedia information is small, for example, the decoded video data with the resolution of 640 × 480, a small-capacity output buffer area is required to store the decoded data. However, in the prior art, a buffer area for storing decoded data of multimedia information is already preset, and in order to ensure that an embedded device can smoothly play multimedia information of various sizes, so as to avoid the occurrence of jamming and even errors when playing the multimedia information, the buffer area is generally preset to a large capacity, so that errors when playing the multimedia information can be avoided as much as possible, but when the decoded data of the multimedia information is small, a large amount of system memory space is unnecessarily occupied, and the system operation performance of the embedded device is affected.
Disclosure of Invention
In order to overcome the above technical problems or at least partially solve the above technical problems, the following technical solutions are proposed:
one embodiment of the present invention provides a method for adjusting a multimedia decoding information buffer, comprising:
when the decoding of the multimedia information is monitored to be completed, judging whether a buffer area needs to be reallocated or not based on the multimedia parameters obtained according to the decoded data so as to cache the decoded data;
when the buffer area needs to be reallocated, determining the reallocated buffer area based on the multimedia parameters;
the decoded data is buffered in the reallocated buffer.
Preferably, before the step of decoding the multimedia information, the method further comprises:
initializing an initial capacity of an allocation buffer based on a buffer allocation parameter;
wherein, the step of determining whether the buffer needs to be reallocated based on the multimedia parameters comprises:
and judging whether the buffer area needs to be reallocated or not based on the comparison result of the multimedia parameters and the initial capacity of the initial allocation buffer area.
Preferably, the buffer is judged to need to be reallocated when the comparison result satisfies any one of the following conditions:
the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is smaller than the calculation result of the multimedia parameters which is obtained through calculation based on the preset operation mode; or
And the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is larger than the calculation result of the multimedia parameters which is obtained through calculation based on the preset operation mode, and the difference value of the two is larger than the first threshold value.
The multimedia parameters comprise the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and preset related parameters.
Preferably, the step of determining the reallocated buffer area based on the multimedia parameters comprises:
determining the number of the redistribution buffer areas based on the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and a preset related parameter;
based on the number of the re-allocated buffers, notifying and calling a release memory function of the open multimedia acceleration layer OpenMax, releasing the initially allocated buffers, calling an allocation memory function of the open multimedia acceleration layer OpenMax, and re-allocating the buffers.
Preferably, the method further comprises:
the buffer allocation parameter is updated based on the number of reallocated buffers.
Another embodiment of the present invention provides an apparatus for adjusting a multimedia decoding information buffer, including:
the monitoring module is used for judging whether a buffer area needs to be reallocated or not based on the multimedia parameters obtained according to the decoding data to cache the decoding data when the decoding of the multimedia information is monitored to be completed;
the allocation module is used for determining the reallocated buffer area based on the multimedia parameters when the buffer area needs to be reallocated;
and the buffer module is used for buffering the decoded data into the reallocated buffer area.
Preferably, the apparatus further comprises: the initialization module is used for initializing the initial capacity of the allocated buffer area based on the buffer area allocation parameter;
the monitoring module is used for judging whether the buffer area needs to be reallocated or not based on the comparison result of the multimedia parameters and the initial capacity of the initial allocation buffer area.
Preferably, the buffer is judged to need to be reallocated when the comparison result satisfies any one of the following conditions:
the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is smaller than the calculation result of the multimedia parameters which is obtained through calculation based on the preset operation mode; or
And the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is larger than the calculation result of the multimedia parameters which is obtained through calculation based on the preset operation mode, and the difference value of the two is larger than the first threshold value.
The multimedia parameters comprise the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and preset related parameters.
Preferably, the buffer module includes:
the determining unit is used for determining the number of the redistribution buffers based on the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and the preset related parameter;
and the reallocation unit is used for notifying and calling a release memory function of the open multimedia acceleration layer OpenMax based on the number of the reallocated buffer areas, releasing the initially allocated buffer areas, calling an allocation memory function of the open multimedia acceleration layer OpenMax and reallocating the buffer areas.
Preferably, the apparatus further comprises: and the updating module is used for updating the buffer allocation parameters based on the number of the re-allocated buffers.
In the technical scheme of the invention, when the decoding of the multimedia information is monitored to be completed, whether a buffer area needs to be reallocated is judged based on the multimedia parameters obtained according to the decoded data so as to cache the decoded data; when the buffer area needs to be reallocated, determining the reallocated buffer area based on the multimedia parameters; buffering the decoded data into a reallocated buffer; therefore, the purpose of dynamically adjusting the preset buffer area based on the multimedia parameters of the multimedia information to be played is achieved, the smooth playing of the multimedia information to be played is met, the situation of jamming or errors in the playing of the multimedia information to be played is avoided, meanwhile, the occupation of redundant system memory can be reduced, the system operation performance of the playing equipment and the operation of other applications are prevented from being influenced, and the use experience of a user is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flowchart illustrating a method for adjusting a multimedia decoding information buffer according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating interaction information between a hardware vendor decoding library and an open multimedia acceleration layer according to a preferred embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for adjusting a multimedia decoding information buffer according to another embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
FIG. 1 is a flowchart illustrating a method for adjusting a multimedia decoding information buffer according to an embodiment of the present invention.
It should be noted that the execution subject of the present embodiment is a hardware vendor decoding library. The hardware manufacturer decoding library is a set of packaged program interfaces provided by embedded equipment core chip manufacturers, and can complete the coding and decoding of multimedia information, such as the coding and decoding of audio, video and the like, and allocate and release a buffer area for caching the decoding data of the multimedia information; and the hardware vendor decoding library can also communicate with the gst-omx module.
Step S101: when the decoding of the multimedia information is monitored to be completed, judging whether a buffer area needs to be reallocated or not based on the multimedia parameters obtained according to the decoded data so as to cache the decoded data; step S102: when the buffer area needs to be reallocated, determining the reallocated buffer area based on the multimedia parameters; step S103: the decoded data is buffered in the reallocated buffer.
In the technical scheme of the invention, when the decoding of the multimedia information is monitored to be completed, whether a buffer area needs to be reallocated is judged based on the multimedia parameters obtained according to the decoded data so as to cache the decoded data; when the buffer area needs to be reallocated, determining the reallocated buffer area based on the multimedia parameters; buffering the decoded data into a reallocated buffer; therefore, the purpose of dynamically adjusting the preset buffer area based on the multimedia parameters of the multimedia information to be played is achieved, the smooth playing of the multimedia information to be played is met, the situation of jamming or errors in the playing of the multimedia information to be played is avoided, meanwhile, the occupation of redundant system memory can be reduced, the system operation performance of the playing equipment and the operation of other applications are prevented from being influenced, and the use experience of a user is improved.
The following further explains the specific implementation of each step:
step S101: when the decoding of the multimedia information is monitored to be completed, whether a buffer area needs to be reallocated or not is judged based on the multimedia parameters obtained according to the decoded data so as to cache the decoded data.
Among them, the multimedia information includes but is not limited to: video information, audio information.
The multimedia parameters comprise the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and preset related parameters; the preset related parameters comprise the number of the output-avoiding pause buffers, the number of the reconstruction frames and the number of the reserved buffers of the SurfaceFlinger component.
Specifically, before the step of decoding the multimedia information, the method further comprises: an initial capacity of the allocation buffer is initialized based on the buffer allocation parameter.
Wherein, the buffer allocation parameter is the buffer allocation number.
Specifically, the step of determining whether the buffer needs to be reallocated based on the multimedia parameters comprises: and judging whether the buffer area needs to be reallocated or not based on the comparison result of the multimedia parameters and the initial capacity of the initial allocation buffer area.
Wherein, when the comparison result satisfies any one of the following conditions, the buffer needs to be reallocated: the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is smaller than the calculation result of the multimedia parameters which is obtained through calculation based on the preset operation mode; or the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is larger than the calculation result obtained by calculating the multimedia parameters based on the preset operation mode, and the difference value of the two is larger than the first threshold value. The first threshold value may be set to 1 or 2.
For example, the hardware manufacturer decoding library initializes the initial capacity of the allocated buffer to be the buffer capacity of 15 buffers based on the buffer allocation number "15", and each buffer is preset with a capacity, such as 4M; decoding the video information by a hardware manufacturer decoding library; as shown in fig. 2, when the hardware manufacturer decoding library detects that the decoding of the video information is completed, the decoding data of the video information is buffered according to the number of reference frames of the video information obtained or extracted from the decoding data of the video information and the indication parameter value of whether the video information has a B frame, and the preset related parameters, for example, the number of reference frames of the video information is "2", the indication parameter value of whether the video information has a B frame is "1", and the value of the preset related parameter is "6", and the number of required allocated buffers is obtained according to the following formula 1):
equation 1) number of buffers to be allocated
=info->numRefFrames+info->has_b_frames+1+1+4
Wherein info- > numRefFrames is the number of reference frames of the video information, has _ B _ frames is an indication parameter of whether the video information has B frames, the first "1" is the number of output pause buffers to avoid outputting, the second "1" is the number of reconstructed frames, and "4" is the number of reserved buffers of the surface flag component.
The calculation of the above equation 1) can determine that 9 buffers are required to be allocated to buffer the decoded data of the video information; then, comparing the number 15 of the buffers corresponding to the initial capacity of the buffer to be initially allocated with the number 9 of the buffers corresponding to the capacity of the buffer to be allocated, and obtaining a comparison result that the number 15 of the buffers corresponding to the initial capacity of the buffer to be initially allocated is greater than a calculation result obtained by calculating the multimedia parameter based on a predetermined operation mode, namely a calculation result "9" obtained by the above formula 1), and a difference value "6" between the two is greater than a first threshold value "1" or "2". The buffer needs to be reallocated to buffer the decoded data of the video information.
It should be noted that, when the video information has a B frame, the indicated parameter value of whether the video information has a B frame is 1; when the video information has no B frame, the value of the indicating parameter for judging whether the video information has the B frame is 0. And the number of output pause buffer areas is preset to be 1, the number of reconstruction frames is preset to be 1, and the number of reserved buffer areas of the surface flag component is preset to be 4.
Step S102: when it is determined that the buffer needs to be reallocated, the reallocated buffer is determined based on the multimedia parameters.
Specifically, the step of determining the re-allocation buffer based on the multimedia parameters comprises: determining the number of the redistribution buffer areas based on the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and a preset related parameter; based on the number of the re-allocated buffers, notifying and calling a release memory function of the open multimedia acceleration layer OpenMax, releasing the initially allocated buffers, calling an allocation memory function of the open multimedia acceleration layer OpenMax, and re-allocating the buffers.
For example, as shown in fig. 2, when the hardware manufacturer decoding library determines that the buffer needs to be reallocated, the hardware manufacturer decoding library buffers the decoded data of the video information according to the number of reference frames of the video information obtained or extracted from the decoded data of the video information, the value of the indication parameter indicating whether the video information has B frames, and the preset related parameters, for example, the number of reference frames based on the video information is "2", the value of the indication parameter indicating whether the video information has B frames is "1", and the value of the preset related parameter is "6", and obtains the number of buffers that need to be allocated based on the following formula 2):
formula 2)
The number of reallocated buffers ═ info- > numRefFrames + info- > has _ b _ frames +1+1+4
Wherein info- > numRefFrames is the number of reference frames of the video information, has _ B _ frames is an indication parameter of whether the video information has B frames, the first "1" is the number of output pause buffers to avoid outputting, the second "1" is the number of reconstructed frames, and "4" is the number of reserved buffers of the surface flag component.
The calculation of the above equation 2) can determine that 9 buffers are allocated again to buffer the decoded data of the video information; the hardware manufacturer decoding library sends notification information to a plug-in gst-OMX module in a Gstreamer based on the number of the reallocated buffers being '9', the gst-OMX module is notified that the buffer is reallocated and the number of the reallocated buffers is 9, the gst-OMX module confirms the notification information after receiving the notification information sent by the hardware manufacturer decoding library, and calls a release memory function OMX _ FreeBuffer of an open multimedia acceleration layer OpenMax, releases 15 buffers initially allocated, and then calls an allocation memory function OMX _ AllocateBuffer of the open multimedia acceleration layer OpenMax to reallocate 9 buffers.
Step S103: the decoded data is buffered in the reallocated buffer.
Specifically, after the gst-omx module reallocates the buffer, the decoded data of the multimedia information, such as the decoded data of the video information, is buffered in the reallocated buffer.
Specifically, the method further comprises: the buffer allocation parameter is updated based on the number of reallocated buffers.
For example, as shown in fig. 2, after finishing buffering the decoded data of the video information into the reallocated buffer, the gst-omx module sends notification information to the hardware vendor decoding library to notify the hardware vendor decoding library that the allocated number of the buffer has been modified, and modifies the allocated number of the buffer to 9; after receiving the notification message sent by the gst-omx module, the hardware vendor decoding library confirms that the buffer has been reallocated and updates the allocated number of the buffer.
FIG. 3 is a block diagram of an apparatus for adjusting a multimedia decoding information buffer according to another embodiment of the present invention.
The monitoring module is used for judging whether a buffer area needs to be reallocated or not to cache the decoded data based on the multimedia parameters obtained according to the decoded data when the decoding of the multimedia information is completed; the allocation module determines the re-allocation buffer area based on the multimedia parameters when judging that the buffer area needs to be re-allocated; and the buffer module is used for buffering the decoded data into the redistributed buffer area.
The following further explains the specific implementation of each module:
and the monitoring module is used for judging whether a buffer area needs to be reallocated or not to cache the decoded data based on the multimedia parameters acquired according to the decoded data when the decoding of the multimedia information is completed.
Among them, the multimedia information includes but is not limited to: video information, audio information.
The multimedia parameters comprise the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and preset related parameters; the preset related parameters comprise the number of the output-avoiding pause buffers, the number of the reconstruction frames and the number of the reserved buffers of the SurfaceFlinger component.
Specifically, the apparatus further comprises: and the initialization module initializes the initial capacity of the allocated buffer area based on the buffer area allocation parameter.
Wherein, the buffer allocation parameter is the buffer allocation number.
Specifically, the monitoring module judges whether the buffer needs to be reallocated based on the comparison result of the multimedia parameter and the initial capacity of the initial allocation buffer.
Wherein, when the comparison result satisfies any one of the following conditions, the buffer needs to be reallocated: the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is smaller than the calculation result of the multimedia parameters which is obtained through calculation based on the preset operation mode; or the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is larger than the calculation result obtained by calculating the multimedia parameters based on the preset operation mode, and the difference value of the two is larger than the first threshold value. The first threshold value may be set to 1 or 2.
For example, the initialization module initializes the initial capacity of the allocated buffer to be the buffer capacity of 15 buffers based on the buffer allocation number "15", and each buffer is preset with a capacity, such as 4M; decoding the video information by a hardware manufacturer decoding library; when the monitoring module monitors that the decoding of the video information is completed, buffering the decoded data of the video information according to the number of reference frames of the video information and the indicating parameter value of whether the video information has a B frame, which are obtained or extracted from the decoded data of the video information, and preset related parameters, for example, the number of reference frames of the video information is "2", the indicating parameter value of whether the video information has a B frame is "1", and the value of the preset related parameter is "6", and the number of required allocated buffers is obtained based on the following formula 1):
formula 1)
The number of buffers required to be allocated is info- > numRefFrames + info- > has _ b _ frames +1+1+4
Wherein info- > numRefFrames is the number of reference frames of the video information, has _ B _ frames is an indication parameter of whether the video information has B frames, the first "1" is the number of output pause buffers to avoid outputting, the second "1" is the number of reconstructed frames, and "4" is the number of reserved buffers of the surface flag component.
The calculation of the above equation 1) can determine that 9 buffers are required to be allocated to buffer the decoded data of the video information; then, the monitoring module compares the number of the buffer areas corresponding to the initial capacity of the buffer area to be initially allocated, namely 15, of the buffer areas corresponding to the initial capacity of the buffer area to be initially allocated, with the number of the buffer areas corresponding to the capacity of the buffer area to be allocated, and obtains a comparison result that the number of the buffer areas corresponding to the initial capacity of the buffer area to be initially allocated is greater than a calculation result obtained by calculating the multimedia parameter based on a predetermined operation mode, namely the calculation result obtained by the formula 1) is "9", and a difference value "6" between the two is greater than a first threshold value "1" or "2". The buffer needs to be reallocated to buffer the decoded data of the video information.
It should be noted that, when the video information has a B frame, the indicated parameter value of whether the video information has a B frame is 1; when the video information has no B frame, the value of the indicating parameter for judging whether the video information has the B frame is 0. And the number of output pause buffer areas is preset to be 1, the number of reconstruction frames is preset to be 1, and the number of reserved buffer areas of the surface flag component is preset to be 4. And the allocation module determines the re-allocation buffer area based on the multimedia parameters when judging that the buffer area needs to be re-allocated.
Specifically, the buffer module includes: the determining unit is used for determining the number of the redistribution buffers based on the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and the preset related parameters; and the reallocation unit is used for notifying and calling a release memory function of the open multimedia acceleration layer OpenMax based on the number of the reallocated buffer areas, releasing the initially allocated buffer areas, calling an allocation memory function of the open multimedia acceleration layer OpenMax and reallocating the buffer areas.
For example, when the monitoring module determines that buffer reallocation is required, the determining unit buffers the decoded data of the video information according to the number of reference frames of the video information obtained or extracted from the decoded data of the video information and the value of an indication parameter of whether the video information has a B frame, and preset related parameters, for example, based on the number of reference frames of the video information being "2", the value of an indication parameter of whether the video information has a B frame being "1", and the value of a preset related parameter being "6", and derives the number of buffer reallocation required based on the following formula 2):
formula 2)
The number of reallocated buffers ═ info- > numRefFrames + info- > has _ b _ frames +1+1+4
Wherein info- > numRefFrames is the number of reference frames of the video information, has _ B _ frames is an indication parameter of whether the video information has B frames, the first "1" is the number of output pause buffers to avoid outputting, the second "1" is the number of reconstructed frames, and "4" is the number of reserved buffers of the surface flag component.
The calculation of the above equation 2) can determine that 9 buffers are allocated again to buffer the decoded data of the video information; the reallocation unit sends notification information to a plug-in gst-OMX module in the Gstreamer based on the number of the reallocation buffers being "9", the gst-OMX module is notified that the number of the reallocation buffers is 9, after receiving the notification information sent by the reallocation unit, the gst-OMX module confirms the notification information, calls a release memory function OMX _ FreeBuffer of an open multimedia acceleration layer OpenMax, releases 15 buffers initially allocated, and calls an allocation memory function OMX _ AllocateBuffer of the open multimedia acceleration layer OpenMax to reallocate 9 buffers.
And the buffer module is used for buffering the decoded data into the redistributed buffer area.
Specifically, after the gst-omx module reallocates the buffer, the buffer module buffers the decoded data of the multimedia information, such as the decoded data of the video information, into the reallocated buffer.
Specifically, the apparatus further comprises: and the updating module updates the buffer allocation parameters based on the number of the re-allocated buffers.
For example, after finishing caching the decoded data of the video information into the reallocated buffer, the gst-omx module sends notification information to the hardware manufacturer decoding library, notifies the hardware manufacturer that the allocated number of the buffer in the decoding library has been modified, and modifies the allocated number of the buffer into 9; after receiving the notification message sent by the gst-omx module, the hardware vendor decoding library confirms that the buffer has been reallocated, and updates the allocated number of the buffer through the updating module.
Those skilled in the art will appreciate that the present invention includes apparatus directed to performing one or more of the operations described in the present application. These devices may be specially designed and manufactured for the required purposes, or they may comprise known devices in general-purpose computers. These devices have stored therein computer programs that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium, including, but not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magnetic-optical disks, ROMs (Read-Only memories), RAMs (Random Access memories), EPROMs (Erasable programmable Read-Only memories), EEPROMs (Electrically Erasable programmable Read-Only memories), flash memories, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a bus. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer).
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the features specified in the block or blocks of the block diagrams and/or flowchart illustrations of the present disclosure.
Those of skill in the art will appreciate that various operations, methods, steps in the processes, acts, or solutions discussed in the present application may be alternated, modified, combined, or deleted. Further, various operations, methods, steps in the flows, which have been discussed in the present application, may be interchanged, modified, rearranged, decomposed, combined, or eliminated. Further, steps, measures, schemes in the various operations, methods, procedures disclosed in the prior art and the present invention can also be alternated, changed, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (7)

1. A method for adjusting a multimedia decoding information buffer, comprising:
when the decoding of the multimedia information is monitored to be completed, judging whether a buffer area needs to be reallocated or not based on multimedia parameters obtained according to the decoded data so as to cache the decoded data;
when the buffer area needs to be reallocated, determining the reallocated buffer area based on the multimedia parameters;
buffering the decoded data into a reallocated buffer;
the multimedia parameters comprise the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and preset related parameters;
when the step of determining the reallocated buffer based on the multimedia parameters comprises:
determining the number of the redistribution buffer areas based on the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame and a preset related parameter;
based on the number of the re-allocated buffer areas, notifying and calling a release memory function of an open multimedia acceleration layer OpenMax, releasing the initially allocated buffer areas, calling an allocation memory function of the open multimedia acceleration layer OpenMax, and re-allocating the buffer areas;
the preset relevant parameters comprise the number of output pause buffer areas, the number of reconstruction frames and the number of reserved buffer areas of the surface flag component.
2. The method of claim 1, wherein the step of decoding the multimedia information is preceded by:
initializing an initial capacity of an allocation buffer based on a buffer allocation parameter;
wherein, the step of determining whether the buffer needs to be reallocated based on the multimedia parameters comprises:
and judging whether the buffer area needs to be reallocated or not based on the comparison result of the multimedia parameter and the initial capacity of the initial allocation buffer area.
3. The method of claim 2, wherein the buffer needs to be reallocated is determined when the comparison result satisfies any one of:
the comparison result is a calculation result obtained by calculating the multimedia parameters based on a preset operation mode, wherein the number of the buffer areas corresponding to the initial capacity of the buffer areas subjected to the initial allocation is smaller than that of the multimedia parameters; or,
the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is larger than the calculation result of the multimedia parameters which is obtained through calculation based on the preset operation mode, and the difference value of the two is larger than a first threshold value.
4. The method of claim 2, further comprising:
updating the buffer allocation parameter based on the number of reallocated buffers.
5. An apparatus for adjusting a multimedia decoding information buffer, comprising:
the monitoring module is used for judging whether a buffer area needs to be reallocated or not based on multimedia parameters obtained according to the decoding data to cache the decoding data when the decoding of the multimedia information is monitored to be completed;
the allocation module is used for determining the reallocated buffer area based on the multimedia parameters when the buffer area needs to be reallocated;
the buffer module is used for buffering the decoding data into a redistributed buffer area;
the multimedia parameters comprise the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and preset related parameters;
the distribution module includes:
the determining unit is used for determining the number of the redistribution buffers based on the number of reference frames of the multimedia information, the indication parameter value of whether the multimedia information has a B frame or not and the preset related parameter;
the reallocation unit is used for notifying and calling a release memory function of the open multimedia acceleration layer OpenMax based on the number of the reallocation buffer areas, releasing the initially allocated buffer areas, calling an allocation memory function of the open multimedia acceleration layer OpenMax and reallocating the buffer areas;
the preset relevant parameters comprise the number of output pause buffer areas, the number of reconstruction frames and the number of reserved buffer areas of the surface flag component.
6. The apparatus of claim 5, further comprising: the initialization module is used for initializing the initial capacity of the allocated buffer area based on the buffer area allocation parameter;
the monitoring module is configured to determine whether to reallocate a buffer area based on a comparison result between the multimedia parameter and the initial capacity of the initial allocation buffer area.
7. The apparatus of claim 6, wherein the buffer needs to be reallocated is determined when the comparison result satisfies any one of:
the comparison result is a calculation result obtained by calculating the multimedia parameters based on a preset operation mode, wherein the number of the buffer areas corresponding to the initial capacity of the buffer areas subjected to the initial allocation is smaller than that of the multimedia parameters; or,
the comparison result is that the number of the buffer areas corresponding to the initial capacity of the buffer areas which are initially allocated is larger than the calculation result of the multimedia parameters which is obtained through calculation based on the preset operation mode, and the difference value of the two is larger than a first threshold value.
CN201710252385.4A 2017-04-18 2017-04-18 Method and device for adjusting multimedia decoding information buffer zone Active CN106993220B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710252385.4A CN106993220B (en) 2017-04-18 2017-04-18 Method and device for adjusting multimedia decoding information buffer zone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710252385.4A CN106993220B (en) 2017-04-18 2017-04-18 Method and device for adjusting multimedia decoding information buffer zone

Publications (2)

Publication Number Publication Date
CN106993220A CN106993220A (en) 2017-07-28
CN106993220B true CN106993220B (en) 2020-05-01

Family

ID=59416210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710252385.4A Active CN106993220B (en) 2017-04-18 2017-04-18 Method and device for adjusting multimedia decoding information buffer zone

Country Status (1)

Country Link
CN (1) CN106993220B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI819455B (en) * 2021-08-30 2023-10-21 瑞昱半導體股份有限公司 System and method for processing video

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109725951A (en) * 2018-12-29 2019-05-07 上海掌门科技有限公司 Control method, system, electronic equipment and computer-readable medium
CN110740374B (en) * 2019-10-31 2022-03-11 广州市网星信息技术有限公司 Multimedia data processing method and device, computer equipment and storage medium
CN111182309B (en) * 2019-12-31 2022-09-20 深圳市瑞讯云技术有限公司 Video decoding processing method and device
CN111736796A (en) * 2020-05-15 2020-10-02 深圳市战音科技有限公司 Real-time stream data processing method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013109356A (en) * 2012-12-20 2013-06-06 Japan Radio Co Ltd Image display driving device and image display system
CN104159079A (en) * 2014-08-13 2014-11-19 上海航天电子通讯设备研究所 Image real-time decoding display method
CN106528303A (en) * 2016-10-20 2017-03-22 武汉斗鱼网络科技有限公司 GPU texture sharing-based method and system for obtaining source images of D3D12 game

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013109356A (en) * 2012-12-20 2013-06-06 Japan Radio Co Ltd Image display driving device and image display system
CN104159079A (en) * 2014-08-13 2014-11-19 上海航天电子通讯设备研究所 Image real-time decoding display method
CN106528303A (en) * 2016-10-20 2017-03-22 武汉斗鱼网络科技有限公司 GPU texture sharing-based method and system for obtaining source images of D3D12 game

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI819455B (en) * 2021-08-30 2023-10-21 瑞昱半導體股份有限公司 System and method for processing video

Also Published As

Publication number Publication date
CN106993220A (en) 2017-07-28

Similar Documents

Publication Publication Date Title
CN106993220B (en) Method and device for adjusting multimedia decoding information buffer zone
KR100289627B1 (en) Resource management method and apparatus for information processing system having multitasking function
KR101034080B1 (en) Uniform video decoding and display
US10114740B2 (en) Memory management techniques
EP3008602B1 (en) Page-based compressed storage management
CN102932324B (en) Support reduce the network bandwidth use across the progressive damage of frame
CN106131550B (en) Method and device for playing multimedia file
US9916199B2 (en) Method and apparatus for an error tolerance aware data retention scheme in a storage device for multi-scale error tolerant data
KR20160132432A (en) Dynamic resource management for multi-process applications
KR101812300B1 (en) Allocation of memory buffers in computing system with multiple memory channels
CN109376053B (en) Data processing method and device and mobile terminal
US20160306738A1 (en) Reducing Memory Commit Charge When Compressing Memory
US20160124667A1 (en) Method and apparatus for storing image
JP2015517159A (en) Method for controlling the use of hardware resources in a computer system, system and piece of code method
CN107220063B (en) Dynamic wallpaper generation method and device
WO2017222739A1 (en) Selective flash memory compression/decompression using a storage usage collar
CN111367677A (en) Cluster resource allocation method and system
US20210034509A1 (en) Electronic apparatus and controlling method thereof
CN102473136A (en) Memory management device, memory management method, memory management program, computer-readable recording medium storing the memory management program and integrated circuit
CN114327564A (en) Method, system, device and medium for solving multi-layer nested array data response
CA2878759C (en) Methods and systems for providing software applications
CN105988871B (en) Remote memory allocation method, device and system
US10387330B1 (en) Less recently and frequently used (LRAFU) cache replacement policy
CN107077420B (en) Overlay Erase Block mapping
CN110119313B (en) Image processing method and image processing apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210201

Address after: 101300 room 153, 1 / F, building 17, 16 Caixiang East Road, Nancai Town, Shunyi District, Beijing

Patentee after: Yuanxin Information Technology Group Co.,Ltd.

Address before: 100176 room 2222, building D, building 33, 99 Kechuang 14th Street, Beijing Economic and Technological Development Zone, Beijing

Patentee before: BEIJING YUANXIN SCIENCE & TECHNOLOGY Co.,Ltd.

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20170728

Assignee: Beijing Yuanxin Junsheng Technology Co.,Ltd.

Assignor: Yuanxin Information Technology Group Co.,Ltd.

Contract record no.: X2021110000018

Denomination of invention: Method and device for adjusting multimedia decoding information buffer

Granted publication date: 20200501

License type: Common License

Record date: 20210531