CN103747253B - A kind of video data encoder transmission method based on FIFO - Google Patents
A kind of video data encoder transmission method based on FIFO Download PDFInfo
- Publication number
- CN103747253B CN103747253B CN201310734483.3A CN201310734483A CN103747253B CN 103747253 B CN103747253 B CN 103747253B CN 201310734483 A CN201310734483 A CN 201310734483A CN 103747253 B CN103747253 B CN 103747253B
- Authority
- CN
- China
- Prior art keywords
- cell
- write
- fifo
- video data
- fifo buffer
- 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
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a kind of video data encoder transmission method based on FIFO, including step:S1. Initialize installation is carried out to the multiple parameters of fifo buffer;S2. video data encoder is write in a dynamic fashion by fifo buffer according to the parameter for arranging, the dynamical fashion represents to write save as in unit variable-length state, for the frame of video of correspondence storage write, the operation of the internal memory variable-length state representation internal memory is how under absorbed with the video frame size of write according to each r/w cell;S3. the video data encoder of write fifo buffer is read.The present invention has the characteristics of real-time is high, reliability is high and low in resources consumption.
Description
Technical field
The present invention relates to a kind of buffered technology of the video data encoder of web camera, more particularly to one kind is based on
The video data encoder transmission method of FIFO.
Background technology
The video data encoder transmission technology of the web camera of main flow mainly has two kinds now, and one is wait more than single task
Sequence buffer technology, as shown in figure 1, mean web camera be notified that after often encoding out a frame data network send mould
Block, then the coding module of web camera enter waiting state, until network sending module has sent a just frame data
Carry out coding next time afterwards again.Two is the sequence buffer technology of multitask multicopy, as shown in Fig. 2 meaning that network is taken the photograph
Camera is few greatly in the internal memory of the multiple fixations of coding module default allocation, has compiled a frame data every time and has just copied data to acquiescence
In the fixed memory for distributing.Network sending module again fixed memory copy out coding after a frame data for sending.
But the poor real of the sequence buffer technology waited one single task of prior art more.Two multitask of prior art is more
The sequence buffer technical disadvantages resource consumption of copy is big, design is complicated, reliability is low, very flexible.
The content of the invention
In order to overcome the deficiencies in the prior art, the invention provides a kind of video data encoder transmission side based on FIFO
Method, the problems such as it can solve big poor real, resource consumption, low reliability and very flexible.
The technical solution used in the present invention is as follows:
A kind of video data encoder transmission method based on FIFO, including step:
S1. Initialize installation is carried out to the multiple parameters of fifo buffer;
S2. video data encoder is write in a dynamic fashion by fifo buffer, the dynamical fashion according to the parameter for arranging
Represent in r/w cell and save as variable-length state, for the frame of video of correspondence storage write, the internal memory variable-length state table
Show internal memory operation be according to each r/w cell with write video frame size distribution;
S3. the video data encoder of write fifo buffer is read.
Wherein, the parameter includes:FIFO start address, FIFO total lengths, r/w cell, reading cell array and write-once
Greatest length;Wherein write-once greatest length represents the protection zone of fifo buffer.
The present invention is appreciated that:FIFO allows multiple users to read, but the parameter initialization in fifo buffer is arranged
When have determined that the number of users of maximum reads the array size of unit, and it is exactly the reading r/w cell one by one to read unit
Go out, one is read the client that unit represents a request video flowing of network sending module.
The r/w cell internal memory of the present invention storage video data encoder mentioned for step S2 is variable, this is because often
The video frame size that the individual time period transmits all may be different, and in order to not waste memory headroom, the operation of internal memory is to write
Unit is border, how under absorbed with the video frame size of write according to each r/w cell.
Can be well understood by, general operation system is all to carry out by byte to memory address.Namely 0 He of memory address
Memory address 1 can deposit the data of 2 bytes.For example, the data of 4 bytes are written with the position of memory address 0, then
Read the data for just having write to be accomplished by from address 0 starting to read address 3 terminating.From the example above it is envisioned that into
The position of memory address 0 writes one new " r/w cell ".Assume information 3 bytes behind 1 byte of " r/w cell "
It is video requency frame data, then the beginning border of this " r/w cell " is memory address 0, and end boundary is memory address 3, these letters
Breath is also stored in inside the information of " r/w cell " of 1 byte.
Again " r/w cell " that size is 10 bytes can be write from the position of memory address 4 in the same manner, due to will
" r/w cell " size of write is 10 bytes, therefore the beginning border of this r/w cell is memory address 4, and end boundary is interior
Deposit address 13.
Because " r/w cell " is with border, " r/w cell " can be pressed according to border when " r/w cell " is read
Different length and memory address is continuously to read out.
The write of the video data encoder specifically video encoding module often completes one-frame video data and encodes then it
A r/w cell toward fifo buffer writes, and then next frame coding completes to write next r/w cell again, carries out down according to this
Go.
The write-once process includes the operation of data Overflow handling, specific as follows:
Write starts, and judges whether video data encoder has been written into protection zone mark, if it is, new r/w cell
First r/w cell of fifo buffer covered, is changed to no whether data have been written into protection zone mark, is then terminated
The write-once of fifo buffer;If it is not, then new r/w cell is directly appended to last r/w cell of fifo buffer
Below, then terminate the write-once of fifo buffer.
The present invention compares other prior arts and increased a data Overflow handling operation, and FIFO total lengths are that initialization sets
Determination is put, when constantly there is r/w cell to write with video requency frame data, internal memory constantly can be allocated away, when occurring new writing list
Unit can carry out Overflow handling to the data into protection zone when entering protection zone, and the data to protection zone can move relief area
Most start, that is, cover earliest data, and as video data requires real-time, so the data of write are general soon
Can be sent on network, capped earliest data do not interfere with whole transmitting procedure.
When occur new r/w cell cover fifo buffer write at first r/w cell when, next new r/w cell
Write is added to behind the r/w cell after covering.
Specifically on the basis of fixed reading cell array, each reads unit to data in r/w cell to step S3
Read.That is, the readings cell array for determining represent the client for asking video flowing that determines how many, then each client
End receives multiple r/w cell data by network sending module, namely one enters to have more.
The readout is specific as follows:
S11:Reading starts, and whether there is available reading unit in searching the reading cell array of fifo buffer, if
Then distribute a reading unit, if otherwise terminating to read;
S12:Whether there is effective r/w cell in searching the r/w cell of fifo buffer, if it is, buffering from FIFO
The r/w cell of the write earliest for current reading unit is found out in effective r/w cell in area;If it is not, then waiting for a period of time;
S13:A frame video data encoder of r/w cell is returned to network sending module simultaneously repeat step S12.
Wherein the expression of step S13 is then conveyed it to by reading the video data encoder in unit reading r/w cell
Network sending module then proceedes to repeat step S12.With reference to step S3, after video data encoder is received, network sends mould
Block will send it to the client for asking video.
The present invention is had the advantage that compared with prior art:
1. real-time is high.Write and read is all had very high independence in different threads in the present invention, is not deposited
In the mechanism for waiting write-read, therefore real-time is higher;
2. reliability is high.There is the Overflow handling of data in the present invention, it is hereby ensured the reliability of the design;
3. low in resources consumption.As the data transfer in middle motion is carried out in the good internal memory of predistribution, do not have
Unnecessary memory copying process.
Description of the drawings
The fundamental diagram of Fig. 1 prior arts one;
The fundamental diagram of Fig. 2 prior arts two;
Fig. 3 FIFO initialization flowcharts of the present invention;
The content logic structure chart of Fig. 4 FIFO of the present invention;
Fig. 5 ablation process flow charts of the present invention;
Fig. 6 readout flow charts of the present invention.
Specific embodiment
The invention will be further described below in conjunction with the accompanying drawings.
As shown in figure 3, carrying out Initialize installation to five parameters of FIFO namely fifo buffer, the parameter is specifically wrapped
Include:FIFO start address, FIFO total lengths, r/w cell, reading cell array and write-once greatest length.
As shown in figure 4, from the figure, it can be seen that each read unit the data in r/w cell are read out, wherein once
Write greatest length belongs to the protection zone of fifo buffer.
As shown in figure 5, video encoding module often complete one-frame video data encode toward fifo buffer write, it is described once
Ablation process is specific as follows:
Write starts, and judges whether video data encoder has been written into protection zone mark, if it is, new r/w cell
Cover the r/w cell for writing at first of fifo buffer, data whether have been written into protection zone mark be changed to it is no, then
Terminate the write-once of fifo buffer;If it is not, then new r/w cell is directly appended to last of fifo buffer writing
Behind unit, then terminate the write-once of fifo buffer.
In addition, when occur new r/w cell cover fifo buffer write at first r/w cell when, it is next new
R/w cell write is added to behind it.
As shown in fig. 6, when the client of request video flowing is read in r/w cell to FIFO requests by network sending module
Video data encoder, the readout are specific as follows:
S11:Reading starts, and whether there is available reading unit in searching the reading cell array of fifo buffer, if
Then distribute a reading unit, if otherwise terminating to read;
S12:Whether there is effective r/w cell in searching the r/w cell of fifo buffer, if it is, buffering from FIFO
The r/w cell of the write earliest for current reading unit is found out in effective r/w cell in area;If it is not, then waiting for a period of time;
S13:A frame video data encoder of r/w cell is returned to network sending module simultaneously repeat step S12.
Claims (5)
1. a kind of video data encoder transmission method based on FIFO, it is characterised in that including step:
S1. Initialize installation is carried out to the multiple parameters of fifo buffer, the parameter includes:FIFO start address, FIFO are total
Length, r/w cell, reading cell array and write-once greatest length;Wherein write-once greatest length belongs to fifo buffer
Protection zone;
S2. video data encoder is write in a dynamic fashion by fifo buffer according to the parameter for arranging, the dynamical fashion is represented
Variable-length state is saved as in r/w cell, for the frame of video of correspondence storage write, in the internal memory variable-length state representation
The operation deposited is the video frame size distribution according to each r/w cell with write;
S3. the video data encoder of write fifo buffer is read;
Wherein, the write-once process includes the operation of data Overflow handling, specific as follows:
Write starts, and judges whether video data encoder has been written into protection zone mark, if it is, new r/w cell is covered
To the r/w cell for writing at first of fifo buffer, be changed to no whether data have been written into protection zone mark, then terminate
The write-once of fifo buffer;If it is not, then new r/w cell is directly appended to last r/w cell of fifo buffer
Below, then terminate the write-once of fifo buffer.
2. a kind of video data encoder transmission method based on FIFO according to claim 1, it is characterised in that described to regard
The write specifically video encoding module of frequency coded data often completes one-frame video data and encodes then it toward fifo buffer
One r/w cell writes, and then next frame coding completes to write next r/w cell again, goes on according to this.
3. a kind of video data encoder transmission method based on FIFO according to claim 1, it is characterised in that work as appearance
New r/w cell cover fifo buffer write at first r/w cell when, next new r/w cell write is added to cover
Behind r/w cell after lid.
4. a kind of video data encoder transmission method based on FIFO according to claim 1, it is characterised in that the step
Specifically on the basis of fixed reading cell array, each reads reading of the unit to data in r/w cell to rapid S3.
5. a kind of video data encoder transmission method based on FIFO according to claim 4, it is characterised in that the reading
Go out process specific as follows:
S11:Reading starts, and whether there is available reading unit in searching the reading cell array of fifo buffer, if it is, point
With a reading unit, if it is not, then terminating to read;
S12:Whether there is effective r/w cell in searching the r/w cell of fifo buffer, if it is, from fifo buffer
The r/w cell of to current reading unit for earliest write is found out in r/w cell effectively;If it is not, then waiting for a period of time;
S13:A frame video data encoder of r/w cell is returned to network sending module simultaneously repeat step S12.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310734483.3A CN103747253B (en) | 2013-12-27 | 2013-12-27 | A kind of video data encoder transmission method based on FIFO |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310734483.3A CN103747253B (en) | 2013-12-27 | 2013-12-27 | A kind of video data encoder transmission method based on FIFO |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103747253A CN103747253A (en) | 2014-04-23 |
CN103747253B true CN103747253B (en) | 2017-04-05 |
Family
ID=50504237
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310734483.3A Active CN103747253B (en) | 2013-12-27 | 2013-12-27 | A kind of video data encoder transmission method based on FIFO |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103747253B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109429070A (en) * | 2017-08-23 | 2019-03-05 | 杭州海康威视系统技术有限公司 | A kind of mobile terminal video coding method, device and mobile terminal |
CN109788299A (en) * | 2019-03-12 | 2019-05-21 | 广东工业大学 | Video transmission method, system, equipment and computer media between a kind of mobile device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1159629A (en) * | 1994-12-16 | 1997-09-17 | 摩托罗拉公司 | Adjustable depth/width FIFO buffer for width changeable data transfer |
CN1472942A (en) * | 2002-07-29 | 2004-02-04 | 华为技术有限公司 | Byte transparent processing method to data flow |
US7366961B1 (en) * | 2000-01-24 | 2008-04-29 | Ati Technologies, Inc. | Method and system for handling errors |
CN102375720A (en) * | 2010-08-20 | 2012-03-14 | 瑞萨电子(中国)有限公司 | Reading and writing control method of asynchronous first-in first-out (FIFO) memory, circuit and system |
CN102654827A (en) * | 2011-03-02 | 2012-09-05 | 安凯(广州)微电子技术有限公司 | First-in first-out buffer and data caching method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE602004006981T2 (en) * | 2003-04-17 | 2008-02-28 | Thomson Licensing | DATA-REQUIRING AND TRANSMITTING DEVICES AND METHODS |
-
2013
- 2013-12-27 CN CN201310734483.3A patent/CN103747253B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1159629A (en) * | 1994-12-16 | 1997-09-17 | 摩托罗拉公司 | Adjustable depth/width FIFO buffer for width changeable data transfer |
US7366961B1 (en) * | 2000-01-24 | 2008-04-29 | Ati Technologies, Inc. | Method and system for handling errors |
CN1472942A (en) * | 2002-07-29 | 2004-02-04 | 华为技术有限公司 | Byte transparent processing method to data flow |
CN102375720A (en) * | 2010-08-20 | 2012-03-14 | 瑞萨电子(中国)有限公司 | Reading and writing control method of asynchronous first-in first-out (FIFO) memory, circuit and system |
CN102654827A (en) * | 2011-03-02 | 2012-09-05 | 安凯(广州)微电子技术有限公司 | First-in first-out buffer and data caching method |
Also Published As
Publication number | Publication date |
---|---|
CN103747253A (en) | 2014-04-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11467975B2 (en) | Data processing method and NVMe storage device | |
CN101060418B (en) | Special disk reading and writing system suitable for IPTV direct broadcast server with time shift | |
WO2014101498A1 (en) | Compressed memory access control method, apparatus and system | |
US20120144092A1 (en) | Efficient cache management | |
CN101150487A (en) | A transmission method for zero copy network packet | |
CN106598752B (en) | Remote zero-copy method | |
CN103389945B (en) | Memory management method and device | |
CN102566958B (en) | Image segmentation processing device based on SGDMA (scatter gather direct memory access) | |
CN107479833B (en) | Key value storage-oriented remote nonvolatile memory access and management method | |
CN102541984A (en) | File system of distributed type file system client side | |
CN101277211A (en) | Method and apparatus for buffering data | |
CN102243615B (en) | Memory buffer management method supporting audio/video frame storage | |
EP4300308A1 (en) | Method and device for achieving memory sharing control, computer device, and system | |
Neufeld et al. | Design of a variable bit rate continuous media file server for an ATM network | |
CN116708579B (en) | Data access method, device, electronic equipment and computer readable storage medium | |
CN103747253B (en) | A kind of video data encoder transmission method based on FIFO | |
CN109508317B (en) | High-capacity data and service management system | |
CN110022336A (en) | Improve method, storage medium, equipment and the system of Internet resources speed of download | |
CN103152606A (en) | Video file processing method, device and system | |
CN102566959A (en) | Image segmentation processing method and device thereof based on SGDMA (scatter gather direct memory access) | |
US20160085683A1 (en) | Data receiving device and data receiving method | |
CN110225399A (en) | Streaming Media processing method, device, computer equipment and storage medium | |
CN117312201A (en) | Data transmission method and device, accelerator equipment, host and storage medium | |
JP2022016368A5 (en) | ||
CN105245313A (en) | Multi-load data dynamic multiplexing method of unmanned aerial vehicle |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |