Revision 4e60b643

View differences:

libavcodec/faxcompr.c
232 232
static void put_line(uint8_t *dst, int size, int width, const int *runs)
233 233
{
234 234
    PutBitContext pb;
235
    int run, mode = 0, pix_left = width, run_idx = 0;
235
    int run, mode = 1, pix_left = width, run_idx = 0;
236 236

  
237 237
    init_put_bits(&pb, dst, size*8);
238 238
    while(pix_left > 0){
239 239
        run = runs[run_idx++];
240
        mode = !mode;
240 241
        if(!run){
241
            mode = !mode;
242 242
            continue;
243 243
        }
244 244
        pix_left -= run;
245 245
        for(; run > 16; run -= 16)
246 246
            put_sbits(&pb, 16, -mode);
247 247
        put_sbits(&pb, run, -mode);
248
        mode = !mode;
249 248
    }
250 249
}
251 250

  

Also available in: Unified diff