Mercurial > libavcodec.hg
comparison faxcompr.c @ 8469:5b63a9da46f4 libavcodec
Avoid negation in put_line().
author | michael |
---|---|
date | Fri, 26 Dec 2008 13:50:00 +0000 |
parents | 75328d3e788e |
children | e765aa020de9 |
comparison
equal
deleted
inserted
replaced
8468:75328d3e788e | 8469:5b63a9da46f4 |
---|---|
230 } | 230 } |
231 | 231 |
232 static void put_line(uint8_t *dst, int size, int width, const int *runs) | 232 static void put_line(uint8_t *dst, int size, int width, const int *runs) |
233 { | 233 { |
234 PutBitContext pb; | 234 PutBitContext pb; |
235 int run, mode = 1, pix_left = width, run_idx = 0; | 235 int run, mode = ~0, pix_left = width, run_idx = 0; |
236 | 236 |
237 init_put_bits(&pb, dst, size*8); | 237 init_put_bits(&pb, dst, size*8); |
238 while(pix_left > 0){ | 238 while(pix_left > 0){ |
239 run = runs[run_idx++]; | 239 run = runs[run_idx++]; |
240 mode = !mode; | 240 mode = ~mode; |
241 if(!run){ | 241 if(!run){ |
242 continue; | 242 continue; |
243 } | 243 } |
244 pix_left -= run; | 244 pix_left -= run; |
245 for(; run > 16; run -= 16) | 245 for(; run > 16; run -= 16) |
246 put_sbits(&pb, 16, -mode); | 246 put_sbits(&pb, 16, mode); |
247 put_sbits(&pb, run, -mode); | 247 put_sbits(&pb, run, mode); |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 static int find_group3_syncmarker(GetBitContext *gb, int srcsize) | 251 static int find_group3_syncmarker(GetBitContext *gb, int srcsize) |
252 { | 252 { |