Mercurial > libavcodec.hg
changeset 4832:8a5cbe8e014e libavcodec
remove code_prefix variable, no speed change
author | michael |
---|---|
date | Mon, 09 Apr 2007 22:21:49 +0000 |
parents | 4a7e1f5cdc7a |
children | cad24e81a7b4 |
files | lzwenc.c |
diffstat | 1 files changed, 5 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lzwenc.c Mon Apr 09 22:18:09 2007 +0000 +++ b/lzwenc.c Mon Apr 09 22:21:49 2007 +0000 @@ -220,29 +220,27 @@ 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); }