diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2007-08-06 01:43:09 +0000 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2007-08-06 01:43:09 +0000 |
commit | 98f0d7787906e91d50c3f1d435df9fd8fcaccc31 (patch) | |
tree | 0b351b1100bb8e1bde8d665f44385a2bb93ebb41 /apps/codecs/libwma/bitstream.c | |
parent | b1fa2f44a2c05997268bdac8d6d85d723e4e85a3 (diff) | |
download | rockbox-98f0d7787906e91d50c3f1d435df9fd8fcaccc31.tar.gz rockbox-98f0d7787906e91d50c3f1d435df9fd8fcaccc31.zip |
Clean up VLC functions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14206 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwma/bitstream.c')
-rw-r--r-- | apps/codecs/libwma/bitstream.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/apps/codecs/libwma/bitstream.c b/apps/codecs/libwma/bitstream.c index bce7ee2ae6..78b078adc7 100644 --- a/apps/codecs/libwma/bitstream.c +++ b/apps/codecs/libwma/bitstream.c @@ -119,8 +119,7 @@ static int build_table(VLC *vlc, int table_nb_bits, const void *codes, int codes_wrap, int codes_size, uint32_t code_prefix, int n_prefix) { - int i, j, k, n, table_size, table_index, nb, n1, index; - uint32_t code_prefix2; + int i, j, k, n, table_size, table_index, nb, n1, index, code_prefix2; uint32_t code; int flags = 0; VLC_TYPE (*table)[2]; @@ -153,10 +152,10 @@ static int build_table(VLC *vlc, int table_nb_bits, /* if code matches the prefix, it is in the table */ n -= n_prefix; if(flags & INIT_VLC_LE) - code_prefix2= code & (n_prefix>=32 ? 0xffffffff : (uint32_t)( (1 << n_prefix)-1)); + code_prefix2= code & (n_prefix>=32 ? 0xffffffff : (uint32_t)(1 << n_prefix)-1); else code_prefix2= code >> n; - if (n > 0 && code_prefix2 == code_prefix) { + if (n > 0 && (int)code_prefix2 == code_prefix) { if (n <= table_nb_bits) { /* no need to add another table */ j = (code << (table_nb_bits - n)) & (table_size - 1); @@ -165,11 +164,10 @@ static int build_table(VLC *vlc, int table_nb_bits, if(flags & INIT_VLC_LE) j = (code >> n_prefix) + (k<<n); #ifdef DEBUG_VLC - av_log(NULL, AV_LOG_DEBUG, "%4x: code=%d n=%d\n", + av_log(NULL, 0, "%4x: code=%d n=%d\n", j, i, n); #endif if (table[j][1] /*bits*/ != 0) { - // av_log(NULL, AV_LOG_ERROR, "incorrect codes\n"); return -1; } table[j][1] = n; //bits @@ -180,7 +178,7 @@ static int build_table(VLC *vlc, int table_nb_bits, n -= table_nb_bits; j = (code >> ((flags & INIT_VLC_LE) ? n_prefix : n)) & ((1 << table_nb_bits) - 1); #ifdef DEBUG_VLC - printf("%4x: n=%d (subtable)\n", + av_log(NULL, 0,"%4x: n=%d (subtable)\n", j, n); #endif /* compute table size */ @@ -267,9 +265,4 @@ int init_vlc(VLC *vlc, int nb_bits, int nb_codes, return flags; } -/* -void free_vlc(VLC *vlc) -{ - av_free(vlc->table); -} -*/ + |