Change the name of the pre-computed bits table to match its actual function

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@653 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2011-05-26 11:28:22 +00:00
parent 418dbdff66
commit ac906c5308

View File

@@ -21,8 +21,8 @@
#include "jchuff.h" /* Declarations shared with jcphuff.c */ #include "jchuff.h" /* Declarations shared with jcphuff.c */
#include <limits.h> #include <limits.h>
static unsigned char jpeg_first_bit_table[65536]; static unsigned char jpeg_nbits_table[65536];
static int jpeg_first_bit_table_init = 0; static int jpeg_nbits_table_init = 0;
#ifndef min #ifndef min
#define min(a,b) ((a)<(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b))
@@ -271,13 +271,13 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
dtbl->ehufsi[i] = huffsize[p]; dtbl->ehufsi[i] = huffsize[p];
} }
if(!jpeg_first_bit_table_init) { if(!jpeg_nbits_table_init) {
for(i = 0; i < 65536; i++) { for(i = 0; i < 65536; i++) {
int bit = 0, val = i; int nbits = 0, temp = i;
while (val) {val >>= 1; bit++;} while (temp) {temp >>= 1; nbits++;}
jpeg_first_bit_table[i] = bit; jpeg_nbits_table[i] = nbits;
} }
jpeg_first_bit_table_init = 1; jpeg_nbits_table_init = 1;
} }
} }
@@ -483,7 +483,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
temp2 += temp3; temp2 += temp3;
/* Find the number of bits needed for the magnitude of the coefficient */ /* Find the number of bits needed for the magnitude of the coefficient */
nbits = jpeg_first_bit_table[temp]; nbits = jpeg_nbits_table[temp];
/* Emit the Huffman-coded symbol for the number of bits */ /* Emit the Huffman-coded symbol for the number of bits */
code = dctbl->ehufco[nbits]; code = dctbl->ehufco[nbits];
@@ -517,7 +517,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
temp ^= temp3; \ temp ^= temp3; \
temp -= temp3; \ temp -= temp3; \
temp2 += temp3; \ temp2 += temp3; \
nbits = jpeg_first_bit_table[temp]; \ nbits = jpeg_nbits_table[temp]; \
/* if run length > 15, must emit special run-length-16 codes (0xF0) */ \ /* if run length > 15, must emit special run-length-16 codes (0xF0) */ \
while (r > 15) { \ while (r > 15) { \
EMIT_BITS(code_0xf0, size_0xf0) \ EMIT_BITS(code_0xf0, size_0xf0) \