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;
51 bytestream_put_byte(&poutbufp, 0xff);
52 bytestream_put_byte(&poutbufp,
SOI);
53 bytestream_put_byte(&poutbufp, 0xff);
54 bytestream_put_byte(&poutbufp,
APP1);
55 bytestream_put_be16(&poutbufp, 42);
56 bytestream_put_be32(&poutbufp, 0);
58 bytestream_put_be32(&poutbufp, buf_size + 44);
59 bytestream_put_be32(&poutbufp, buf_size + 44);
60 bytestream_put_be32(&poutbufp, 0);
62 for (i = 0; i < buf_size - 1; i++) {
65 case DQT: dqt = i + 46;
break;
66 case DHT: dht = i + 46;
break;
67 case SOF0: sof0 = i + 46;
break;
69 bytestream_put_be32(&poutbufp, dqt);
70 bytestream_put_be32(&poutbufp, dht);
71 bytestream_put_be32(&poutbufp, sof0);
72 bytestream_put_be32(&poutbufp, i + 46);
73 bytestream_put_be32(&poutbufp, i + 46 +
AV_RB16(buf + i + 2));
75 *poutbuf_size = poutbufp - *poutbuf;
80 memcpy(*poutbuf, buf, buf_size);
81 *poutbuf_size = buf_size;
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
MJPEG encoder and decoder.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Libavcodec external API header.
main external API structure.
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32