]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mjpegenc: fix and use lossless flag in ff_mjpeg_encode_picture_header()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Dec 2013 12:23:17 +0000 (13:23 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Dec 2013 12:31:14 +0000 (13:31 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegenc.c

index a25af707221ecf74e4612e446d8cb363bb826449..05efe3b1380dfd5251d1acd832be2d9a8ae21e02 100644 (file)
@@ -209,7 +209,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
                                     uint16_t intra_matrix[64])
 {
     int chroma_h_shift, chroma_v_shift;
-    const int lossless = avctx->codec_id != AV_CODEC_ID_MJPEG;
+    const int lossless = avctx->codec_id != AV_CODEC_ID_MJPEG && avctx->codec_id != AV_CODEC_ID_AMV;
     int hsample[3], vsample[3];
     int i;
 
@@ -317,7 +317,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
     put_bits(pb, 8, 0); /* Ah/Al (not used) */
 
 end:
-    if (avctx->codec->priv_data_size == sizeof(MpegEncContext)) {
+    if (!lossless) {
         MpegEncContext *s = avctx->priv_data;
         av_assert0(avctx->codec->priv_data_size == sizeof(MpegEncContext));