annotate fifo.h @ 111:6199da3bf29e libavutil

simplify asm mid_pred, as suggested by michaelni.
author lorenm
date Thu, 21 Sep 2006 17:48:45 +0000
parents 813b7366ac3f
children 4a904af6d8f4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
110
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
1 #ifndef FIFO_H
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
2 #define FIFO_H
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
3
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
4 typedef struct AVFifoBuffer {
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
5 uint8_t *buffer;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
6 uint8_t *rptr, *wptr, *end;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
7 } AVFifoBuffer;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
8
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
9 int av_fifo_init(AVFifoBuffer *f, int size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
10 void av_fifo_free(AVFifoBuffer *f);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
11 int av_fifo_size(AVFifoBuffer *f);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
12 int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
13 int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
14 void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
15 void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
16 void av_fifo_drain(AVFifoBuffer *f, int size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
17
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
18 static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
19 {
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
20 uint8_t *ptr = f->rptr + offs;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
21 if (ptr >= f->end)
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
22 ptr -= f->end - f->buffer;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
23 return *ptr;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
24 }
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
25 #endif /* FIFO_H */