* Copyright (c) 2003 Alex Beregszaszi
* Copyright (c) 2003-2004 Michael Niedermayer
*
+ * Support for external huffman table, various fixes (AVID workaround),
+ * aspecting, new decode_frame mechanism and apple mjpeg-b support
+ * by Alex Beregszaszi
+ *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- * by Alex Beregszaszi
*/
/**
ff_mjpeg_val_ac_luminance);
size += put_huffman_table(s, 1, 1, ff_mjpeg_bits_ac_chrominance,
ff_mjpeg_val_ac_chrominance);
- ptr[0] = size >> 8;
- ptr[1] = size;
+ AV_WB16(ptr, size);
}
static void jpeg_put_comments(MpegEncContext *s)
put_bits(p, 16, 0); /* patched later */
ff_put_string(p, LIBAVCODEC_IDENT, 1);
size = strlen(LIBAVCODEC_IDENT)+3;
- ptr[0] = size >> 8;
- ptr[1] = size;
+ AV_WB16(ptr, size);
}
if( s->avctx->pix_fmt == PIX_FMT_YUV420P
put_bits(p, 16, 0); /* patched later */
ff_put_string(p, "CS=ITU601", 1);
size = strlen("CS=ITU601")+3;
- ptr[0] = size >> 8;
- ptr[1] = size;
+ AV_WB16(ptr, size);
}
}
encode_block(s, block[7], 7);
}
}
+
+AVCodec mjpeg_encoder = {
+ "mjpeg",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_MJPEG,
+ sizeof(MpegEncContext),
+ MPV_encode_init,
+ MPV_encode_picture,
+ MPV_encode_end,
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, -1},
+};