⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qccfifo.3

📁 spiht for linux this is used to decod and encode vedio i wich all enjoy
💻 3
字号:
.TH QCCFIFO 3 "QCCPACK" "".SH NAMEQccFifo \- data structure for bitstream fifo.SH SYNOPSIS.B #include "libQccPack.h".sp.BI "int QccFifoInitialize(QccFifo *" fifo );.br.BI "int QccFifoStart(QccFifo *" fifo );.br.BI "int QccFifoEnd(QccFifo *" fifo );.br.BI "int QccFifoFlush(QccFifo *" fifo );.br.BI "int QccFifoRestart(QccFifo *" fifo );.SH DESCRIPTIONQccPack provides the.B QccFifodata structure to provide first-in, first-out operation on bitstreams.That is, a bitstream can be written to.I fifoand then read from.I fifowith the bits read out in the same order they were written in..SH "DATA STRUCTURE"The.B QccFifodata structure is defined as:.RS.nftypedef struct{  QccBitBuffer output_buffer;  QccBitBuffer input_buffer;} QccFifo;.fi.RE.LPThe fields of.B QccFifoare as follows:.TP.I output_bufferThe.BR QccBitBuffer (3)structure to which the bitstream is written..TP.I input_bufferThe.BR QccBitBuffer (3)structure from which the bitstream is read..SH "ROUTINES".B QccFifoInitialize()should be called before any use of a.B QccFifostructure..B QccFifoInitialize()initializes the.IR input_bufferand.IR output_bufferfields via calls to.BR QccBitBufferInitialize (3)..LP.B QccFifoStart()starts both.IR input_bufferand.IR output_buffervia calls to.BR QccBitBufferStart (3)..LP.B QccFifoEnd()should be called after all accesses (read or write) to.I fifoare complete..B QccFifoEnd()calls.BR QccBitBufferEnd (3)to stop both buffers..LP.B QccFifoFlush()should be called at the end of writing a bitstreamafter all bits have been writtenbut before .BR QccFifoEnd() is called..B QccFifoFlush()ensures that the last byte being packed with bits, which may not befull, is output to the fifo bycalling.BR QccBitBufferFlush (3)on both buffers..LPOnce.BR QccFifoStart (3)has been called, any of the usual bit-buffer routines forreading (e.g.,.BR QccBitBufferReadChar (3),.BR QccBitBufferReadInt (3))or writing (e.g.,.BR QccBitBufferWriteChar (3),.BR QccBitBufferWriteInt (3))can be called on the.IR input_bufferand.IR output_bufferfields of the fifo.The bits are read out of.I input_bufferin the same order they were written into.IR output_buffer ,so one or more calls towrite to.IR output_buffershould precede the first call to read from.IR input_buffer ..LP.BR QccFifoRestart()restarts.I fifoby calling.BR QccFifoEnd()and.BR QccFifoStart()in succession.Any data currently held in.I fifois lost; that is, the.I fifois emptied..SH "IMPLEMENTATION"The fifo operation within the.BR QccFifostructure is implemented with a pipe created by a call to.BR pipe (2)during the call to.BR QccFifoStart() .Specifically,.IR fileptrof.IR output_bufferis set to the write end of the pipe,while.IR fileptrof.IR input_bufferis set to the read end.Consequently,.IR input_bufferis joined to.IR output_bufferthrough this pipe..BR QccFileDescriptorOpen (3)is called to create file streams for the file descriptors returned by.BR pipe (2),and.BR fcntl (2)is used to set both ends of the pipe to non-blocking..LPAs a consequence of the use of.BR pipe (2)to implement the fifo,there is a limit to amount of bits that may be held in the fifoat any given time. Unfortunately, this limit is system-dependent.On POSIX-compliant systems, the pipe is required to be capable ofholding at least.BR PIPE_BUFbytes, and.BR PIPE_BUFmust be at least 512 bytes.This means that, on a POSIX-compliant system,at least 4096 bits can be written to a.BR QccFifostructure before bits must be read out..LPAttempts to write to a full fifo (one already containing thesystem-dependent maximum number of bits) will return in error,as will attempts to read from an empty fifo.It is the responsibility of the calling application to avoidfifo overflow and underflow, and the calling applicationshould do so without trying to determine the maximum size of the fifo,as there does not seem to be a reliable system-independent way ofdoing so..SH "RETURN VALUE"Each of these routines return 0 upon successful completion, 1 on error..SH "SEE ALSO".BR QccBitBuffer (3),.BR QccFileDescriptorOpen (3),.BR QccPack (3),.BR pipe (2),.BR fcntl (2).SH AUTHORCopyright (C) 1997-2009  James E. Fowler.\"  The programs herein are free software; you can redistribute them an.or.\"  modify them under the terms of the GNU General Public License.\"  as published by the Free Software Foundation; either version 2.\"  of the License, or (at your option) any later version..\"  .\"  These programs are distributed in the hope that they will be useful,.\"  but WITHOUT ANY WARRANTY; without even the implied warranty of.\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the.\"  GNU General Public License for more details..\"  .\"  You should have received a copy of the GNU General Public License.\"  along with these programs; if not, write to the Free Software.\"  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -