36 0x4a, 0x46, 0x49, 0x46, 0x00,
48 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
49 0x0a, 0x0b, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01,
50 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
53 static uint8_t *
append(uint8_t *buf,
const uint8_t *src,
int size)
55 memcpy(buf, src, size);
76 uint8_t **poutbuf,
int *poutbuf_size,
77 const uint8_t *buf,
int buf_size,
80 int input_skip, output_size;
81 uint8_t *output, *out;
87 if (memcmp(
"AVI1", buf + 6, 4)) {
91 input_skip = (buf[4] << 8) + buf[5] + 4;
92 if (buf_size < input_skip) {
96 output_size = buf_size - input_skip +
103 out =
append(out, buf + input_skip, buf_size - input_skip);
105 *poutbuf_size = output_size;
110 .
name =
"mjpeg2jpeg",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
const uint8_t ff_mjpeg_bits_ac_chrominance[17]
const uint8_t ff_mjpeg_val_ac_chrominance[]
static const uint8_t dht_segment_frag[]
AVBitStreamFilter ff_mjpeg2jpeg_bsf
MJPEG encoder and decoder.
static int mjpeg2jpeg_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe)
static uint8_t * append(uint8_t *buf, const uint8_t *src, int size)
void av_log(void *avcl, int level, const char *fmt,...)
const uint8_t ff_mjpeg_bits_dc_luminance[17]
main external API structure.
static uint8_t * append_dht_segment(uint8_t *buf)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const uint8_t ff_mjpeg_bits_ac_luminance[17]
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
const uint8_t ff_mjpeg_val_dc[12]
const uint8_t ff_mjpeg_val_ac_luminance[]
static const uint8_t jpeg_header[]
static const int dht_segment_size
static const uint8_t dht_segment_head[]