Browse Source

simplify

Originally committed as revision 8699 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 18 years ago
parent
commit
adf6640c8c
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      libavcodec/lzwenc.c

+ 3
- 4
libavcodec/lzwenc.c View File

@@ -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);
}


Loading…
Cancel
Save