comparison common.c @ 1232:e88d3b1fb2a1 libavcodec

more #ifdef CONFIG_ENCODERS by (Wolfgang Hesseler <qv at multimediaware dot com>)
author michaelni
date Wed, 07 May 2003 23:32:45 +0000
parents 77ccf7fe3bd0
children 7ac0a77e5973
comparison
equal deleted inserted replaced
1231:b88dfc4bbf8c 1232:e88d3b1fb2a1
65 s->bit_left=32; 65 s->bit_left=32;
66 s->bit_buf=0; 66 s->bit_buf=0;
67 #endif 67 #endif
68 } 68 }
69 69
70 #ifdef CONFIG_ENCODERS
71
70 /* return the number of bits output */ 72 /* return the number of bits output */
71 int64_t get_bit_count(PutBitContext *s) 73 int64_t get_bit_count(PutBitContext *s)
72 { 74 {
73 #ifdef ALT_BITSTREAM_WRITER 75 #ifdef ALT_BITSTREAM_WRITER
74 return s->data_out_size * 8 + s->index; 76 return s->data_out_size * 8 + s->index;
83 put_bits(s,( - s->index) & 7,0); 85 put_bits(s,( - s->index) & 7,0);
84 #else 86 #else
85 put_bits(s,s->bit_left & 7,0); 87 put_bits(s,s->bit_left & 7,0);
86 #endif 88 #endif
87 } 89 }
90
91 #endif //CONFIG_ENCODERS
88 92
89 /* pad the end of the output stream with zeros */ 93 /* pad the end of the output stream with zeros */
90 void flush_put_bits(PutBitContext *s) 94 void flush_put_bits(PutBitContext *s)
91 { 95 {
92 #ifdef ALT_BITSTREAM_WRITER 96 #ifdef ALT_BITSTREAM_WRITER
102 s->bit_left=32; 106 s->bit_left=32;
103 s->bit_buf=0; 107 s->bit_buf=0;
104 #endif 108 #endif
105 } 109 }
106 110
111 #ifdef CONFIG_ENCODERS
112
107 void put_string(PutBitContext * pbc, char *s) 113 void put_string(PutBitContext * pbc, char *s)
108 { 114 {
109 while(*s){ 115 while(*s){
110 put_bits(pbc, 8, *s); 116 put_bits(pbc, 8, *s);
111 s++; 117 s++;
112 } 118 }
113 put_bits(pbc, 8, 0); 119 put_bits(pbc, 8, 0);
114 } 120 }
115 121
116 /* bit input functions */ 122 /* bit input functions */
123
124 #endif //CONFIG_ENCODERS
117 125
118 void init_get_bits(GetBitContext *s, 126 void init_get_bits(GetBitContext *s,
119 const uint8_t *buffer, int bit_size) 127 const uint8_t *buffer, int bit_size)
120 { 128 {
121 const int buffer_size= (bit_size+7)>>3; 129 const int buffer_size= (bit_size+7)>>3;