diff options
author | Thom Johansen <thomj@rockbox.org> | 2007-11-24 19:14:29 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2007-11-24 19:14:29 +0000 |
commit | 929443cca52e53696d776661af42d5737a0af10d (patch) | |
tree | fe118429b9c1467b721fe2e1cab5b7ae4a0fa873 /apps/codecs/libspeex/bits.c | |
parent | d6e22443c4406d94038fdf19955371d38e2ab71f (diff) |
Sync to SVN.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15792 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspeex/bits.c')
-rw-r--r-- | apps/codecs/libspeex/bits.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/apps/codecs/libspeex/bits.c b/apps/codecs/libspeex/bits.c index 4629012c57..78b38db44e 100644 --- a/apps/codecs/libspeex/bits.c +++ b/apps/codecs/libspeex/bits.c @@ -151,13 +151,9 @@ void speex_bits_read_from(SpeexBits *bits, char *chars, int len) static void speex_bits_flush(SpeexBits *bits) { - int i; int nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); if (bits->charPtr>0) - { - for (i=bits->charPtr;i<nchars; i++) - bits->chars[i-bits->charPtr]=bits->chars[i]; - } + SPEEX_MOVE(bits->chars, &bits->chars[bits->charPtr], nchars-bits->charPtr); bits->nbBits -= bits->charPtr<<LOG2_BITS_PER_CHAR; bits->charPtr=0; } @@ -232,8 +228,6 @@ int speex_bits_write_whole_bytes(SpeexBits *bits, char *chars, int max_nbytes) bits->chars[0]=bits->chars[max_nchars]; else bits->chars[0]=0; - for (i=1;i<((bits->nbBits)>>LOG2_BITS_PER_CHAR)+1;i++) - bits->chars[i]=0; bits->charPtr=0; bits->nbBits &= (BITS_PER_CHAR-1); return max_nchars*BYTES_PER_CHAR; |