Mercurial > libavcodec.hg
comparison cook.c @ 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 |
---|---|
314 const uint32_t* buf; | 314 const uint32_t* buf; |
315 uint32_t* obuf = (uint32_t*) out; | 315 uint32_t* obuf = (uint32_t*) out; |
316 /* FIXME: 64 bit platforms would be able to do 64 bits at a time. | 316 /* FIXME: 64 bit platforms would be able to do 64 bits at a time. |
317 * I'm too lazy though, should be something like | 317 * I'm too lazy though, should be something like |
318 * for(i=0 ; i<bitamount/64 ; i++) | 318 * for(i=0 ; i<bitamount/64 ; i++) |
319 * (int64_t)out[i] = 0x37c511f237c511f2^be2ne_64(int64_t)in[i]); | 319 * (int64_t)out[i] = 0x37c511f237c511f2^av_be2ne64(int64_t)in[i]); |
320 * Buffer alignment needs to be checked. */ | 320 * Buffer alignment needs to be checked. */ |
321 | 321 |
322 off = (intptr_t)inbuffer & 3; | 322 off = (intptr_t)inbuffer & 3; |
323 buf = (const uint32_t*) (inbuffer - off); | 323 buf = (const uint32_t*) (inbuffer - off); |
324 c = be2ne_32((0x37c511f2 >> (off*8)) | (0x37c511f2 << (32-(off*8)))); | 324 c = av_be2ne32((0x37c511f2 >> (off*8)) | (0x37c511f2 << (32-(off*8)))); |
325 bytes += 3 + off; | 325 bytes += 3 + off; |
326 for (i = 0; i < bytes/4; i++) | 326 for (i = 0; i < bytes/4; i++) |
327 obuf[i] = c ^ buf[i]; | 327 obuf[i] = c ^ buf[i]; |
328 | 328 |
329 return off; | 329 return off; |