34 uint8_t **poutbuf,
int *poutbuf_size,
35 const uint8_t *buf,
int buf_size,
int keyframe)
38 unsigned dqt = 0, dht = 0, sof0 = 0;
49 bytestream_put_byte(&poutbufp, 0xff);
50 bytestream_put_byte(&poutbufp,
SOI);
51 bytestream_put_byte(&poutbufp, 0xff);
52 bytestream_put_byte(&poutbufp,
APP1);
53 bytestream_put_be16(&poutbufp, 42);
54 bytestream_put_be32(&poutbufp, 0);
56 bytestream_put_be32(&poutbufp, buf_size + 44);
57 bytestream_put_be32(&poutbufp, buf_size + 44);
58 bytestream_put_be32(&poutbufp, 0);
60 for (i = 0; i < buf_size - 1; i++) {
63 case DQT: dqt = i + 46;
break;
64 case DHT: dht = i + 46;
break;
65 case SOF0: sof0 = i + 46;
break;
67 bytestream_put_be32(&poutbufp, dqt);
68 bytestream_put_be32(&poutbufp, dht);
69 bytestream_put_be32(&poutbufp, sof0);
70 bytestream_put_be32(&poutbufp, i + 46);
71 bytestream_put_be32(&poutbufp, i + 46 +
AV_RB16(buf + i + 2));
73 *poutbuf_size = poutbufp - *poutbuf;
78 memcpy(*poutbuf, buf, buf_size);
79 *poutbuf_size = buf_size;
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_WB24 AV_RB16
MJPEG encoder and decoder.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
void av_log(void *avcl, int level, const char *fmt,...)
main external API structure.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)