3 * Copyright (c) 2000, 2001 Fabrice Bellard.
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * alternative bitstream reader & writer by Michael Niedermayer <michaelni@gmx.at>
29 #include "bitstream.h"
31 /* bit input functions */
36 unsigned int get_bits_long(GetBitContext
*s
, int n
){
37 if(n
<=17) return get_bits(s
, n
);
39 int ret
= get_bits(s
, 16) << (n
-16);
40 return ret
| get_bits(s
, n
-16);
47 unsigned int show_bits_long(GetBitContext
*s
, int n
){
48 if(n
<=17) return show_bits(s
, n
);
51 int ret
= get_bits_long(s
, n
);
57 void align_get_bits(GetBitContext
*s
)
59 int n
= (-get_bits_count(s
)) & 7;
60 if(n
) skip_bits(s
, n
);