38 unsigned dqt = 0,
dht = 0, sof0 = 0;
54 bytestream_put_byte(&out_buf, 0xff);
55 bytestream_put_byte(&out_buf,
SOI);
56 bytestream_put_byte(&out_buf, 0xff);
57 bytestream_put_byte(&out_buf,
APP1);
58 bytestream_put_be16(&out_buf, 42);
59 bytestream_put_be32(&out_buf, 0);
61 bytestream_put_be32(&out_buf, in->
size + 44);
62 bytestream_put_be32(&out_buf, in->
size + 44);
63 bytestream_put_be32(&out_buf, 0);
65 for (
i = 0;
i < in->
size - 1;
i++) {
66 if (in->
data[
i] == 0xff) {
67 switch (in->
data[
i + 1]) {
70 case SOF0: sof0 =
i + 46;
break;
72 bytestream_put_be32(&out_buf,
dqt);
73 bytestream_put_be32(&out_buf,
dht);
74 bytestream_put_be32(&out_buf, sof0);
75 bytestream_put_be32(&out_buf,
i + 46);
76 bytestream_put_be32(&out_buf,
i + 46 +
AV_RB16(in->
data +
i + 2));
79 out->size = out_buf -
out->data;
105 .p.name =
"mjpegadump",
static enum AVCodecID codec_ids[]
static AVFormatContext * ctx
const FFBitStreamFilter ff_mjpega_dump_header_bsf
int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt)
Called by the bitstream filters to get the next packet for filtering.
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define i(width, name, range_min, range_max)
static int FUNC dht(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawHuffmanTableSpecification *current)
static int FUNC dqt(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawQuantisationTableSpecification *current)
AVCodecID
Identify the syntax and semantics of the bitstream.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
MJPEG encoder and decoder.
The bitstream filter state.
This structure stores compressed data.