*
* Support for external huffman table, various fixes (AVID workaround),
* aspecting, new decode_frame mechanism and apple mjpeg-b support
- * by Alex Beregszaszi <alex@naxine.org>
+ * by Alex Beregszaszi
*/
/**
static int jpeg_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ParseContext *pc = s->priv_data;
next= find_frame_end(pc, buf, buf_size);
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
+ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
*poutbuf = NULL;
*poutbuf_size = 0;
return buf_size;
}
- *poutbuf = (uint8_t *)buf;
+ *poutbuf = buf;
*poutbuf_size = buf_size;
return next;
}
static int mjpeg_decode_app(MJpegDecodeContext *s)
{
- int len, id;
+ int len, id, i;
len = get_bits(&s->gb, 16);
if (len < 5)
s->buggy_avid = 1;
// if (s->first_picture)
// printf("mjpeg: workarounding buggy AVID\n");
- s->bottom_field = get_bits(&s->gb, 8) == 2;
+ i = get_bits(&s->gb, 8);
+ if (i==2) s->bottom_field= 1;
+ else if(i==1) s->bottom_field= 0;
#if 0
skip_bits(&s->gb, 8);
skip_bits(&s->gb, 32);
};
#endif
+#ifdef CONFIG_MJPEG_PARSER
AVCodecParser mjpeg_parser = {
{ CODEC_ID_MJPEG },
sizeof(ParseContext),
jpeg_parse,
ff_parse_close,
};
+#endif
AVBitStreamFilter mjpega_dump_header_bsf = {
"mjpegadump",