comparison bitstream.c @ 3648:c44d798b06b5 libavcodec

move some functions to bitstream.h to avoid conflicts between different bitstream readers in different codecs
author aurel
date Mon, 28 Aug 2006 18:44:49 +0000
parents 2ab6ec6259b1
children c8c591fe26f8
comparison
equal deleted inserted replaced
3647:4a93d7102793 3648:c44d798b06b5
43 put_bits(pbc, 8, *s); 43 put_bits(pbc, 8, *s);
44 s++; 44 s++;
45 } 45 }
46 if(put_zero) 46 if(put_zero)
47 put_bits(pbc, 8, 0); 47 put_bits(pbc, 8, 0);
48 }
49
50 /* bit input functions */
51
52 /**
53 * reads 0-32 bits.
54 */
55 unsigned int get_bits_long(GetBitContext *s, int n){
56 if(n<=17) return get_bits(s, n);
57 else{
58 int ret= get_bits(s, 16) << (n-16);
59 return ret | get_bits(s, n-16);
60 }
61 }
62
63 /**
64 * shows 0-32 bits.
65 */
66 unsigned int show_bits_long(GetBitContext *s, int n){
67 if(n<=17) return show_bits(s, n);
68 else{
69 GetBitContext gb= *s;
70 int ret= get_bits_long(s, n);
71 *s= gb;
72 return ret;
73 }
74 }
75
76 int check_marker(GetBitContext *s, const char *msg)
77 {
78 int bit= get_bits1(s);
79 if(!bit)
80 av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg);
81
82 return bit;
83 } 48 }
84 49
85 /* VLC decoding */ 50 /* VLC decoding */
86 51
87 //#define DEBUG_VLC 52 //#define DEBUG_VLC