diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-04-10 02:21:49 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-04-10 02:21:49 +0400 |
commit | 0ddfb84d6dc8a7e77479cf8d7498aedadcca5e26 (patch) | |
tree | 4e713c84cf6b4c398f31000c3a90aab96195a4b8 | |
parent | adf6640c8c8c1745ab5b6c969764db5793f31e41 (diff) |
remove code_prefix variable, no speed change
Originally committed as revision 8700 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/lzwenc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/lzwenc.c b/libavcodec/lzwenc.c index 6b9b8d47af..bc9c4beb32 100644 --- a/libavcodec/lzwenc.c +++ b/libavcodec/lzwenc.c @@ -220,29 +220,27 @@ void ff_lzw_encode_init(LZWEncodeState * s, uint8_t * outbuf, int outsize, int m int ff_lzw_encode(LZWEncodeState * s, const uint8_t * inbuf, int insize) { int i; - int code_prefix = s->last_code; if(insize * 3 > (s->bufsize - s->output_bytes) * 2){ return -1; } - if (code_prefix == LZW_PREFIX_EMPTY) + if (s->last_code == LZW_PREFIX_EMPTY) clearTable(s); for (i = 0; i < insize; i++) { uint8_t c = *inbuf++; - int code = findCode(s, c, code_prefix); + int code = findCode(s, c, s->last_code); if (s->tab[code].hash_prefix == LZW_PREFIX_FREE) { - writeCode(s, code_prefix); - addCode(s, c, code_prefix, code); + writeCode(s, s->last_code); + addCode(s, c, s->last_code, code); code= hash(0, c); } - code_prefix = s->tab[code].code; + s->last_code = s->tab[code].code; if (s->tabsize >= s->maxcode - 1) { clearTable(s); } } - s->last_code = code_prefix; return writtenBytes(s); } |