diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-05-23 12:58:46 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-05-23 12:58:46 +0000 |
commit | 14b74d381a32d80e5ab26d9cf2188ca3fc68c940 (patch) | |
tree | 1649db71909bdd942e9207b47ba1aaeddb65a95e /libavcodec/huffyuv.c | |
parent | d07f90433af9b830efc47c19723d23d176be9c55 (diff) | |
download | ffmpeg-14b74d381a32d80e5ab26d9cf2188ca3fc68c940.tar.gz |
cleanup
Originally committed as revision 1899 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/huffyuv.c')
-rw-r--r-- | libavcodec/huffyuv.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index fd4ec29527..7d41ef3b61 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -237,17 +237,15 @@ static int generate_bits_table(uint32_t *dst, uint8_t *len_table){ uint32_t bits=0; for(len=32; len>0; len--){ - int bit= 1<<(32-len); for(index=0; index<256; index++){ - if(len_table[index]==len){ - if(bits & (bit-1)){ - fprintf(stderr, "Error generating huffman table\n"); - return -1; - } - dst[index]= bits>>(32-len); - bits+= bit; - } + if(len_table[index]==len) + dst[index]= bits++; + } + if(bits & 1){ + fprintf(stderr, "Error generating huffman table\n"); + return -1; } + bits >>= 1; } return 0; } |