Mercurial > libavcodec.hg
changeset 4831:4a7e1f5cdc7a libavcodec
simplify
author | michael |
---|---|
date | Mon, 09 Apr 2007 22:18:09 +0000 |
parents | 5a523aee7379 |
children | 8a5cbe8e014e |
files | lzwenc.c |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lzwenc.c Mon Apr 09 14:10:07 2007 +0000 +++ b/lzwenc.c Mon Apr 09 22:18:09 2007 +0000 @@ -232,13 +232,12 @@ for (i = 0; i < insize; i++) { uint8_t c = *inbuf++; int code = findCode(s, c, code_prefix); - if (s->tab[code].hash_prefix != LZW_PREFIX_FREE) { - code_prefix = s->tab[code].code; - } else { + if (s->tab[code].hash_prefix == LZW_PREFIX_FREE) { writeCode(s, code_prefix); addCode(s, c, code_prefix, code); - code_prefix = s->tab[hash(0, c)].code; + code= hash(0, c); } + code_prefix = s->tab[code].code; if (s->tabsize >= s->maxcode - 1) { clearTable(s); }