summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-06 13:23:17 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-06 13:31:14 +0100
commit0ebdf8d9ec603c895dc84f405d973922952d22b7 (patch)
tree48012d4e4a2dae3d2080899d429ae69598238816 /libavcodec/mjpegenc.c
parent93947d88f2abdf17d374a2d83cdb051ef9bafb2c (diff)
avcodec/mjpegenc: fix and use lossless flag in ff_mjpeg_encode_picture_header()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegenc.c')
-rw-r--r--libavcodec/mjpegenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index a25af70722..05efe3b138 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -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));