Merge commit '3360ad995530ea6967b1e83981b4aa8240fbb0ed'
[ffmpeg.git] / libavcodec / ljpegenc.c
index 09aeaaa..c467d63 100644 (file)
@@ -79,7 +79,8 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
     p->pict_type= AV_PICTURE_TYPE_I;
     p->key_frame= 1;
 
-    ff_mjpeg_encode_picture_header(s);
+    ff_mjpeg_encode_picture_header(avctx, &s->pb, &s->intra_scantable,
+                                   s->intra_matrix);
 
     s->header_bits= put_bits_count(&s->pb);
 
@@ -209,8 +210,9 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
 
     emms_c();
     av_assert0(s->esc_pos == s->header_bits >> 3);
+
     ff_mjpeg_encode_stuffing(s);
-    ff_mjpeg_encode_picture_trailer(s);
+    ff_mjpeg_encode_picture_trailer(&s->pb, s->header_bits);
     s->picture_number++;
 
     flush_put_bits(&s->pb);