MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / decode_bytes

Function decode_bytes

libavcodec/cook.c:310–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308#define DECODE_BYTES_PAD2(bytes) ((bytes) % 4 + DECODE_BYTES_PAD1(2 * (bytes)))
309
310static inline int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){
311 int i, off;
312 uint32_t c;
313 const uint32_t* buf;
314 uint32_t* obuf = (uint32_t*) out;
315 /* FIXME: 64 bit platforms would be able to do 64 bits at a time.
316 * I'm too lazy though, should be something like
317 * for(i=0 ; i<bitamount/64 ; i++)
318 * (int64_t)out[i] = 0x37c511f237c511f2^be2me_64(int64_t)in[i]);
319 * Buffer alignment needs to be checked. */
320
321 off = (intptr_t)inbuffer & 3;
322 buf = (const uint32_t*) (inbuffer - off);
323 c = be2me_32((0x37c511f2 >> (off*8)) | (0x37c511f2 << (32-(off*8))));
324 bytes += 3 + off;
325 for (i = 0; i < bytes/4; i++)
326 obuf[i] = c ^ buf[i];
327
328 return off;
329}
330
331/**
332 * Cook uninit

Callers 1

decode_bytes_and_gainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected