[FFmpeg-cvslog] avcodec/ljpegenc: Allow full range yuv420p, yuv422p, yuv444p by default

Andreas Rheinhardt git at videolan.org
Sat Apr 10 05:59:24 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Apr  6 00:45:25 2021 +0200| [48cda7d02b768d965db6582271a2f8591f2a3a10] | committer: Andreas Rheinhardt

avcodec/ljpegenc: Allow full range yuv420p, yuv422p, yuv444p by default

The documentation for AV_PIX_FMT_YUVJ420P reads:
"planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of
AV_PIX_FMT_YUV420P and setting color_range"
Yet the LJPEG encoder only accepts full scale yuv420p when strictness is
set to unofficial or lower; with default strictness it emits a nonsense
error message that says that limit range YUV is unofficial. This has
been changed to allow full range yuv420p, yuv422p and yuv444p irrespective
of the level of strictness.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48cda7d02b768d965db6582271a2f8591f2a3a10
---

 libavcodec/ljpegenc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
index 056b80b4b5..dd91c729d4 100644
--- a/libavcodec/ljpegenc.c
+++ b/libavcodec/ljpegenc.c
@@ -295,10 +295,11 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
          avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
          avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
          avctx->color_range == AVCOL_RANGE_MPEG) &&
+        avctx->color_range != AVCOL_RANGE_JPEG   &&
         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");
+               "Non full-range YUV is non-standard, set strict_std_compliance "
+               "to at most unofficial to use it.\n");
         return AVERROR(EINVAL);
     }
 



More information about the ffmpeg-cvslog mailing list