]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ljpegenc.c
lavu/x86/tx_float: fix FMA3 implying AVX2 is available
[ffmpeg] / libavcodec / ljpegenc.c
index 056b80b4b58f76a20a8caad9c5645b057afb90d8..74a2cdcc462571859a4d9a5bfc5d6f89f4e8a41f 100644 (file)
@@ -289,18 +289,11 @@ static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
 
 static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
 {
+    int ret = ff_mjpeg_encode_check_pix_fmt(avctx);
     LJpegEncContext *s = avctx->priv_data;
 
-    if ((avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
-         avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
-         avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
-         avctx->color_range == AVCOL_RANGE_MPEG) &&
-        avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Limited range YUV is non-standard, set strict_std_compliance to "
-               "at least unofficial to use it.\n");
-        return AVERROR(EINVAL);
-    }
+    if (ret < 0)
+        return ret;
 
 #if FF_API_CODED_FRAME
 FF_DISABLE_DEPRECATION_WARNINGS