aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-12-26 13:48:09 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-12-26 13:48:09 +0000
commit4e60b64324c807eb7333f6586f4c2b38b83be835 (patch)
tree9f528e616dc15a5477c6ef18a70f7fc6b8b07896 /libavcodec
parenteb12536a31897c67d5a930e5f5c2f129d721412f (diff)
downloadffmpeg-4e60b64324c807eb7333f6586f4c2b38b83be835.tar.gz
Factorize mode switching in put_line().
Originally committed as revision 16326 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/faxcompr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c
index 9f1da4d279..417e0b6cb9 100644
--- a/libavcodec/faxcompr.c
+++ b/libavcodec/faxcompr.c
@@ -232,20 +232,19 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
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;
}
}