[FFmpeg-trac] #9085(avcodec:reopened): JPEG: YCCK too green

FFmpeg trac at avcodec.org
Mon Mar 22 00:53:04 EET 2021


#9085: JPEG: YCCK too green
------------------------------------+------------------------------------
             Reporter:  Balling     |                    Owner:
                 Type:  defect      |                   Status:  reopened
             Priority:  normal      |                Component:  avcodec
              Version:  git-master  |               Resolution:
             Keywords:  mjpeg cmyk  |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------

Comment (by cehoyos):

 You can test that the issue is not related to yuvj vs yuva:
 {{{
 diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
 index 20f310fd70..5a873dfebe 100644
 --- a/libavcodec/mjpegdec.c
 +++ b/libavcodec/mjpegdec.c
 @@ -533,8 +533,9 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
                  if (s->adobe_transform == 0 && s->bits <= 8) {
                      s->avctx->pix_fmt = AV_PIX_FMT_GBRAP;
                  } else {
 -                    s->avctx->pix_fmt = s->bits <= 8 ?
 AV_PIX_FMT_YUVA444P : AV_PIX_FMT_YUVA444P16;
 -                    s->avctx->color_range = s->cs_itu601 ?
 AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
 +                    s->avctx->pix_fmt = s->bits <= 8 ?
 AV_PIX_FMT_YUVJ444P : AV_PIX_FMT_YUVA444P16;
 +//                    s->avctx->color_range = s->cs_itu601 ?
 AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
 +s->avctx->color_range = AVCOL_RANGE_JPEG;
                  }
              }
              av_assert0(s->nb_components == 4);
 @@ -2794,7 +2795,7 @@ the_end:
              }
          }
      }
 -    if (s->adobe_transform == 2 && s->avctx->pix_fmt ==
 AV_PIX_FMT_YUVA444P) {
 +    if (s->adobe_transform == 2 && s->avctx->pix_fmt ==
 AV_PIX_FMT_YUVJ444P) {
          int w = s->picture_ptr->width;
          int h = s->picture_ptr->height;
          av_assert0(s->nb_components == 4);
 diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
 index 2a919461a5..1c192454e6 100644
 --- a/libavutil/pixdesc.c
 +++ b/libavutil/pixdesc.c
 @@ -403,13 +403,14 @@ static const AVPixFmtDescriptor
 av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
      },
      [AV_PIX_FMT_YUVJ444P] = {
          .name = "yuvj444p",
 -        .nb_components = 3,
 +        .nb_components = 4,
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
              { 0, 1, 0, 0, 8, 0, 7, 1 },        /* Y */
              { 1, 1, 0, 0, 8, 0, 7, 1 },        /* U */
              { 2, 1, 0, 0, 8, 0, 7, 1 },        /* V */
 +{ 3, 1, 0, 0, 8, 0, 7, 1 },
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR,
      },
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/9085#comment:22>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list