Revision 84082497

View differences:

libav/gif.c
58 58
 *   echo -n "{ 0x$r, 0x$g, 0x$b }, "; done; echo ""; done; done
59 59
 */
60 60

  
61
const rgb_triplet gif_clut[216] = {
61
static const rgb_triplet gif_clut[216] = {
62 62
    { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x33 }, { 0x00, 0x00, 0x66 }, { 0x00, 0x00, 0x99 }, { 0x00, 0x00, 0xcc }, { 0x00, 0x00, 0xff },
63 63
    { 0x00, 0x33, 0x00 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x33, 0x66 }, { 0x00, 0x33, 0x99 }, { 0x00, 0x33, 0xcc }, { 0x00, 0x33, 0xff },
64 64
    { 0x00, 0x66, 0x00 }, { 0x00, 0x66, 0x33 }, { 0x00, 0x66, 0x66 }, { 0x00, 0x66, 0x99 }, { 0x00, 0x66, 0xcc }, { 0x00, 0x66, 0xff },
......
106 106
# error no ALT_BITSTREAM_WRITER support for now
107 107
#endif
108 108

  
109
void init_put_bits_rev(PutBitContext *s,
110
                   UINT8 *buffer, int buffer_size,
111
                   void *opaque,
112
                   void (*write_data)(void *, UINT8 *, int))
113
{
114
    init_put_bits(s, buffer, buffer_size, opaque, write_data);
115
}
116

  
117
void put_bits_rev(PutBitContext *s, int n, unsigned int value)
109
static void gif_put_bits_rev(PutBitContext *s, int n, unsigned int value)
118 110
{
119 111
    unsigned int bit_buf;
120 112
    int bit_cnt;
......
158 150
    s->bit_left = 32 - bit_cnt;
159 151
}
160 152

  
161
/* return the number of bits output */
162
INT64 get_bit_count_rev(PutBitContext *s)
163
{
164
    return get_bit_count(s);
165
}
166

  
167
void align_put_bits_rev(PutBitContext *s)
168
{
169
    align_put_bits(s);
170
}
171

  
172 153
/* pad the end of the output stream with zeros */
173
void flush_put_bits_rev(PutBitContext *s)
154
static void gif_flush_put_bits_rev(PutBitContext *s)
174 155
{
175 156
    while (s->bit_left < 32) {
176 157
        /* XXX: should test end of buffer */
......
318 299

  
319 300
    left=size/3;
320 301

  
321
    /* XXX:deprecated */
322
    /*init_put_bits_rev(&p, buffer, sizeof(buf), (void *)pb, gif_put_chunk); *//* mmm found a but in my code: s/sizeof(buf)/150/ */
323

  
324
    init_put_bits_rev(&p, buffer, 130, NULL, NULL);
302
    init_put_bits(&p, buffer, 130, NULL, NULL);
325 303

  
326 304
/*
327 305
 * the thing here is the bitstream is written as little packets, with a size byte before
......
330 308

  
331 309
    while(left>0) {
332 310

  
333
        put_bits_rev(&p, 9, 0x0100); /* clear code */
311
        gif_put_bits_rev(&p, 9, 0x0100); /* clear code */
334 312

  
335 313
        for(i=0;i<GIF_CHUNKS;i++) {
336
            put_bits_rev(&p, 9, gif_clut_index(NULL, *buf, buf[1], buf[2]));
314
	    gif_put_bits_rev(&p, 9, gif_clut_index(NULL, *buf, buf[1], buf[2]));
337 315
            buf+=3;
338 316
        }
339 317

  
340 318
        if(left<=GIF_CHUNKS) {
341
            put_bits_rev(&p, 9, 0x101); /* end of stream */
342
            flush_put_bits_rev(&p);
319
            gif_put_bits_rev(&p, 9, 0x101); /* end of stream */
320
            gif_flush_put_bits_rev(&p);
343 321
        }
344 322
        if(pbBufPtr(&p) - p.buf > 0) {
345 323
            put_byte(pb, pbBufPtr(&p) - p.buf); /* byte count of the packet */

Also available in: Unified diff