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.
Unified · Split
| @@ -295,10 +295,11 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx) · 294 unmodified lines | |||
| 295 | avctx->pix_fmt == AV_PIX_FMT_YUV422P || | 295 | avctx->pix_fmt == AV_PIX_FMT_YUV422P || |
| 296 | avctx->pix_fmt == AV_PIX_FMT_YUV444P || | 296 | avctx->pix_fmt == AV_PIX_FMT_YUV444P || |
| 297 | avctx->color_range == AVCOL_RANGE_MPEG) && | 297 | avctx->color_range == AVCOL_RANGE_MPEG) && |
| 298 | avctx->color_range != AVCOL_RANGE_JPEG && | ||
| 298 | avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { | 299 | avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { |
| 299 | av_log(avctx, AV_LOG_ERROR, | 300 | av_log(avctx, AV_LOG_ERROR, |
| 300 | "Limited range YUV is non-standard, set strict_std_compliance to " | 301 | "Non full-range YUV is non-standard, set strict_std_compliance " |
| 301 | "at least unofficial to use it.\n"); | 302 | "to at most unofficial to use it.\n"); |
| 302 | return AVERROR(EINVAL); | 303 | return AVERROR(EINVAL); |
| 303 | } | 304 | } |
| 304 | 305 | ||