Mercurial > libavcodec.hg
changeset 8468:75328d3e788e libavcodec
Factorize mode switching in put_line().
author | michael |
---|---|
date | Fri, 26 Dec 2008 13:48:09 +0000 |
parents | 3700af1c1f4f |
children | 5b63a9da46f4 |
files | faxcompr.c |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/faxcompr.c Fri Dec 26 13:46:11 2008 +0000 +++ b/faxcompr.c Fri Dec 26 13:48:09 2008 +0000 @@ -232,20 +232,19 @@ static void put_line(uint8_t *dst, int size, int width, const int *runs) { PutBitContext pb; - int run, mode = 0, pix_left = width, run_idx = 0; + int run, mode = 1, pix_left = width, run_idx = 0; init_put_bits(&pb, dst, size*8); while(pix_left > 0){ run = runs[run_idx++]; + mode = !mode; if(!run){ - mode = !mode; continue; } pix_left -= run; for(; run > 16; run -= 16) put_sbits(&pb, 16, -mode); put_sbits(&pb, run, -mode); - mode = !mode; } }