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;