diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-04-09 22:18:09 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-04-09 22:18:09 +0000 |
commit | adf6640c8c8c1745ab5b6c969764db5793f31e41 (patch) | |
tree | c52b0087ea72458087d2268482c3fb2356adc121 /libavcodec | |
parent | 6207bb209e1aae9b696b6147a12d52246e1a8811 (diff) | |
download | ffmpeg-adf6640c8c8c1745ab5b6c969764db5793f31e41.tar.gz |
simplify
Originally committed as revision 8699 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/lzwenc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/lzwenc.c b/libavcodec/lzwenc.c index 5b448953c8..6b9b8d47af 100644 --- a/libavcodec/lzwenc.c +++ b/libavcodec/lzwenc.c @@ -232,13 +232,12 @@ int ff_lzw_encode(LZWEncodeState * s, const uint8_t * inbuf, int insize) 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); } |