]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/jpeglsenc: Remove redundant pixel format checks
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Mon, 12 Apr 2021 17:02:58 +0000 (19:02 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Tue, 13 Apr 2021 00:44:48 +0000 (02:44 +0200)
This encoder has AVCodec.pix_fmts set, so ff_encode_preinit() already
checks for this.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavcodec/jpeglsenc.c

index 2bb6b1407afa20c672fb8144a4805fac959578fc..d03ce32f41cc94fc1ed5c065a18330268879ce0a 100644 (file)
@@ -429,14 +429,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
-    if (ctx->pix_fmt != AV_PIX_FMT_GRAY8  &&
-        ctx->pix_fmt != AV_PIX_FMT_GRAY16 &&
-        ctx->pix_fmt != AV_PIX_FMT_RGB24  &&
-        ctx->pix_fmt != AV_PIX_FMT_BGR24) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Only grayscale and RGB24/BGR24 images are supported\n");
-        return -1;
-    }
     return 0;
 }