Revision 73a0b19b libavcodec/gifdec.c

View differences:

libavcodec/gifdec.c
76 76
    is_interleaved = flags & 0x40;
77 77
    has_local_palette = flags & 0x80;
78 78
    bits_per_pixel = (flags & 0x07) + 1;
79
#ifdef DEBUG
79

  
80 80
    dprintf(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
81
#endif
82 81

  
83 82
    if (has_local_palette) {
84 83
        bytestream_get_buffer(&s->bytestream, s->local_palette, 3 * (1 << bits_per_pixel));
......
163 162
    /* extension */
164 163
    ext_code = bytestream_get_byte(&s->bytestream);
165 164
    ext_len = bytestream_get_byte(&s->bytestream);
166
#ifdef DEBUG
165

  
167 166
    dprintf(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
168
#endif
167

  
169 168
    switch(ext_code) {
170 169
    case 0xf9:
171 170
        if (ext_len != 4)
......
179 178
        else
180 179
            s->transparent_color_index = -1;
181 180
        s->gce_disposal = (gce_flags >> 2) & 0x7;
182
#ifdef DEBUG
181

  
183 182
        dprintf(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
184 183
               gce_flags, s->gce_delay,
185 184
               s->transparent_color_index, s->gce_disposal);
186
#endif
185

  
187 186
        ext_len = bytestream_get_byte(&s->bytestream);
188 187
        break;
189 188
    }
......
194 193
        for (i = 0; i < ext_len; i++)
195 194
            bytestream_get_byte(&s->bytestream);
196 195
        ext_len = bytestream_get_byte(&s->bytestream);
197
#ifdef DEBUG
196

  
198 197
        dprintf(s->avctx, "gif: ext_len1=%d\n", ext_len);
199
#endif
200 198
    }
201 199
    return 0;
202 200
}
......
232 230
    s->bits_per_pixel = (v & 0x07) + 1;
233 231
    s->background_color_index = bytestream_get_byte(&s->bytestream);
234 232
    bytestream_get_byte(&s->bytestream);                /* ignored */
235
#ifdef DEBUG
233

  
236 234
    dprintf(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
237 235
           s->screen_width, s->screen_height, s->bits_per_pixel,
238 236
           has_global_palette);
239
#endif
237

  
240 238
    if (has_global_palette) {
241 239
        n = 1 << s->bits_per_pixel;
242 240
        if (s->bytestream_end < s->bytestream + n * 3)
......
250 248
{
251 249
    while (s->bytestream < s->bytestream_end) {
252 250
        int code = bytestream_get_byte(&s->bytestream);
253
#ifdef DEBUG
251

  
254 252
        dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code);
255
#endif
253

  
256 254
        switch (code) {
257 255
        case ',':
258 256
            return gif_read_image(s);

Also available in: Unified diff