#include "libavutil/pixfmt.h"
#include "avcodec.h"
-#include "dsputil.h"
+#include "idctdsp.h"
+#include "jpegtables.h"
#include "put_bits.h"
+#include "mjpegenc.h"
#include "mjpegenc_common.h"
#include "mjpeg.h"
put_marker(p, APP0);
put_bits(p, 16, 16);
avpriv_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */
- put_bits(p, 16, 0x0201); /* v 1.02 */
+ /* The most significant byte is used for major revisions, the least
+ * significant byte for minor revisions. Version 1.02 is the current
+ * released revision. */
+ put_bits(p, 16, 0x0102);
put_bits(p, 8, 0); /* units type: 0 - aspect ratio */
put_bits(p, 16, avctx->sample_aspect_ratio.num);
put_bits(p, 16, avctx->sample_aspect_ratio.den);
}
/* comment */
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
put_marker(p, COM);
flush_put_bits(p);
ptr = put_bits_ptr(p);
}
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
- ScanTable *intra_scantable,
+ ScanTable *intra_scantable, int pred,
uint16_t intra_matrix[64])
{
int chroma_h_shift, chroma_v_shift;
put_bits(pb, 4, 1); /* DC huffman table index */
put_bits(pb, 4, lossless ? 0 : 1); /* AC huffman table index */
- put_bits(pb, 8, lossless ? avctx->prediction_method + 1 : 0); /* Ss (not used) */
+ put_bits(pb, 8, lossless ? pred : 0); /* Ss (not used) */
switch (avctx->codec_id) {
case AV_CODEC_ID_MJPEG: put_bits(pb, 8, 63); break; /* Se (not used) */