CN112822494A - Double-buffer coding system and control method thereof - Google Patents
Double-buffer coding system and control method thereof Download PDFInfo
- Publication number
- CN112822494A CN112822494A CN202011610557.9A CN202011610557A CN112822494A CN 112822494 A CN112822494 A CN 112822494A CN 202011610557 A CN202011610557 A CN 202011610557A CN 112822494 A CN112822494 A CN 112822494A
- Authority
- CN
- China
- Prior art keywords
- module
- buffer
- production
- consumption
- queue corresponding
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000004519 manufacturing process Methods 0.000 claims abstract description 152
- 238000004590 computer program Methods 0.000 claims description 11
- 238000010586 diagram Methods 0.000 description 10
- 230000003139 buffering effect Effects 0.000 description 6
- 238000012986 modification Methods 0.000 description 6
- 230000004048 modification Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 230000004075 alteration Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/40—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
- H04N19/423—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a double-buffer coding system and a control method, a medium and equipment thereof, wherein the double-buffer coding system comprises: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; when the queue corresponding to the buffer module connected with the production module reaches a threshold value and the queue corresponding to the buffer module connected with the consumption module is empty, the production module and the consumption module exchange the buffer modules connected with each other; the method can complete the transcoding of the video through the multiple threads without locking, improve the video transcoding efficiency and reduce the waiting time of users.
Description
Technical Field
The present invention relates to the field of video transcoding technologies, and in particular, to a double-buffer encoding system, a control method of the double-buffer encoding system, a computer-readable storage medium, and a computer device.
Background
In the process of video transcoding, in order to improve transcoding efficiency, a multithreading technology is often adopted, wherein one production thread is used for producing uncompressed frames, and one consumption thread is used for consuming, and the uncompressed frames obtained by production are compressed into a file.
In the related art, only one buffer is provided between two threads for storing data communicated between the two threads. In order to avoid asynchronous problems caused by multi-thread communication, locking operation is often performed on reading and writing of data to ensure atomicity of the data; however, this approach inevitably requires locking or unlocking operations at each read and write, which is very performance-consuming, reduces transcoding efficiency, and increases user latency.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an object of the present invention is to provide a double-buffer encoding system, which can complete video transcoding through multiple threads without locking, thereby improving video transcoding efficiency and reducing user latency.
The second objective of the present invention is to provide a control method for a double-buffer coding system.
A third object of the invention is to propose a computer-readable storage medium.
A fourth object of the invention is to propose a computer device.
In order to achieve the above object, a first embodiment of the present invention provides a double-buffer coding system, including: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; when the queue corresponding to the buffer module connected with the production module reaches the threshold value and the queue corresponding to the buffer module connected with the consumption module is empty, the production module and the consumption module exchange the buffer modules connected with each other.
The double-buffer coding system according to the embodiment of the invention comprises: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; when the queue corresponding to the buffer module connected with the production module reaches a threshold value and the queue corresponding to the buffer module connected with the consumption module is empty, the production module and the consumption module exchange the buffer modules connected with each other; therefore, the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
In addition, the double-buffer coding system proposed according to the above embodiment of the present invention may further have the following additional technical features:
optionally, the production module is configured to perform production to obtain production data, and store the production data in a buffer module connected to the production module; when the queue corresponding to the buffer module connected with the production module reaches a threshold value, the production module acquires queue information corresponding to the buffer module connected with the consumption module, and judges whether the queue corresponding to the buffer module connected with the consumption module is empty or not according to the queue information; if so, the production module and the consumption module exchange respectively connected buffer modules; and if not, the production module enters a waiting state until the queue corresponding to the buffer module connected with the consumption module is empty.
Optionally, the consumption module is configured to consume the production data stored in the buffer module connected thereto; when the queue corresponding to the buffer module connected with the consumption module is empty, the consumption module acquires queue information corresponding to the buffer module connected with the production module, and judges whether the queue corresponding to the buffer module connected with the production module reaches a threshold value according to the queue information; if so, the production module and the consumption module exchange respectively connected buffer modules; if not, the consumption module enters a waiting state until the queue corresponding to the buffer module connected with the production module reaches a threshold value.
In order to achieve the above object, a second embodiment of the present invention provides a method for controlling a double-buffer coding system, where the double-buffer coding system includes: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; the control method comprises the following steps: and judging whether the queue corresponding to the buffer module connected with the production module reaches a threshold value or not, and if so, interchanging the buffer modules respectively connected with the production module and the consumption module, wherein the queue corresponding to the buffer module connected with the consumption module is empty.
According to the control method of the double-buffer coding system of the embodiment of the invention, the double-buffer coding system comprises the following steps: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; the control method comprises the following steps: judging whether a queue corresponding to a buffer module connected with the production module reaches a threshold value or not, and if so, interchanging the buffer modules respectively connected with the production module and the consumption module; therefore, the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
In addition, the control method of the double-buffer coding system proposed by the above embodiment of the present invention may further have the following additional technical features:
optionally, determining whether a queue corresponding to a buffering module connected to the production module reaches a threshold, and a queue corresponding to a buffering module connected to the consumption module is empty, and interchanging the buffering modules respectively connected to the production module and the consumption module when the determination result is yes, includes: in the encoding process, the production module judges whether a queue corresponding to a buffer module connected with the production module reaches a threshold value; if not, continuing production, and storing production data obtained by production into the buffer module; if so, acquiring queue information corresponding to the buffer module connected with the consumption module, and judging whether the queue corresponding to the buffer module connected with the consumption module is empty or not according to the queue information; if so, the production module and the consumption module exchange respectively connected buffer modules; and if not, the production module enters a waiting state until the queue corresponding to the buffer module connected with the consumption module is empty.
Optionally, determining whether a queue corresponding to a buffering module connected to the production module reaches a threshold, and a queue corresponding to a buffering module connected to the consumption module is empty, and interchanging the buffering modules respectively connected to the production module and the consumption module when the determination result is yes, includes: in the encoding process, the consumption module judges whether a queue corresponding to a buffer module connected with the consumption module is empty; if not, continuing to consume the production data flushed by the buffer module; if so, acquiring queue information corresponding to the buffer module connected with the production module, and judging whether the queue corresponding to the buffer module connected with the production module reaches a threshold value according to the queue information; if so, the production module and the consumption module exchange respectively connected buffer modules; if not, the consumption module enters a waiting state until the queue corresponding to the buffer module connected with the production module reaches a threshold value.
In order to achieve the above object, a third embodiment of the present invention provides a computer-readable storage medium, on which a control program of a double-buffer coding system is stored, which when executed by a processor implements a control method of the double-buffer coding system as described above.
According to the computer readable storage medium of the embodiment of the invention, the control program of the double-buffer coding system is stored, so that when the processor executes the control program of the double-buffer coding system, the control method of the double-buffer coding system is realized, and the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
In order to achieve the above object, a fourth aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the control method of the double-buffer coding system as described above when executing the program.
According to the computer equipment provided by the embodiment of the invention, the control program of the double-buffer coding system is stored through the memory, so that the processor can realize the control method of the double-buffer coding system when executing the control program of the double-buffer coding system, and the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
Drawings
FIG. 1 is a block diagram of a double-buffer encoding system according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of data production by a production module according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of consuming generated data by the consuming module according to an 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 and intended to be illustrative of the invention and are not to be construed as limiting the invention.
In the related art, in the process of video transcoding through multiple threads, locking or unlocking operation is inevitably required during each reading and writing, so that the performance is greatly consumed, the transcoding efficiency is reduced, and the waiting time of a user is increased; the double-buffer coding system according to the embodiment of the invention comprises: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; when the queue corresponding to the buffer module connected with the production module reaches a threshold value and the queue corresponding to the buffer module connected with the consumption module is empty, the production module and the consumption module exchange the buffer modules connected with each other; therefore, the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a block schematic diagram of a double-buffer encoding system according to an embodiment of the present invention, as shown in fig. 1, which includes a production module 10, a consumption module 20, and two buffer modules 30.
Wherein the production module 10 and the consumption module 20 are respectively connected with one of the two buffer modules 30;
when the queue corresponding to the buffer module 30 connected to the production module 10 has reached the threshold value and the queue corresponding to the buffer module 30 connected to the consumption module 20 is empty, the production module 10 and the consumption module 20 exchange the buffer modules 30 respectively connected thereto.
That is, during the transcoding process, the production module 10 and the consumption module 20 are respectively connected to a buffer module 30; the buffer module 30 is connected with the production module 10 and used for storing production data produced by the production module 10; when the queue corresponding to the buffer module 30 connected to the production module 10 has reached the threshold value and the queue corresponding to the buffer module 30 connected to the consumption module 20 is empty, the production module 10 and the consumption module 20 exchange the buffer modules 30 connected to each other; after the exchange, the production module 10 may store the production data obtained by its own production through the empty buffer module 30, and the consumption module 20 may acquire the production data stored in the buffer module 30 connected to itself for consumption, in the encoding process, the locking and unlocking operations are not required, and the encoding process does not have an asynchronous problem; the transcoding efficiency can be greatly improved.
In some embodiments, the production module 10 is configured to perform production to obtain production data and store the production data in the buffer module 30 connected thereto; when the queue corresponding to the buffer module 30 connected to the production module 10 has reached the threshold, the production module 10 obtains the queue information corresponding to the buffer module 30 connected to the consumption module 20, and determines whether the queue corresponding to the buffer module 30 connected to the consumption module 20 is empty according to the queue information; if so, the production module 10 and the consumption module 20 interchange the respectively connected buffer modules 30; if not, the production module 10 enters a wait state until the queue corresponding to the buffer module 30 connected to the consumption module 20 is empty.
In some embodiments, the consumption module 20 is used to consume the production data 10 stored in the buffer module 30 connected thereto; when the queue corresponding to the buffer module 30 connected to the consumption module 20 is empty, the consumption module 20 obtains queue information corresponding to the buffer module 30 connected to the production module 10, and judges whether the queue corresponding to the buffer module 30 connected to the production module 10 has reached a threshold value according to the queue information; if so, the production module 10 and the consumption module 20 interchange the respectively connected buffer modules 30; if not, the consuming module 20 enters a wait state until the queue corresponding to the buffer module 30 to which the producing module 10 is connected has reached the threshold.
That is, the threads of the production module 10 and the threads of the consumption module 20 are independent of each other.
As an example, in the encoding process, whether the interchange condition of the buffer module 30 is reached may be judged by the production module 10; that is, the consuming module 20 enters a waiting state when its corresponding buffer module 30 is empty; when the queue corresponding to the buffer module 30 connected to the production module 10 reaches the threshold, the production module 10 acquires the queue information corresponding to the buffer module 30 connected to the consumption module 20 to determine whether the buffer module 30 is empty; in other words, whether or not the buffer module 30 interchange is possible is entirely determined by the production module 10.
As another example, in the encoding process, whether the interchange condition of the buffer module 30 is reached may be judged by the consumption module 20; that is, the production module 10 enters a waiting state when the queue corresponding to the buffer module 30 connected thereto reaches a threshold; the consuming module 20 obtains the queue information corresponding to the buffer module 30 connected to the producing module 10 only when the queue corresponding to the buffer module 30 connected to the consuming module is empty, so as to determine whether the interchange condition is met; in other words, whether or not the buffer module 30 interchange is possible is entirely determined by the consumption module 20.
As yet another example, both threads may make a determination of whether the interchange condition is reached; that is, when the queue corresponding to the buffer module 30 connected to the production module 10 reaches the threshold, it is determined whether the buffer module 30 connected to the consumption module 20 is empty; when the buffer module 30 connected to the consuming module 20 is empty, it is determined whether the queue corresponding to the buffer module 30 connected to the producing module 10 has reached the threshold.
It should be noted that there may be various ways to set the threshold of the queue corresponding to the buffer module 30 connected to the production module 10. For example, whether the queue has reached a threshold; alternatively, the amount of data in the queue may reach 60%. When the buffer module 30 connected to the production module 10 stores the ending identifier, the queue is considered to have reached the threshold.
In summary, the double-buffer coding system according to the embodiment of the present invention includes: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; when the queue corresponding to the buffer module connected with the production module reaches a threshold value and the queue corresponding to the buffer module connected with the consumption module is empty, the production module and the consumption module exchange the buffer modules connected with each other; therefore, the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
In order to achieve the above embodiments, an embodiment of the present invention further provides a control method for a double-buffer coding system, where the double-buffer coding system includes: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; the control method comprises the following steps:
and judging whether the queue corresponding to the buffer module connected with the production module reaches the threshold value or not, and if so, interchanging the buffer modules respectively connected with the production module and the consumption module.
In some embodiments, as shown in FIG. 2, the process of the production data by the production module includes:
and S101, the production module produces data and stores the produced data into the connected buffer module.
S102, judging whether a queue corresponding to a buffer module connected with the self reaches a threshold value; if not, returning to the step S101; if so, step S103 is performed.
S103, acquiring queue information corresponding to the buffer module connected with the consumption module.
S104, judging whether the queue corresponding to the buffer module connected with the consumption module is empty or not according to the queue information; if yes, executing step S105; if not, step S106 is performed.
S105, exchanging the buffer modules connected with the production module and the consumption module respectively; the process returns to step S101.
S106, the production module enters a waiting state and executes the step S104.
In some embodiments, as shown in FIG. 3, the process of consuming production data by the consumption module includes:
s201, the consumption module acquires production data stored in a buffer module connected with the consumption module.
S202, the consumption module judges whether a queue corresponding to a buffer module connected with the consumption module is empty; if not, returning to the step S201; if so, step S203 is performed.
And S203, acquiring queue information corresponding to the buffer module connected with the production module.
S204, judging whether the queue corresponding to the buffer module connected with the production module reaches a threshold value according to the queue information; if yes, go to step S205; if not, step S206 is performed.
S205, the production module and the consumption module exchange the buffer modules which are respectively connected, and the step S201 is returned.
S206, the consumption module enters a waiting state and executes the step S204.
It should be noted that the above description about the double-buffer coding system in fig. 1 is also applicable to the control method of the double-buffer coding system, and is not repeated herein.
In summary, according to the control method of the double-buffer coding system in the embodiment of the present invention, the double-buffer coding system includes: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; the control method comprises the following steps: judging whether a queue corresponding to a buffer module connected with the production module reaches a threshold value or not, and if so, interchanging the buffer modules respectively connected with the production module and the consumption module; therefore, the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
In order to implement the above embodiments, an embodiment of the present invention proposes a computer readable storage medium on which a control program of a double-buffer encoding system is stored, which when executed by a processor implements a control method of the double-buffer encoding system as described above.
According to the computer readable storage medium of the embodiment of the invention, the control program of the double-buffer coding system is stored, so that when the processor executes the control program of the double-buffer coding system, the control method of the double-buffer coding system is realized, and the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
In order to implement the above embodiments, an embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and is characterized in that when the processor executes the computer program, the control method of the double-buffer coding system as described above is implemented.
According to the computer equipment provided by the embodiment of the invention, the control program of the double-buffer coding system is stored through the memory, so that the processor can realize the control method of the double-buffer coding system when executing the control program of the double-buffer coding system, and the asynchronous problem can not occur in the process of completing video transcoding through multiple threads; meanwhile, the video transcoding efficiency is improved, and the waiting time of a user is reduced.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, 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, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.
Claims (8)
1. A double-buffered encoding system, comprising: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules;
when the queue corresponding to the buffer module connected with the production module reaches the threshold value and the queue corresponding to the buffer module connected with the consumption module is empty, the production module and the consumption module exchange the buffer modules connected with each other.
2. The double-buffer encoding system of claim 1, wherein the production module is configured to produce production data and store the production data in a buffer module coupled thereto;
when the queue corresponding to the buffer module connected with the production module reaches a threshold value, the production module acquires queue information corresponding to the buffer module connected with the consumption module, and judges whether the queue corresponding to the buffer module connected with the consumption module is empty or not according to the queue information;
if so, the production module and the consumption module exchange respectively connected buffer modules;
and if not, the production module enters a waiting state until the queue corresponding to the buffer module connected with the consumption module is empty.
3. The double-buffer encoding system of claim 1, wherein the consuming module is configured to consume production data stored in a buffer module coupled thereto;
when the queue corresponding to the buffer module connected with the consumption module is empty, the consumption module acquires queue information corresponding to the buffer module connected with the production module, and judges whether the queue corresponding to the buffer module connected with the production module reaches a threshold value according to the queue information;
if so, the production module and the consumption module exchange respectively connected buffer modules;
if not, the consumption module enters a waiting state until the queue corresponding to the buffer module connected with the production module reaches a threshold value.
4. A method for controlling a double-buffer coding system, the double-buffer coding system comprising: the system comprises a production module, a consumption module and two buffer modules, wherein the production module and the consumption module are respectively connected with one of the two buffer modules; the control method comprises the following steps:
and judging whether the queue corresponding to the buffer module connected with the production module reaches a threshold value or not, and if so, interchanging the buffer modules respectively connected with the production module and the consumption module, wherein the queue corresponding to the buffer module connected with the consumption module is empty.
5. The method as claimed in claim 4, wherein the determining whether the queue corresponding to the buffer module connected to the production module reaches the threshold value and the queue corresponding to the buffer module connected to the consumption module is empty, and the interchanging the buffer modules respectively connected to the production module and the consumption module when the determination result is yes comprises:
in the encoding process, the production module judges whether a queue corresponding to a buffer module connected with the production module reaches a threshold value;
if not, continuing production, and storing production data obtained by production into the buffer module;
if so, acquiring queue information corresponding to the buffer module connected with the consumption module, and judging whether the queue corresponding to the buffer module connected with the consumption module is empty or not according to the queue information;
if so, the production module and the consumption module exchange respectively connected buffer modules;
and if not, the production module enters a waiting state until the queue corresponding to the buffer module connected with the consumption module is empty.
6. The method as claimed in claim 4, wherein the determining whether the queue corresponding to the buffer module connected to the production module reaches the threshold value and the queue corresponding to the buffer module connected to the consumption module is empty, and the interchanging the buffer modules respectively connected to the production module and the consumption module when the determination result is yes comprises:
in the encoding process, the consumption module judges whether a queue corresponding to a buffer module connected with the consumption module is empty;
if not, continuing to consume the production data flushed by the buffer module;
if so, acquiring queue information corresponding to the buffer module connected with the production module, and judging whether the queue corresponding to the buffer module connected with the production module reaches a threshold value according to the queue information;
if so, the production module and the consumption module exchange respectively connected buffer modules;
if not, the consumption module enters a waiting state until the queue corresponding to the buffer module connected with the production module reaches a threshold value.
7. A computer-readable storage medium, on which a control program of a double-buffer encoding system is stored, which when executed by a processor implements the control method of the double-buffer encoding system according to any one of claims 4 to 6.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of controlling a double-buffered coding system as claimed in any one of claims 4 to 6 when executing the program.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011610557.9A CN112822494A (en) | 2020-12-30 | 2020-12-30 | Double-buffer coding system and control method thereof |
PCT/CN2021/099772 WO2022142157A1 (en) | 2020-12-30 | 2021-06-11 | Double-buffering encoding system and control method therefor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011610557.9A CN112822494A (en) | 2020-12-30 | 2020-12-30 | Double-buffer coding system and control method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112822494A true CN112822494A (en) | 2021-05-18 |
Family
ID=75854882
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011610557.9A Pending CN112822494A (en) | 2020-12-30 | 2020-12-30 | Double-buffer coding system and control method thereof |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112822494A (en) |
WO (1) | WO2022142157A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022142157A1 (en) * | 2020-12-30 | 2022-07-07 | 稿定(厦门)科技有限公司 | Double-buffering encoding system and control method therefor |
CN117289875A (en) * | 2023-11-08 | 2023-12-26 | 腾云悦智科技(深圳)有限责任公司 | Double-buffer file writing method capable of elastically expanding and contracting capacity |
Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030169263A1 (en) * | 2002-03-11 | 2003-09-11 | Lavelle Michael G. | System and method for prefetching data from a frame buffer |
JP3700561B2 (en) * | 2000-08-30 | 2005-09-28 | 松下電器産業株式会社 | Buffer control device |
CN102999537A (en) * | 2011-09-19 | 2013-03-27 | 阿里巴巴集团控股有限公司 | System and method for data migration |
CN103309767A (en) * | 2012-03-08 | 2013-09-18 | 阿里巴巴集团控股有限公司 | Method and device for processing client log |
CN103389944A (en) * | 2012-05-09 | 2013-11-13 | 辉达公司 | Virtual memory structure for coprocessor having memory allocation limitation |
US8948269B1 (en) * | 2011-03-23 | 2015-02-03 | Marvell International Ltd. | Processor implemented systems and methods for optimized video decoding using adaptive thread priority adjustment |
CN107423148A (en) * | 2017-07-26 | 2017-12-01 | 广州路派电子科技有限公司 | A kind of double buffering protocol data analysis system being applied under multi-task scheduling environment |
US20180146243A1 (en) * | 2016-11-21 | 2018-05-24 | Alibaba Group Holding Limited | Method and system for managing buffers |
CN108848384A (en) * | 2018-06-19 | 2018-11-20 | 复旦大学 | A kind of efficient parallel code-transferring method towards multi-core platform |
CN109040771A (en) * | 2018-07-20 | 2018-12-18 | 北京交通大学 | Based on the video cache method and system to cooperate between more cache servers |
CN110312156A (en) * | 2018-03-27 | 2019-10-08 | 腾讯科技(深圳)有限公司 | A kind of video cache method, apparatus and readable storage medium storing program for executing |
CN110636309A (en) * | 2018-06-22 | 2019-12-31 | Arm有限公司 | Data processing system |
CN111124270A (en) * | 2018-10-31 | 2020-05-08 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for cache management |
CN111225268A (en) * | 2019-12-03 | 2020-06-02 | 深圳市道通智能航空技术有限公司 | Video data transmission method and terminal |
CN111953990A (en) * | 2020-07-07 | 2020-11-17 | 西安万像电子科技有限公司 | Encoding method and device |
CN113836048A (en) * | 2021-09-17 | 2021-12-24 | 许昌许继软件技术有限公司 | Data exchange method and device based on FPGA memory dynamic allocation |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9250858B2 (en) * | 2013-02-20 | 2016-02-02 | International Business Machines Corporation | Dual-buffer serialization and consumption of variable-length data records produced by multiple parallel threads |
CN105302028A (en) * | 2015-11-19 | 2016-02-03 | 海安县申菱电器制造有限公司 | Real-time data acquiring system of motor torque and flux linkage |
CN108170758A (en) * | 2017-12-22 | 2018-06-15 | 福建天泉教育科技有限公司 | High concurrent date storage method and computer readable storage medium |
CN109711323B (en) * | 2018-12-25 | 2021-06-15 | 武汉烽火众智数字技术有限责任公司 | Real-time video stream analysis acceleration method, device and equipment |
CN112822494A (en) * | 2020-12-30 | 2021-05-18 | 稿定(厦门)科技有限公司 | Double-buffer coding system and control method thereof |
-
2020
- 2020-12-30 CN CN202011610557.9A patent/CN112822494A/en active Pending
-
2021
- 2021-06-11 WO PCT/CN2021/099772 patent/WO2022142157A1/en active Application Filing
Patent Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3700561B2 (en) * | 2000-08-30 | 2005-09-28 | 松下電器産業株式会社 | Buffer control device |
US20030169263A1 (en) * | 2002-03-11 | 2003-09-11 | Lavelle Michael G. | System and method for prefetching data from a frame buffer |
US8948269B1 (en) * | 2011-03-23 | 2015-02-03 | Marvell International Ltd. | Processor implemented systems and methods for optimized video decoding using adaptive thread priority adjustment |
CN102999537A (en) * | 2011-09-19 | 2013-03-27 | 阿里巴巴集团控股有限公司 | System and method for data migration |
CN103309767A (en) * | 2012-03-08 | 2013-09-18 | 阿里巴巴集团控股有限公司 | Method and device for processing client log |
CN103389944A (en) * | 2012-05-09 | 2013-11-13 | 辉达公司 | Virtual memory structure for coprocessor having memory allocation limitation |
US20180146243A1 (en) * | 2016-11-21 | 2018-05-24 | Alibaba Group Holding Limited | Method and system for managing buffers |
CN107423148A (en) * | 2017-07-26 | 2017-12-01 | 广州路派电子科技有限公司 | A kind of double buffering protocol data analysis system being applied under multi-task scheduling environment |
CN110312156A (en) * | 2018-03-27 | 2019-10-08 | 腾讯科技(深圳)有限公司 | A kind of video cache method, apparatus and readable storage medium storing program for executing |
CN108848384A (en) * | 2018-06-19 | 2018-11-20 | 复旦大学 | A kind of efficient parallel code-transferring method towards multi-core platform |
CN110636309A (en) * | 2018-06-22 | 2019-12-31 | Arm有限公司 | Data processing system |
CN109040771A (en) * | 2018-07-20 | 2018-12-18 | 北京交通大学 | Based on the video cache method and system to cooperate between more cache servers |
CN111124270A (en) * | 2018-10-31 | 2020-05-08 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for cache management |
CN111225268A (en) * | 2019-12-03 | 2020-06-02 | 深圳市道通智能航空技术有限公司 | Video data transmission method and terminal |
CN111953990A (en) * | 2020-07-07 | 2020-11-17 | 西安万像电子科技有限公司 | Encoding method and device |
CN113836048A (en) * | 2021-09-17 | 2021-12-24 | 许昌许继软件技术有限公司 | Data exchange method and device based on FPGA memory dynamic allocation |
Non-Patent Citations (2)
Title |
---|
杨朝龙等: "基于双接收缓冲队列的CAN驱动模型设计", 《微计算机信息》 * |
陈小潘等: "基于双缓冲队列的海量地形数据并行处理方法", 《郑州大学学报(工学版)》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022142157A1 (en) * | 2020-12-30 | 2022-07-07 | 稿定(厦门)科技有限公司 | Double-buffering encoding system and control method therefor |
CN117289875A (en) * | 2023-11-08 | 2023-12-26 | 腾云悦智科技(深圳)有限责任公司 | Double-buffer file writing method capable of elastically expanding and contracting capacity |
Also Published As
Publication number | Publication date |
---|---|
WO2022142157A1 (en) | 2022-07-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8868851B2 (en) | Data access method of a memory device | |
CN103279309B (en) | Based on DDR control device and the method for FPGA | |
US7937522B2 (en) | Method for flash memory data management | |
CN112822494A (en) | Double-buffer coding system and control method thereof | |
CN112929755B (en) | Video file playing method and device in progress dragging process | |
US8548061B2 (en) | Image decoding apparatus and image decoding method | |
CN109558456A (en) | A kind of file migration method, apparatus, equipment and readable storage medium storing program for executing | |
CN116954929B (en) | Dynamic GPU scheduling method and system for live migration | |
CN108664577B (en) | File management method and system based on FLASH idle area | |
CN109343796B (en) | Data processing method and device | |
CN114237505B (en) | Batch processing method and device for business data and computer equipment | |
CN112969092B (en) | Video file playing system | |
CN110555890A (en) | Memory management method and system | |
CN103677893A (en) | Method for reducing size of image file of starting up and arithmetic device | |
JP2009294990A (en) | Image processing system | |
CN110446046B (en) | Batch image fast decoding method based on embedded platform | |
US8756396B1 (en) | Conversion of in-memory data representations | |
CN108536759B (en) | Sample playback data access method and device | |
CN111143079A (en) | Method for realizing multi-read multi-write lock-free queue | |
CN117472568A (en) | Multithreading task processing method and terminal | |
US6785337B2 (en) | MPEG picture processing apparatus and data transferring method using the apparatus | |
CN111488118A (en) | Method for managing flash memory module and related flash memory controller and electronic device | |
CN111625395B (en) | Parallel erasure code encoding and decoding method and system | |
CN112068948B (en) | Data hashing method, readable storage medium and electronic device | |
CN115794446A (en) | Message processing method and device, electronic equipment and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210518 |
|
RJ01 | Rejection of invention patent application after publication |