Commit ad3713cb authored by Laurent Aimar's avatar Laurent Aimar

* bits.h: clean up

parent 8d98b9f5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* bits.h * bits.h
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: bits.h,v 1.3 2003/01/08 10:34:58 fenrir Exp $ * $Id: bits.h,v 1.4 2003/05/05 15:52:13 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org> * Eric Petit <titer@videolan.org>
...@@ -72,7 +72,9 @@ static inline void bits_write( bits_buffer_t *p_buffer, ...@@ -72,7 +72,9 @@ static inline void bits_write( bits_buffer_t *p_buffer,
{ {
while( i_count > 0 ) while( i_count > 0 )
{ {
if( ( i_bits >> ( i_count - 1 ) )&0x01 ) i_count--;
if( ( i_bits >> i_count )&0x01 )
{ {
p_buffer->p_data[p_buffer->i_data] |= p_buffer->i_mask; p_buffer->p_data[p_buffer->i_data] |= p_buffer->i_mask;
} }
...@@ -84,14 +86,9 @@ static inline void bits_write( bits_buffer_t *p_buffer, ...@@ -84,14 +86,9 @@ static inline void bits_write( bits_buffer_t *p_buffer,
if( p_buffer->i_mask == 0 ) if( p_buffer->i_mask == 0 )
{ {
p_buffer->i_data++; p_buffer->i_data++;
if( p_buffer->i_data < p_buffer->i_size )
{
// p_buffer->p_data[p_buffer->i_data] = 0;
p_buffer->i_mask = 0x80; p_buffer->i_mask = 0x80;
} }
} }
i_count--;
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment