Mercurial > libavcodec.hg
comparison put_bits.h @ 12129:8b28e74de2c0 libavcodec
Add av_ prefix to bswap macros
author | mru |
---|---|
date | Sat, 10 Jul 2010 22:12:30 +0000 |
parents | ee740a4e80c5 |
children |
comparison
equal
deleted
inserted
replaced
12128:ee740a4e80c5 | 12129:8b28e74de2c0 |
---|---|
166 #if !HAVE_FAST_UNALIGNED | 166 #if !HAVE_FAST_UNALIGNED |
167 if (3 & (intptr_t) s->buf_ptr) { | 167 if (3 & (intptr_t) s->buf_ptr) { |
168 AV_WL32(s->buf_ptr, bit_buf); | 168 AV_WL32(s->buf_ptr, bit_buf); |
169 } else | 169 } else |
170 #endif | 170 #endif |
171 *(uint32_t *)s->buf_ptr = le2ne_32(bit_buf); | 171 *(uint32_t *)s->buf_ptr = av_le2ne32(bit_buf); |
172 s->buf_ptr+=4; | 172 s->buf_ptr+=4; |
173 bit_buf = (bit_left==32)?0:value >> bit_left; | 173 bit_buf = (bit_left==32)?0:value >> bit_left; |
174 bit_left+=32; | 174 bit_left+=32; |
175 } | 175 } |
176 bit_left-=n; | 176 bit_left-=n; |
184 #if !HAVE_FAST_UNALIGNED | 184 #if !HAVE_FAST_UNALIGNED |
185 if (3 & (intptr_t) s->buf_ptr) { | 185 if (3 & (intptr_t) s->buf_ptr) { |
186 AV_WB32(s->buf_ptr, bit_buf); | 186 AV_WB32(s->buf_ptr, bit_buf); |
187 } else | 187 } else |
188 #endif | 188 #endif |
189 *(uint32_t *)s->buf_ptr = be2ne_32(bit_buf); | 189 *(uint32_t *)s->buf_ptr = av_be2ne32(bit_buf); |
190 //printf("bitbuf = %08x\n", bit_buf); | 190 //printf("bitbuf = %08x\n", bit_buf); |
191 s->buf_ptr+=4; | 191 s->buf_ptr+=4; |
192 bit_left+=32 - n; | 192 bit_left+=32 - n; |
193 bit_buf = value; | 193 bit_buf = value; |
194 } | 194 } |
222 int index= s->index; | 222 int index= s->index; |
223 uint32_t *ptr= ((uint32_t *)s->buf)+(index>>5); | 223 uint32_t *ptr= ((uint32_t *)s->buf)+(index>>5); |
224 | 224 |
225 value<<= 32-n; | 225 value<<= 32-n; |
226 | 226 |
227 ptr[0] |= be2ne_32(value>>(index&31)); | 227 ptr[0] |= av_be2ne32(value>>(index&31)); |
228 ptr[1] = be2ne_32(value<<(32-(index&31))); | 228 ptr[1] = av_be2ne32(value<<(32-(index&31))); |
229 //if(n>24) printf("%d %d\n", n, value); | 229 //if(n>24) printf("%d %d\n", n, value); |
230 index+= n; | 230 index+= n; |
231 s->index= index; | 231 s->index= index; |
232 # endif | 232 # endif |
233 # else //ALIGNED_BITSTREAM_WRITER | 233 # else //ALIGNED_BITSTREAM_WRITER |
250 ); | 250 ); |
251 # else | 251 # else |
252 int index= s->index; | 252 int index= s->index; |
253 uint32_t *ptr= (uint32_t*)(((uint8_t *)s->buf)+(index>>3)); | 253 uint32_t *ptr= (uint32_t*)(((uint8_t *)s->buf)+(index>>3)); |
254 | 254 |
255 ptr[0] |= be2ne_32(value<<(32-n-(index&7) )); | 255 ptr[0] |= av_be2ne32(value<<(32-n-(index&7) )); |
256 ptr[1] = 0; | 256 ptr[1] = 0; |
257 //if(n>24) printf("%d %d\n", n, value); | 257 //if(n>24) printf("%d %d\n", n, value); |
258 index+= n; | 258 index+= n; |
259 s->index= index; | 259 s->index= index; |
260 # endif | 260 # endif |