Mercurial > libavcodec.hg
comparison lzw.c @ 6218:dfdff1ca78a7 libavcodec
consts
I have underestimated this a little, and these are just some ...
| author | michael |
|---|---|
| date | Fri, 01 Feb 2008 03:26:31 +0000 |
| parents | 59649ebd5ed8 |
| children | 48759bfbd073 |
comparison
equal
deleted
inserted
replaced
| 6217:f838213ca91b | 6218:dfdff1ca78a7 |
|---|---|
| 40 0x00FF, 0x01FF, 0x03FF, 0x07FF, | 40 0x00FF, 0x01FF, 0x03FF, 0x07FF, |
| 41 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF | 41 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 struct LZWState { | 44 struct LZWState { |
| 45 uint8_t *pbuf, *ebuf; | 45 const uint8_t *pbuf, *ebuf; |
| 46 int bbits; | 46 int bbits; |
| 47 unsigned int bbuf; | 47 unsigned int bbuf; |
| 48 | 48 |
| 49 int mode; ///< Decoder mode | 49 int mode; ///< Decoder mode |
| 50 int cursize; ///< The current code size | 50 int cursize; ///< The current code size |
| 89 } | 89 } |
| 90 s->bbits -= s->cursize; | 90 s->bbits -= s->cursize; |
| 91 return c & s->curmask; | 91 return c & s->curmask; |
| 92 } | 92 } |
| 93 | 93 |
| 94 uint8_t* ff_lzw_cur_ptr(LZWState *p) | 94 const uint8_t* ff_lzw_cur_ptr(LZWState *p) |
| 95 { | 95 { |
| 96 return ((struct LZWState*)p)->pbuf; | 96 return ((struct LZWState*)p)->pbuf; |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ff_lzw_decode_tail(LZWState *p) | 99 void ff_lzw_decode_tail(LZWState *p) |
| 125 * @param csize initial code size in bits | 125 * @param csize initial code size in bits |
| 126 * @param buf input data | 126 * @param buf input data |
| 127 * @param buf_size input data size | 127 * @param buf_size input data size |
| 128 * @param mode decoder working mode - either GIF or TIFF | 128 * @param mode decoder working mode - either GIF or TIFF |
| 129 */ | 129 */ |
| 130 int ff_lzw_decode_init(LZWState *p, int csize, uint8_t *buf, int buf_size, int mode) | 130 int ff_lzw_decode_init(LZWState *p, int csize, const uint8_t *buf, int buf_size, int mode) |
| 131 { | 131 { |
| 132 struct LZWState *s = (struct LZWState *)p; | 132 struct LZWState *s = (struct LZWState *)p; |
| 133 | 133 |
| 134 if(csize < 1 || csize > LZW_MAXBITS) | 134 if(csize < 1 || csize > LZW_MAXBITS) |
| 135 return -1; | 135 return -1; |
